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.

DHCP server using tiva

Hi,

i'm using the following platform:

- TM4C129

- CCS : 6.1.0.00104 (it can install ARM compiler 5.1.6)

- XDCTool : xdctools_3_30_06_67_core

- ARM Compiler : 5.2.0
- TIRTOS : tirtos_tivac_2.10.01.38 

and i want to use the TM4C129 as a DHCP server, so is there any ready made sample that demonstrate it?

Thanks,

Mohamed Fawzy

  • Take a look at this page. The PPT describes how to do a DHCP Server on the NDK. The DHCP slides are at the end of the PPT.

     Note: this page incorrectly said "DNS" instead of "DHCP". I corrected that this morning.

    Todd

  • the tutorial is nice but actually i need to know, if i enabled the DHCP server feature, Am i able add a configuration somewhere to Assign specific MAC address to specific IP address?, so my board act like a real DHCP server
  • The DHCP Server in the NDK does not have that feature.

    Todd

  • is there any plan regarding adding this feature any time?

    Mohamed
  • Mohamed,

    I opened an enhancement request (SDOCM00118423: Add MAC to IP address mapping in NDK's DHCP Server) but I don't foreseen this being implemented this year.

    Todd

  • Hello, Todd ! Recently, I also  have this  problem. I have downloaded and read the ppt.Maybe I don't understand the connection between .c and .cfg file. So I want to know whether I need configure in C source file  when I configure dhcp server in .cfg file. In addtions, I also have trouble when I configure DHCP Server as ppt says. The problem is as follows:

    Why I can't set the server interface and address?

    My C 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 = 0;

    // 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).
    bzero( &RT, sizeof(RT) );
    RT.IPDestAddr = 0;
    RT.IPDestMask = 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-1
    bzero( &dhcps, sizeof(dhcps) );
    dhcps.cisargs.Mode = 0;
    dhcps.cisargs.IfIdx = 1;
    dhcps.cisargs.IPAddr =inet_addr("192.168.2.10");
    dhcps.cisargs.pCbSrv = &ServiceReport;
    dhcps.param.PoolBase =inet_addr("192.168.2.1");
    dhcps.param.PoolCount=200;
    dhcps.param.Flags =DHCPS_FLG_LOCALDNS;
    CfgAddEntry( hCfg, CFGTAG_SERVICE, CFGITEM_SERVICE_DHCPSERVER, 0,
    sizeof(CI_SERVICE_DHCPS), (UINT8 *)&dhcps, 0 );

  • It looks like you have a different question. Can you please open a new thread?

    Todd
  • I don't how to open a new thread.But I think reason why I can't set in XDC Windows(NA) is that my dscp server failed in initializing. Where are errors in my codes ?
  • Use the red +New button at the top of the page to start a new thread.