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

VxWorks

开发平台:

C/C++

  1. /* distLib.h - defines for distributed objects (VxFusion) */
  2. /* Copyright 1999 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01e,24may99,drm  adding vxfusion prefix to VxFusion related includes
  7. 01d,10nov98,drm  added typedef for DIST_NODE_ID
  8. 01c,08sep98,drm  added #defines for default startup parameters
  9. 01b,12aug98,drm  removed #includes for private files.
  10. 01a,04sep97,ur   written.
  11. */
  12. #ifndef __INCdistLibh
  13. #define __INCdistLibh
  14. #include "vxWorks.h"
  15. #include "errno.h"
  16. #include "vwModNum.h"
  17. #include "vxfusion/distNodeLib.h"
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21. /* defines */
  22. #define DIST_MAX_TBUFS_LOG2_DFLT           9 /* max # TBufs log 2 */
  23. #define DIST_MAX_NODES_LOG2_DFLT           5 /* max # nodes in node DB log 2 */
  24. #define DIST_MAX_QUEUES_LOG2_DFLT          7 /* max # queues per node log 2 */
  25. #define DIST_MAX_GROUPS_LOG2_DFLT          6 /* max # msg Q groups log 2*/
  26. #define DIST_MAX_NAME_DB_ENTRIES_LOG2_DFLT 8 /* max # entries in name DB log 2*/
  27. #define DIST_MAX_TICKS_TO_WAIT_DFLT (4*sysClkRateGet()) /* max ticks to wait */
  28.                                                         /* for other nodes to */
  29.                                                         /* respond at startup */
  30. #define DIST_OBJ_TYPE_MSG_Q     0x0     /* message queue object type */
  31. #define DIST_ID_MSG_Q_SERV      0       /* message queue service */
  32. #define DIST_ID_MSG_Q_GRP_SERV 1       /* message queue group service */
  33. #define DIST_ID_DNDB_SERV       2       /* distributed name database */
  34. #define DIST_ID_DGDB_SERV       3       /* distributed group database */
  35. #define DIST_ID_INCO_SERV       4       /* incorporation protocol */
  36. #define DIST_ID_GAP_SERV        5       /* group agreement protocol */
  37. #define DIST_ID_DIST_LIB 16      /* */
  38. #define DIST_ID_NODE_LIB 17      /* node library */
  39. #define DIST_ID_NET_LIB 18      /* network library */
  40. #define DIST_CTL_TYPE_MASK 0xff    /* control functions 0-255 */
  41. #define DIST_CTL_TYPE_DIST DIST_ID_DIST_LIB
  42. #define DIST_CTL_LOG_HOOK ((0 << 8) | DIST_CTL_TYPE_DIST)
  43. #define DIST_CTL_PANIC_HOOK ((1 << 8) | DIST_CTL_TYPE_DIST)
  44. #define DIST_NAME_MAX_LENGTH 19      /* max name length for dist name DB */
  45. /* typedefs */
  46. typedef uint32_t    DIST_NODE_ID;       /* unique node identifier */
  47. #if defined(__STDC__) || defined(__cplusplus)
  48. STATUS distInit (DIST_NODE_ID me, FUNCPTR ifIntiRtn, void *pIfInitConf,
  49. int maxTBufsLog2, int maxNodesLog2, int maxQueuesLog2,
  50. int maxGroupsLog2, int maxNamesLog2, int waitNTicks);
  51. int distCtl (int function, int argument);
  52. #else   /* __STDC__ */
  53. STATUS distInit ();  /* function to startup distributed objects */
  54. int distCtl ();   /* control function for distrubted objects */
  55. #endif  /* __STDC__ */
  56. #ifdef __cplusplus
  57. }
  58. #endif /* __cplusplus */
  59. #endif /* __INCdistLibh */