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

VxWorks

开发平台:

C/C++

  1. /* wtxrpc.h - wtx rpc header file */
  2. /* Copyright 1984-1995 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01l,28sep01,fle  SPR#28684 : added usePMap parameter to wtxRpcExchangeCreate
  7.                  ()
  8. 01k,24nov99,fle  SPR#28684 : made WTX_RPC_SPLIT_KEY structure have ippAddrList
  9.                  rather than ipAddr
  10. 01j,11may99,fle  changed wtxRpcExchangeFree - removed xid from parameters and
  11.                  turned it into a WTX_ERROR_T
  12. 01i,06apr98,c_c  Changed the registry listenning port for the official one.
  13. 01h,24mar98,c_c  Get rid of portmapper.
  14. 01g,30sep96,elp  put in share/src/wtx (SPR# 6775).
  15. 01f,30may95,c_s  added ipAddr to WTX_RPC_SPLIT_KEY.
  16. 01e,17may95,s_w  update functions to form RPC implementation of exchange
  17.  protocol. Key management functions unchanged.
  18. 01d,05may95,p_m  changed WTX_RPC_PROG to differentiate Beta from SDK release.
  19. 01c,04may95,s_w  changes to make this the central include file for RPC based
  20.  implementation files. Moved in defines of WTX_SVC_BASE,
  21.                  WTX_FIRST_ADDL_PROC_NUM, typedef of WTX_ID. Added include of
  22.  <rpc/rpc.h>.
  23. 01b,26jan95,p_m  added UNIX style authentication.
  24. 01a,15jan95,p_m  written.
  25. */
  26. #ifndef __INCwtxrpch
  27. #define __INCwtxrpch 1
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif
  31. #include "wtxexch.h"
  32. #ifdef SUN4_SOLARIS2
  33. #define PORTMAP /* for backward compatibility */
  34. #endif
  35. #include <rpc/rpc.h>
  36. /* defines */
  37. #define WTX_RPC_PROG 0x55555551 /* WTX RPC program number */
  38. #define WTX_RPC_VERSION 1 /* WTX RPC version number */
  39. #define WTX_SVC_BASE 0x22000000 /* base service number */
  40. /* "official" registry port number */
  41. #define REGISTRY_PORT ((unsigned short)2340)
  42. /*
  43.  * Valid service numbers range between 0 and 500. Standard service have numbers
  44.  * 0 to 300. Additionnal services have numbers 301 to 500.
  45.  */
  46. #define WTX_FIRST_ADDL_PROC_NUM 301
  47. /* typedefs */
  48. typedef struct wtx_rpc_split_key /* WTX_RPC_SPLIT_KEY                  */
  49.     {
  50.     int progNum; /* rpc program number                 */
  51.     int version; /* rpc version number                 */
  52.     int protocol; /* rpc protocol type                  */
  53.     unsigned short port; /* rpc protocol type                  */
  54.     char host [32]; /* host where service resides         */
  55.     char ** ipAddrList; /* IP addr in a.b.c.d form            */
  56.     } WTX_RPC_SPLIT_KEY;
  57. /* function declarations */
  58. /* Basic exchange functions */
  59. extern STATUS wtxRpcExchangeCreate /* create new exchange clnt using RPC */
  60.     (
  61.     WTX_XID xid, /* Exchange handle */
  62.     const char * key, /* Key for server to connect to */
  63.     BOOL usePMap /* do we use port mapper to connect ? */
  64.     );
  65. extern STATUS wtxRpcExchangeDelete /* delete exchange handle */
  66.     (
  67.     WTX_XID xid /* Exchange handle */
  68.     );
  69. extern STATUS wtxRpcExchange /* do a WTX call via exchange */
  70.     (
  71.     WTX_XID xid, /* Exchange handle */
  72.     WTX_REQUEST reqId, /* exchange service number */
  73.     void * pIn, /* exchange service in args */
  74.     void * pOut /* exchange service out args */
  75.     );
  76. extern WTX_ERROR_T wtxRpcExchangeFree /* free a exchange call result message*/
  77.     (
  78.     WTX_REQUEST reqId, /* service ID to free */
  79.     void * pMsg /* pointer to result message to free */
  80.     );
  81. extern STATUS wtxRpcExchangeControl /* perform exchange control functions */
  82.     (
  83.     WTX_XID xid, /* Exchange handle */
  84.     UINT32 request, /* Exchange control request number */
  85.     void * arg /* Pointer to request argument */
  86.     );
  87. /* RPC key utilities exported for convenience */
  88. extern STATUS wtxRpcKeySplit /* split RPC key string in components */
  89.     (
  90.     const char * rpcKey, /* key to split */
  91.     WTX_RPC_SPLIT_KEY * pSplitKey /* split key */
  92.     );
  93. extern STATUS wtxRpcKeySplitFree /* free a splitted  RPC key members   */
  94.     (
  95.     WTX_RPC_SPLIT_KEY * pRpcSplitKey /* RPC key to free members of         */
  96.     );
  97. extern STATUS wtxRpcSvcUnregister /* performs svc_unregister using RPC */
  98.     (
  99.     const char * rpcKey /* service key of service to unreg */
  100.     );
  101. extern char * wtxRpcKey /* construt an RPC key given params */
  102.     (
  103.     UINT32 progNum, /* rpc prog number, or NULL TBA */
  104.     UINT32 version, /* rpc version number */
  105.     UINT32 protocol, /* IPPROTO_TCP or IPPROTO_UDP */
  106.     void (*dispatch) /* rpc dispatch routine */
  107. (struct svc_req *, SVCXPRT *),
  108.     BOOL register2pmap, /* Register to the local portmapper ? */
  109.     SVCXPRT ** ppNewXprt /* where to return transport */
  110.     );
  111. char * wtxRpcKeyIPListUpdate /* update an RPC key address list     */
  112.     (
  113.     const char * rpcKeyStr, /* rpc Key string to update with IP   */
  114.     int ipNum /* IP address num to set as default   */
  115.     );
  116. #ifdef __cplusplus
  117. }
  118. #endif
  119. #endif /* __INCwtxrpch */