3
0

dhcpc.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. 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 */
  13. uint8_t opt_mask[256 / 8]; /* Bitmask of options to send (-O option) */
  14. const char *interface; /* The name of the interface to use */
  15. char *pidfile; /* Optionally store the process ID */
  16. const char *script; /* User script to run at dhcp events */
  17. struct option_set *options; /* list of DHCP options to send to server */
  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. uint16_t first_secs;
  23. uint16_t last_secs;
  24. } FIX_ALIASING;
  25. /* server_config sits in 1st half of bb_common_bufsiz1 */
  26. #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)
  29. #else
  30. #define CLIENT_PORT 68
  31. #endif
  32. POP_SAVED_FUNCTION_VISIBILITY
  33. #endif