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

VxWorks

开发平台:

C/C++

  1. /* distIfUdp.h - UDP adapter initialization routine (VxFusion) */
  2. /* Copyright 1999-2002 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01d,16oct01,jws  ARM support
  7. 01c,11jun99,drm  Changing default ring buffer size to 256.
  8. 01b,29oct98,drm  removed maxTBufs argument from distIfUdpInit()
  9. 01a,31jul98,drm  initial version
  10. */
  11. #ifndef __INCdistIfUdph
  12. #define __INCdistIfUdph
  13. #include "vxWorks.h"
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif /* __cplusplus */
  17. /*
  18.  * The NET_HDR structure encapsulates the fields needed by the Network Layer
  19.  * (L3) of the VxFusion protocol stack.  These fields are encapsulated at a 
  20.  * header at this level to allow for the flexibility of different types of 
  21.  * interfaces.  Interfaces with small MTU sizes may wish to use smaller headers 
  22.  * to increase throughput, while interfacs with larger MTU sizes may wish to 
  23.  * use larger headers to allow larger messages to be sent.  The values that 
  24.  * need to be set for the  fields of the structure below are passed to/from 
  25.  * the Network Layer within the TBuf structure.
  26.  *
  27.  * The NET_HDR structure may also be used to store values such as priority
  28.  * which may be lost if the transport doesn't support message priorities.
  29.  */
  30. /* defines */
  31. /* get rid of this next when underscore issue is settled */
  32. #ifndef _WRS_PACK_ALIGN
  33. # define _WRS_PACK_ALIGN(m)  WRS_PACK_ALIGN(m)
  34. #endif
  35. #define UDP_IO_PORT         5011    /* UDP port for node to node comm */
  36. #define UDP_MTU_BUF_SZ      1500    /* MTU size to use for packets */
  37. #define UDP_RING_BUF_SZ      256    /* Window size used by network protocol */
  38. #define UDP_MAX_FRAGS         10    /* Max # fragments msg can be broken into */
  39. /* typedefs */
  40. typedef struct
  41.     {
  42.     uint16_t pktId;           /* Packet ID */
  43.     uint16_t pktAck;          /* Last Packet ID Acked */
  44.     uint16_t pktFragSeq;      /* Fragmented packet sequence number */
  45.     uint16_t pktLen;          /* Packet Length */
  46.     uint16_t pktType;         /* Packet type (DATA, ACK,...) */
  47.     uint16_t pktFlags;        /* Packet flags HDR,MORE_MF, and/or BROADCAST */
  48.     uint16_t priority;        /* Priority */
  49.     } _WRS_PACK_ALIGN(2) NET_HDR;  /* Network Header */
  50. /* function declarations */
  51. #if defined(__STDC__) || defined(__cplusplus)
  52. STATUS distIfUdpInit
  53.     (
  54.     void    *pConf,      /* ptr to configuration struct */
  55.     FUNCPTR *pStartup    /* Ptr to startup routine */
  56.     );
  57. #else   /* __STDC__ */
  58. STATUS distIfUdpInit ();
  59. #endif  /* __STDC__ */
  60. #ifdef __cplusplus
  61. }
  62. #endif /* __cplusplus */
  63. #endif /* __INCdistIfUdph */