udhcpc: kill undocumented -W, it was a no-op.
[oweals/busybox.git] / networking / udhcp / dhcpc.h
1 /* vi: set sw=4 ts=4: */
2 /* dhcpc.h */
3
4 #ifndef _DHCPC_H
5 #define _DHCPC_H
6
7 #if __GNUC_PREREQ(4,1)
8 # pragma GCC visibility push(hidden)
9 #endif
10
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
17         uint16_t port;
18 #endif
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 */
28 };
29
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]))
32
33 #if ENABLE_FEATURE_UDHCP_PORT
34 #define CLIENT_PORT (client_config.port)
35 #else
36 #define CLIENT_PORT 68
37 #endif
38
39
40 /*** clientpacket.h ***/
41
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);
47 #endif
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);
51
52 int udhcp_recv_raw_packet(struct dhcpMessage *payload, int fd);
53
54 #if __GNUC_PREREQ(4,1)
55 # pragma GCC visibility pop
56 #endif
57
58 #endif