From 739e30fbc3363756e574b5761ff63ea97ffd61c1 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Fri, 26 Sep 2008 23:45:20 +0000 Subject: udhcp: add inline docs; small code shrink function old new delta send_packet 103 87 -16 udhcpc_main 2359 2323 -36 --- networking/udhcp/common.h | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'networking/udhcp/common.h') diff --git a/networking/udhcp/common.h b/networking/udhcp/common.h index 68fa65c..66a0b0d 100644 --- a/networking/udhcp/common.h +++ b/networking/udhcp/common.h @@ -27,21 +27,23 @@ extern const uint8_t MAC_BCAST_ADDR[6]; /* six all-ones */ #define DHCP_OPTIONS_BUFSIZE 308 struct dhcpMessage { - uint8_t op; - uint8_t htype; - uint8_t hlen; - uint8_t hops; - uint32_t xid; - uint16_t secs; - uint16_t flags; - uint32_t ciaddr; - uint32_t yiaddr; - uint32_t siaddr; - uint32_t giaddr; - uint8_t chaddr[16]; - uint8_t sname[64]; - uint8_t file[128]; - uint32_t cookie; + uint8_t op; /* 1 = BOOTREQUEST, 2 = BOOTREPLY */ + uint8_t htype; /* hardware address type. 1 = 10mb ethernet */ + uint8_t hlen; /* hardware address length */ + uint8_t hops; /* used by relay agents only */ + uint32_t xid; /* unique id */ + uint16_t secs; /* elapsed since client began acquisition/renewal */ + uint16_t flags; /* only one flag so far: */ +#define BROADCAST_FLAG 0x8000 /* "I need broadcast replies" */ + uint32_t ciaddr; /* client IP (if client is in BOUND, RENEW or REBINDING state) */ + uint32_t yiaddr; /* 'your' (client) IP address */ + uint32_t siaddr; /* IP address of next server to use in bootstrap, + * returned in DHCPOFFER, DHCPACK by server */ + uint32_t giaddr; /* relay agent IP address */ + uint8_t chaddr[16];/* link-layer client hardware address (MAC) */ + uint8_t sname[64]; /* server host name (ASCIZ) */ + uint8_t file[128]; /* boot file name (ASCIZ) */ + uint32_t cookie; /* fixed first four option bytes (99,130,83,99 dec) */ uint8_t options[DHCP_OPTIONS_BUFSIZE + CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS]; } PACKED; -- cgit v1.1