1 /* vi: set sw=4 ts=4: */
8 # pragma GCC visibility push(hidden)
11 struct client_config_t {
12 uint8_t arp[6]; /* Our arp address */
13 /* TODO: combine flag fields into single "unsigned opt" */
14 /* (can be set directly to the result of getopt32) */
15 char no_default_options; /* Do not include default optins in request */
16 #if ENABLE_FEATURE_UDHCP_PORT
19 int ifindex; /* Index number of the interface to use */
20 uint8_t opt_mask[256 / 8]; /* Bitmask of options to send (-O option) */
21 const char *interface; /* The name of the interface to use */
22 char *pidfile; /* Optionally store the process ID */
23 const char *script; /* User script to run at dhcp events */
24 uint8_t *clientid; /* Optional client id to use */
25 uint8_t *vendorclass; /* Optional vendor class-id to use */
26 uint8_t *hostname; /* Optional hostname to use */
27 uint8_t *fqdn; /* Optional fully qualified domain name to use */
30 /* server_config sits in 1st half of bb_common_bufsiz1 */
31 #define client_config (*(struct client_config_t*)(&bb_common_bufsiz1[COMMON_BUFSIZE / 2]))
33 #if ENABLE_FEATURE_UDHCP_PORT
34 #define CLIENT_PORT (client_config.port)
36 #define CLIENT_PORT 68
40 /*** clientpacket.h ***/
42 uint32_t random_xid(void);
43 int send_discover(uint32_t xid, uint32_t requested);
44 int send_selecting(uint32_t xid, uint32_t server, uint32_t requested);
45 #if ENABLE_FEATURE_UDHCPC_ARPING
46 int send_decline(uint32_t xid, uint32_t server, uint32_t requested);
48 int send_renew(uint32_t xid, uint32_t server, uint32_t ciaddr);
49 int send_renew(uint32_t xid, uint32_t server, uint32_t ciaddr);
50 int send_release(uint32_t server, uint32_t ciaddr);
52 int udhcp_recv_raw_packet(struct dhcpMessage *payload, int fd);
54 #if __GNUC_PREREQ(4,1)
55 # pragma GCC visibility pop