busybox/networking/udhcp/dhcpc.h
<<
>>
Prefs
   1/* vi: set sw=4 ts=4: */
   2/* dhcpc.h */
   3#ifndef UDHCP_DHCPC_H
   4#define UDHCP_DHCPC_H 1
   5
   6PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
   7
   8struct 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 */
  13        int verbose;
  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 */
  22};
  23
  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]))
  26
  27#if ENABLE_FEATURE_UDHCP_PORT
  28#define CLIENT_PORT (client_config.port)
  29#else
  30#define CLIENT_PORT 68
  31#endif
  32
  33
  34/*** clientpacket.h ***/
  35
  36uint32_t random_xid(void) FAST_FUNC;
  37int send_discover(uint32_t xid, uint32_t requested) FAST_FUNC;
  38int send_select(uint32_t xid, uint32_t server, uint32_t requested) FAST_FUNC;
  39#if ENABLE_FEATURE_UDHCPC_ARPING
  40int send_decline(uint32_t xid, uint32_t server, uint32_t requested) FAST_FUNC;
  41#endif
  42int send_renew(uint32_t xid, uint32_t server, uint32_t ciaddr) FAST_FUNC;
  43int send_renew(uint32_t xid, uint32_t server, uint32_t ciaddr) FAST_FUNC;
  44int send_release(uint32_t server, uint32_t ciaddr) FAST_FUNC;
  45
  46int udhcp_recv_raw_packet(struct dhcp_packet *dhcp_pkt, int fd) FAST_FUNC;
  47
  48POP_SAVED_FUNCTION_VISIBILITY
  49
  50#endif
  51