|
@@ -359,12 +359,14 @@ SetLanConfigParam ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes)
|
|
|
m_MsgPkt.Param = PARAM_LAN;
|
|
|
m_MsgPkt.NetFnLUN = NETFNLUN_IPMI_TRANSPORT;
|
|
|
m_MsgPkt.Cmd = CMD_SET_LAN_CONFIGURATION_PARAMETERS;
|
|
|
- m_MsgPkt.Size = sizeof(SetLanConfigReq_T);
|
|
|
- memcpy(m_MsgPkt.Data, pSetLanReq, sizeof(SetLanConfigReq_T));
|
|
|
+ m_MsgPkt.Size = sizeof(SetLanConfigReq_T)+2;
|
|
|
+ m_MsgPkt.Data[0] = 0;//eth0
|
|
|
+ m_MsgPkt.Data[1] = 0;//掉电不保存
|
|
|
+ memcpy(&m_MsgPkt.Data[2], pSetLanReq, sizeof(SetLanConfigReq_T));
|
|
|
PostMsg(gPendActionIfc, &m_MsgPkt);
|
|
|
|
|
|
//Update
|
|
|
- memcpy(g_BMCInfo.LanInfo[index].IPAddr, pSetLanReq->ConfigData.IPAddr, 4);
|
|
|
+ memcpy(g_BMCInfo.IpmiConfig.LanInfo[index].IPAddr, pSetLanReq->ConfigData.IPAddr, 4);
|
|
|
FlushIpmiConfig();
|
|
|
printf("---> old_ip: %s, new_ip: %s\n", old_ip, ipStr);
|
|
|
printf("---> send data: %#x %#x %#x %#x %#x\n", m_MsgPkt.Data[0], m_MsgPkt.Data[1]
|
|
@@ -373,79 +375,6 @@ SetLanConfigParam ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes)
|
|
|
|
|
|
case LAN_PARAM_IP_ADDRESS_SOURCE:
|
|
|
printf("---> Not implement!\n");
|
|
|
- //Update
|
|
|
- g_BMCInfo.LanInfo[index].IPAddrSrc = pSetLanReq->ConfigData.IPAddrSrc ;
|
|
|
- FlushIpmiConfig();
|
|
|
- // if ((pSetLanReq->ConfigData.IPAddrSrc > BMC_OTHER_SOURCE)
|
|
|
- // ||(pSetLanReq->ConfigData.IPAddrSrc == UNSPECIFIED_IP_SOURCE))
|
|
|
- // {
|
|
|
- // *pRes = CC_INV_DATA_FIELD;
|
|
|
- // return sizeof (uint8_t);
|
|
|
- // }
|
|
|
- // if ( g_BMCInfo.IpmiConfig.IPAddrSrc == pSetLanReq->ConfigData.IPAddrSrc )
|
|
|
- // {
|
|
|
- // printf("LAN or VLAN if current SRC is DHCP/Static and incoming SRC is DHCP/Static, do nothing\n");
|
|
|
- // break;
|
|
|
- // }
|
|
|
- // if(!((pSetLanReq->ConfigData.IPAddrSrc == STATIC_IP_SOURCE ) || (pSetLanReq->ConfigData.IPAddrSrc == DHCP_IP_SOURCE )))
|
|
|
- // g_BMCInfo.IpmiConfig.IPAddrSrc = pSetLanReq->ConfigData.IPAddrSrc ;
|
|
|
-
|
|
|
- // if ( (pSetLanReq->ConfigData.IPAddrSrc == STATIC_IP_SOURCE ) || (pSetLanReq->ConfigData.IPAddrSrc == DHCP_IP_SOURCE ) )
|
|
|
- // {
|
|
|
- // pendStatus = GetPendStatus(PEND_OP_SET_SOURCE);
|
|
|
- // if(pendStatus == PEND_STATUS_PENDING)
|
|
|
- // {
|
|
|
- // *pRes = CC_PARAM_NOT_SUP_IN_CUR_STATE;
|
|
|
- // return sizeof (uint8_t);
|
|
|
- // }
|
|
|
- // pBMCInfo->LANCfs[EthIndex].IPAddrSrc = pSetLanReq->ConfigData.IPAddrSrc ;
|
|
|
- // NWConfig.CfgMethod = pSetLanReq->ConfigData.IPAddrSrc;
|
|
|
- // SetPendStatus(PEND_OP_SET_SOURCE,PEND_STATUS_PENDING);
|
|
|
- // PostPendTask(PEND_OP_SET_SOURCE,(uint8_t*) &NWConfig,sizeof(NWConfig),(pSetLanReq->ChannelNum & 0x0F), BMCInst );
|
|
|
- // }
|
|
|
- // else if(pSetLanReq->ConfigData.IPAddrSrc == BIOS_IP_SOURCE)
|
|
|
- // {
|
|
|
- // /*Perform OEM action*/
|
|
|
- // if(g_PDKHandle[PDK_BIOSIPSOURCE] != NULL)
|
|
|
- // {
|
|
|
- // retValue = ((int(*)(uint8_t))g_PDKHandle[PDK_BIOSIPSOURCE]) (pSetLanReq->ChannelNum & CHANNEL_ID_MASK);
|
|
|
- // if(retValue == 1)
|
|
|
- // {
|
|
|
- // *pRes = CC_INV_DATA_FIELD;
|
|
|
- // return sizeof (*pRes);
|
|
|
- // }
|
|
|
- // }
|
|
|
- // else
|
|
|
- // {
|
|
|
- // pendStatus = GetPendStatus(PEND_OP_SET_SOURCE);
|
|
|
- // if(pendStatus == PEND_STATUS_PENDING)
|
|
|
- // {
|
|
|
- // *pRes = CC_PARAM_NOT_SUP_IN_CUR_STATE;
|
|
|
- // return sizeof (uint8_t);
|
|
|
- // }
|
|
|
- // NWConfig.CfgMethod = STATIC_IP_SOURCE;
|
|
|
- // SetPendStatus(PEND_OP_SET_SOURCE,PEND_STATUS_PENDING);
|
|
|
- // PostPendTask(PEND_OP_SET_SOURCE, (uint8_t*) &NWConfig,sizeof(NWConfig), (pSetLanReq->ChannelNum & CHANNEL_ID_MASK), BMCInst );
|
|
|
- // }
|
|
|
- // }
|
|
|
- // else if(pSetLanReq->ConfigData.IPAddrSrc == BMC_OTHER_SOURCE)
|
|
|
- // {
|
|
|
- // /*Perform OEM action*/
|
|
|
- // if(g_PDKHandle[PDK_BMCOTHERSOURCEIP] != NULL)
|
|
|
- // {
|
|
|
- // retValue = ((int(*)(uint8_t))g_PDKHandle[PDK_BMCOTHERSOURCEIP]) (pSetLanReq->ChannelNum & CHANNEL_ID_MASK);
|
|
|
- // if(retValue == 1)
|
|
|
- // {
|
|
|
- // *pRes = CC_INV_DATA_FIELD;
|
|
|
- // return sizeof (*pRes);
|
|
|
- // }
|
|
|
- // }
|
|
|
- // else
|
|
|
- // {
|
|
|
- // *pRes = CC_INV_DATA_FIELD;
|
|
|
- // return sizeof (*pRes);
|
|
|
- // }
|
|
|
- // }
|
|
|
break;
|
|
|
|
|
|
case LAN_PARAM_MAC_ADDRESS:
|
|
@@ -479,25 +408,19 @@ SetLanConfigParam ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes)
|
|
|
m_MsgPkt.Param = PARAM_LAN;
|
|
|
m_MsgPkt.NetFnLUN = NETFNLUN_IPMI_TRANSPORT;
|
|
|
m_MsgPkt.Cmd = CMD_SET_LAN_CONFIGURATION_PARAMETERS;
|
|
|
- m_MsgPkt.Size = sizeof(SetLanConfigReq_T);
|
|
|
- memcpy(m_MsgPkt.Data, pSetLanReq, sizeof(SetLanConfigReq_T));
|
|
|
+ m_MsgPkt.Size = sizeof(SetLanConfigReq_T)+2;
|
|
|
+ m_MsgPkt.Data[0] = 0;//eth0
|
|
|
+ m_MsgPkt.Data[1] = 0;//掉电不保存
|
|
|
+ memcpy(&m_MsgPkt.Data[2], pSetLanReq, sizeof(SetLanConfigReq_T));
|
|
|
PostMsg(gPendActionIfc, &m_MsgPkt);
|
|
|
//Update
|
|
|
- memcpy(g_BMCInfo.LanInfo[index].MACAddr, pSetLanReq->ConfigData.MACAddr, 6);
|
|
|
- FlushIpmiConfig();
|
|
|
+ memcpy(g_BMCInfo.IpmiConfig.LanInfo[index].MACAddr, pSetLanReq->ConfigData.MACAddr, 6);
|
|
|
printf("---> old_mac: %s, new_mac: %s\n", old_mac, macStr);
|
|
|
pSetLanRes->CompletionCode = CC_NORMAL;
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
case LAN_PARAM_SUBNET_MASK:
|
|
|
- /*Returning valid completion code in case of attempt to set netmask in DHCP mode */
|
|
|
- if(g_BMCInfo.LanInfo[index].IPAddrSrc == DHCP_IP_SOURCE)
|
|
|
- {
|
|
|
- *pRes = CC_PARAM_NOT_SUP_IN_CUR_STATE;
|
|
|
- return sizeof (uint8_t);
|
|
|
- }
|
|
|
-
|
|
|
getnetmask(old_netmask);
|
|
|
sprintf(netmaskStr, "%d.%d.%d.%d", pSetLanReq->ConfigData.SubNetMask[0],
|
|
|
pSetLanReq->ConfigData.SubNetMask[1], pSetLanReq->ConfigData.SubNetMask[2],
|
|
@@ -518,58 +441,22 @@ SetLanConfigParam ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes)
|
|
|
m_MsgPkt.Param = PARAM_LAN;
|
|
|
m_MsgPkt.NetFnLUN = NETFNLUN_IPMI_TRANSPORT;
|
|
|
m_MsgPkt.Cmd = CMD_SET_LAN_CONFIGURATION_PARAMETERS;
|
|
|
- m_MsgPkt.Size = sizeof(SetLanConfigReq_T);
|
|
|
- memcpy(m_MsgPkt.Data, pSetLanReq, sizeof(SetLanConfigReq_T));
|
|
|
+ m_MsgPkt.Size = sizeof(SetLanConfigReq_T)+2;
|
|
|
+ m_MsgPkt.Data[0] = 0;//eth0
|
|
|
+ m_MsgPkt.Data[1] = 0;//掉电不保存
|
|
|
+ memcpy(&m_MsgPkt.Data[2], pSetLanReq, sizeof(SetLanConfigReq_T));
|
|
|
PostMsg(gPendActionIfc, &m_MsgPkt);
|
|
|
//Update
|
|
|
- memcpy(g_BMCInfo.LanInfo[index].NetMask, pSetLanReq->ConfigData.SubNetMask, 4);
|
|
|
- FlushIpmiConfig();
|
|
|
+ memcpy(g_BMCInfo.IpmiConfig.LanInfo[index].NetMask, pSetLanReq->ConfigData.SubNetMask, 4);
|
|
|
pSetLanRes->CompletionCode = CC_NORMAL;
|
|
|
break;
|
|
|
|
|
|
case LAN_PARAM_IPv4_HEADER:
|
|
|
printf("Not implement\n");
|
|
|
- // pendStatus = GetPendStatus(PEND_OP_SET_IPV4_HEADERS);
|
|
|
- // if(pendStatus == PEND_STATUS_PENDING)
|
|
|
- // {
|
|
|
- // *pRes = CC_PARAM_NOT_SUP_IN_CUR_STATE;
|
|
|
- // return sizeof (uint8_t);
|
|
|
- // }
|
|
|
- // if(!pSetLanReq->ConfigData.Ipv4HdrParam.TimeToLive > 0)
|
|
|
- // {
|
|
|
- // IPMI_DBG_PRINT("The requested IPv4 header(TTL) to set is invalid.\n");
|
|
|
- // *pRes = CC_PARAM_OUT_OF_RANGE;
|
|
|
- // return sizeof(*pRes);
|
|
|
- // }
|
|
|
- // if(pSetLanReq->ConfigData.Ipv4HdrParam.IpHeaderFlags == 0x60) // Flags can be either of the values: DF(0x40) or MF(0x20)
|
|
|
- // {
|
|
|
- // IPMI_DBG_PRINT("The requested IPv4 header(Flags) to set is invalid.\n");
|
|
|
- // *pRes = CC_PARAM_OUT_OF_RANGE;
|
|
|
- // return sizeof(*pRes);
|
|
|
- // }
|
|
|
- // LOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
- // _fmemcpy (&pBMCInfo->LANCfs[EthIndex].Ipv4HdrParam,
|
|
|
- // &pSetLanReq->ConfigData.Ipv4HdrParam, sizeof(IPv4HdrParams_T));
|
|
|
- // UNLOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
- // SetPendStatus(PEND_OP_SET_IPV4_HEADERS,PEND_STATUS_PENDING);
|
|
|
- // PostPendTask(PEND_OP_SET_IPV4_HEADERS, (uint8_t*)&(pSetLanReq->ConfigData.Ipv4HdrParam),
|
|
|
- // sizeof(pSetLanReq->ConfigData.Ipv4HdrParam),(pSetLanReq->ChannelNum & 0x0F),BMCInst);
|
|
|
break;
|
|
|
|
|
|
case LAN_PARAM_PRI_RMCP_PORT:
|
|
|
printf("Not implement\n"); //需要重启网络线程
|
|
|
- // pendStatus = GetPendStatus(PEND_RMCP_PORT_CHANGE);
|
|
|
- // if(pendStatus == PEND_STATUS_PENDING)
|
|
|
- // {
|
|
|
- // *pRes = CC_PARAM_NOT_SUP_IN_CUR_STATE;
|
|
|
- // return sizeof (uint8_t);
|
|
|
- // }
|
|
|
- // LOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
- // pBMCInfo->LANCfs[EthIndex].PrimaryRMCPPort = ipmitoh_u16 (pSetLanReq->ConfigData.PrimaryRMCPPort);
|
|
|
- // UNLOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
- // SetPendStatus(PEND_RMCP_PORT_CHANGE,PEND_STATUS_PENDING);
|
|
|
- // PostPendTask(PEND_RMCP_PORT_CHANGE,(uint8_t*)&(pSetLanReq->ConfigData.PrimaryRMCPPort),
|
|
|
- // sizeof(pSetLanReq->ConfigData.PrimaryRMCPPort),(pSetLanReq->ChannelNum & 0x0F),BMCInst);
|
|
|
break;
|
|
|
|
|
|
case LAN_PARAM_SEC_RMCP_PORT:
|
|
@@ -581,46 +468,13 @@ SetLanConfigParam ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes)
|
|
|
|
|
|
case LAN_PARAM_BMC_GENERATED_ARP_CONTROL:
|
|
|
printf("Not implement\n");
|
|
|
- // currBmcGenArpCtrl = pBMCInfo->LANCfs[EthIndex].BMCGeneratedARPControl;
|
|
|
-
|
|
|
- // if(currBmcGenArpCtrl != pSetLanReq->ConfigData.BMCGeneratedARPControl)
|
|
|
- // pBMCInfo->LANCfs[EthIndex].BMCGeneratedARPControl = pSetLanReq->ConfigData.BMCGeneratedARPControl;
|
|
|
-
|
|
|
- // if((ENABLE_ARP_RESPONSES & currBmcGenArpCtrl) !=
|
|
|
- // (ENABLE_ARP_RESPONSES & pSetLanReq->ConfigData.BMCGeneratedARPControl))
|
|
|
- // {
|
|
|
- // UpdateArpStatus(EthIndex, BMC_GET_SHARED_MEM(BMCInst)->IsWDTRunning, BMCInst);
|
|
|
- // }
|
|
|
-
|
|
|
- // if(!(GRATIUTOUS_ENABLE_MASK & currBmcGenArpCtrl) &&
|
|
|
- // (GRATIUTOUS_ENABLE_MASK & pSetLanReq->ConfigData.BMCGeneratedARPControl))
|
|
|
- // {
|
|
|
- // /* Create a thread to Send Gratuitous ARP Packet */
|
|
|
- // pLANArg = malloc(sizeof(BMCArg));
|
|
|
- // pLANArg->BMCInst = BMCInst;
|
|
|
- // pLANArg->Len = strlen((char *)&EthIndex);
|
|
|
- // pLANArg->Argument = malloc(pLANArg->Len);
|
|
|
- // memcpy(pLANArg->Argument,(char *)&EthIndex,pLANArg->Len);
|
|
|
-
|
|
|
- // OS_CREATE_THREAD ((void *)GratuitousARPTask,(void *)pLANArg, NULL);
|
|
|
- // }
|
|
|
-
|
|
|
break;
|
|
|
|
|
|
case LAN_PARAM_GRATITIOUS_ARP_INTERVAL:
|
|
|
printf("Not implement\n");
|
|
|
- // pBMCInfo->LANCfs[EthIndex].GratitousARPInterval =
|
|
|
- // pSetLanReq->ConfigData.GratitousARPInterval;
|
|
|
break;
|
|
|
|
|
|
case LAN_PARAM_DEFAULT_GATEWAY_IP:
|
|
|
- /*Returning valid completion code in case of attempt to set default gateway ip in DHCP mode */
|
|
|
- if(g_BMCInfo.LanInfo[index].IPAddrSrc == DHCP_IP_SOURCE)
|
|
|
- {
|
|
|
- *pRes = CC_PARAM_NOT_SUP_IN_CUR_STATE;
|
|
|
- return sizeof (uint8_t);
|
|
|
- }
|
|
|
-
|
|
|
if(IPAddrCheck(pSetLanReq->ConfigData.DefaultGatewayIPAddr,LAN_PARAM_DEFAULT_GATEWAY_IP))
|
|
|
{
|
|
|
*pRes = CC_INV_DATA_FIELD;
|
|
@@ -630,12 +484,13 @@ SetLanConfigParam ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes)
|
|
|
m_MsgPkt.Param = PARAM_LAN;
|
|
|
m_MsgPkt.NetFnLUN = NETFNLUN_IPMI_TRANSPORT;
|
|
|
m_MsgPkt.Cmd = CMD_SET_LAN_CONFIGURATION_PARAMETERS;
|
|
|
- m_MsgPkt.Size = sizeof(SetLanConfigReq_T);
|
|
|
- memcpy(m_MsgPkt.Data, pSetLanReq, sizeof(SetLanConfigReq_T));
|
|
|
+ m_MsgPkt.Size = sizeof(SetLanConfigReq_T)+2;
|
|
|
+ m_MsgPkt.Data[0] = 0;//eth0
|
|
|
+ m_MsgPkt.Data[1] = 0;//掉电不保存
|
|
|
+ memcpy(&m_MsgPkt.Data[2], pSetLanReq, sizeof(SetLanConfigReq_T));
|
|
|
PostMsg(gPendActionIfc, &m_MsgPkt);
|
|
|
//Update
|
|
|
- memcpy(g_BMCInfo.LanInfo[index].DefaultGW, pSetLanReq->ConfigData.DefaultGatewayIPAddr, 4);
|
|
|
- FlushIpmiConfig();
|
|
|
+ memcpy(g_BMCInfo.IpmiConfig.LanInfo[index].DefaultGW, pSetLanReq->ConfigData.DefaultGatewayIPAddr, 4);
|
|
|
pSetLanRes->CompletionCode = CC_NORMAL;
|
|
|
|
|
|
break;
|
|
@@ -647,45 +502,14 @@ SetLanConfigParam ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes)
|
|
|
|
|
|
case LAN_PARAM_BACKUP_GATEWAY_IP:
|
|
|
printf("Not implement\n");
|
|
|
- // nwReadNWCfg_v4_v6( &NWConfig,&NWConfig6, netindex,g_corefeatures.global_ipv6);
|
|
|
- // _fmemcpy ((uint8_t*)&GWIp,pSetLanReq->ConfigData.BackupGatewayIPAddr, IP_ADDR_LEN);
|
|
|
- // _fmemcpy ((uint8_t*)&Subnetmask,&NWConfig.Mask[0],IP_ADDR_LEN);
|
|
|
- // _fmemcpy ((uint8_t*)&IPAddr,&NWConfig.IPAddr[0], IP_ADDR_LEN);
|
|
|
- // if(GWIp != 0)
|
|
|
- // {
|
|
|
- // if((IPAddr & Subnetmask ) != (GWIp & Subnetmask))
|
|
|
- // {
|
|
|
- // IPMI_DBG_PRINT("\n Backup GatewayIP to set is not valid \n");
|
|
|
- // *pRes = CC_INV_DATA_FIELD;
|
|
|
- // return sizeof (uint8_t);
|
|
|
- // }
|
|
|
- // }
|
|
|
- // LOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
- // _fmemcpy (pBMCInfo->LANCfs[EthIndex].BackupGatewayIPAddr,
|
|
|
- // pSetLanReq->ConfigData.BackupGatewayIPAddr, IP_ADDR_LEN);
|
|
|
- // nwSetBkupGWyAddr(pSetLanReq->ConfigData.BackupGatewayIPAddr,netindex);
|
|
|
- // UNLOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
break;
|
|
|
|
|
|
case LAN_PARAM_BACKUP_GATEWAY_MAC:
|
|
|
printf("Not implement\n");
|
|
|
- // LOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
- // _fmemcpy (pBMCInfo->LANCfs[EthIndex].BackupGatewayMACAddr,
|
|
|
- // pSetLanReq->ConfigData.BackupGatewayMACAddr, MAC_ADDR_LEN);
|
|
|
- // UNLOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
break;
|
|
|
|
|
|
case LAN_PARAM_COMMUNITY_STRING:
|
|
|
printf("Not implement\n");
|
|
|
- // if (g_PDKHandle[PDK_SETSNMPCOMMUNITYNAME] != NULL )
|
|
|
- // {
|
|
|
- // if(((int(*)(uint8_t *, uint8_t,int))(g_PDKHandle[PDK_SETSNMPCOMMUNITYNAME]))(pSetLanReq->ConfigData.CommunityStr,MAX_COMM_STRING_SIZE, BMCInst)==0)
|
|
|
- // break;
|
|
|
- // }
|
|
|
- // OS_THREAD_MUTEX_ACQUIRE(&pBMCInfo->PefConfig.PEFSharedMemMutex, WAIT_INFINITE);
|
|
|
- // _fmemcpy (pBMCInfo->LANCfs[EthIndex].CommunityStr,
|
|
|
- // pSetLanReq->ConfigData.CommunityStr, MAX_COMM_STRING_SIZE);
|
|
|
- // OS_THREAD_MUTEX_RELEASE(&pBMCInfo->PefConfig.PEFSharedMemMutex);
|
|
|
break;
|
|
|
|
|
|
case LAN_PARAM_DEST_NUM:
|
|
@@ -695,285 +519,17 @@ SetLanConfigParam ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes)
|
|
|
|
|
|
case LAN_PARAM_SELECT_DEST_TYPE:
|
|
|
printf("Not implement\n");
|
|
|
- // // if (pSetLanReq->ConfigData.DestType.SetSelect > NUM_LAN_DESTINATION)
|
|
|
- // if (pSetLanReq->ConfigData.DestType.SetSelect > pBMCInfo->LANCfs[EthIndex].NumDest )
|
|
|
- // {
|
|
|
- // *pRes = CC_PARAM_OUT_OF_RANGE;
|
|
|
- // return sizeof (*pRes);
|
|
|
- // }
|
|
|
-
|
|
|
- // if (0 == pSetLanReq->ConfigData.DestType.SetSelect)
|
|
|
- // {
|
|
|
- // LOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
- // _fmemcpy (&pSharedMem->VolLANDestType[EthIndex],
|
|
|
- // &pSetLanReq->ConfigData.DestType, sizeof(LANDestType_T));
|
|
|
- // UNLOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
- // }
|
|
|
- // else
|
|
|
- // {
|
|
|
- // LOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
- // _fmemcpy (&pBMCInfo->LANCfs[EthIndex].DestType [pSetLanReq->ConfigData.DestType.SetSelect - 1],
|
|
|
- // &pSetLanReq->ConfigData.DestType, sizeof(LANDestType_T));
|
|
|
- // UNLOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
- // }
|
|
|
break;
|
|
|
|
|
|
case LAN_PARAM_SELECT_DEST_ADDR:
|
|
|
printf("Not implement\n");
|
|
|
- // pendStatus = GetPendStatus(PEND_OP_SET_GATEWAY);
|
|
|
- // if(pendStatus == PEND_STATUS_PENDING)
|
|
|
- // {
|
|
|
- // *pRes = CC_PARAM_NOT_SUP_IN_CUR_STATE;
|
|
|
- // return sizeof (uint8_t);
|
|
|
- // }
|
|
|
- // // if (pSetLanReq->ConfigData.DestAddr.SetSelect > NUM_LAN_DESTINATION)
|
|
|
- // if (pSetLanReq->ConfigData.DestType.SetSelect > pBMCInfo->LANCfs[EthIndex].NumDest )
|
|
|
- // {
|
|
|
- // *pRes = CC_PARAM_OUT_OF_RANGE ;
|
|
|
- // return sizeof (*pRes);
|
|
|
- // }
|
|
|
-
|
|
|
- // if (0 == pSetLanReq->ConfigData.DestAddr.SetSelect)
|
|
|
- // {
|
|
|
- // LOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
- // _fmemcpy (&pSharedMem->VolLANDest[EthIndex],
|
|
|
- // &pSetLanReq->ConfigData.DestAddr, sizeof(LANDestAddr_T));
|
|
|
- // memset(pSharedMem->VolLANv6Dest,0,sizeof(LANDestv6Addr_T));
|
|
|
- // UNLOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
- // }
|
|
|
- // else
|
|
|
- // {
|
|
|
- // LOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
- // _fmemcpy (&pBMCInfo->LANCfs[EthIndex].DestAddr [pSetLanReq->ConfigData.DestAddr.SetSelect - 1],
|
|
|
- // &pSetLanReq->ConfigData.DestAddr, sizeof(LANDestAddr_T));
|
|
|
- // memset( &pBMCInfo->LANCfs[EthIndex].Destv6Addr [pSetLanReq->ConfigData.Destv6Addr.SetSelect -1], 0 ,
|
|
|
- // sizeof(LANDestv6Addr_T));
|
|
|
- // UNLOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
- // }
|
|
|
- // /* Setting BackupGw to DefaultGw as per request to send trap */
|
|
|
- // if(pSetLanReq->ConfigData.DestAddr.GateWayUse == 1)
|
|
|
- // {
|
|
|
- // IPMI_DBG_PRINT("Setting Backupgw to Defaultgwip as per Request \n");
|
|
|
- // nwReadNWCfg_v4_v6( &NWConfig, &NWConfig6, netindex,g_corefeatures.global_ipv6);
|
|
|
- // LOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
- // _fmemcpy(NWConfig.Gateway,pBMCInfo->LANCfs[EthIndex].BackupGatewayIPAddr,IP_ADDR_LEN);
|
|
|
- // UNLOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
- // SetPendStatus(PEND_OP_SET_GATEWAY,PEND_STATUS_PENDING);
|
|
|
- // PostPendTask(PEND_OP_SET_GATEWAY,(uint8_t*)&NWConfig,sizeof(NWConfig),(pSetLanReq->ChannelNum & 0x0F),BMCInst);
|
|
|
-
|
|
|
- // }
|
|
|
break;
|
|
|
|
|
|
case LAN_PARAM_VLAN_ID:
|
|
|
printf("Not implement\n");
|
|
|
- // if( pBMCInfo->IpmiConfig.VLANIfcSupport == 1)
|
|
|
- // {
|
|
|
- // nwReadNWCfg_v4_v6( &NWConfig, &NWConfig6, netindex,g_corefeatures.global_ipv6);
|
|
|
-
|
|
|
- // if((pSetLanReq->ConfigData.VLANID & VLAN_MASK_BIT) == VLAN_MASK_BIT) /* checks for VLAN enable bit*/
|
|
|
- // {
|
|
|
- // pendStatus = GetPendStatus(PEND_OP_SET_VLAN_ID);
|
|
|
- // if(pendStatus == PEND_STATUS_PENDING)
|
|
|
- // {
|
|
|
- // *pRes = CC_PARAM_NOT_SUP_IN_CUR_STATE;
|
|
|
- // return sizeof (uint8_t);
|
|
|
- // }
|
|
|
- // vlanID = (pSetLanReq->ConfigData.VLANID & 0xfff); /* get the vlan d from the data */
|
|
|
-
|
|
|
- // for(i=0;i<sizeof(InvalidVlanID)/sizeof(uint16_t);i++)
|
|
|
- // {
|
|
|
- // if(InvalidVlanID[i] != vlanID)
|
|
|
- // {
|
|
|
- // continue;
|
|
|
- // }
|
|
|
- // else /*invalid vlan id */
|
|
|
- // {
|
|
|
- // *pRes = CC_INV_DATA_FIELD ;
|
|
|
- // return sizeof (*pRes);
|
|
|
- // }
|
|
|
- // }
|
|
|
-
|
|
|
- // if ( NWConfig.VLANID != 0) /* checks if vlan id already present */
|
|
|
- // {
|
|
|
- // if(NWConfig.VLANID == vlanID)
|
|
|
- // {
|
|
|
- // TCRIT("Currently configured vlan id and incoming set vlan id are same thus, do nothing\n");
|
|
|
- // break;
|
|
|
- // }
|
|
|
- // memset(IfcName,0,sizeof(IfcName));
|
|
|
- // if(GetIfcName(EthIndex, IfcName,BMCInst) != 0)
|
|
|
- // {
|
|
|
- // TCRIT("Error in getting Interface Name for the Lan Index :%d\n",EthIndex);
|
|
|
- // *pRes = CC_INV_DATA_FIELD ;
|
|
|
- // return sizeof (*pRes);
|
|
|
- // }
|
|
|
- // sprintf(VLANInterfaceName, "%s.%d", IfcName, (int)(NWConfig.VLANID));
|
|
|
- // if (0 == NwInterfacePresenceCheck (VLANInterfaceName))
|
|
|
- // {
|
|
|
- // pendStatus = GetPendStatus(PEND_OP_SET_VLAN_ID);
|
|
|
- // if(pendStatus == PEND_STATUS_PENDING)
|
|
|
- // {
|
|
|
- // *pRes = CC_PARAM_NOT_SUP_IN_CUR_STATE;
|
|
|
- // return sizeof (uint8_t);
|
|
|
- // }
|
|
|
- // SetPendStatus(PEND_OP_DECONFIG_VLAN_IFC,PEND_STATUS_PENDING);
|
|
|
- // PostPendTask(PEND_OP_DECONFIG_VLAN_IFC,(uint8_t*)&NWConfig,sizeof(NWConfig),(pSetLanReq->ChannelNum & 0x0F), BMCInst );
|
|
|
- // pBMCInfo->LANCfs[EthIndex].VLANPriority =0;
|
|
|
- // }
|
|
|
- // }
|
|
|
-
|
|
|
- // NWConfig.VLANID=vlanID;
|
|
|
- // SetPendStatus(PEND_OP_SET_VLAN_ID,PEND_STATUS_PENDING);
|
|
|
- // PostPendTask(PEND_OP_SET_VLAN_ID,(uint8_t*)&NWConfig,sizeof(NWConfig),(pSetLanReq->ChannelNum & 0x0F), BMCInst );
|
|
|
- // pBMCInfo->LANCfs[EthIndex].VLANID = pSetLanReq->ConfigData.VLANID;
|
|
|
- // }
|
|
|
- // else /* Vlan Bit is Disabled */
|
|
|
- // {
|
|
|
- // if(NWConfig.VLANID==0) /* Vlan id is disabled */
|
|
|
- // {
|
|
|
- // if((pSetLanReq->ConfigData.VLANID & 0xfff)!=0)
|
|
|
- // {
|
|
|
- // pBMCInfo->LANCfs[EthIndex].VLANID = pSetLanReq->ConfigData.VLANID;
|
|
|
- // }
|
|
|
-
|
|
|
- // if((pSetLanReq->ConfigData.VLANID & 0xfff)==0)
|
|
|
- // {
|
|
|
- // if((pBMCInfo->LANCfs[EthIndex].VLANID & 0xfff)!=0)
|
|
|
- // {
|
|
|
- // pBMCInfo->LANCfs[EthIndex].VLANID = pSetLanReq->ConfigData.VLANID;
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
-
|
|
|
- // else /* Vlan ID is enable. so deconfigure it */
|
|
|
- // {
|
|
|
- // memset(IfcName,0,sizeof(IfcName));
|
|
|
- // if(GetIfcName(EthIndex, IfcName,BMCInst) != 0)
|
|
|
- // {
|
|
|
- // TCRIT("Error in getting Interface Name for the Lan Index :%d\n",EthIndex);
|
|
|
- // *pRes = CC_INV_DATA_FIELD ;
|
|
|
- // return sizeof (*pRes);
|
|
|
- // }
|
|
|
- // sprintf(VLANInterfaceName, "%s.%d", IfcName, (int)(NWConfig.VLANID));
|
|
|
- // if (0 == NwInterfacePresenceCheck (VLANInterfaceName))
|
|
|
- // {
|
|
|
- // pendStatus = GetPendStatus(PEND_OP_SET_VLAN_ID);
|
|
|
- // if(pendStatus == PEND_STATUS_PENDING)
|
|
|
- // {
|
|
|
- // *pRes = CC_PARAM_NOT_SUP_IN_CUR_STATE;
|
|
|
- // return sizeof (uint8_t);
|
|
|
- // }
|
|
|
- // SetPendStatus(PEND_OP_DECONFIG_VLAN_IFC,PEND_STATUS_PENDING);
|
|
|
- // PostPendTask(PEND_OP_DECONFIG_VLAN_IFC,(uint8_t*)&NWConfig,sizeof(NWConfig),(pSetLanReq->ChannelNum & 0x0F), BMCInst );
|
|
|
- // pBMCInfo->LANCfs[EthIndex].VLANPriority =0;
|
|
|
- // }
|
|
|
- // pendStatus = GetPendStatus(PEND_OP_SET_SOURCE);
|
|
|
- // if(pendStatus == PEND_STATUS_PENDING)
|
|
|
- // {
|
|
|
- // *pRes = CC_PARAM_NOT_SUP_IN_CUR_STATE;
|
|
|
- // return sizeof (uint8_t);
|
|
|
- // }
|
|
|
- // //NWConfig.VLANID=0;
|
|
|
- // NWConfig.CfgMethod = pBMCInfo->LANCfs[EthIndex].IPAddrSrc;
|
|
|
- // SetPendStatus(PEND_OP_SET_SOURCE,PEND_STATUS_PENDING);
|
|
|
- // PostPendTask(PEND_OP_SET_SOURCE,(uint8_t*) &NWConfig,sizeof(NWConfig),(pSetLanReq->ChannelNum & 0x0F), BMCInst );
|
|
|
- // pBMCInfo->LANCfs[EthIndex].VLANID = pSetLanReq->ConfigData.VLANID;
|
|
|
- // }
|
|
|
-
|
|
|
- // }
|
|
|
- // }
|
|
|
- // else
|
|
|
- // {
|
|
|
- // pSetLanRes->CompletionCode = CC_PARAM_NOT_SUP_IN_CUR_STATE;
|
|
|
- // return sizeof(uint8_t);
|
|
|
- // }
|
|
|
break;
|
|
|
case LAN_PARAM_VLAN_PRIORITY:
|
|
|
printf("Not implement\n");
|
|
|
- // if( pBMCInfo->IpmiConfig.VLANIfcSupport == 1)
|
|
|
- // {
|
|
|
- // if((pBMCInfo->LANCfs[EthIndex].VLANID & VLAN_MASK_BIT) != VLAN_MASK_BIT) /* checks for VLAN enable bit*/
|
|
|
- // {
|
|
|
- // if(g_corefeatures.vlan_priorityset == ENABLED)
|
|
|
- // {
|
|
|
- // if(pSetLanReq->ConfigData.VLANPriority > 7 )
|
|
|
- // {
|
|
|
- // TCRIT(" VLAN Priority value should be 0-7 \n");
|
|
|
- // *pRes = CC_INV_DATA_FIELD ;
|
|
|
- // return sizeof (*pRes);
|
|
|
- // }
|
|
|
- // if(ReadVLANFile(VLAN_PRIORITY_SETTING_STR, PriorityLevel) == -1)
|
|
|
- // {
|
|
|
- // return -1;
|
|
|
- // }
|
|
|
- // if(WriteVLANFile(VLAN_PRIORITY_SETTING_STR, PriorityLevel, netindex,pSetLanReq->ConfigData.VLANPriority) == -1)
|
|
|
- // {
|
|
|
- // return -1;
|
|
|
- // }
|
|
|
- // pBMCInfo->LANCfs[EthIndex].VLANPriority = pSetLanReq->ConfigData.VLANPriority;
|
|
|
- // }
|
|
|
- // else
|
|
|
- // {
|
|
|
- // TCRIT(" VLAN is not Configured \n");
|
|
|
- // *pRes = CC_PARAM_NOT_SUP_IN_CUR_STATE;
|
|
|
- // return sizeof (*pRes);
|
|
|
- // }
|
|
|
- // }
|
|
|
- // else
|
|
|
- // {
|
|
|
- // if(pSetLanReq->ConfigData.VLANPriority > 7 )
|
|
|
- // {
|
|
|
- // TCRIT(" VLAN Priority value should be 0-7 \n");
|
|
|
- // *pRes = CC_INV_DATA_FIELD ;
|
|
|
- // return sizeof (*pRes);
|
|
|
- // }
|
|
|
-
|
|
|
- // if(ReadVLANFile(VLAN_PRIORITY_SETTING_STR, PriorityLevel) == -1)
|
|
|
- // {
|
|
|
- // return -1;
|
|
|
- // }
|
|
|
-
|
|
|
- // if(WriteVLANFile(VLAN_PRIORITY_SETTING_STR, PriorityLevel, netindex,pSetLanReq->ConfigData.VLANPriority) == -1)
|
|
|
- // {
|
|
|
- // return -1;
|
|
|
- // }
|
|
|
-
|
|
|
- // pBMCInfo->LANCfs[EthIndex].VLANPriority = pSetLanReq->ConfigData.VLANPriority;
|
|
|
- // vlanID = (pBMCInfo->LANCfs[EthIndex].VLANID & 0xfff);
|
|
|
- // memset(IfcName,0,sizeof(IfcName));
|
|
|
- // if(GetIfcName(EthIndex, IfcName,BMCInst) != 0)
|
|
|
- // {
|
|
|
- // TCRIT("Error in getting Interface Name for the Lan Index :%d\n",EthIndex);
|
|
|
- // *pRes = CC_INV_DATA_FIELD;
|
|
|
- // return sizeof(*pRes);
|
|
|
- // }
|
|
|
- // /*vconfig set_egress_map <valninterface> <skb_buffer> <vlan-priority>*/
|
|
|
- // sprintf(cmdSetPriority,"vconfig set_egress_map %s.%d 0 %d",IfcName,vlanID,pSetLanReq->ConfigData.VLANPriority);
|
|
|
- // if(((retValue = safe_system(cmdSetPriority)) < 0))
|
|
|
- // {
|
|
|
- // TCRIT("ERROR %d: Set VLAN Priority failed\n",retValue);
|
|
|
- // }
|
|
|
-
|
|
|
- // /*
|
|
|
- // * Set priority of IPMI commands.
|
|
|
- // * The skb->priority value of IPMI command will be modified by TOS option.
|
|
|
- // * So, use the mapping table to get the current value.
|
|
|
- // */
|
|
|
- // memset(&cmdSetPriority,0,sizeof(cmdSetPriority));
|
|
|
- // TOS = pBMCInfo->LANCfs[EthIndex].Ipv4HdrParam.TypeOfService;
|
|
|
- // SkbPriority = IP_TOS2PRIO[IPTOS_TOS(TOS)>>1];
|
|
|
- // sprintf(cmdSetPriority,"vconfig set_egress_map %s.%d %d %d",IfcName,vlanID,SkbPriority,pSetLanReq->ConfigData.VLANPriority);
|
|
|
- // if(((retValue = safe_system(cmdSetPriority)) < 0))
|
|
|
- // {
|
|
|
- // TCRIT("ERROR %d: Set VLAN IPMI Priority failed\n",retValue);
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // else
|
|
|
- // {
|
|
|
- // pSetLanRes->CompletionCode = CC_PARAM_NOT_SUP_IN_CUR_STATE;
|
|
|
- // return sizeof(uint8_t);
|
|
|
- // }
|
|
|
break;
|
|
|
case LAN_PARAM_CIPHER_SUITE_ENTRY_SUP:
|
|
|
pSetLanRes->CompletionCode = CC_ATTEMPT_TO_SET_RO_PARAM;
|
|
@@ -986,42 +542,14 @@ SetLanConfigParam ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes)
|
|
|
|
|
|
case LAN_PARAM_CIPHER_SUITE_PRIV_LEVELS:
|
|
|
printf("Not implement\n");
|
|
|
- // LOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
- // _fmemcpy (pBMCInfo->LANCfs[EthIndex].CipherSuitePrivLevels,
|
|
|
- // pSetLanReq->ConfigData.CipherSuitePrivLevels, MAX_NUM_CIPHER_SUITE_PRIV_LEVELS);
|
|
|
- // UNLOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
break;
|
|
|
|
|
|
case LAN_PARAM_VLAN_TAGS:
|
|
|
printf("Not implement\n");
|
|
|
- // if (0 == pSetLanReq->ConfigData.DestAddr.SetSelect)
|
|
|
- // {
|
|
|
- // LOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
- // _fmemcpy(&pSharedMem->VLANDestTag,
|
|
|
- // (( uint8_t*)&pSetLanReq->ConfigData) + 1, sizeof(VLANDestTags_T));
|
|
|
- // UNLOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
- // }
|
|
|
- // else
|
|
|
- // {
|
|
|
- // if (pSetLanReq->ConfigData.DestAddr.SetSelect > pBMCInfo->LANCfs[EthIndex].NumDest)
|
|
|
- // {
|
|
|
- // pSetLanRes->CompletionCode = CC_PARAM_OUT_OF_RANGE;
|
|
|
- // return sizeof (uint8_t);
|
|
|
- // }
|
|
|
- // LOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
- // _fmemcpy(&pBMCInfo->LANCfs[EthIndex].VLANDestTags [pSetLanReq->ConfigData.DestAddr.SetSelect - 1],
|
|
|
- // (( uint8_t*)&pSetLanReq->ConfigData) + 1, sizeof(VLANDestTags_T));
|
|
|
- // UNLOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
- // }
|
|
|
break;
|
|
|
|
|
|
case LAN_PARAMS_BAD_PASSWORD_THRESHOLD:
|
|
|
printf("Not implement\n");
|
|
|
- // ClearUserLockAttempts(LAN_CHANNEL_BADP,BMCInst);
|
|
|
- // LOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
- // _fmemcpy(&pBMCInfo->LANCfs[EthIndex].BadPasswd,
|
|
|
- // &pSetLanReq->ConfigData.BadPasswd,sizeof(BadPassword_T));
|
|
|
- // UNLOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
break;
|
|
|
default:
|
|
|
pSetLanRes->CompletionCode = CC_PARAM_NOT_SUPPORTED;
|