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

VxWorks

开发平台:

C/C++

  1. /* wdbEndPktLib.h - header file for WDB agents END based packet driver */
  2. /* Copyright 1996-2002 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01k,26apr02,dat  Adding cplusplus protection, SPR 75017
  7. 01j,30oct01,jhw Copied version TOR3_1-RC-1.
  8. 01i,02aug99,dbt  added WDB standalone agent support.
  9. 01h,26feb99,dbt  set WDB END driver MTU to 1500.
  10. 01g,25sep97,gnn  SENS beta feedback fixes
  11. 01f,22aug97,gnn update of polled mode.
  12. 01e,19aug97,gnn changes due to new buffering scheme.
  13. 01d,21jan97,gnn added a source NET_ADDRESS.
  14. 01c,04nov96,gnn change the MTU size
  15. 01b,23oct96,gnn name changes to follow coding standards
  16. 01a,01jul96,gnn written.
  17. */
  18. #ifndef __INCwdbEndPktLibh
  19. #define __INCwdbEndPktLibh
  20. /* includes */
  21. #include "end.h"
  22. #include "wdb/wdb.h"
  23. #include "wdb/wdbCommIfLib.h"
  24. #include "wdb/wdbMbufLib.h"
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif
  28. /* defines */
  29. #define WDB_END_PKT_MTU           1500    /* MTU of this driver */
  30. /* data types */
  31. typedef struct /* hidden */
  32.     {
  33.     WDB_DRV_IF wdbDrvIf; /* a packet dev must have this first */
  34.     u_int mode; /* current mode - poll or int */
  35.     /* END Cookie since we bind to a lower layer. */
  36.     void* pCookie;
  37.     /* input buffer - loaned to the agent when a packet arrives */
  38.     bool_t inputBusy;
  39.     M_BLK_ID    pInBlk;
  40.     /* Need a place to store outgoing packet for the driver. */
  41.     M_BLK_ID    pOutBlk;
  42.     /* output buffers - a chain of mbufs given to us by the agent */
  43.     bool_t outputBusy;
  44.     /* device register addresses etc */
  45.     /* Addressing information. 
  46.      * We have to fake the addressing because the last thing we
  47.      * want is to have to try and broadcast an ARP to find the
  48.      * hardware address of the remote side.
  49.      * The solution is to keep track of the last IP address that
  50.      * we communicated with and the associated hardware address
  51.      * for that host.  
  52.      * If we don't have that info then we send the IP packet
  53.      * in a broadcast Ethernet packet (ff:ff:ff:ff:ff:ff) so
  54.      * so that the host will see it.  This limits our ability
  55.      * to do system level debugging with things like Ethernet
  56.      * to the local network.
  57.      */
  58.     M_BLK_ID lastHAddr;
  59.     M_BLK_ID srcAddr;
  60.     /* device IP address */
  61.     struct in_addr ipAddr;
  62.     } WDB_END_PKT_DEV;
  63. /* function prototypes */
  64. #if defined(__STDC__)
  65. extern STATUS wdbEndPktDevInit
  66.     (
  67.     WDB_END_PKT_DEV *pPktDev, /* device structure to init */
  68.     void (*stackRcv)(), /* receive packet callback (udpRcv) */
  69.     char * pDevice, /* Device (ln, ie, etc.) that we wish to */
  70.      /* bind to. */
  71.     int         unit            /* unit number (0, 1, etc.) */
  72.     );
  73. #else   /* __STDC__ */
  74. extern STATUS    wdbEndPktDevInit ();
  75. #endif  /* __STDC__ */
  76. #ifdef __cplusplus
  77. }
  78. #endif
  79. #endif  /* __INCwdbEndPktLibh */