This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

C6000 DHCP Server failed



Recently, I have some trouble in configure dhcp server. Yes,I have seen ppt about dhcp server,but I still confused. The problems are as follows:

EVMK2E:

Why N/A ???  My code is as follows:

CI_IPNET NA;
//CI_ROUTE RT;
//IPN IPTmp;

// Setup manual IP address
bzero( &NA, sizeof(NA) );
NA.IPAddr = inet_addr(LocalIPAddr);
NA.IPMask = inet_addr(LocalIPMask);
strcpy( NA.Domain, DomainName );
NA.NetType = CFG_NETTYPE_VIRTUAL;

// Add the address to interface 1
CfgAddEntry( hCfg, CFGTAG_IPNET, 1, 0,
sizeof(CI_IPNET), (UINT8 *)&NA, 0 );

// Add the default gateway. Since it is the default, the
// destination address and mask are both zero (we go ahead
// and show the assignment for clarity).
CI_ROUTE RT;
IPN IPTmp;
bzero( &RT, sizeof(RT) );
RT.IPDestAddr = inet_addr("192.168.2.20");
RT.IPDestMask = inet_addr("255.255.255.0");
RT.IPGateAddr = inet_addr(GatewayIP);//

// Add the route
CfgAddEntry( hCfg, CFGTAG_ROUTE, 0, 0,
sizeof(CI_ROUTE), (UINT8 *)&RT, 0 );

// Manually add the DNS server when specified
IPTmp = inet_addr(DNSServer);
if( IPTmp )
CfgAddEntry( hCfg, CFGTAG_SYSINFO, CFGITEM_DHCP_DOMAINNAMESERVER,
0, sizeof(IPTmp), (UINT8 *)&IPTmp, 0 );
CI_SERVICE_DHCPS dhcps;
// Specify DHCPS Service on IF-2
bzero( &dhcps, sizeof(dhcps) );
dhcps.cisargs.Mode = CIS_FLG_IFIDXVALID;
dhcps.cisargs.IfIdx = 1;
// dhcps.cisargs.IPAddr = NA.IPAddr;
dhcps.cisargs.pCbSrv = &ServiceReport;
dhcps.param.PoolBase =inet_addr("192.168.2.1");
dhcps.param.PoolCount=200;
dhcps.param.Flags =DHCPS_FLG_LOCALDNS | DHCPS_FLG_LOCALDOMAIN;
CfgAddEntry( hCfg, CFGTAG_SERVICE, CFGITEM_SERVICE_DHCPSERVER, 0,
sizeof(CI_SERVICE_DHCPS), (UINT8 *)&dhcps, 0 );

}
// Else we specify DHCP
else
{
CI_SERVICE_DHCPC dhcpc;

// Specify DHCP Service on IF-1
/* bzero( &dhcpc, sizeof(dhcpc) );
dhcpc.cisargs.Mode = CIS_FLG_IFIDXVALID;
dhcpc.cisargs.IfIdx = 1;*/
dhcpc.cisargs.pCbSrv = &ServiceReport;
CfgAddEntry( hCfg, CFGTAG_SERVICE, CFGITEM_SERVICE_DHCPCLIENT, 0,
sizeof(dhcpc), (UINT8 *)&dhcpc, 0 );

Please tell me,thank you !

  • I think, need to add those DHCPS settings in *.cfg to affect in XDC window.
  • Thank your solutions. I try to modify the setting in .cfg file, but result is as the picture above. I don't know the meaning of N/A, so I can't modify the paraments. In additions, if I want to set dhcp server, please tell me what are codes in C file.
    Thank you!
  • I  was able to modify the .cfg to add a DHCP server, following spru 523 section 1.7

    - open the .cfg with xgconf

    - click global you will see "system overview"

    - select DHCP server by right click it and use "Use DhcpServer"

    - click add in your figure above, you will get

  • Sorry, I can't find documents(spru523 and spru524). Please give the interlinkage. Thank you! In addition, if I succeed to make dsp server as a DHCP Server by using the configuration of "CI_SERVICE_DHCPS dhcps", what I should do to know the IP address that is allocated to client by dsp.
  • ti\ndk_2_24_03_35\docs for spru523 and spru524.

    What is your client? Is there a way to query the IP address obtained? Like ifconfig/ipconfig for Linux PC/Windows PC. From the DHCP server side, it is typically from the first available IP address in the pool.

    Regards, Eric
  • Yes, you are right. If my client is PC, I can obtain IP address by ipconfig. However, if my client is camera, is there any way for dsp to obtain the IP? As we know, if you want to know IP address of dsp, you can use the function of NetworkIPAddr. The stucture of NetworkAddr() and dhcps is as follows: