Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
20 years ago

DHCP Client using lwip

I am trying to get DHCP working using LWIP. I have successfully managed to get DHCP working using MicroC but would prefer not to use an OS.

I have downloaded LWIP and have managed to get fixed IP addressing to work but not DHCP client.

Does anyone have some sample code to show how this is done ?

I am just looking for the intial sequence of function calls to set up the IP address. Do I need to call coarse & fine timer functions to make this work ?

2 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    originally posted by poirot@Jan 4 2006, 11:22 AM

    i am trying to get dhcp working using lwip. i have successfully managed to get dhcp working using microc but would prefer not to use an os.

    i have downloaded lwip and have managed to get fixed ip addressing to work but not dhcp client.

    does anyone have some sample code to show how this is done ?

    i am just looking for the intial sequence of function calls to set up the ip address. do i need to call coarse & fine timer functions to make this work ?

    <div align='right'><{post_snapback}> (index.php?act=findpost&pid=11949)

    --- quote end ---

    --- Quote End ---

    Did you set LWIP_DHCP to 1 in lwipopts.h? It&#39;s been a while since I worked with the standalone LWIP but I don&#39;t recall having a problem with DHCP.

    Also are you using the lwip_web_server example? Because that has all the code necessary to make DHCP work.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    originally posted by bkucera+jan 10 2006, 11:41 am--><div class='quotetop'>quote (bkucera @ jan 10 2006, 11:41 am)</div>

    --- quote start ---

    <!--quotebegin-poirot@Jan 4 2006, 11:22 AM

    i am trying to get dhcp working using lwip. i have successfully managed to get dhcp working using microc but would prefer not to use an os.

    i have downloaded lwip and have managed to get fixed ip addressing to work but not dhcp client.

    does anyone have some sample code to show how this is done ?

    i am just looking for the intial sequence of function calls to set up the ip address. do i need to call coarse & fine timer functions to make this work ?

    <div align='right'><{post_snapback}> (index.php?act=findpost&pid=11949)

    --- quote end ---

    --- Quote End ---

    Did you set LWIP_DHCP to 1 in lwipopts.h? It&#39;s been a while since I worked with the standalone LWIP but I don&#39;t recall having a problem with DHCP.

    Also are you using the lwip_web_server example? Because that has all the code necessary to make DHCP work.

    <div align='right'><{post_snapback}> (index.php?act=findpost&pid=12112)</div>

    [/b]

    --- Quote End ---