busybox/networking/udhcp/dhcpc.h
<<
>>
Prefs
   1/* vi: set sw=4 ts=4: */
   2/*
   3 * Licensed under GPLv2, see file LICENSE in this source tree.
   4 */
   5#ifndef UDHCP_DHCPC_H
   6#define UDHCP_DHCPC_H 1
   7
   8PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
   9
  10struct client_data_t {
  11        uint8_t client_mac[6];          /* Our mac address */
  12        IF_FEATURE_UDHCP_PORT(uint16_t port;)
  13        int ifindex;                    /* Index number of the interface to use */
  14        uint32_t xid;
  15        uint8_t opt_mask[256 / 8];      /* Bitmask of options to send (-O option) */
  16// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TODO: DHCPv6 has 16-bit option numbers
  17        const char *interface;          /* The name of the interface to use */
  18        char *pidfile;                  /* Optionally store the process ID */
  19        const char *script;             /* User script to run at dhcp events */
  20        struct option_set *options;     /* list of DHCP options to send to server */
  21        llist_t *envp;                  /* list of DHCP options used for env vars */
  22
  23        unsigned first_secs;
  24        unsigned last_secs;
  25
  26        int sockfd;
  27        smallint listen_mode;
  28        smallint state;
  29} FIX_ALIASING;
  30
  31/* server_config sits in 1st half of bb_common_bufsiz1 */
  32#define client_data (*(struct client_data_t*)(&bb_common_bufsiz1[COMMON_BUFSIZE / 2]))
  33
  34#if ENABLE_FEATURE_UDHCP_PORT
  35#define CLIENT_PORT  (client_data.port)
  36#define CLIENT_PORT6 (client_data.port)
  37#else
  38#define CLIENT_PORT  68
  39#define CLIENT_PORT6 546
  40#endif
  41
  42POP_SAVED_FUNCTION_VISIBILITY
  43
  44#endif
  45