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

VxWorks

开发平台:

C/C++

  1. /* if_subr.h - header for common routines for network interface drivers */
  2. /* Copyright 1984 - 2000 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01n,17oct00,spm  updated ether_attach to report memory allocation failures
  7. 01m,15may97,vin  added additional type declarations.
  8. 01l,06sep93,jcf  added prototype for netTypeInit.
  9. 01k,22sep92,rrr  added support for c++
  10. 01j,23jun92,ajm  added prototype for do_protocol_with_type
  11. 01i,06jun92,elh  added includes.
  12. 01h,04jun92,ajm  Fixed erroneous ansi prototype.
  13. 01g,26may92,rrr  the tree shuffle
  14. 01f,01apr92,elh  Added ansi prototypes.  Added functions.
  15. 01e,04oct91,rrr  passed through the ansification filter
  16.   -changed VOID to void
  17.   -changed copyright notice
  18. 01d,19jul91,hdn  moved SIZEOF_ETHERHEADER to if_ether.h.
  19. 01c,29apr91,hdn  added defines and macros for TRON architecture.
  20. 01b,05oct90,shl  added copyright notice.
  21.                  made #endif ANSI style.
  22. 01a,10aug90,dnw  written
  23. */
  24. #ifndef __INCif_subrh
  25. #define __INCif_subrh
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29. /* includes */
  30. #include "net/if.h"
  31. #include "netinet/if_ether.h"
  32. #include "net/mbuf.h"
  33. /* this macro directly calls ether_input function. */
  34. #define do_protocol(eh, m, pArpcom, len)
  35. ether_input((struct ifnet *)pArpcom, eh, m)
  36. /* function declarations */
  37. #if defined(__STDC__) || defined(__cplusplus)
  38. extern void do_protocol_with_type (u_short type, struct mbuf *m,
  39.                                    struct arpcom *pArpcom, int len);
  40. extern int set_if_addr (struct ifnet *ifp, char *data, u_char *enaddr);
  41. extern STATUS ether_attach (struct ifnet *ifp, int unit, char *name,
  42.           FUNCPTR initRtn, FUNCPTR ioctlRtn, FUNCPTR outputRtn,
  43.   FUNCPTR resetRtn);
  44. extern void ether_ifattach (struct ifnet *);
  45. extern void ether_input (struct ifnet *, struct ether_header *, struct mbuf *);
  46. extern int  ether_output (struct ifnet *, struct mbuf *, struct sockaddr *, 
  47.                           struct rtentry *);
  48. extern char    *ether_sprintf (u_char *);
  49. extern STATUS netTypeAdd (int etherType, FUNCPTR inputRtn);
  50. extern STATUS netTypeDelete (int etherType);
  51. extern void netTypeInit ();
  52. #else
  53. extern void do_protocol ();
  54. extern void do_protocol_with_type ();
  55. extern int ether_output ();
  56. extern int set_if_addr ();
  57. extern void ether_attach ();
  58. extern STATUS netTypeAdd ();
  59. extern STATUS netTypeDelete ();
  60. extern void netTypeInit ();
  61. extern void ether_ifattach ();
  62. extern void ether_input ();
  63. extern char * ether_sprintf ();
  64. #endif /* __STDC__ */
  65. #ifdef __cplusplus
  66. }
  67. #endif
  68. #endif /* __INCif_subrh */