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

VxWorks

开发平台:

C/C++

  1. /* etherLib.h - ethernet hook routines header */
  2. /* Copyright 1984-2001 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01k,10oct01,rae  update copyright
  7. 01j,17dec96,gnn  removed some prototypes to have variable args
  8. 01k,22oct96,gnn  added support for the etherTypeGet call.
  9.                  added the ENET_HDR typedef.
  10. 01j,22sep92,rrr  added support for c++
  11. 01i,04jul92,jcf  cleaned up.
  12. 01h,26may92,rrr  the tree shuffle
  13.   -changed includes to have absolute path from h/
  14. 01g,26feb92,elh  added prototypes for ether{Input,Output}HookDelete.
  15. 01f,04oct91,rrr  passed through the ansification filter
  16.   -changed includes to have absolute path from h/
  17.   -fixed #else and #endif
  18.   -changed copyright notice
  19. 01e,15jan91,shl  included "if.h" and "if_ether.h" so ifnet and ether_header
  20.  are defined before the prototypes.
  21. 01d,05oct90,shl  added ANSI function prototypes.
  22.                  made #endif ANSI style.
  23.                  added copyright notice.
  24. 01c,07aug90,shl  added INCetherLibh to #endif.
  25. 01b,01nov87,dnw  added etherOutputHookRtn.
  26. 01a,28aug87,dnw  written
  27. */
  28. #ifndef __INCetherLibh
  29. #define __INCetherLibh
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33. #include "net/if.h"
  34. #include "netinet/if_ether.h"
  35. IMPORT FUNCPTR etherInputHookRtn;
  36. IMPORT FUNCPTR etherOutputHookRtn;
  37. #if ((CPU_FAMILY==I960) && (defined __GNUC__))
  38. #pragma align 1                 /* tell gcc960 not to optimize alignments */
  39. #endif  /* CPU_FAMILY==I960 */
  40. /* defints */
  41. typedef struct enet_hdr
  42.     {
  43.     char dst [6];
  44.     char src [6];
  45.     USHORT type;
  46.     } ENET_HDR;
  47. #if ((CPU_FAMILY==I960) && (defined __GNUC__))
  48. #pragma align 0                 /* turn off alignment requirement */
  49. #endif  /* CPU_FAMILY==I960 */
  50. #define ENET_HDR_SIZ        sizeof(ENET_HDR)
  51. #define ENET_HDR_REAL_SIZ   14
  52. /* function declarations */
  53. #if defined(__STDC__) || defined(__cplusplus)
  54. extern STATUS  etherAddrResolve (struct ifnet *pIf, char *targetAddr,
  55.   char *eHdr, int numTries, int numTicks);
  56. extern STATUS  etherInputHookAdd ();
  57. extern STATUS  etherOutput (struct ifnet *pIf, struct ether_header
  58. *pEtherHeader, char *pData, int dataLength);
  59. extern STATUS  etherOutputHookAdd ();
  60. extern void  etherInputHookDelete ();
  61. extern void  etherOutputHookDelete ();
  62. extern USHORT etherTypeGet (char *pPacket);
  63. #else /* __STDC__ */
  64. extern STATUS  etherAddrResolve ();
  65. extern STATUS  etherInputHookAdd ();
  66. extern STATUS  etherOutput ();
  67. extern STATUS  etherOutputHookAdd ();
  68. extern void  etherInputHookDelete ();
  69. extern void  etherOutputHookDelete ();
  70. extern USHORT etherTypeGet ();
  71. #endif /* __STDC__ */
  72. #ifdef __cplusplus
  73. }
  74. #endif
  75. #endif /* __INCetherLibh */