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 USE_FEATURE_UDHCP_PORT(uint16_t port;)
17 int ifindex; /* Index number of the interface to use */
18 uint8_t opt_mask[256 / 8]; /* Bitmask of options to send (-O option) */
19 const char *interface; /* The name of the interface to use */
20 char *pidfile; /* Optionally store the process ID */
21 const char *script; /* User script to run at dhcp events */
22 uint8_t *clientid; /* Optional client id to use */
23 uint8_t *vendorclass; /* Optional vendor class-id to use */
24 uint8_t *hostname; /* Optional hostname to use */
25 uint8_t *fqdn; /* Optional fully qualified domain name to use */
28 /* server_config sits in 1st half of bb_common_bufsiz1 */
29 #define client_config (*(struct client_config_t*)(&bb_common_bufsiz1[COMMON_BUFSIZE / 2]))
31 #if ENABLE_FEATURE_UDHCP_PORT
32 #define CLIENT_PORT (client_config.port)
34 #define CLIENT_PORT 68
38 /*** clientpacket.h ***/
40 uint32_t random_xid(void) FAST_FUNC;
41 int send_discover(uint32_t xid, uint32_t requested) FAST_FUNC;
42 int send_selecting(uint32_t xid, uint32_t server, uint32_t requested) FAST_FUNC;
43 #if ENABLE_FEATURE_UDHCPC_ARPING
44 int send_decline(uint32_t xid, uint32_t server, uint32_t requested) FAST_FUNC;
46 int send_renew(uint32_t xid, uint32_t server, uint32_t ciaddr) FAST_FUNC;
47 int send_renew(uint32_t xid, uint32_t server, uint32_t ciaddr) FAST_FUNC;
48 int send_release(uint32_t server, uint32_t ciaddr) FAST_FUNC;
50 int udhcp_recv_raw_packet(struct dhcpMessage *payload, int fd) FAST_FUNC;
52 #if __GNUC_PREREQ(4,1)
53 # pragma GCC visibility pop