1 /* vi: set sw=4 ts=4: */
4 #define UDHCP_DHCPC_H 1
6 PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
8 struct client_config_t {
9 uint8_t client_mac[6]; /* Our mac address */
10 char no_default_options; /* Do not include default options in request */
11 IF_FEATURE_UDHCP_PORT(uint16_t port;)
12 int ifindex; /* Index number of the interface to use */
14 uint8_t opt_mask[256 / 8]; /* Bitmask of options to send (-O option) */
15 const char *interface; /* The name of the interface to use */
16 char *pidfile; /* Optionally store the process ID */
17 const char *script; /* User script to run at dhcp events */
18 uint8_t *clientid; /* Optional client id to use */
19 uint8_t *vendorclass; /* Optional vendor class-id to use */
20 uint8_t *hostname; /* Optional hostname to use */
21 uint8_t *fqdn; /* Optional fully qualified domain name to use */
24 /* server_config sits in 1st half of bb_common_bufsiz1 */
25 #define client_config (*(struct client_config_t*)(&bb_common_bufsiz1[COMMON_BUFSIZE / 2]))
27 #if ENABLE_FEATURE_UDHCP_PORT
28 #define CLIENT_PORT (client_config.port)
30 #define CLIENT_PORT 68
34 /*** clientpacket.h ***/
36 uint32_t random_xid(void) FAST_FUNC;
37 int send_discover(uint32_t xid, uint32_t requested) FAST_FUNC;
38 int send_select(uint32_t xid, uint32_t server, uint32_t requested) FAST_FUNC;
39 #if ENABLE_FEATURE_UDHCPC_ARPING
40 int send_decline(uint32_t xid, uint32_t server, uint32_t requested) FAST_FUNC;
42 int send_renew(uint32_t xid, uint32_t server, uint32_t ciaddr) FAST_FUNC;
43 int send_renew(uint32_t xid, uint32_t server, uint32_t ciaddr) FAST_FUNC;
44 int send_release(uint32_t server, uint32_t ciaddr) FAST_FUNC;
46 int udhcp_recv_raw_packet(struct dhcpMessage *dhcp_pkt, int fd) FAST_FUNC;
48 POP_SAVED_FUNCTION_VISIBILITY