Do you know there is already a DHCP client in lwIP ?

  ----- Original Message ----- 
  From: Chien-Lung Wu 
  To: [email protected] 
  Sent: Friday, December 14, 2007 5:05 PM
  Subject: [lwip-users] It is weired! 


  Hi, 

   

  I am implemented DHCP client for my project based on lwIP TCP/IP stack. I 
defined DHCP protocol structure as following:

   

  typedef struct dhcp_s {

      u8_t            dhcp_op;

      u8_t            dhcp_htype;

      u8_t            dhcp_hlen;

      u8_t            dhcp_hops;

      u8_t            dhcp_xid[4];

      u8_t            dhcp_secs[2];

      u8_t            dhcp_flags[2];

      u8_t            dhcp_ciaddr[4];

      u8_t            dhcp_yiaddr[4];

      u8_t            dhcp_siaddr[4];

      u8_t            dhcp_giaddr[4];

      u8_t            dhcp_hwaddr[6];

      u8_t            dhcp_sname[64];

      u8_t            dhcp_file[128];

      u8_t            dhcp_option[312];

  } dhcp_t;

   

  Everything seems fine except that dhcp_option[312] always shift 10 bytes 
ahead (overlapping with dhcp_file) when I use 

  Netbuf_ref (conn, &dhcpmessage, sizeof(dhcp_t)). (I use Ethereal to capture 
the packet and I observe that the dhcp_option was shifted 10 bytes.)

   

  Is there anyone there having any idea and how to solve it?

   

  Regards,

   

  David



------------------------------------------------------------------------------


  _______________________________________________
  lwip-users mailing list
  [email protected]
  http://lists.nongnu.org/mailman/listinfo/lwip-users
_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to