OpenClovis Logo

clIocApi.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 : ioc
21  * File : clIocApi.h
22  *******************************************************************************/
23 
24 /*******************************************************************************
25  * Description :
26  *
27  * Ioc data structures and APIs
28  *
29  *
30  *****************************************************************************/
31 
32 /*****************************************************************************/
33 /******************************** IOC APIs ***********************************/
34 /*****************************************************************************/
35 /*
36  */
37 /*
38  * clIocCommPortCreate
39  */
40 /*
41  * clIocCommPortDelete
42  */
43 /*
44  * clIocSend
45  */
46 /*
47  * clIocReceive
48  */
49 /*
50  * clIocTransparencyRegister
51  */
52 /*
53  * clIocTransparencyDeregister
54  */
55 /*
56  * clIocLocalAddressGet
57  */
58 /*
59  * clIocBind
60  */
61 /*
62  * clIocVersionCheck
63  */
64 /*
65  */
66 /*****************************************************************************/
67 
81 #ifndef _CL_IOC_API_H_
82 # define _CL_IOC_API_H_
83 
84 # ifdef __cplusplus
85 extern "C"
86 {
87 # endif
88 
89 
90 /*****************************************************************************/
91 /*********************** User configurable parameters ************************/
92 /*****************************************************************************/
93 # include <clCommon.h>
94 # include <clBufferApi.h>
95 # include <clIocServices.h>
96 # include <clIocProtocols.h>
97 # include <clIocErrors.h>
98 
99 /*
100  * Defines
101  */
102 
103 
107 # define CL_IOC_HEADER_VERSION 1
108 
109 # define CL_IOC_NOTIFICATION_VERSION 1
110 
111 
115 # define CL_IOC_TIMEOUT_FOREVER ~0U
116 
117 
122 # define CL_IOC_UNRELIABLE_MESSAGING 0
123 
128 # define CL_IOC_RELIABLE_MESSAGING (1<<0)
129 
130 
131 
132 
133  /*
134  * The node status and ARP related flags.
135  */
136 
137 
141 # define CL_IOC_NODE_UP 1
142 
146 # define CL_IOC_NODE_DOWN 0
147 
148 
149 
150 
154 # define CL_IOC_LINK_UP 2
155 
159 # define CL_IOC_LINK_DOWN 3
160 
161 
162 
163 
167 # define CL_IOC_BROADCAST_ADDRESS 0xffffffff
168 
172 # define CL_IOC_RESERVED_ADDRESS 0
173 
177 # define CL_IOC_GEO_ADDR_MAX_LENGTH 128
178 
179 
180 
181 
185 # define CL_IOC_PHYSICAL_ADDRESS_TYPE 0
186 
190 # define CL_IOC_LOGICAL_ADDRESS_TYPE 1
191 
195 # define CL_IOC_MULTICAST_ADDRESS_TYPE 2
196 
197 /*
198  * Master address type
199  */
200 # define CL_IOC_MASTER_ADDRESS_TYPE 3
201 
202 /*
203  * Local commport address type
204  */
205 # define CL_IOC_INTRANODE_ADDRESS_TYPE 4
206 
207 
208 # define CL_IOC_USER_ADDRESS_TYPE 10
209 
213 # define CL_IOC_BROADCAST_ADDRESS_TYPE 0xff
214 
215  /*
216  * Rest of the addresses are not valid
217  */
218 
219 
223 typedef enum {
228 
233 
238 
239  /*
240  * This is the priority for sending ordered proto messages,
241  * delivered in order
242  */
243  CL_IOC_ORDERED_PRIORITY = 3,
244 
245  /*
246  * This is the priority for sending notification protos in order
247  */
248  CL_IOC_NOTIFICATION_PRIORITY = 4,
249 
254 
255  CL_IOC_RESERVED_PRIORITY_USER = 6,
256 
257  CL_IOC_RESERVED_PRIORITY_USER_END = 16,
258 
262  CL_IOC_MAX_PRIORITIES = CL_IOC_RESERVED_PRIORITY_USER_END + 1
264 
265 
266 
270 typedef enum {
275 
281 
282 
283 
284 #define CL_IOC_ADDRESS_TYPE_BITS (0x8)
285 #define CL_IOC_ADDRESS_TYPE_MASK ((1<<CL_IOC_ADDRESS_TYPE_BITS)-1)
286 #define CL_IOC_NODE_MASK (~0U >> CL_IOC_ADDRESS_TYPE_BITS)
287 #define CL_IOC_ADDRESS_TYPE_SHIFT_WORD (32-CL_IOC_ADDRESS_TYPE_BITS)
288 #define CL_IOC_ADDRESS_TYPE_SHIFT_DWORD (64-CL_IOC_ADDRESS_TYPE_BITS)
289 
293 # define CL_IOC_ADDRESS_TYPE_GET(param)\
294  ((ClUint32T)((*((ClUint64T*)(param))) >> CL_IOC_ADDRESS_TYPE_SHIFT_DWORD))
295 
296 #define CL_IOC_ADDRESS_FORM(addrType,addr,compId) \
297  (ClUint64T)( \
298  ( (((ClUint64T)(addrType)) & CL_IOC_ADDRESS_TYPE_MASK) << CL_IOC_ADDRESS_TYPE_SHIFT_DWORD ) | \
299  ( ( ((ClUint64T)(addr)) & CL_IOC_NODE_MASK) << 32 ) | \
300  ( ((ClUint64T)(compId)) & 0xffffffff ) \
301  )
302 
303 #define CL_IOC_TIPC_ADDRESS_TYPE_FORM(t,v) (((t) << CL_IOC_ADDRESS_TYPE_SHIFT_WORD) | ( (v) & CL_IOC_NODE_MASK ) )
304 
305 #define CL_IOC_TIPC_TYPE_FORM(v) \
306  CL_IOC_TIPC_ADDRESS_TYPE_FORM(CL_IOC_USER_ADDRESS_TYPE,v)
307 
311 # define CL_IOC_LOGICAL_ADDRESS_FORM(compId)\
312  CL_IOC_ADDRESS_FORM(CL_IOC_LOGICAL_ADDRESS_TYPE, 0 , compId)
313 
317 # define CL_IOC_MULTICAST_ADDRESS_FORM(addr, compId) \
318  CL_IOC_ADDRESS_FORM(CL_IOC_MULTICAST_ADDRESS_TYPE, addr, compId)
319 
320 
325 # define CL_IOC_TL_ACTIVE 0
326 
331 # define CL_IOC_TL_STDBY 1
332 
333 
334 
335  /*
336  * Type definitions
337  */
338 
342  typedef ClUint32T ClIocNodeAddressT;
343 
347  typedef ClUint32T ClIocPortT;
348 
352  typedef ClWordT ClIocCommPortHandleT;
353 
357  typedef ClHandleT ClIocToBindHandleT;
358 
359 
365  typedef ClUint32T ClIocCommPortFlagsT;
366 
370  typedef ClUint64T ClIocLogicalAddressT;
371 
375  typedef ClUint64T ClIocMulticastAddressT;
376 
377 
381  typedef struct ClIocPhysicalAddress
382  {
383 
387  ClIocNodeAddressT nodeAddress;
388 
392  ClIocPortT portId;
393 
395 
399  typedef union ClIocAddress
400  {
401 
406 
410  ClIocLogicalAddressT iocLogicalAddress;
411 
415  ClIocMulticastAddressT iocMulticastAddress;
416 
417 
418  } ClIocAddressT;
419 
420 
421 
422 
423 
424 
425 
426 
427 
428 
429 
433  typedef enum ClIocMessageOption
434  {
440 
447 
448 
449 
450 
451 
455  typedef struct ClIocSendOption
456  {
457 
461  ClUint8T priority;
462 
466  ClUint8T sendType;
470  ClWordT linkHandle;
471 
476 
480  ClUint32T timeout;
481 
483 
484 
485 
489  typedef struct ClIocRecvParam
490  {
494  ClUint8T priority;
495 
499  ClUint8T protoType;
500 
504  ClUint32T length;
505 
510 
511  } ClIocRecvParamT;
512 
513 
514 
515 
516 
521  typedef struct ClIocRecvOption
522  {
523 
527  ClUint32T recvTimeout;
529 
530  typedef enum ClIocQueueId
531  {
532  CL_IOC_SENDQ,
533  CL_IOC_RECVQ,
534  CL_IOC_QUEUE_MAX,
535  } ClIocQueueIdT;
536 
537  typedef struct ClIocQueueInfo
538  {
539  ClUint32T queueSize;
540  ClWaterMarkT queueWM;
541  } ClIocQueueInfoT;
542 
543  typedef struct ClIocQueueStats
544  {
545  ClIocQueueInfoT queueInfo;
546  ClUint32T queueUtilisation;
547  } ClIocQueueStatsT;
548 
549  typedef struct ClIocLibConfig
550  {
554  ClUint8T version;
558  ClIocNodeAddressT nodeAddress;
562  ClCharT iocGeoGraphicalAddress[CL_IOC_GEO_ADDR_MAX_LENGTH + 1];
566  ClUint32T iocMaxNumOfPriorities;
570  ClUint32T iocReassemblyTimeOut;
574  ClUint32T iocMaxNumOfXports;
578  ClUint32T iocHeartbeatTimeInterval;
582  ClUint32T iocTLMaxEntries;
583 
584  /*SendQ config*/
585  ClIocQueueInfoT iocSendQInfo;
586 
587  /*RecvQ config*/
588  ClIocQueueInfoT iocRecvQInfo;
589 
590  /*The port to which the global sendq events should be sent*/
591  ClIocPortT iocNodeRepresentative;
592 
593  /*The port to which the global sendq events should be sent*/
594  ClBoolT isNodeRepresentative;
595 
596  } ClIocLibConfigT;
597 
598 
599 /*****************************************************************************/
600 /***************** Transparency Layer related data structures ****************/
601 /*****************************************************************************/
602 
606  typedef enum ClIocTLContext
607  {
608 
613 
618  } ClIocTLContextT;
619 
620 
621 
622 
626  typedef struct
627  {
631  ClUint32T haState;
632 
637  } ClIocTLMappingT;
638 
639 
640 /* This is kept only for backward compatibility */
641 #define CL_IOC_TL_NO_REPLICATION 0
642 #define repliSemantics unused
643 
647  typedef struct ClIocTlInfo
648  {
649 
653  ClIocLogicalAddressT logicalAddr;
654 
658  ClUint32T compId;
659 
664 
668  ClUint32T unused;
669 
673  ClUint32T haState;
674 
679 
680  } ClIocTLInfoT;
681 
682 
683  typedef struct ClIocMcastUserInfo
684  {
685  ClIocMulticastAddressT mcastAddr; /* multicast address */
686  ClIocPhysicalAddressT physicalAddr; /* IOC physical address */
687  } ClIocMcastUserInfoT;
688 
689 
690 /*****************************************************************************
691  * IOC APIs
692  *****************************************************************************/
693 
694 
742  CL_IN ClIocPortT portId,
743  CL_IN ClIocCommPortFlagsT portType,
744  CL_OUT ClIocCommPortHandleT * pIocCommPortHdl
745  );
746 
747 
748 
749 
778  CL_IN ClIocCommPortHandleT iocCommPortHdl
779  );
780 
781 
818  CL_IN ClIocCommPortHandleT portHandle,
819  CL_INOUT ClInt32T *pSd
820  );
821 
852  CL_IN ClIocCommPortHandleT pIocCommPort,
853  CL_OUT ClIocPortT * pPortId
854  );
855 
856 
889  CL_IN ClIocPortT port,
891  );
892 
893 
996  CL_IN ClIocCommPortHandleT commPortHandle,
997  CL_IN ClBufferHandleT message,
998  CL_IN ClUint8T protoType,
999  CL_IN ClIocAddressT * pDestAddr,
1000  CL_IN ClIocSendOptionT * pSendOption
1001  );
1002 
1003 
1004 
1061  CL_IN ClIocCommPortHandleT commPortHdl,
1062  CL_IN ClIocRecvOptionT * pRecvOption,
1063  CL_OUT ClBufferHandleT userMsg,
1064  CL_OUT ClIocRecvParamT * pRecvParam
1065  );
1066 
1067  ClRcT clIocReceiveAsync(
1068  CL_IN ClIocCommPortHandleT commPortHdl,
1069  CL_IN ClIocRecvOptionT * pRecvOption,
1070  CL_OUT ClBufferHandleT userMsg,
1071  CL_OUT ClIocRecvParamT * pRecvParam
1072  );
1073 
1074  ClRcT clIocReceiveWithBuffer(
1075  CL_IN ClIocCommPortHandleT commPortHdl,
1076  CL_IN ClIocRecvOptionT * pRecvOption,
1077  CL_IN ClUint8T *buffer,
1078  CL_IN ClUint32T bufSize,
1079  CL_OUT ClBufferHandleT userMsg,
1080  CL_OUT ClIocRecvParamT * pRecvParam
1081  );
1082 
1083  ClRcT clIocReceiveWithBufferAsync(
1084  CL_IN ClIocCommPortHandleT commPortHdl,
1085  CL_IN ClIocRecvOptionT * pRecvOption,
1086  CL_IN ClUint8T *buffer,
1087  CL_IN ClUint32T bufSize,
1088  CL_OUT ClBufferHandleT userMsg,
1089  CL_OUT ClIocRecvParamT * pRecvParam
1090  );
1091 
1092 
1124  CL_IN ClIocCommPortHandleT commPortHdl
1125  );
1126 
1127 
1128 
1129 
1130 /*********************************************************************************/
1131 /************************ Transparency Layer APIs ******************************/
1132 /*********************************************************************************/
1133 
1134 
1135 
1178  CL_IN ClIocTLInfoT * pTLInfo
1179  );
1180 
1181 
1182 
1209  CL_IN ClUint32T compId
1210  );
1211 
1212 
1213 
1214 
1246  ClRcT clIocMulticastRegister(CL_IN ClIocMcastUserInfoT *pMcastInfo);
1247 
1284  ClRcT clIocMulticastDeregister(CL_IN ClIocMcastUserInfoT *pMcastInfo);
1285 
1326  ClRcT clIocMulticastDeregisterAll(CL_IN ClIocMulticastAddressT *pMcastAddress);
1327 
1328 
1329 
1330 
1353  ClIocNodeAddressT clIocLocalAddressGet(
1354  void
1355  );
1356 
1357 
1358 
1359 
1384  CL_IN ClVersionT * pVersion
1385  );
1386 
1387 
1388 #if 0
1389 
1390  ClRcT clIocTransparencyDeregisterNode(
1391  CL_IN ClIocNodeAddressT nodeId
1392  ) CL_DEPRECATED;
1393 
1394 #endif
1395 
1396  ClRcT clIocTransparencyLogicalToPhysicalAddrGet(
1397  CL_IN ClIocLogicalAddressT logicalAddr,
1398  CL_OUT ClIocTLMappingT ** pPhysicalAddr,
1399  CL_OUT ClUint32T * pNoEntries
1400  ) CL_DEPRECATED;
1401 
1402 
1403 # ifdef __cplusplus
1404 }
1405 # endif
1406 #endif /* _CL_IOC_API_H_ */
1407 

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