|
@@ -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;
|
|
@@ -1206,857 +734,185 @@ int IPAddrCheck(uint8_t *Addr,int params)
|
|
|
// }
|
|
|
|
|
|
|
|
|
-// /*---------------------------------------------------
|
|
|
-// * GetLanConfigParam
|
|
|
-// *---------------------------------------------------*/
|
|
|
-// int
|
|
|
-// GetLanConfigParam ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes, int BMCInst)
|
|
|
-// {
|
|
|
-// GetLanConfigReq_T* pGetLanReq = ( GetLanConfigReq_T*) pReq;
|
|
|
-// GetLanConfigRes_T* pGetLanRes = ( GetLanConfigRes_T*) pRes;
|
|
|
-// BMCSharedMem_T* pSharedMem = BMC_GET_SHARED_MEM (BMCInst);
|
|
|
-// uint8_t IsOemDefined = FALSE;
|
|
|
-// NWCFG_STRUCT NWConfig;
|
|
|
-// NWCFG6_STRUCT NWConfig6;
|
|
|
-// // V6DNS_CONFIG v6dnsconfig;
|
|
|
-// uint8_t EthIndex,netindex= 0xFF,i;
|
|
|
-// BMCInfo_t* pBMCInfo = &g_BMCInfo[BMCInst];
|
|
|
-// int ncsiPortConfigNum = 0;
|
|
|
-
|
|
|
-// ETHCFG_STRUCT PHYCfg;
|
|
|
-// ChannelInfo_T* pChannelInfo = NULL;
|
|
|
-
|
|
|
-// char IfcName[16]; /* Eth interface name */
|
|
|
-// uint8_t ComStrLen=MAX_COMM_STRING_SIZE;
|
|
|
-// int retValue = 0,NIC_Count = 0;
|
|
|
-
|
|
|
-// pGetLanRes->CCParamRev.CompletionCode = CC_NORMAL;
|
|
|
-// pGetLanRes->CCParamRev.ParamRevision = PARAMETER_REVISION_FORMAT;
|
|
|
-
|
|
|
-// // printf("---> channel: %d, parameter: %#x, setslect: %#x, blockselect: %#x\n", pGetLanReq->ChannelNum, pGetLanReq->ParameterSelect, pGetLanReq->SetSelect, pGetLanReq->BlockSelect);
|
|
|
-// if(pGetLanReq->ChannelNum & RESERVED_VALUE_70)
|
|
|
-// {
|
|
|
-// /* Alarm !!! Somebody is trying to set Reseved Bits */
|
|
|
-// *pRes = CC_INV_DATA_FIELD;
|
|
|
-// return sizeof (*pRes);
|
|
|
-// }
|
|
|
-
|
|
|
-// if((pGetLanReq->ParameterSelect >= MIN_LAN_OEM_CONF_PARAM) &&
|
|
|
-// (pGetLanReq->ParameterSelect <= MAX_LAN_OEM_CONF_PARAM) )
|
|
|
-// {
|
|
|
-// /* Converts OEM parameter value to equivalent AMI parameter value */
|
|
|
-// if (0 != GetLanAMIParamValue (&pGetLanReq->ParameterSelect, &IsOemDefined) )
|
|
|
-// {
|
|
|
-// pGetLanRes->CCParamRev.CompletionCode = CC_PARAM_NOT_SUPPORTED;
|
|
|
-// return sizeof(uint8_t);
|
|
|
-// }
|
|
|
-
|
|
|
-// /* Hook for OEM to handle this parameter */
|
|
|
-// if ( (IsOemDefined) && (g_PDKHandle[PDK_GETLANOEMPARAM] != NULL) )
|
|
|
-// {
|
|
|
-// return ((int(*)(uint8_t *, uint8_t, uint8_t *,int))(g_PDKHandle[PDK_GETLANOEMPARAM]))(pReq, ReqLen, pRes, BMCInst);
|
|
|
-// }
|
|
|
-
|
|
|
-// }
|
|
|
-
|
|
|
-// if (g_PDKHandle[PDK_BEFOREGETLANPARM] != NULL)
|
|
|
-// {
|
|
|
-// retValue = ((int(*)(uint8_t *, uint8_t, uint8_t *,int))(g_PDKHandle[PDK_BEFOREGETLANPARM]))(pReq, ReqLen, pRes, BMCInst);
|
|
|
-// if(retValue != 0)
|
|
|
-// {
|
|
|
-// return retValue;
|
|
|
-// }
|
|
|
-// }
|
|
|
-
|
|
|
-// //! Validate the SetSelector value.
|
|
|
-// if ( (0x00 != pGetLanReq->SetSelect) &&
|
|
|
-// (pGetLanReq->ParameterSelect != LAN_PARAM_SELECT_DEST_TYPE) &&
|
|
|
-// (pGetLanReq->ParameterSelect != LAN_PARAM_SELECT_DEST_ADDR) &&
|
|
|
-// (pGetLanReq->ParameterSelect != LAN_PARAM_VLAN_TAGS) &&
|
|
|
-// (pGetLanReq->ParameterSelect != LAN_PARAMS_AMI_OEM_SNMPV6_DEST_ADDR) &&
|
|
|
-// (pGetLanReq->ParameterSelect != LAN_PARAMS_AMI_OEM_IPV6_IP_ADDR) &&
|
|
|
-// (pGetLanReq->ParameterSelect != LAN_PARAMS_AMI_OEM_IPV6_IP_ADDR_EUI64) &&
|
|
|
-// (pGetLanReq->ParameterSelect != LAN_PARAMS_AMI_OEM_IPV6_PREFIX_LENGTH))
|
|
|
-// {
|
|
|
-// printf("GetLanConfigParam log1\n");
|
|
|
-// if( g_corefeatures.ncsi_cmd_support == ENABLED )
|
|
|
-// {
|
|
|
-// if ((pGetLanReq->ParameterSelect != LAN_PARAMS_AMI_OEM_NCSI_SETTINGS) &&
|
|
|
-// (pGetLanReq->ParameterSelect != LAN_PARAMS_AMI_OEM_NCSI_MODE_CHANGE) &&
|
|
|
-// (pGetLanReq->ParameterSelect != LAN_PARAMS_AMI_OEM_NCSI_EXTENSION))
|
|
|
-// {
|
|
|
-// *pRes = CC_INV_DATA_FIELD;
|
|
|
-// return sizeof (*pRes);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// *pRes = CC_INV_DATA_FIELD;
|
|
|
-// return sizeof (*pRes);
|
|
|
-// }
|
|
|
-// }
|
|
|
-
|
|
|
-// //! Validate the BlockSelector value.
|
|
|
-// if (0x00 != pGetLanReq->BlockSelect)
|
|
|
-// {
|
|
|
-// printf("GetLanConfigParam log2\n");
|
|
|
-// *pRes = CC_INV_DATA_FIELD;
|
|
|
-// return sizeof (*pRes);
|
|
|
-// }
|
|
|
-
|
|
|
-
|
|
|
-// EthIndex= GetEthIndex(pGetLanReq->ChannelNum & 0x0F, BMCInst);
|
|
|
-// if(0xff == EthIndex)
|
|
|
-// {
|
|
|
-// printf("GetLanConfigParam log3\n");
|
|
|
-// *pRes = CC_INV_DATA_FIELD;
|
|
|
-// return sizeof (uint8_t);
|
|
|
-// }
|
|
|
-
|
|
|
-// /*Get the EthIndex*/
|
|
|
-// if(GetIfcName(EthIndex,IfcName, BMCInst) != 0)
|
|
|
-// {
|
|
|
-// TCRIT("Error in Getting IfcName\n");
|
|
|
-// *pRes = CC_INV_DATA_FIELD;
|
|
|
-// return sizeof (uint8_t);
|
|
|
-// }
|
|
|
+/*---------------------------------------------------
|
|
|
+ * GetLanConfigParam
|
|
|
+ *---------------------------------------------------*/
|
|
|
+int
|
|
|
+GetLanConfigParam ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes)
|
|
|
+{
|
|
|
+ GetLanConfigReq_T* pGetLanReq = ( GetLanConfigReq_T*) pReq;
|
|
|
+ GetLanConfigRes_T* pGetLanRes = ( GetLanConfigRes_T*) pRes;
|
|
|
+ uint8_t EthIndex;
|
|
|
+ char IfcName[16]; /* Eth interface name */
|
|
|
|
|
|
-// for(i=0;i<sizeof(Ifcnametable)/sizeof(IfcName_T);i++)
|
|
|
-// {
|
|
|
-// if(strcmp(Ifcnametable[i].Ifcname,IfcName) == 0)
|
|
|
-// {
|
|
|
-// netindex= Ifcnametable[i].Index;
|
|
|
-// break;
|
|
|
-// }
|
|
|
-// }
|
|
|
+ pGetLanRes->CCParamRev.CompletionCode = CC_NORMAL;
|
|
|
+ pGetLanRes->CCParamRev.ParamRevision = PARAMETER_REVISION_FORMAT;
|
|
|
|
|
|
-// if(netindex == 0xFF)
|
|
|
-// {
|
|
|
-// TCRIT("Error in Getting netindex %d %s\n",netindex,IfcName);
|
|
|
-// *pRes = CC_INV_DATA_FIELD;
|
|
|
-// return sizeof (uint8_t);
|
|
|
-// }
|
|
|
+// printf("---> channel: %d, parameter: %#x, setslect: %#x, blockselect: %#x\n", pGetLanReq->ChannelNum, pGetLanReq->ParameterSelect, pGetLanReq->SetSelect, pGetLanReq->BlockSelect);
|
|
|
+ if(pGetLanReq->ChannelNum & RESERVED_VALUE_70)
|
|
|
+ {
|
|
|
+ /* Alarm !!! Somebody is trying to set Reseved Bits */
|
|
|
+ *pRes = CC_INV_DATA_FIELD;
|
|
|
+ return sizeof (*pRes);
|
|
|
+ }
|
|
|
|
|
|
-// if ((pGetLanReq->ChannelNum & GET_PARAMETER_REVISION_MASK) != 0)
|
|
|
-// {
|
|
|
-// if((MAX_LAN_CONF_PARAM >= pGetLanReq->ParameterSelect) ||
|
|
|
-// ((MIN_LAN_OEM_CONF_PARAM <= pGetLanReq->ParameterSelect) && (MAX_LAN_OEM_CONF_PARAM >= pGetLanReq->ParameterSelect)) )
|
|
|
-// {
|
|
|
-// return sizeof(GetLanCCRev_T);
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// *pRes = CC_PARAM_NOT_SUPPORTED;
|
|
|
-// return sizeof (*pRes);
|
|
|
-// }
|
|
|
-
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// printf("GetLanConfigParam log4\n");
|
|
|
-// switch(pGetLanReq->ParameterSelect)
|
|
|
-// {
|
|
|
-// case LAN_PARAM_SET_IN_PROGRESS:
|
|
|
-
|
|
|
-// LOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
-// pGetLanRes->ConfigData.SetInProgress = BMC_GET_SHARED_MEM(BMCInst)->m_Lan_SetInProgress;
|
|
|
-// UNLOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
-// break;
|
|
|
-
|
|
|
-// case LAN_PARAM_AUTH_TYPE_SUPPORT:
|
|
|
-
|
|
|
-// pGetLanRes->ConfigData.AuthTypeSupport = pBMCInfo->LANCfs[EthIndex].AuthTypeSupport;
|
|
|
-// break;
|
|
|
-
|
|
|
-// case LAN_PARAM_AUTH_TYPE_ENABLES:
|
|
|
-
|
|
|
-// LOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
-// _fmemcpy (&pGetLanRes->ConfigData.AuthTypeEnables,
|
|
|
-// &(pBMCInfo->LANCfs[EthIndex].AuthTypeEnables), sizeof(AuthTypeEnables_T));
|
|
|
-// UNLOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
-// break;
|
|
|
-
|
|
|
-// case LAN_PARAM_IP_ADDRESS:
|
|
|
-// if((g_corefeatures.delayed_lan_restart_support) && (pBMCInfo->LANCfs[EthIndex].IPAddrSrc == STATIC_IP_SOURCE))
|
|
|
-// {
|
|
|
-// if(pBMCInfo->LANCfs[EthIndex].IPv4_Enable)
|
|
|
-// {
|
|
|
-// _fmemcpy (NWConfig.IPAddr,pBMCInfo->LANCfs[EthIndex].IPAddr, IP_ADDR_LEN);
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// memset(&NWConfig, 0, sizeof(NWConfig));
|
|
|
-// }
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// nwReadNWCfg_v4_v6( &NWConfig, &NWConfig6, netindex,g_corefeatures.global_ipv6);
|
|
|
-// }
|
|
|
-// _fmemcpy (pGetLanRes->ConfigData.IPAddr, NWConfig.IPAddr, IP_ADDR_LEN);
|
|
|
-
|
|
|
-
|
|
|
-// break;
|
|
|
-
|
|
|
-// case LAN_PARAM_IP_ADDRESS_SOURCE:
|
|
|
-// if(g_corefeatures.delayed_lan_restart_support)
|
|
|
-// {
|
|
|
-// if(pBMCInfo->LANCfs[EthIndex].IPv4_Enable)
|
|
|
-// {
|
|
|
-// NWConfig.CfgMethod = pBMCInfo->LANCfs[EthIndex].IPAddrSrc;
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// memset(&NWConfig, 0, sizeof(NWConfig));
|
|
|
-// }
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// nwReadNWCfg_v4_v6( &NWConfig, &NWConfig6, netindex,g_corefeatures.global_ipv6);
|
|
|
-// }
|
|
|
-
|
|
|
-// pGetLanRes->ConfigData.IPAddrSrc = NWConfig.CfgMethod;
|
|
|
-// break;
|
|
|
-
|
|
|
-// case LAN_PARAM_MAC_ADDRESS:
|
|
|
-// nwGetNWInformations(&NWConfig,IfcName);
|
|
|
-// _fmemcpy (pGetLanRes->ConfigData.MACAddr, NWConfig.MAC, MAC_ADDR_LEN);
|
|
|
-
|
|
|
-// break;
|
|
|
-
|
|
|
-// case LAN_PARAM_SUBNET_MASK:
|
|
|
-// if((g_corefeatures.delayed_lan_restart_support) && (pBMCInfo->LANCfs[EthIndex].IPAddrSrc == STATIC_IP_SOURCE))
|
|
|
-// {
|
|
|
-// if(pBMCInfo->LANCfs[EthIndex].IPv4_Enable)
|
|
|
-// {
|
|
|
-// _fmemcpy (NWConfig.Mask,pBMCInfo->LANCfs[EthIndex].SubNetMask, IP_ADDR_LEN);
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// memset(&NWConfig, 0, sizeof(NWConfig));
|
|
|
-// }
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// nwReadNWCfg_v4_v6( &NWConfig, &NWConfig6, netindex,g_corefeatures.global_ipv6);
|
|
|
-// }
|
|
|
-// _fmemcpy (pGetLanRes->ConfigData.SubNetMask, NWConfig.Mask, IP_ADDR_LEN);
|
|
|
-// break;
|
|
|
-
|
|
|
-// case LAN_PARAM_IPv4_HEADER:
|
|
|
-
|
|
|
-// LOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
-// _fmemcpy (&pGetLanRes->ConfigData.Ipv4HdrParam,
|
|
|
-// &(pBMCInfo->LANCfs[EthIndex].Ipv4HdrParam), sizeof(IPv4HdrParams_T));
|
|
|
-// UNLOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
-// break;
|
|
|
-
|
|
|
-// case LAN_PARAM_PRI_RMCP_PORT:
|
|
|
-
|
|
|
-// pGetLanRes->ConfigData.PrimaryRMCPPort = htoipmi_u16(pBMCInfo->LANCfs[EthIndex].PrimaryRMCPPort);
|
|
|
-// break;
|
|
|
-
|
|
|
-// case LAN_PARAM_SEC_RMCP_PORT:
|
|
|
-// /* Returning Invalid error message */
|
|
|
-// *pRes = CC_PARAM_NOT_SUPPORTED;
|
|
|
-// return sizeof (uint8_t);
|
|
|
-// /*pGetLanRes->ConfigData.SecondaryPort = htoipmi_u16(pPMConfig->LANConfig[EthIndex].SecondaryPort);*/
|
|
|
-// break;
|
|
|
-
|
|
|
-// case LAN_PARAM_BMC_GENERATED_ARP_CONTROL:
|
|
|
-
|
|
|
-// pGetLanRes->ConfigData.BMCGeneratedARPControl = pBMCInfo->LANCfs[EthIndex].BMCGeneratedARPControl;
|
|
|
-// break;
|
|
|
-// case LAN_PARAM_GRATITIOUS_ARP_INTERVAL:
|
|
|
-// pGetLanRes->ConfigData.GratitousARPInterval =
|
|
|
-// pBMCInfo->LANCfs[EthIndex].GratitousARPInterval;
|
|
|
-// break;
|
|
|
-
|
|
|
-// case LAN_PARAM_DEFAULT_GATEWAY_IP:
|
|
|
-// if((g_corefeatures.delayed_lan_restart_support) && (pBMCInfo->LANCfs[EthIndex].IPAddrSrc == STATIC_IP_SOURCE))
|
|
|
-// {
|
|
|
-// if(pBMCInfo->LANCfs[EthIndex].IPv4_Enable)
|
|
|
-// {
|
|
|
-// _fmemcpy (NWConfig.Gateway, pBMCInfo->LANCfs[EthIndex].DefaultGatewayIPAddr, IP_ADDR_LEN);
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// memset(&NWConfig, 0, sizeof(NWConfig));
|
|
|
-// }
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// nwReadNWCfg_v4_v6( &NWConfig, &NWConfig6, netindex,g_corefeatures.global_ipv6);
|
|
|
-// }
|
|
|
-// _fmemcpy (pGetLanRes->ConfigData.DefaultGatewayIPAddr, NWConfig.Gateway, IP_ADDR_LEN);
|
|
|
-// break;
|
|
|
-
|
|
|
-// case LAN_PARAM_DEFAULT_GATEWAY_MAC:
|
|
|
-// nwReadNWCfg_v4_v6( &NWConfig, &NWConfig6, netindex,g_corefeatures.global_ipv6);
|
|
|
-// nwGetSrcMacAddr(&NWConfig.Gateway[0],netindex, &pGetLanRes->ConfigData.DefaultGatewayMACAddr[0]);
|
|
|
-// break;
|
|
|
-
|
|
|
-// case LAN_PARAM_BACKUP_GATEWAY_IP:
|
|
|
-
|
|
|
-// LOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
-// nwGetBkupGWyAddr(pGetLanRes->ConfigData.BackupGatewayIPAddr,netindex);
|
|
|
-// UNLOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
-// break;
|
|
|
-
|
|
|
-// case LAN_PARAM_BACKUP_GATEWAY_MAC:
|
|
|
-
|
|
|
-// LOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
-// _fmemcpy (pGetLanRes->ConfigData.BackupGatewayMACAddr,
|
|
|
-// pBMCInfo->LANCfs[EthIndex].BackupGatewayMACAddr, MAC_ADDR_LEN);
|
|
|
-// UNLOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
-// break;
|
|
|
-
|
|
|
-// case LAN_PARAM_COMMUNITY_STRING:
|
|
|
-// if (g_PDKHandle[PDK_GETSNMPCOMMUNITYNAME] != NULL )
|
|
|
-// {
|
|
|
-// if(((int(*)(uint8_t *, uint8_t *,int))(g_PDKHandle[PDK_GETSNMPCOMMUNITYNAME]))(pGetLanRes->ConfigData.CommunityStr,&ComStrLen, BMCInst)==0)
|
|
|
-// break;
|
|
|
-// }
|
|
|
-// LOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
-// _fmemcpy (pGetLanRes->ConfigData.CommunityStr,
|
|
|
-// pBMCInfo->LANCfs[EthIndex].CommunityStr, MAX_COMM_STRING_SIZE);
|
|
|
-// UNLOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
-// break;
|
|
|
-
|
|
|
-// case LAN_PARAM_DEST_NUM:
|
|
|
-
|
|
|
-// pGetLanRes->ConfigData.NumDest = pBMCInfo->LANCfs[EthIndex].NumDest;
|
|
|
-// break;
|
|
|
-
|
|
|
-// case LAN_PARAM_SELECT_DEST_TYPE:
|
|
|
-
|
|
|
-
|
|
|
-// //if (pGetLanReq->SetSelect > NUM_LAN_DESTINATION)
|
|
|
-// if ( pGetLanReq->SetSelect > pBMCInfo->LANCfs[EthIndex].NumDest )
|
|
|
-// {
|
|
|
-// *pRes = CC_PARAM_OUT_OF_RANGE ;
|
|
|
-// return sizeof (*pRes);
|
|
|
-// }
|
|
|
-
|
|
|
-// if (0 == pGetLanReq->SetSelect)
|
|
|
-// {
|
|
|
-// LOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
-// _fmemcpy (&pGetLanRes->ConfigData.DestType,
|
|
|
-// &pSharedMem->VolLANDestType[EthIndex], sizeof(LANDestType_T));
|
|
|
-// UNLOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// LOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
-// _fmemcpy (&pGetLanRes->ConfigData.DestType,
|
|
|
-// &(pBMCInfo->LANCfs[EthIndex].DestType[pGetLanReq->SetSelect - 1]),
|
|
|
-// sizeof(LANDestType_T));
|
|
|
-// UNLOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
-// }
|
|
|
-// break;
|
|
|
-
|
|
|
-// case LAN_PARAM_SELECT_DEST_ADDR:
|
|
|
-
|
|
|
-// //if (pGetLanReq->SetSelect > NUM_LAN_DESTINATION)
|
|
|
-// if ( pGetLanReq->SetSelect > pBMCInfo->LANCfs[EthIndex].NumDest )
|
|
|
-// {
|
|
|
-// *pRes = CC_PARAM_OUT_OF_RANGE ;
|
|
|
-// return sizeof (*pRes);
|
|
|
-// }
|
|
|
-
|
|
|
-// if (0 == pGetLanReq->SetSelect)
|
|
|
-// {
|
|
|
-// LOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
-// _fmemcpy (&pGetLanRes->ConfigData.DestAddr,
|
|
|
-// &pSharedMem->VolLANDest[EthIndex], sizeof(LANDestAddr_T));
|
|
|
-// UNLOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// LOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
-// _fmemcpy (&pGetLanRes->ConfigData.DestAddr,
|
|
|
-// &(pBMCInfo->LANCfs[EthIndex].DestAddr[pGetLanReq->SetSelect - 1]),
|
|
|
-// sizeof(LANDestAddr_T));
|
|
|
-// UNLOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
-// }
|
|
|
-// break;
|
|
|
-
|
|
|
-// case LAN_PARAM_VLAN_ID:
|
|
|
-
|
|
|
-// if( pBMCInfo->IpmiConfig.VLANIfcSupport == 1)
|
|
|
-// {
|
|
|
-// pGetLanRes->ConfigData.VLANID = pBMCInfo->LANCfs[EthIndex].VLANID;
|
|
|
-// }
|
|
|
-// break;
|
|
|
-
|
|
|
-// case LAN_PARAM_VLAN_PRIORITY:
|
|
|
-
|
|
|
-// pGetLanRes->ConfigData.VLANPriority = pBMCInfo->LANCfs[EthIndex].VLANPriority;
|
|
|
-// break;
|
|
|
-
|
|
|
-// case LAN_PARAM_CIPHER_SUITE_ENTRY_SUP:
|
|
|
-
|
|
|
-// pGetLanRes->ConfigData.CipherSuiteSup = N0_OF_CIPHER_SUITE_SUPPORTED;
|
|
|
-// break;
|
|
|
-
|
|
|
-// case LAN_PARAM_CIPHER_SUITE_ENTRIES:
|
|
|
-// {
|
|
|
-// int i;
|
|
|
-// _fmemset (pGetLanRes->ConfigData.CipherSuiteEntries, 0,
|
|
|
-// sizeof (pGetLanRes->ConfigData.CipherSuiteEntries));
|
|
|
-// for (i = 0; i < (N0_OF_CIPHER_SUITE_SUPPORTED); i++)
|
|
|
-// {
|
|
|
-// pGetLanRes->ConfigData.CipherSuiteEntries[i+1] = g_CipherRec[1 + i * 5];
|
|
|
-// }
|
|
|
-// }
|
|
|
-// break;
|
|
|
-
|
|
|
-// case LAN_PARAM_CIPHER_SUITE_PRIV_LEVELS:
|
|
|
-
|
|
|
-// LOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
-// _fmemcpy (pGetLanRes->ConfigData.CipherSuitePrivLevels,
|
|
|
-// pBMCInfo->LANCfs[EthIndex].CipherSuitePrivLevels,
|
|
|
-// MAX_NUM_CIPHER_SUITE_PRIV_LEVELS);
|
|
|
-// UNLOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
-// break;
|
|
|
-
|
|
|
-// case LAN_PARAM_VLAN_TAGS:
|
|
|
-
|
|
|
-// *(( uint8_t*)&pGetLanRes->ConfigData) = pGetLanReq->SetSelect;
|
|
|
-// if (pGetLanReq->SetSelect > pBMCInfo->LANCfs[EthIndex].NumDest)
|
|
|
-// {
|
|
|
-// pGetLanRes->CCParamRev.CompletionCode = CC_PARAM_OUT_OF_RANGE;
|
|
|
-// return sizeof (GetLanCCRev_T);
|
|
|
-// }
|
|
|
-// if (0 == pGetLanReq->SetSelect)
|
|
|
-// {
|
|
|
-// LOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
-// _fmemcpy ((( uint8_t*) &pGetLanRes->ConfigData) + 1,&pSharedMem->VLANDestTag, sizeof(VLANDestTags_T));
|
|
|
-// UNLOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// if (pGetLanReq->SetSelect > pBMCInfo->LANCfs[EthIndex].NumDest)
|
|
|
-// {
|
|
|
-// pGetLanRes->CCParamRev.CompletionCode = CC_PARAM_OUT_OF_RANGE;
|
|
|
-// return sizeof(GetLanCCRev_T);
|
|
|
-// }
|
|
|
-
|
|
|
-// LOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
-// _fmemcpy ((( uint8_t*)&pGetLanRes->ConfigData) + 1,
|
|
|
-// &pBMCInfo->LANCfs[EthIndex].VLANDestTags[pGetLanReq->SetSelect - 1],
|
|
|
-// sizeof(VLANDestTags_T));
|
|
|
-// UNLOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
-// }
|
|
|
-// break;
|
|
|
-
|
|
|
-// case LAN_PARAMS_BAD_PASSWORD_THRESHOLD:
|
|
|
-// LOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
-// _fmemcpy(&pGetLanRes->ConfigData.BadPasswd,
|
|
|
-// &pBMCInfo->LANCfs[EthIndex].BadPasswd,sizeof(BadPassword_T));
|
|
|
-// UNLOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
-// break;
|
|
|
-// case LAN_PARAMS_AMI_OEM_SNMPV6_DEST_ADDR:
|
|
|
-
|
|
|
-// if ( pGetLanReq->SetSelect > pBMCInfo->LANCfs[EthIndex].NumDest )
|
|
|
-// {
|
|
|
-// *pRes = CC_PARAM_OUT_OF_RANGE ;
|
|
|
-// return sizeof (*pRes);
|
|
|
-// }
|
|
|
-
|
|
|
-// if (0 == pGetLanReq->SetSelect)
|
|
|
-// {
|
|
|
-// LOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
-// _fmemcpy (&pGetLanRes->ConfigData.Destv6Addr,
|
|
|
-// &pSharedMem->VolLANv6Dest[EthIndex], sizeof(LANDestv6Addr_T));
|
|
|
-// UNLOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// LOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
-// _fmemcpy (&pGetLanRes->ConfigData.Destv6Addr,
|
|
|
-// &(pBMCInfo->LANCfs[EthIndex].Destv6Addr[pGetLanReq->SetSelect - 1]),
|
|
|
-// sizeof(LANDestv6Addr_T));
|
|
|
-// UNLOCK_BMC_SHARED_MEM(BMCInst);
|
|
|
-// }
|
|
|
-
|
|
|
-// TDBG("\n GetLanconfig: Getting SNMPv6 configuration done..\n");
|
|
|
-
|
|
|
-// return sizeof(GetLanConfigRes_T);
|
|
|
-
|
|
|
-// break;
|
|
|
-
|
|
|
-// case LAN_PARAMS_AMI_OEM_ENABLE_SET_MAC:
|
|
|
-
|
|
|
-// pGetLanRes->ConfigData.ChangeMACEnabled = enableSetMACAddr;
|
|
|
-// return sizeof(GetLanCCRev_T) + sizeof(uint8_t);
|
|
|
-
|
|
|
-// case LAN_PARAMS_AMI_OEM_IPV6_ENABLE:
|
|
|
-// if(g_corefeatures.delayed_lan_restart_support)
|
|
|
-// {
|
|
|
-// NWConfig6.enable = pBMCInfo->LANCfs[EthIndex].IPv6_Enable;
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// nwReadNWCfg_v4_v6( &NWConfig, &NWConfig6, netindex,g_corefeatures.global_ipv6);
|
|
|
-// }
|
|
|
-// pGetLanRes->ConfigData.IPv6_Enable = NWConfig6.enable;
|
|
|
-// return sizeof(GetLanCCRev_T) + sizeof(uint8_t);
|
|
|
-
|
|
|
-// break;
|
|
|
-
|
|
|
-// case LAN_PARAMS_AMI_OEM_IPV6_IP_ADDR_SOURCE:
|
|
|
-// if(g_corefeatures.delayed_lan_restart_support)
|
|
|
-// {
|
|
|
-// if((pBMCInfo->LANCfs[EthIndex].IPv6_Enable))
|
|
|
-// {
|
|
|
-// NWConfig6.CfgMethod = pBMCInfo->LANCfs[EthIndex].IPv6_IPAddrSrc;
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// memset(&NWConfig6, 0, sizeof(NWConfig6));
|
|
|
-// }
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// nwReadNWCfg_v4_v6( &NWConfig, &NWConfig6, netindex,g_corefeatures.global_ipv6);
|
|
|
-// }
|
|
|
-// pGetLanRes->ConfigData.IPv6_IPAddrSrc = NWConfig6.CfgMethod;
|
|
|
-// return sizeof(GetLanCCRev_T) + sizeof(uint8_t);
|
|
|
-
|
|
|
-// break;
|
|
|
-
|
|
|
-// case LAN_PARAMS_AMI_OEM_IPV6_IP_ADDR:
|
|
|
-// case LAN_PARAMS_AMI_OEM_IPV6_IP_ADDR_EUI64:
|
|
|
-// if(pGetLanReq->SetSelect & 0xF0)
|
|
|
-// {
|
|
|
-// *pRes = CC_INV_DATA_FIELD;
|
|
|
-// return sizeof(uint8_t);
|
|
|
-// }
|
|
|
-
|
|
|
-// if((g_corefeatures.delayed_lan_restart_support) && (pBMCInfo->LANCfs[EthIndex].IPv6_IPAddrSrc == STATIC_IP_SOURCE))
|
|
|
-// {
|
|
|
-// if((pBMCInfo->LANCfs[EthIndex].IPv6_Enable))
|
|
|
-// {
|
|
|
-// _fmemcpy (NWConfig6.GlobalIPAddr,pBMCInfo->LANCfs[EthIndex].IPv6_IPAddr, IP6_ADDR_LEN*MAX_IPV6ADDRS);
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// memset(&NWConfig6, 0, sizeof(NWConfig6));
|
|
|
-// }
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// nwReadNWCfg_v4_v6( &NWConfig, &NWConfig6, netindex,g_corefeatures.global_ipv6);
|
|
|
-// }
|
|
|
-// _fmemcpy (pGetLanRes->ConfigData.IPv6_LinkAddr, NWConfig6.GlobalIPAddr[(pGetLanReq->SetSelect & 0x0F)], IP6_ADDR_LEN);
|
|
|
-// return sizeof(GetLanCCRev_T) + IP6_ADDR_LEN;
|
|
|
-
|
|
|
-// break;
|
|
|
-// case LAN_PARAMS_AMI_OEM_IPV6_LINK_ADDR:
|
|
|
-// nwReadNWCfg_v4_v6( &NWConfig, &NWConfig6, netindex,g_corefeatures.global_ipv6);
|
|
|
-// _fmemcpy (pGetLanRes->ConfigData.IPv6_LinkAddr, NWConfig6.LinkIPAddr, IP6_ADDR_LEN);
|
|
|
-// return sizeof(GetLanCCRev_T) + IP6_ADDR_LEN;
|
|
|
-
|
|
|
-// case LAN_PARAMS_AMI_OEM_IPV6_PREFIX_LENGTH:
|
|
|
-
|
|
|
-// if(pGetLanReq->SetSelect & 0xF0)
|
|
|
-// {
|
|
|
-// *pRes = CC_INV_DATA_FIELD;
|
|
|
-// return sizeof(uint8_t);
|
|
|
-// }
|
|
|
-
|
|
|
-// if((g_corefeatures.delayed_lan_restart_support) && (pBMCInfo->LANCfs[EthIndex].IPv6_IPAddrSrc == STATIC_IP_SOURCE))
|
|
|
-// {
|
|
|
-// if((pBMCInfo->LANCfs[EthIndex].IPv6_Enable))
|
|
|
-// {
|
|
|
-// NWConfig6.GlobalPrefix[(pGetLanReq->SetSelect & 0x0F)] = pBMCInfo->LANCfs[EthIndex].IPv6_PrefixLen[(pGetLanReq->SetSelect & 0x0F)];
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// memset(&NWConfig6, 0, sizeof(NWConfig6));
|
|
|
-// }
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// nwReadNWCfg_v4_v6( &NWConfig, &NWConfig6, netindex,g_corefeatures.global_ipv6);
|
|
|
-// }
|
|
|
-// pGetLanRes->ConfigData.IPv6_LinkAddrPrefix = NWConfig6.GlobalPrefix[(pGetLanReq->SetSelect & 0x0F)];
|
|
|
-// return sizeof(GetLanCCRev_T) + sizeof(uint8_t);
|
|
|
-
|
|
|
-// break;
|
|
|
-
|
|
|
-// case LAN_PARAMS_AMI_OEM_IPV6_LINK_ADDR_PREFIX:
|
|
|
-// nwReadNWCfg_v4_v6( &NWConfig, &NWConfig6, netindex,g_corefeatures.global_ipv6);
|
|
|
-// pGetLanRes->ConfigData.IPv6_LinkAddrPrefix = NWConfig6.LinkPrefix;
|
|
|
-// return sizeof(GetLanCCRev_T) + sizeof(uint8_t);
|
|
|
-
|
|
|
-// break;
|
|
|
-
|
|
|
-// case LAN_PARAMS_AMI_OEM_IPV6_GATEWAY_IP:
|
|
|
-// if((g_corefeatures.delayed_lan_restart_support) && (pBMCInfo->LANCfs[EthIndex].IPv6_IPAddrSrc == STATIC_IP_SOURCE))
|
|
|
-// {
|
|
|
-// if((pBMCInfo->LANCfs[EthIndex].IPv6_Enable))
|
|
|
-// {
|
|
|
-// _fmemcpy (NWConfig6.Gateway,pBMCInfo->LANCfs[EthIndex].IPv6_GatewayIPAddr, IP6_ADDR_LEN);
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// memset(&NWConfig6, 0, sizeof(NWConfig6));
|
|
|
-// }
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// nwReadNWCfg_v4_v6( &NWConfig, &NWConfig6, netindex,g_corefeatures.global_ipv6);
|
|
|
-// }
|
|
|
-// _fmemcpy (pGetLanRes->ConfigData.IPv6_GatewayIPAddr, NWConfig6.Gateway, IP6_ADDR_LEN);
|
|
|
-// return sizeof(GetLanCCRev_T) + IP6_ADDR_LEN;
|
|
|
-
|
|
|
-// break;
|
|
|
-
|
|
|
-// case LAN_PARAMS_AMI_OEM_PHY_SETTINGS:
|
|
|
-// memset(IfcName, 0, sizeof(IfcName));
|
|
|
-// if(GetIfcNameByIndex(EthIndex, IfcName) != 0)
|
|
|
-// {
|
|
|
-// TCRIT("Error in Getting Interface Name for the lan Index:%d\n",EthIndex);
|
|
|
-// }
|
|
|
-// if(nwGetEthInformation(&PHYCfg, IfcName) !=0)
|
|
|
-// {
|
|
|
-// pGetLanRes->CCParamRev.CompletionCode = CC_UNSPECIFIED_ERR;
|
|
|
-// return sizeof(GetLanCCRev_T);
|
|
|
-// }
|
|
|
-// pGetLanRes->ConfigData.PHYConfig.Interface = EthIndex;
|
|
|
-// pGetLanRes->ConfigData.PHYConfig.AutoNegotiationEnable = PHYCfg.autoneg;
|
|
|
-// pGetLanRes->ConfigData.PHYConfig.Speed = PHYCfg.speed;
|
|
|
-// pGetLanRes->ConfigData.PHYConfig.Duplex = PHYCfg.duplex;
|
|
|
-// pGetLanRes->ConfigData.PHYConfig.CapabilitiesSupported = PHYCfg.supported;
|
|
|
-
|
|
|
-// return sizeof(GetLanCCRev_T) + sizeof(PHYConfig_T);
|
|
|
-
|
|
|
-// case LAN_PARAMS_AMI_OEM_MTU_SETTINGS:
|
|
|
-// memset(IfcName,0,sizeof(IfcName));
|
|
|
-// if(GetIfcNameByIndex(EthIndex, IfcName) != 0)
|
|
|
-// {
|
|
|
-// TCRIT("Error in Getting Interface Name for the lan Index:%d\n",EthIndex);
|
|
|
-// pGetLanRes->CCParamRev.CompletionCode = CC_UNSPECIFIED_ERR;
|
|
|
-// return sizeof(GetLanCCRev_T);
|
|
|
-
|
|
|
-// }
|
|
|
-// if(nwGetEthInformation(&PHYCfg, IfcName) !=0)
|
|
|
-// {
|
|
|
-// pGetLanRes->CCParamRev.CompletionCode = CC_UNSPECIFIED_ERR;
|
|
|
-// return sizeof(GetLanCCRev_T);
|
|
|
-// }
|
|
|
-
|
|
|
-// pGetLanRes->ConfigData.MTU_size = PHYCfg.maxtxpkt;
|
|
|
-// return sizeof(GetLanCCRev_T) + sizeof(uint16_t);
|
|
|
-
|
|
|
-// case LAN_PARAMS_SSI_OEM_2ND_PRI_ETH_MAC_ADDR:
|
|
|
-// if(g_corefeatures.ssi_support == ENABLED)
|
|
|
-// {
|
|
|
-// netindex = 0x1; /* Specify the 2nd interface */
|
|
|
-// nwReadNWCfg_v4_v6(&NWConfig, &NWConfig6, netindex,g_corefeatures.global_ipv6);
|
|
|
-// _fmemcpy(pGetLanRes->ConfigData.SSI2ndPriEthMACAddr, NWConfig.MAC, MAC_ADDR_LEN);
|
|
|
-// return sizeof(GetLanCCRev_T) + sizeof(pGetLanRes->ConfigData.SSI2ndPriEthMACAddr);
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// pGetLanRes->CCParamRev.CompletionCode = CC_PARAM_NOT_SUPPORTED;
|
|
|
-// return sizeof(uint8_t);
|
|
|
-// }
|
|
|
-// break;
|
|
|
-
|
|
|
-// case LAN_PARAMS_SSI_OEM_LINK_CTRL:
|
|
|
-// if(g_corefeatures.ssi_support == ENABLED)
|
|
|
-// {
|
|
|
-// pGetLanRes->ConfigData.SSILinkControl = 0;
|
|
|
-
|
|
|
-// pChannelInfo = getChannelInfo(pBMCInfo->RMCPLAN1Ch, BMCInst);
|
|
|
-// if(NULL == pChannelInfo)
|
|
|
-// {
|
|
|
-// *pRes = CC_UNSPECIFIED_ERR;
|
|
|
-// return sizeof (*pRes);
|
|
|
-// }
|
|
|
+ //! Validate the SetSelector value.
|
|
|
+ if (0x00 != pGetLanReq->SetSelect)
|
|
|
+ {
|
|
|
+ printf("---> SetSelector not support!\n");
|
|
|
+ *pRes = CC_INV_DATA_FIELD;
|
|
|
+ return sizeof (*pRes);
|
|
|
+ }
|
|
|
|
|
|
-// if (pChannelInfo->AccessMode == 0x02) /* If 1st channal is available */
|
|
|
-// pGetLanRes->ConfigData.SSILinkControl |= BIT0;
|
|
|
-// NIC_Count = g_coremacros.global_nic_count;
|
|
|
-// if (NIC_Count == 2)
|
|
|
-// {
|
|
|
-// pChannelInfo = getChannelInfo(pBMCInfo->RMCPLAN2Ch, BMCInst);
|
|
|
-// if(NULL == pChannelInfo)
|
|
|
-// {
|
|
|
-// *pRes = CC_UNSPECIFIED_ERR;
|
|
|
-// return sizeof (*pRes);
|
|
|
-// }
|
|
|
-
|
|
|
-// if (pChannelInfo->AccessMode == 0x02) /* If 2nd channal is available */
|
|
|
-// pGetLanRes->ConfigData.SSILinkControl |= BIT1;
|
|
|
-// }
|
|
|
-// return sizeof(GetLanCCRev_T) + sizeof(pGetLanRes->ConfigData.SSILinkControl);
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// pGetLanRes->CCParamRev.CompletionCode = CC_PARAM_NOT_SUPPORTED;
|
|
|
-// return sizeof(uint8_t);
|
|
|
-// }
|
|
|
-// break;
|
|
|
+ //! Validate the BlockSelector value.
|
|
|
+ if (0x00 != pGetLanReq->BlockSelect)
|
|
|
+ {
|
|
|
+ printf("---> BlockSelector not support!\n");
|
|
|
+ *pRes = CC_INV_DATA_FIELD;
|
|
|
+ return sizeof (*pRes);
|
|
|
+ }
|
|
|
|
|
|
-// case LAN_PARAMS_SSI_OEM_CMM_IP_ADDR:
|
|
|
-// if(g_corefeatures.ssi_support == ENABLED)
|
|
|
-// {
|
|
|
-// _fmemcpy (pGetLanRes->ConfigData.CMMIPAddr, pBMCInfo->SSIConfig.CMMIPAddr, IP_ADDR_LEN);
|
|
|
-// return sizeof(GetLanCCRev_T) + sizeof(pGetLanRes->ConfigData.CMMIPAddr);
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// pGetLanRes->CCParamRev.CompletionCode = CC_PARAM_NOT_SUPPORTED;
|
|
|
-// return sizeof(uint8_t);
|
|
|
-// }
|
|
|
-// break;
|
|
|
|
|
|
-// default:
|
|
|
-// if(g_corefeatures.ncsi_cmd_support == ENABLED)
|
|
|
-// {
|
|
|
-// switch(pGetLanReq->ParameterSelect)
|
|
|
-// {
|
|
|
-// case LAN_PARAMS_AMI_OEM_NCSI_CONFIG_NUM:
|
|
|
-// NCSIGetTotalPorts(&ncsiPortConfigNum);
|
|
|
-
|
|
|
-// if (ncsiPortConfigNum >= 0xFF)
|
|
|
-// {
|
|
|
-// pGetLanRes->CCParamRev.CompletionCode = CC_INV_DATA_FIELD;
|
|
|
-// return sizeof(GetLanCCRev_T);
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// pGetLanRes->ConfigData.NumNCSIPortConfigs = ncsiPortConfigNum;
|
|
|
-// return sizeof(GetLanCCRev_T) + sizeof(uint8_t);
|
|
|
-// }
|
|
|
-// break;
|
|
|
-
|
|
|
-// case LAN_PARAMS_AMI_OEM_NCSI_SETTINGS:
|
|
|
-// {
|
|
|
-// NIC_Count=g_coremacros.global_nic_count;
|
|
|
-// if (pGetLanReq->SetSelect >= NIC_Count)
|
|
|
-// {
|
|
|
-// pGetLanRes->CCParamRev.CompletionCode = CC_INV_DATA_FIELD;
|
|
|
-// return sizeof(GetLanCCRev_T);
|
|
|
-// }
|
|
|
-// NCSIConfig_T configData;
|
|
|
-// char interfaceName[8];
|
|
|
-
|
|
|
-// memset(&configData, 0, sizeof(NCSIConfig_T));
|
|
|
-// memset(interfaceName, 0, sizeof(interfaceName));
|
|
|
-
|
|
|
-// snprintf(interfaceName, sizeof(interfaceName), "%s%d", "eth", pGetLanReq->SetSelect);
|
|
|
-
|
|
|
-// if (NCSIGetPortConfigByName(interfaceName, &configData) != 0)
|
|
|
-// {
|
|
|
-// pGetLanRes->CCParamRev.CompletionCode = CC_INV_DATA_FIELD;
|
|
|
-// return sizeof(GetLanCCRev_T);
|
|
|
-// }
|
|
|
-
|
|
|
-// if (configData.PackageId >= 0xFF || configData.ChannelId >= 0xFF)
|
|
|
-// {
|
|
|
-// pGetLanRes->CCParamRev.CompletionCode = CC_INV_DATA_FIELD;
|
|
|
-// return sizeof(GetLanCCRev_T);
|
|
|
-// }
|
|
|
-
|
|
|
-// pGetLanRes->ConfigData.NCSIPortConfig.Interface = pGetLanReq->SetSelect;
|
|
|
-// pGetLanRes->ConfigData.NCSIPortConfig.PackageId = configData.PackageId;
|
|
|
-// pGetLanRes->ConfigData.NCSIPortConfig.ChannelId = configData.ChannelId;
|
|
|
-
|
|
|
-// return sizeof(GetLanCCRev_T) + sizeof(NCSIPortConfig_T);
|
|
|
-// }
|
|
|
-// break;
|
|
|
-
|
|
|
-// case LAN_PARAMS_AMI_OEM_NCSI_MODE_CHANGE:
|
|
|
-// {
|
|
|
-// NIC_Count=g_coremacros.global_nic_count;
|
|
|
-// if (pGetLanReq->SetSelect >= NIC_Count)
|
|
|
-// {
|
|
|
-// printf("---> log5, SetSelect = %d, NIC_Count = %d\n",pGetLanReq->SetSelect, NIC_Count);
|
|
|
-// pGetLanRes->CCParamRev.CompletionCode = CC_INV_DATA_FIELD;
|
|
|
-// return sizeof(GetLanCCRev_T);
|
|
|
-// }
|
|
|
-
|
|
|
-// NCSIConfig_T configData;
|
|
|
-// char interfaceName[8];
|
|
|
-// memset(&configData, 0, sizeof(NCSIConfig_T));
|
|
|
-// memset(interfaceName, 0, sizeof(interfaceName));
|
|
|
-
|
|
|
-// snprintf(interfaceName, sizeof(interfaceName), "%s%d", "eth", pGetLanReq->SetSelect);
|
|
|
-
|
|
|
-// if (NCSIGetPortConfigByName(interfaceName, &configData) != 0)
|
|
|
-// {
|
|
|
-// pGetLanRes->CCParamRev.CompletionCode = CC_INV_DATA_FIELD;
|
|
|
-// return sizeof(GetLanCCRev_T);
|
|
|
-// }
|
|
|
-
|
|
|
-// if (configData.AutoSelect>= 0xFF)
|
|
|
-// {
|
|
|
-// pGetLanRes->CCParamRev.CompletionCode = CC_INV_DATA_FIELD;
|
|
|
-// return sizeof(GetLanCCRev_T);
|
|
|
-// }
|
|
|
-
|
|
|
-// pGetLanRes->ConfigData.NCSIModeConfig.Interface = pGetLanReq->SetSelect;
|
|
|
-// pGetLanRes->ConfigData.NCSIModeConfig.NCSIMode = configData.AutoSelect;
|
|
|
-
|
|
|
-// return sizeof(GetLanCCRev_T) + sizeof(NCSIModeConfig_T);
|
|
|
-// }
|
|
|
-// break;
|
|
|
-
|
|
|
-// case LAN_PARAMS_AMI_OEM_NCSI_EXTENSION:
|
|
|
-// {
|
|
|
-// char ncsi_default_ifc[IFNAMSIZ + 1] = "eth1";
|
|
|
-
|
|
|
-// if ((pGetLanReq->SetSelect == 0x20) &&
|
|
|
-// (g_corefeatures.ncsi_keep_phy_linkup_support == ENABLED))
|
|
|
-// {
|
|
|
-// NIC_Count=g_coremacros.global_nic_count;
|
|
|
-// NCSIConfig_T configData;
|
|
|
-// char interfaceName[8];
|
|
|
-// memset(&configData, 0, sizeof(NCSIConfig_T));
|
|
|
-// memset(interfaceName, 0, sizeof(interfaceName));
|
|
|
-
|
|
|
-// GetMacrodefine_string("CONFIG_SPX_FEATURE_NCSI_DEFAULT_INTERFACE", ncsi_default_ifc);
|
|
|
-// snprintf(interfaceName, sizeof(interfaceName), "%s", ncsi_default_ifc);
|
|
|
-
|
|
|
-// if (NCSIGetPortConfigByName(interfaceName, &configData) != 0)
|
|
|
-// {
|
|
|
-// pGetLanRes->CCParamRev.CompletionCode = CC_INV_DATA_FIELD;
|
|
|
-// return sizeof(GetLanCCRev_T);
|
|
|
-// }
|
|
|
-
|
|
|
-// char Interface[2];
|
|
|
-// snprintf(Interface, sizeof(Interface), "%c", interfaceName[3]);
|
|
|
-// pGetLanRes->ConfigData.NCSIPHYConfigGet.Interface = atoi(Interface);
|
|
|
-// pGetLanRes->ConfigData.NCSIPHYConfigGet.VetoBit = configData.VetoBit;
|
|
|
-
|
|
|
-// return sizeof(GetLanCCRev_T) + sizeof(NCSIPHYConfigGet_T);
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// pGetLanRes->CCParamRev.CompletionCode = CC_PARAM_NOT_SUPPORTED;
|
|
|
-// return sizeof(GetLanCCRev_T);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// break;
|
|
|
-
|
|
|
-// default:
|
|
|
-// TDBG("In Valid Option\n");
|
|
|
-
|
|
|
-// }
|
|
|
-// }
|
|
|
-// pGetLanRes->CCParamRev.CompletionCode = CC_PARAM_NOT_SUPPORTED;
|
|
|
-// return sizeof(uint8_t);
|
|
|
-// }
|
|
|
+ EthIndex= 0;
|
|
|
+ sprintf(IfcName, "eth%d", EthIndex);
|
|
|
|
|
|
-// }
|
|
|
+ if ((pGetLanReq->ChannelNum & GET_PARAMETER_REVISION_MASK) != 0)
|
|
|
+ {
|
|
|
+ if(MAX_LAN_CONF_PARAM >= pGetLanReq->ParameterSelect)
|
|
|
+ {
|
|
|
+ return sizeof(GetLanCCRev_T);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ *pRes = CC_PARAM_NOT_SUPPORTED;
|
|
|
+ return sizeof (*pRes);
|
|
|
+ }
|
|
|
|
|
|
-
|
|
|
-// return sizeof(GetLanCCRev_T) + LanconfigParameterLength[pGetLanReq->ParameterSelect];
|
|
|
-// }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ printf("GetLanConfigParam log4\n");
|
|
|
+ switch(pGetLanReq->ParameterSelect)
|
|
|
+ {
|
|
|
+ case LAN_PARAM_SET_IN_PROGRESS:
|
|
|
+ pGetLanRes->ConfigData.SetInProgress = 0;
|
|
|
+ break;
|
|
|
+ case LAN_PARAM_AUTH_TYPE_SUPPORT:
|
|
|
+ pGetLanRes->ConfigData.AuthTypeSupport = 0x04; //only support MD5
|
|
|
+ break;
|
|
|
+ case LAN_PARAM_AUTH_TYPE_ENABLES:
|
|
|
+ pGetLanRes->ConfigData.AuthTypeEnables.AuthTypeCallBack = 0x04; //MD5
|
|
|
+ pGetLanRes->ConfigData.AuthTypeEnables.AuthTypeUser = 0x04;
|
|
|
+ pGetLanRes->ConfigData.AuthTypeEnables.AuthTypeOperator = 0x04;
|
|
|
+ pGetLanRes->ConfigData.AuthTypeEnables.AuthTypeAdmin = 0x04;
|
|
|
+ pGetLanRes->ConfigData.AuthTypeEnables.AuthTypeOem = 0x04;
|
|
|
+ break;
|
|
|
+ case LAN_PARAM_IP_ADDRESS:
|
|
|
+ pGetLanRes->ConfigData.IPAddr[0] = g_BMCInfo.IpmiConfig.LanInfo[EthIndex].IPAddr[0];
|
|
|
+ pGetLanRes->ConfigData.IPAddr[1] = g_BMCInfo.IpmiConfig.LanInfo[EthIndex].IPAddr[1];
|
|
|
+ pGetLanRes->ConfigData.IPAddr[2] = g_BMCInfo.IpmiConfig.LanInfo[EthIndex].IPAddr[2];
|
|
|
+ pGetLanRes->ConfigData.IPAddr[3] = g_BMCInfo.IpmiConfig.LanInfo[EthIndex].IPAddr[3];
|
|
|
+ break;
|
|
|
+ case LAN_PARAM_IP_ADDRESS_SOURCE:
|
|
|
+ pGetLanRes->ConfigData.IPAddrSrc = 1; //static
|
|
|
+ break;
|
|
|
+ case LAN_PARAM_MAC_ADDRESS:
|
|
|
+ pGetLanRes->ConfigData.MACAddr[0] = g_BMCInfo.IpmiConfig.LanInfo[EthIndex].MACAddr[0];
|
|
|
+ pGetLanRes->ConfigData.MACAddr[1] = g_BMCInfo.IpmiConfig.LanInfo[EthIndex].MACAddr[1];
|
|
|
+ pGetLanRes->ConfigData.MACAddr[2] = g_BMCInfo.IpmiConfig.LanInfo[EthIndex].MACAddr[2];
|
|
|
+ pGetLanRes->ConfigData.MACAddr[3] = g_BMCInfo.IpmiConfig.LanInfo[EthIndex].MACAddr[3];
|
|
|
+ pGetLanRes->ConfigData.MACAddr[4] = g_BMCInfo.IpmiConfig.LanInfo[EthIndex].MACAddr[4];
|
|
|
+ pGetLanRes->ConfigData.MACAddr[5] = g_BMCInfo.IpmiConfig.LanInfo[EthIndex].MACAddr[5];
|
|
|
+ break;
|
|
|
+ case LAN_PARAM_SUBNET_MASK:
|
|
|
+ pGetLanRes->ConfigData.SubNetMask[0] = g_BMCInfo.IpmiConfig.LanInfo[EthIndex].NetMask[0];
|
|
|
+ pGetLanRes->ConfigData.SubNetMask[1] = g_BMCInfo.IpmiConfig.LanInfo[EthIndex].NetMask[1];
|
|
|
+ pGetLanRes->ConfigData.SubNetMask[2] = g_BMCInfo.IpmiConfig.LanInfo[EthIndex].NetMask[2];
|
|
|
+ pGetLanRes->ConfigData.SubNetMask[3] = g_BMCInfo.IpmiConfig.LanInfo[EthIndex].NetMask[3];
|
|
|
+ break;
|
|
|
+ case LAN_PARAM_IPv4_HEADER: //下面这些参数是多少不知道,参考LanIfc.c的SetIPv4Header函数。
|
|
|
+ pGetLanRes->ConfigData.Ipv4HdrParam.TimeToLive = 64;
|
|
|
+ pGetLanRes->ConfigData.Ipv4HdrParam.IpHeaderFlags = 0;
|
|
|
+ pGetLanRes->ConfigData.Ipv4HdrParam.TypeOfService = 0x10; //default
|
|
|
+ break;
|
|
|
+ case LAN_PARAM_PRI_RMCP_PORT:
|
|
|
+ pGetLanRes->ConfigData.PrimaryRMCPPort = LAN_RMCP_PORT; //LSB first
|
|
|
+ break;
|
|
|
+ case LAN_PARAM_SEC_RMCP_PORT:
|
|
|
+ *pRes = CC_PARAM_NOT_SUPPORTED;
|
|
|
+ return sizeof (uint8_t);
|
|
|
+ break;
|
|
|
+
|
|
|
+ case LAN_PARAM_BMC_GENERATED_ARP_CONTROL:
|
|
|
+ pGetLanRes->ConfigData.BMCGeneratedARPControl = 0;
|
|
|
+ break;
|
|
|
+ case LAN_PARAM_GRATITIOUS_ARP_INTERVAL:
|
|
|
+ pGetLanRes->ConfigData.GratitousARPInterval = 4; //4*500ms
|
|
|
+ break;
|
|
|
+ case LAN_PARAM_DEFAULT_GATEWAY_IP:
|
|
|
+ pGetLanRes->ConfigData.DefaultGatewayIPAddr[0] = g_BMCInfo.IpmiConfig.LanInfo[EthIndex].DefaultGW[0];
|
|
|
+ pGetLanRes->ConfigData.DefaultGatewayIPAddr[1] = g_BMCInfo.IpmiConfig.LanInfo[EthIndex].DefaultGW[1];
|
|
|
+ pGetLanRes->ConfigData.DefaultGatewayIPAddr[2] = g_BMCInfo.IpmiConfig.LanInfo[EthIndex].DefaultGW[2];
|
|
|
+ pGetLanRes->ConfigData.DefaultGatewayIPAddr[3] = g_BMCInfo.IpmiConfig.LanInfo[EthIndex].DefaultGW[3];
|
|
|
+ break;
|
|
|
+ case LAN_PARAM_DEFAULT_GATEWAY_MAC: //这个参数提供不了。
|
|
|
+ *pRes = CC_PARAM_NOT_SUPPORTED;
|
|
|
+ return sizeof (uint8_t);
|
|
|
+ break;
|
|
|
+ case LAN_PARAM_BACKUP_GATEWAY_IP:
|
|
|
+ *pRes = CC_PARAM_NOT_SUPPORTED;
|
|
|
+ return sizeof (uint8_t);
|
|
|
+ break;
|
|
|
+ case LAN_PARAM_BACKUP_GATEWAY_MAC:
|
|
|
+ *pRes = CC_PARAM_NOT_SUPPORTED;
|
|
|
+ return sizeof (uint8_t);
|
|
|
+ break;
|
|
|
+ case LAN_PARAM_COMMUNITY_STRING:
|
|
|
+ sprintf(pGetLanRes->ConfigData.CommunityStr,"public");
|
|
|
+ break;
|
|
|
+ case LAN_PARAM_DEST_NUM:
|
|
|
+ pGetLanRes->ConfigData.NumDest = 0;
|
|
|
+ break;
|
|
|
+ case LAN_PARAM_SELECT_DEST_TYPE:
|
|
|
+ *pRes = CC_PARAM_NOT_SUPPORTED;
|
|
|
+ return sizeof (uint8_t);
|
|
|
+ break;
|
|
|
+ case LAN_PARAM_SELECT_DEST_ADDR:
|
|
|
+ *pRes = CC_PARAM_NOT_SUPPORTED;
|
|
|
+ return sizeof (uint8_t);
|
|
|
+ break;
|
|
|
+ case LAN_PARAM_VLAN_ID:
|
|
|
+ *pRes = CC_PARAM_NOT_SUPPORTED;
|
|
|
+ return sizeof (uint8_t);
|
|
|
+ break;
|
|
|
+ case LAN_PARAM_VLAN_PRIORITY:
|
|
|
+ *pRes = CC_PARAM_NOT_SUPPORTED;
|
|
|
+ return sizeof (uint8_t);
|
|
|
+ break;
|
|
|
+ case LAN_PARAM_CIPHER_SUITE_ENTRY_SUP:
|
|
|
+ *pRes = CC_PARAM_NOT_SUPPORTED;
|
|
|
+ return sizeof (uint8_t);
|
|
|
+ break;
|
|
|
+ case LAN_PARAM_CIPHER_SUITE_ENTRIES:
|
|
|
+ *pRes = CC_PARAM_NOT_SUPPORTED;
|
|
|
+ return sizeof (uint8_t);
|
|
|
+ break;
|
|
|
+ case LAN_PARAM_CIPHER_SUITE_PRIV_LEVELS:
|
|
|
+ *pRes = CC_PARAM_NOT_SUPPORTED;
|
|
|
+ return sizeof (uint8_t);
|
|
|
+ break;
|
|
|
+ case LAN_PARAM_VLAN_TAGS:
|
|
|
+ *pRes = CC_PARAM_NOT_SUPPORTED;
|
|
|
+ return sizeof (uint8_t);
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ *pRes = CC_PARAM_NOT_SUPPORTED;
|
|
|
+ return sizeof(uint8_t);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return sizeof(GetLanCCRev_T) + LanconfigParameterLength[pGetLanReq->ParameterSelect];
|
|
|
+}
|
|
|
|
|
|
|
|
|
// /*---------------------------------------------------
|