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

VxWorks

开发平台:

C/C++

  1. /* bootLib.h - boot support subroutine library */
  2. /* Copyright 1984-2002 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01m,13mar02,jkf  Fixed SPR#74251, increased BOOT_DEV_LEN, BOOT_FILE_LEN, 
  7.                  and BOOT_FIELD_LEN, changed copyright date to 2002.
  8. 01l,15may97,spm  fixed SPR 8533: increased BOOT_PARAMS field sizes to prevent 
  9.                  overflow with DHCP client leases
  10. 01k,30apr97,spm  moved unit number field to end of BOOT_PARAMS structure
  11. 01j,16dec96,spm  removed conditional include from DHCP client code
  12. 01i,03dec96,spm  added conditional include to DHCP client code
  13. 01h,27nov96,spm  added support for DHCP client and network device unit numbers
  14. 01g,22sep92,rrr  added support for c++
  15. 01f,04jul92,jcf  cleaned up.
  16. 01e,26may92,rrr  the tree shuffle
  17. 01d,04oct91,rrr  passed through the ansification filter
  18.   -changed VOID to void
  19.   -changed copyright notice
  20. 01c,05oct90,shl  added ANSI function prototypes.
  21.                  added copyright notice.
  22. 01b,10aug90,dnw  added declaration of bootParamsErrorPrint().
  23. 01a,18jul90,dnw  written
  24. */
  25. #ifndef __INCbootLibh
  26. #define __INCbootLibh
  27. #ifdef __cplusplus
  28. extern "C" {
  29. #endif
  30. /* BOOT_PARAMS is a structure containing all the fields of the VxWorks
  31.  * boot line.  The routines in bootLib convert this structure to and
  32.  * from the boot line ascii string.
  33.  */
  34. #define BOOT_DEV_LEN 40 /* max chars in device name */
  35. #define BOOT_HOST_LEN 20 /* max chars in host name */
  36. #define BOOT_ADDR_LEN 30 /* max chars in net addr */
  37. #define BOOT_TARGET_ADDR_LEN    50      /* IP address + mask + lease times */
  38. #define BOOT_ADDR_LEN 30 /* max chars in net addr */
  39. #define BOOT_FILE_LEN 160 /* max chars in file name */
  40. #define BOOT_USR_LEN 20 /* max chars in user name */
  41. #define BOOT_PASSWORD_LEN 20 /* max chars in password */
  42. #define BOOT_OTHER_LEN 80 /* max chars in "other" field */
  43. #define BOOT_FIELD_LEN 160 /* max chars in any boot field */
  44. typedef struct /* BOOT_PARAMS */
  45.     {
  46.     char bootDev [BOOT_DEV_LEN]; /* boot device code */
  47.     char hostName [BOOT_HOST_LEN]; /* name of host */
  48.     char targetName [BOOT_HOST_LEN]; /* name of target */
  49.     char ead [BOOT_TARGET_ADDR_LEN]; /* ethernet internet addr */
  50.     char bad [BOOT_TARGET_ADDR_LEN]; /* backplane internet addr */
  51.     char had [BOOT_ADDR_LEN]; /* host internet addr */
  52.     char gad [BOOT_ADDR_LEN]; /* gateway internet addr */
  53.     char bootFile [BOOT_FILE_LEN]; /* name of boot file */
  54.     char startupScript [BOOT_FILE_LEN]; /* name of startup script file */
  55.     char usr [BOOT_USR_LEN]; /* user name */
  56.     char passwd [BOOT_PASSWORD_LEN]; /* password */
  57.     char other [BOOT_OTHER_LEN]; /* available for applications */
  58.     int  procNum; /* processor number */
  59.     int  flags; /* configuration flags */
  60.     int  unitNum;                       /* network device unit number */
  61.     } BOOT_PARAMS;
  62. /* function declarations */
  63. #if defined(__STDC__) || defined(__cplusplus)
  64. extern STATUS  bootBpAnchorExtract (char *string, char ** pAnchorAdrs);
  65. extern STATUS  bootLeaseExtract (char *string, u_long *pLeaseLen, 
  66.                                   u_long *pLeaseStart);
  67. extern STATUS  bootNetmaskExtract (char *string, int *pNetmask);
  68. extern STATUS  bootScanNum (char ** ppString, int *pValue, BOOL hex);
  69. extern STATUS  bootStructToString (char *paramString, BOOT_PARAMS
  70. *pBootParams);
  71. extern char * bootStringToStruct (char *bootString, BOOT_PARAMS *pBootParams);
  72. extern void  bootParamsErrorPrint (char *bootString, char *pError);
  73. extern void  bootParamsPrompt (char *string);
  74. extern void  bootParamsShow (char *paramString);
  75. #else /* __STDC__ */
  76. extern STATUS  bootBpAnchorExtract ();
  77. extern STATUS  bootLeaseExtract ();
  78. extern STATUS  bootNetmaskExtract ();
  79. extern STATUS  bootScanNum ();
  80. extern STATUS  bootStructToString ();
  81. extern char * bootStringToStruct ();
  82. extern void  bootParamsErrorPrint ();
  83. extern void  bootParamsPrompt ();
  84. extern void  bootParamsShow ();
  85. #endif /* __STDC__ */
  86. #ifdef __cplusplus
  87. }
  88. #endif
  89. #endif /* __INCbootLibh */