OpenClovis Logo

clRmdApi.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2002-2012 OpenClovis Solutions Inc. All Rights Reserved.
3  *
4  * This file is available under a commercial license from the
5  * copyright holder or the GNU General Public License Version 2.0.
6  *
7  * The source code for this program is not published or otherwise
8  * divested of its trade secrets, irrespective of what has been
9  * deposited with the U.S. Copyright office.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * General Public License for more details.
15  *
16  * For more information, see the file COPYING provided with this
17  * material.
18  */
19 /*******************************************************************************
20  * ModuleName : rmd
21  * File : clRmdApi.h
22  *******************************************************************************/
23 
24 /*******************************************************************************
25  * Description :
26  * This header defines the RMD Interface.
27  *
28  *
29  *****************************************************************************/
30 
42 #ifndef _CL_RMD_API_H_
43 # define _CL_RMD_API_H_
44 
45 # ifdef __cplusplus
46 extern "C"
47 {
48 # endif
49 
50 
51 /*****************************************************************************/
52 
53 
54 # include <clBufferApi.h>
55 # include <clIocApi.h>
56 # include <clRmdErrors.h>
57 
58 
59  /*
60  * RMD Flags
61  */
62 
66 # define CL_RMD_CALL_ASYNC (1<<0)
67 
71 # define CL_RMD_CALL_NEED_REPLY (1<<1)
72 
76 # define CL_RMD_CALL_ATMOST_ONCE (1<<2)
77 
81 # define CL_RMD_CALL_DO_NOT_OPTIMIZE (1<<3)
82 
86 # define CL_RMD_CALL_NON_PERSISTENT (1<<4)
87 
92 # define CL_RMD_CALL_IN_SESSION (1<<5)
93 
94  /*
95  * Default Values
96  */
97 
98 /*
99  * Default header version of the RMD.
100  */
101 #define CL_RMD_HEADER_VERSION 1
102 
105 # define CL_RMD_DEFAULT_PRIORITY CL_IOC_DEFAULT_PRIORITY
106 
112 #ifdef QNX_BUILD
113 
114 # define CL_RMD_DEFAULT_TIMEOUT 50000
115 
116 #else
117 
118 # define CL_RMD_DEFAULT_TIMEOUT 10000
119 
120 #endif
121 
125 # define CL_RMD_DEFAULT_RETRIES 5
126 
130 # define CL_RMD_DEFAULT_TRANSPORT_HANDLE 0
131 
135 #define CL_RMD_DEFAULT_OPTIONS { \
136  CL_RMD_DEFAULT_TIMEOUT, \
137  CL_RMD_DEFAULT_RETRIES, \
138  CL_RMD_DEFAULT_PRIORITY, \
139  CL_RMD_DEFAULT_TRANSPORT_HANDLE, \
140  }
141 
142 #define CL_RMD_DEFAULT_OPTIONS_SET(options) \
143  (options).timeout = CL_RMD_DEFAULT_TIMEOUT, \
144  (options).retries = CL_RMD_DEFAULT_RETRIES, \
145  (options).priority = CL_RMD_DEFAULT_PRIORITY, \
146  (options).transportHandle = CL_RMD_DEFAULT_LINK_HANDLE
147 
150 # define CL_RMD_TIMEOUT_FOREVER -1
151 
152 /*
153  * Check for typical rmd unreachable errors
154  */
155 #define CL_RMD_UNREACHABLE_CHECK(ret) \
156  (CL_GET_ERROR_CODE((ret)) == CL_IOC_ERR_COMP_UNREACHABLE || \
157  CL_GET_ERROR_CODE((ret)) == CL_IOC_ERR_HOST_UNREACHABLE)
158 
159 #define CL_RMD_TIMEOUT_UNREACHABLE_CHECK(ret) \
160  ( CL_GET_ERROR_CODE((ret))== CL_ERR_TIMEOUT || CL_RMD_UNREACHABLE_CHECK(ret) )
161 
162 #define CL_RMD_VERSION_ERROR(rc) ( (rc) == CL_RC(CL_CID_EO, CL_ERR_DOESNT_EXIST) \
163  || (rc) == CL_RC(CL_CID_EO, CL_ERR_VERSION_MISMATCH) )
164 
165 /*
166  * Type definitions
167  */
168 
169 
183  typedef void (*ClRmdAsyncCallbackT) (
184  ClRcT retCode,
185  ClPtrT pCookie,
186  ClBufferHandleT inMsgHdl,
187  ClBufferHandleT outMsgHdl);
188 
189 
190  typedef ClPtrT ClRmdObjHandleT;
191 
195  typedef struct ClRmdOptions
196  {
197 
204  ClUint32T timeout;
205 
210  ClUint32T retries;
211 
215  ClUint8T priority;
216 
222 
223  } ClRmdOptionsT;
224 
228  typedef struct ClRmdAsyncOptions
229  {
233  ClPtrT pCookie;
238 
240 
241 
242 
317  ClRcT clRmdWithMsg(CL_IN ClIocAddressT remoteObjAddr, /* remote Object
318  * addr */
319  CL_IN ClUint32T funcId, /* Function ID to invoke */
320  CL_IN ClBufferHandleT inMsgHdl, /* Input
321  * Message */
322  CL_OUT ClBufferHandleT outMsgHdl, /* Output
323  * Message */
324  CL_IN ClUint32T flags, /* Flags */
325  CL_IN ClRmdOptionsT *pOptions, /* Optional Parameters
326  * for RMD Call */
327  CL_IN ClRmdAsyncOptionsT *pAsyncOptions); /* Optional
328  * Parameters
329  * for
330  * Async
331  * RMD Call
332  */
333 
334 
335  ClRcT clRmdWithMsgVer(CL_IN ClIocAddressT remoteObjAddr, /* remote Object
336  * addr */
337  CL_IN ClVersionT *version,
338  CL_IN ClUint32T funcId, /* Function ID to invoke */
339  CL_IN ClBufferHandleT inMsgHdl, /* Input
340  * Message */
341  CL_OUT ClBufferHandleT outMsgHdl, /* Output
342  * Message */
343  CL_IN ClUint32T flags, /* Flags */
344  CL_IN ClRmdOptionsT *pOptions, /* Optional Parameters
345  * for RMD Call */
346  CL_IN ClRmdAsyncOptionsT *pAsyncOptions); /* Optional
347  * Parameters
348  * for
349  * Async
350  * RMD Call
351  */
352 
353 
354 
355 # ifdef __cplusplus
356 }
357 # endif
358 
359 
360 #endif /* _CL_RMD_API_H_ */
361 

Generated on Tue Jan 10 10:29:15 PST 2012 for OpenClovis SDK using Doxygen