aboutsummaryrefslogtreecommitdiff
path: root/networking/udhcp/common.h
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-09-26 23:45:20 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-09-26 23:45:20 +0000
commit739e30fbc3363756e574b5761ff63ea97ffd61c1 (patch)
treee2a42d90dcc984d6ad6dc1736d75095991a1ab09 /networking/udhcp/common.h
parent7d9399e8dcfb9853f435c2936f449377d92f6e47 (diff)
downloadbusybox-w32-739e30fbc3363756e574b5761ff63ea97ffd61c1.tar.gz
busybox-w32-739e30fbc3363756e574b5761ff63ea97ffd61c1.tar.bz2
busybox-w32-739e30fbc3363756e574b5761ff63ea97ffd61c1.zip
udhcp: add inline docs; small code shrink
function old new delta send_packet 103 87 -16 udhcpc_main 2359 2323 -36
Diffstat (limited to 'networking/udhcp/common.h')
-rw-r--r--networking/udhcp/common.h32
1 files changed, 17 insertions, 15 deletions
diff --git a/networking/udhcp/common.h b/networking/udhcp/common.h
index 68fa65cf5..66a0b0d8b 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 */
27#define DHCP_OPTIONS_BUFSIZE 308 27#define DHCP_OPTIONS_BUFSIZE 308
28 28
29struct dhcpMessage { 29struct dhcpMessage {
30 uint8_t op; 30 uint8_t op; /* 1 = BOOTREQUEST, 2 = BOOTREPLY */
31 uint8_t htype; 31 uint8_t htype; /* hardware address type. 1 = 10mb ethernet */
32 uint8_t hlen; 32 uint8_t hlen; /* hardware address length */
33 uint8_t hops; 33 uint8_t hops; /* used by relay agents only */
34 uint32_t xid; 34 uint32_t xid; /* unique id */
35 uint16_t secs; 35 uint16_t secs; /* elapsed since client began acquisition/renewal */
36 uint16_t flags; 36 uint16_t flags; /* only one flag so far: */
37 uint32_t ciaddr; 37#define BROADCAST_FLAG 0x8000 /* "I need broadcast replies" */
38 uint32_t yiaddr; 38 uint32_t ciaddr; /* client IP (if client is in BOUND, RENEW or REBINDING state) */
39 uint32_t siaddr; 39 uint32_t yiaddr; /* 'your' (client) IP address */
40 uint32_t giaddr; 40 uint32_t siaddr; /* IP address of next server to use in bootstrap,
41 uint8_t chaddr[16]; 41 * returned in DHCPOFFER, DHCPACK by server */
42 uint8_t sname[64]; 42 uint32_t giaddr; /* relay agent IP address */
43 uint8_t file[128]; 43 uint8_t chaddr[16];/* link-layer client hardware address (MAC) */
44 uint32_t cookie; 44 uint8_t sname[64]; /* server host name (ASCIZ) */
45 uint8_t file[128]; /* boot file name (ASCIZ) */
46 uint32_t cookie; /* fixed first four option bytes (99,130,83,99 dec) */
45 uint8_t options[DHCP_OPTIONS_BUFSIZE + CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS]; 47 uint8_t options[DHCP_OPTIONS_BUFSIZE + CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS];
46} PACKED; 48} PACKED;
47 49