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

VxWorks

开发平台:

C/C++

  1. /* hostLib.h - header for hostLib.c */
  2. /* Copyright 1984-1997 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01k,20aug97,jag  added function declations for hostTblSearchByAddr(),
  7.                  hostTblSearchByName() (SPR #9175)
  8. 01j,19may97,spm  added S_hostLib_INVALID_PARAMETER error value
  9. 01i,22sep92,rrr  added support for c++
  10. 01h,27jul92,elh  Moved hostShow to netShow.
  11. 01g,04jul92,jcf  cleaned up.
  12. 01f,26may92,rrr  the tree shuffle
  13. 01e,04oct91,rrr  passed through the ansification filter
  14.   -fixed #else and #endif
  15.   -changed VOID to void
  16.   -changed copyright notice
  17. 01d,05oct90,shl  added ANSI function prototypes.
  18.                  made #endif ANSI style.
  19.                  added copyright notice.
  20. 01c,13apr89,shl  added MAXHOSTNAMELEN.
  21. 01b,04jun88,gae  changed S_remLib_* to S_hostLib_*.
  22. 01a,28may88,dnw  extracted from remLib.h
  23. */
  24. #ifndef __INChostLibh
  25. #define __INChostLibh
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29. #include "lstLib.h"
  30. #include "netinet/in.h"
  31. #define MAXHOSTNAMELEN  64
  32. /* status messages */
  33. #define S_hostLib_UNKNOWN_HOST (M_hostLib | 1)
  34. #define S_hostLib_HOST_ALREADY_ENTERED (M_hostLib | 2)
  35. #define S_hostLib_INVALID_PARAMETER             (M_hostLib | 3)
  36. #if ((CPU_FAMILY==I960) && (defined __GNUC__))
  37. #pragma align 1                 /* tell gcc960 not to optimize alignments */
  38. #endif  /* CPU_FAMILY==I960 */
  39. typedef struct hostname_struct
  40.     {
  41.     struct hostname_struct *link;
  42.     char *name;
  43.     } HOSTNAME;
  44. typedef struct
  45.     {
  46.     NODE node;
  47.     HOSTNAME hostName;
  48.     struct in_addr netAddr;
  49.     } HOSTENTRY;
  50. #if ((CPU_FAMILY==I960) && (defined __GNUC__))
  51. #pragma align 0                 /* turn off alignment requirement */
  52. #endif  /* CPU_FAMILY==I960 */
  53. /* function declarations */
  54. #if defined(__STDC__) || defined(__cplusplus)
  55. extern STATUS  hostAdd (char *hostName, char *hostAddr);
  56. extern STATUS  hostDelete (char *name, char *addr);
  57. extern STATUS  hostGetByAddr (int addr, char *name);
  58. extern int  gethostname (char *name, int nameLen);
  59. extern int  hostGetByName (char *name);
  60. extern int  sethostname (char *name, int nameLen);
  61. extern void  hostTblInit (void);
  62. extern int      hostTblSearchByName (char *name);
  63. extern STATUS   hostTblSearchByAddr (int addr, char *name);
  64. #else /* __STDC__ */
  65. extern STATUS  hostAdd ();
  66. extern STATUS  hostDelete ();
  67. extern STATUS  hostGetByAddr ();
  68. extern int  gethostname ();
  69. extern int  hostGetByName ();
  70. extern int  sethostname ();
  71. extern void  hostTblInit ();
  72. extern int      hostTblSearchByName ();
  73. extern STATUS   hostTblSearchByAddr ();
  74. #endif /* __STDC__ */
  75. #ifdef __cplusplus
  76. }
  77. #endif
  78. #endif /* __INChostLibh */