OpenClovis Logo

clCorMetaData.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 : cor
21  * File : clCorMetaData.h
22  *******************************************************************************/
23 
24 /*******************************************************************************
25  * Description :
26  *
27  * The file contains all the MetaData data structures.
28  *
29  *
30  *****************************************************************************/
31 
45 #ifndef _CL_COR_META_DATA_H_
46 
47 #define _CL_COR_META_DATA_H_
48 
49 #ifdef __cplusplus
50  extern "C" {
51 #endif
52 
53 #include <clCommon.h>
54 #include <clCntApi.h>
55 #include <clIocApi.h>
56 #include <clOsalApi.h>
57 
58 
59 /******************************************************************************
60  * Constant and Macro Definitions
61  *****************************************************************************/
62 
66 #define CL_COR_WTH_COOKIE_ID CL_EO_COR_SERVER_COOKIE_ID+1
67 
68 
69 #define CL_COR_VERSION_NO 0x0100
70 #define CL_COR_DEFAULT_MAX_SESSIONS 5
71 
72 #define CL_COR_DEFAULT_MAX_RETRIES 3
73 
77 #define CL_COR_DEFAULT_TIMEOUT 3000
78 
82 #define CL_COR_MAX_NAME_SZ CL_MAX_NAME_LENGTH
83 
87 #define CL_COR_NO_SAVE 0
88 #define CL_COR_SAVE_PER_TXN 1
89 #define CL_COR_PERIODIC_SAVE 2
90 #define CL_COR_DELTA_SAVE 3
91 
95 #define CL_COR_UNKNOWN_ATTRIB -1
96 
102 #define CL_COR_CLI_STR_LEN 1024
103 
104 
109 #define CL_COR_VERSION_NO 0x0100
110 #define CL_COR_HANDLE_MAX_DEPTH 20
111 #define CL_COR_INVALID_MO_ID -1
112 #define CL_COR_INVALID_MO_INSTANCE -1
113 #define CL_COR_INVALID_SVC_ID -1
114 #define CL_COR_SVC_ID_DEFAULT 0
115 
119 #define CL_COR_CLASS_WILD_CARD ((ClCorClassTypeT)0xFFFFFFFE)
120 
124 #define CL_COR_INSTANCE_WILD_CARD 0xFFFFFFFE
125 #define CL_COR_SVC_WILD_CARD ((ClCorMOServiceIdT)0xFFFE)
126 
127 
131 #define CL_COR_CONT_ATTR_MAX_DEPTH 10
132 
136 #define CL_COR_INVALID_ATTR_ID -1
137 
141 #define CL_COR_INVALID_ATTR_IDX -1
142 #define CL_COR_ATTR_WILD_CARD -2
143 #define CL_COR_INDEX_WILD_CARD -2
144 
148 #define CL_COR_SIMPLE_TXN NULL
149 
150 #define CL_COR_OH_MAX_TYPES 16
151 #define CL_COR_OH_MAX_LEVELS 64
152 
156 #define CL_COR_OH_MASK_END_MARKER 0xFF
157 
166 #define CL_COR_ATTR_CONFIG 0x01000000
167 
170 #define CL_COR_ATTR_RUNTIME 0x02000000
171 
174 #define CL_COR_ATTR_OPERATIONAL 0x04000000
175 
178 #define CL_COR_ATTR_WRITABLE 0x00010000
179 
182 #define CL_COR_ATTR_INITIALIZED 0x00020000
183 
187 #define CL_COR_ATTR_CACHED 0x00000100
188 
191 #define CL_COR_ATTR_PERSISTENT 0x00000200
192 
193 /******************************************************************************
194  * Data Types
195  *****************************************************************************/
196 
200 typedef ClInt32T ClCorClassTypeT;
201 
205 typedef ClInt32T ClCorAttrIdT;
206 
210 typedef ClInt32T ClCorInstanceIdT;
211 
215 typedef ClUint32T ClCorAttrFlagT;
216 
220 typedef ClUint32T ClCorJobStatusT;
221 
225 typedef ClHandleT ClCorBundleHandleT;
226 typedef ClHandleT* ClCorBundleHandlePtrT;
227 
228 
232 typedef enum ClCorType {
233 
234  CL_COR_INVALID_DATA_TYPE = -1,
235 
240 
245 
250 
255 
260 
265 
270 
275 
280 
287 
294 
301 
308 
315 
316 } ClCorTypeT;
317 
321 typedef enum ClCorAttrType {
322 
323  CL_COR_MAX_TYPE = CL_COR_SEQUENCE32,
324 
329 
334 
339 
344 
350 
351 } ClCorAttrTypeT ;
352 
358 typedef enum{
395 
402 typedef enum{
423 
431  ClInt64T init;
432 
436  ClInt64T min;
437 
441  ClInt64T max;
442 };
443 
448 
453 
458 
462  ClUint32T maxElement;
463 
467  ClCorClassTypeT classId;
468  };
474  {
475  ClCorAttrIdT attrId;
476  ClCorAttrTypeT attrType;
477  /* union{ - NOTE: Struct made in place of Union becoz of IDL related issues. */
478  struct
479  {
480 
485 
490 
491  }u;
492  /* }u; */
493  };
494 typedef struct ClCorAttrDef ClCorAttrDefT;
495 
499 typedef ClRcT (* ClCorClassAttrWalkFunc)(ClCorClassTypeT clsId, ClCorAttrDefT *attrDef, ClPtrT cookie);
500 
512 typedef enum {
527 
532 typedef enum {
533 
534  CL_COR_LOCK_OBJECT,
535  CL_COR_LOCK_SUBTREE
536 
538 
547 typedef enum {
580 
582 
587 typedef enum {
597 
607 typedef ClPtrT ClCorObjectHandleT;
608 
609 #define CL_COR_OBJ_HANDLE_NULL NULL
610 
611 #define CL_COR_OBJ_HANDLE_INIT(objH) \
612  do \
613  { \
614  if (objH != NULL) \
615  { \
616  ClUint16T size = 0; \
617  ClRcT rc = CL_OK; \
618  ClUint8T* tempHandle = (ClUint8T *) objH; \
619  rc = clCorObjectHandleSizeGet(objH, &size); \
620  if (rc != CL_OK) \
621  return rc; \
622  tempHandle += sizeof(ClUint16T); \
623  memset((void *) tempHandle, 0, size - sizeof(ClUint16T)); \
624  } \
625  } while(0)
626 
627 #define CL_COR_OBJ_HANDLE_ISNULL(objH) (objH == NULL)
628 
636 typedef ClPtrT ClCorTxnSessionIdT;
637 
641 typedef ClPtrT ClCorTxnIdT;
642 
646 typedef ClUint32T ClCorTxnJobIdT;
647 
652 typedef enum {
653  CL_COR_OP_RESERVED = 0,
684  CL_COR_OP_SET |
686  CL_COR_OP_GET |
688 } ClCorOpsT;
689 
694 typedef enum ClCorTxnJobStatus
695 {
696  CL_COR_TXN_JOB_PASS,
697  CL_COR_TXN_JOB_FAIL
699 
718 typedef enum {
719 
724 
729 
735 
740  CL_COR_OBJ_CACHE_MAX = CL_COR_OBJ_CACHE_GLOBAL,
741  CL_COR_OBJ_CACHE_MASK = 0xFF,
742 
747 
752 
757 
761  CL_COR_OBJ_FLAGS_ALL = (CL_COR_OBJ_CACHE_MASK |
765 
766 #define CL_COR_OBJ_FLAGS_DEFAULT \
767  (CL_COR_OBJ_CACHE_GLOBAL | CL_COR_OBJ_PERSIST | CL_COR_OBJ_ALLOW_SUB_TREE_DELETE)
768 
782 
783 
789 
795 typedef ClCorAddrT * ClCorAddrPtrT;
796 
797 /*
798  * This structure ClCorCommInfo contains the communication information for COR. Used for COR
799  * communication configuration.
800  */
801 struct ClCorCommInfo {
802 
806  ClCorAddrT addr;
807 
811  ClUint32T timeout;
812 
816  ClUint16T maxRetries;
817 
821  ClUint16T maxSessions;
822 
823 };
824 
825 typedef struct ClCorCommInfo ClCorCommInfoT;
829 typedef ClCorCommInfoT* ClCorCommInfoPtrT;
830 
840 typedef enum {
841 
846 
851 
857 
858  CL_COR_MO_PATH_QUALIFIER_MAX = CL_COR_MO_PATH_RELATIVE_TO_BASE
859 
861 
871  ClCorClassTypeT type;
872 
876  ClCorInstanceIdT instance;
877 };
878 
883 
888 
889 /* TODO: Finally need to use directly ClCorServiceIdT, but the issue with
890  * enums is they occupy int space (4 bytes). So need to test and
891  * figure out
892  */
899 typedef ClInt16T ClCorMOServiceIdT;
900 
917 struct ClCorMOId {
918 
924  ClCorMOHandleT node[CL_COR_HANDLE_MAX_DEPTH];
925 
933  ClCorMOServiceIdT svcId;
934 
938  ClUint16T depth;
939 
944 
949 };
950 
954 typedef struct ClCorMOId ClCorMOIdT;
955 
960 
965 {
969  ClCorAttrIdT attrId;
970 
974  ClUint32T index;
975 
976 };
977 
982 
987 
996 {
1001 
1005  ClUint16T depth;
1006 
1010  ClUint16T tmp;
1011 };
1012 
1017 
1022 
1028 {
1032  ClUint8T baseAttrWalk;
1033 
1037  ClUint8T contAttrWalk;
1038 
1043 
1048  ClCorAttrIdT attrId;
1049 
1056  ClInt32T index;
1057 
1075 
1081 
1086  ClUint32T size;
1087 
1092  void *value;
1093  };
1094 
1099 
1130 
1131 /*
1132  * Attribute path of contained object,whose attribute is being walked.
1133  * pAttrPath is NULL, if attribute are of the base object (containing object).
1134  */
1135 ClCorAttrPathPtrT pAttrPath,
1136 
1137 /*
1138  * Attribute ID.
1139  */
1140 ClCorAttrIdT attrId,
1141 
1142 /*
1143  * Attribute type. It can be any of the following values:
1144  * \arg \c CL_COR_SIMPLE_ATTR
1145  * \arg \c CL_COR_ARRAY_ATTR
1146  * \arg \c CL_COR_ASSOCIATION_ATTR
1147  */
1148 ClCorAttrTypeT attrType,
1149 
1150 /*
1151  * Data type of an attribute. E.g.: \c CL_COR_UINT32.
1152  * \note
1153  * For attrType \c CL_COR_ASSOCIATION_ATTR, attrDataType is \c CL_COR_INVALID_DATA_TYPE.
1154  */
1155 ClCorTypeT attrDataType,
1156 
1157 /*
1158  * Pointer to actual value of \e attrId.
1159  */
1160 void *value,
1161 
1162 /*
1163  * Size of value.
1164  */
1165 ClUint32T size,
1166 
1167 /*
1168  * Attribute additional Data.
1169  */
1170 ClCorAttrFlagT attrData,
1171 
1172 /*
1173  * Cookie passed by you.
1174  */
1175 void *cookie);
1176 
1177 /*
1178  * COR MOTree walk information.
1179  *
1180  * Provides the class Id, flags and maximum number of instances. In case of MSOs, the
1181  * maximum number of instances should be ignored.
1182  */
1183 struct ClCorMOClassTreeWalkInfo
1184 {
1185 
1189  ClCorClassTypeT classId;
1190 
1194  ClUint16T flags;
1195 
1199  ClUint32T maxInstances;
1200 };
1201 
1202 typedef struct ClCorMOClassTreeWalkInfo ClCorMOClassTreeWalkInfoT;
1203 typedef ClCorMOClassTreeWalkInfoT* ClCorMOClassTreeWalkInfoPtrT;
1204 
1212 
1216  ClCorClassTypeT node[CL_COR_HANDLE_MAX_DEPTH];
1217 
1221  ClUint32T depth;
1222 
1227 
1228 };
1229 
1230 typedef struct ClCorMOClassPath ClCorMOClassPathT;
1232 
1243 {
1259  ClCorAttrIdT attrId;
1263  ClUint32T jobStatus;
1264 };
1265 
1270 
1275 
1276 /*
1277  * Operations used while storing and retrieving the failed jobs in/from the container.
1278  */
1279 
1280 typedef enum ClCorTxnEntryId
1281 {
1282  CL_COR_TXN_INFO_ADD,
1283  CL_COR_TXN_INFO_FIRST_GET,
1284  CL_COR_TXN_INFO_NEXT_GET,
1285  CL_COR_TXN_INFO_CLEAN
1286 }ClCorTxnEntryIdT;
1287 
1288 /*
1289  * The data that is used to form the key while storing the
1290  * failed jobs into the container
1291  */
1292 struct ClCorTxnInfoStore
1293 {
1294  ClCorTxnEntryIdT op;
1295 
1296  ClCorTxnSessionIdT txnSessionId;
1297 
1298  ClCorTxnInfoT txnInfo;
1299 };
1300 
1301 typedef struct ClCorTxnInfoStore ClCorTxnInfoStoreT;
1302 typedef ClCorTxnInfoStoreT* ClCorTxnInfoStorePtrT;
1303 
1308 {
1312  ClCorAttrPathPtrT pAttrPath;
1313 
1317  ClCorAttrIdT attrId;
1318 
1322  ClInt32T index;
1323 
1327  ClPtrT bufferPtr;
1328 
1332  ClInt32T bufferSize;
1333 };
1334 
1339 
1344 
1349 {
1353  ClUint32T numOfValues;
1354 
1358  ClCorAttributeValuePtrT pAttributeValue;
1359 };
1360 
1365 
1370 
1375 {
1379  ClCorAttrPathPtrT pAttrPath;
1383  ClCorAttrIdT attrId;
1387  ClInt32T index;
1391  ClPtrT bufferPtr;
1395  ClInt32T bufferSize;
1399  ClCorJobStatusT * pJobStatus;
1400 };
1401 
1406 
1411 
1417 {
1421  ClUint32T numOfDescriptor;
1422 
1426  ClCorAttrValueDescriptorPtrT pAttrDescriptor;
1427 };
1428 
1433 
1438 
1450  ClCorObjectHandleT *objHandle;
1454  ClCorMOIdPtrT pMoId;
1463  ClUint32T numOfAttrDesc;
1467  ClCorAttrValueDescriptorPtrT pAttrDesc;
1468 };
1469 
1472 
1473 
1478 {
1483 };
1484 
1485 typedef struct ClCorBundleConfig ClCorBundleConfigT;
1487 
1488 
1506 typedef ClRcT (*ClCorObjectWalkFunT)(void * data, void *cookie);
1507 
1511 typedef ClRcT (*clCorXdrMarshallFP)(void *pGenVar, ClBufferHandleT msg, ClUint32T isDelete);
1512 
1516 typedef ClRcT (*clCorXdrUnmarshallFP)(ClBufferHandleT msg, void *pGenVar);
1517 
1544 typedef ClRcT (*ClCorBundleCallbackPtrT) (ClCorBundleHandleT bundleHandle, ClPtrT userArg);
1545 
1546 
1547 #ifdef __cplusplus
1548 }
1549 #endif
1550 #endif /* _CL_COR_META_DATA_H_ */
1551 
1552 

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