dhcpcBoot.h
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:3k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* dhcpcBoot.h - DHCP client include file for boot-time internal usage */
  2. /* Copyright 1984 - 2001 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01g,05nov01,vvv  fixed compilation warning
  7. 01f,09oct01,rae  merge from truestack
  8. 01e,05apr00,spm  upgraded to RFC 2131 and removed direct link-level access;
  9.                  removed entries shared with run-time client
  10. 01d,04dec97,spm  added code review modifications
  11. 01c,06oct97,spm  added support for dynamic driver type detection
  12. 01b,02sep97,spm  removed name conflicts with runtime DHCP client (SPR #9241)
  13. 01a,26aug97,spm  created to preserve single-lease interface at boot time
  14.                  from existing include files - 01f of dhcpClientCommon.h, 
  15.                  01d of dhcp.h, 01c of dhcpCommonSubr.h, and 01e of dhcpc.h
  16. */
  17. #ifndef __INCdhcpcBooth
  18. #define __INCdhcpcBooth
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. #include "net/if.h"
  23. #include "netinet/in.h"
  24. #include "netinet/if_ether.h"
  25. #include "dhcp/dhcpc.h"
  26. /* Define sources for events. */
  27. #define DHCP_AUTO_EVENT 0
  28. /*  Define types of events. */
  29. #define DHCP_MSG_ARRIVED 0
  30. #define DHCP_TIMEOUT 1
  31. /* Status of DHCP client. */
  32. #define DHCP_MANUAL 0      /* IP address assigned manually. */
  33. #define DHCP_BOOTP 1       /* Lease established using BOOTP reply. */
  34. #define DHCP_NATIVE 2      /* Lease established using DHCP reply. */
  35. /* DHCP boot-time client state definitions */
  36. #define  INIT         0
  37. #define  WAIT_OFFER   1
  38. #define  SELECTING    2
  39. #define  REQUESTING   3
  40. #define  BOUND        4
  41. #define  INFORMING    5
  42. /* DHCP client message processing definitions */
  43. #define CHKOFF(LEN)  (offopt + 2 + (LEN) < DFLTOPTLEN) /* check option offset */
  44. #define WORD  4
  45. #define EVENT_RING_SIZE (10 * sizeof (EVENT_DATA))
  46. IMPORT int  dhcpcBindType;  /* Type of DHCP lease, if any. */
  47. IMPORT struct dhcp_param *  dhcpcBootParam; /* Configuration parameters */
  48. /* Mirror variables for values assigned externally when building image. */
  49. IMPORT int dhcpcMinLease;  /* Minimum lease length accepted. */
  50. IMPORT int _dhcpcReadTaskPriority;  /* Priority level of data retriever */
  51. IMPORT int _dhcpcReadTaskOptions;  /* Option settings of data retriever */
  52. IMPORT int _dhcpcReadTaskStackSize;  /* Stack size of data retriever */
  53. IMPORT int dhcpcReadTaskId;  /* Identifier for data retrieval task */
  54. /*
  55.  * Access point to start message exchanges for lease negotation, or for
  56.  * additional configuration parameters if an address is already known.
  57.  */
  58. IMPORT int dhcp_boot_client (struct if_info *, int, int, BOOL);
  59. #ifdef __cplusplus
  60. }
  61. #endif
  62. #endif