52 #include <clArchHeaders.h>
88 #if defined(__STDC__) && __STDC_VERSION__ >= 199901L
89 #define __FUNCTION__ __func__
93 #define CL_MIN(a,b) ( (a) < (b) ? (a) : (b) )
95 #define CL_MAX(a,b) ( (a) > (b) ? (a) : (b) )
98 #define CL_ROUNDUP(VAL,BASE) (((VAL) + (BASE) - 1)/(BASE) * (BASE))
100 #define CL_ROUNDDOWN(VAL,BASE) ((VAL)/(BASE) * (BASE))
103 #define CL_SIZEOF_ARRAY(__ArrayName__) sizeof((__ArrayName__)) / sizeof((__ArrayName__)[0])
115 typedef unsigned long long ClUint64T;
116 typedef signed long long ClInt64T;
118 typedef unsigned int ClUint32T;
119 typedef signed int ClInt32T;
120 typedef unsigned short ClUint16T;
121 typedef signed short ClInt16T;
122 typedef unsigned char ClUint8T;
123 typedef signed char ClInt8T;
124 typedef char ClCharT;
125 typedef signed int ClFdT;
131 typedef unsigned long ClWordT;
134 typedef ClUint16T ClBoolT;
136 typedef ClWordT ClPidT;
139 #define CL_MICRO_TO_NANO 1000ULL
141 #define CL_MILLI_TO_MICRO 1000ULL
143 #define CL_SEC_TO_MILLI 1000ULL
145 #define CL_MILLI_TO_NANO (CL_MICRO_TO_NANO * CL_MILLI_TO_MICRO)
147 #define CL_SEC_TO_NANO (CL_MILLI_TO_NANO * CL_SEC_TO_MILLI)
149 #define CL_TIME_END 0x7fffffffffffffffULL
151 #define CL_TIME_FOREVER 0x7fffffffffffffffULL
155 typedef ClUint64T ClHandleT;
160 typedef ClUint64T ClInvocationT;
161 typedef ClUint64T ClSelectionObjectT;
162 typedef ClUint64T ClNtfIdentifierT;
163 typedef ClInt8T *ClAddrT;
164 typedef void* ClPtrT;
181 typedef union cl_u64_u
194 #define CL_MAX_NAME_LENGTH 256
241 ClBoolT clParseEnvBoolean(ClCharT* envvar);
243 ClCharT *clParseEnvStr(
const ClCharT* envvar);
245 ClInt32T clCreatePipe(ClInt32T fds[2], ClUint32T numMsgs, ClUint32T msgSize);
247 ClUint32T clBinaryPower(ClUint32T size);
263 CL_DISPATCH_BLOCKING = 3,
269 #define CL_FORCED_TO_8BITS 0xff
270 #define CL_FORCED_TO_16BITS 0xffff
271 #define CL_FORCED_TO_32BITS 0xffffffff
272 #define CL_BITS_PER_BYTE 8
273 #define CL_BIT(X) (0x1 << (X))
276 typedef enum ClMetricId
284 typedef struct ClMetric
286 const ClCharT *pType;
288 ClUint32T maxThreshold;
289 ClUint32T currentThreshold;
290 ClUint32T maxOccurences;
291 ClUint32T numOccurences;
294 #define CL_METRIC_STR(id) \
295 ((id) == CL_METRIC_ALL) ? "all" : \
296 ((id) == CL_METRIC_CPU) ? "cpu" : \
297 ((id) == CL_METRIC_MEM) ? "mem" : \
470 CL_CID_BACKING_STORAGE = 0x37,
473 CL_CID_JOBQUEUE = 0x38,
475 CL_CID_THREADPOOL = 0x39,
476 CL_CID_TASKPOOL = 0x39,
483 CL_CID_LEAKY_BUCKET = 0x3b,
499 typedef struct ClWaterMark
508 CL_WM_HIGH_LIMIT = 1,
521 #define CL_WEAK __attribute__((weak))
523 #define CL_EO_ACTION_CUSTOM (1<<0)
524 #define CL_EO_ACTION_EVENT (1<<1)
525 #define CL_EO_ACTION_LOG (1<<2)
526 #define CL_EO_ACTION_NOT (1<<3)
527 #define CL_EO_ACTION_MAX (1<<31)
529 typedef struct ClEoActionInfo {
545 extern ClStringT *clStringDup(
const ClStringT *);
552 #define clNamePrintf(name, ...) \
555 name.length = snprintf(name.value, CL_MAX_NAME_LENGTH - 1, __VA_ARGS__);\
556 name.value[CL_MIN(name.length, CL_MAX_NAME_LENGTH - 1)] = '\0'; \
560 #define CL_DEPRECATED __attribute__((__deprecated__))
561 #define CL_PRINTF_FORMAT(fmtPos, argPos) __attribute__((format(printf, fmtPos, argPos)))
563 #define CL_DEPRECATED
564 #define CL_PRINTF_FORMAT(fmtPos, argPos)
ClUint32T ClRcT
Clovis return code type.
Definition: clCommon.h:168
ClPtrT * ClEoActionArgListT
The argument list that can be provided to the custom action taken on water mark hit.
Definition: clCommon.h:537
ClInt64T ClTimeT
Time duration specified in nanoseconds.
Definition: clCommon.h:154
ClCompIdT
Clovis Component Ids.
Definition: clCommon.h:304
#define CL_MAX_NAME_LENGTH
The Maximum length of most string names in the OpenClovis ASP framework.
Definition: clCommon.h:194
ClRcT(* ClCallbackT)(CL_IN ClPtrT invocation)
Definition of a generic single argument callback function.
Definition: clCommon.h:179
ClInt64T ClOffsetT
Offset of a buffer or object within another
Definition: clCommon.h:159
ClCharT * clStrdup(const ClCharT *str)
Duplicate a string.
void clNameSet(ClNameT *name, const char *str)
Load the ClNameT structure.
void clNameCopy(ClNameT *nameOut, const ClNameT *nameIn)
Load the ClNameT structure.
ClDispatchFlagsT
Dispatch flags.
Definition: clCommon.h:260
ClUint64T ClSizeT
Definition: clCommon.h:157
ClStatusT
These define all the possible states that a component/node can be in.
Definition: clCommon.h:76
void clNameConcat(ClNameT *nameOut, const ClNameT *prefix, const char *separator, const ClNameT *suffix)
Join ClNameT structures.
#define CL_IN
CL_IN macro assists in clearly defining arguments of an API, but has no actual meaning.
Definition: clCommon.h:106
@ CL_CID_DEBUG
Debug.
Definition: clCommon.h:348
@ CL_CID_IOC
Intelligent Object Communication.
Definition: clCommon.h:321
@ CL_CID_MEM
Memory Management.
Definition: clCommon.h:465
@ CL_CID_SNMP
SNMP Agent.
Definition: clCommon.h:423
@ CL_CID_OAMP_RT
OAMP RT parser.
Definition: clCommon.h:441
@ CL_CID_RES
Resource Management (for future use)
Definition: clCommon.h:357
@ CL_CID_EO
Execution Object.
Definition: clCommon.h:318
@ CL_CID_UM
Upgrade Manager (for future use)
Definition: clCommon.h:447
@ CL_CID_CKPT
Checkpointing Service.
Definition: clCommon.h:372
@ CL_CID_TIMER
Timer.
Definition: clCommon.h:330
@ CL_CID_ALARMS
Alarm Manager.
Definition: clCommon.h:387
@ CL_CID_MAX
This will help validate if needs to be.
Definition: clCommon.h:495
@ CL_CID_TXN
Transactions.
Definition: clCommon.h:369
@ CL_CID_FAULTS
Fault Management.
Definition: clCommon.h:405
@ CL_CID_DCNT
Distributed Containers (for future use)
Definition: clCommon.h:381
@ CL_CID_SCRIPTING
Scripting Engine (for future use)
Definition: clCommon.h:396
@ CL_CID_HAL
Hardware Abstraction Layer.
Definition: clCommon.h:312
@ CL_CID_DLOCK
Distributed Locking (for future use)
Definition: clCommon.h:366
@ CL_CID_HPI
Hardware Platform Interface.
Definition: clCommon.h:402
@ CL_CID_CD
Common Diagnostics (for future use)
Definition: clCommon.h:435
@ CL_CID_OSAL
OS Abstraction Layer.
Definition: clCommon.h:309
@ CL_CID_NAMES
Name Service.
Definition: clCommon.h:327
@ CL_CID_UNSPECIFIED
Unspecified.
Definition: clCommon.h:306
@ CL_CID_SHM
Shared Memory Support.
Definition: clCommon.h:333
@ CL_CID_PARSER
Parser.
Definition: clCommon.h:468
@ CL_CID_CM
Chassis Manager.
Definition: clCommon.h:399
@ CL_CID_HEAP
Heap Management.
Definition: clCommon.h:462
@ CL_CID_PM
Performance Management.
Definition: clCommon.h:489
@ CL_CID_CAP
Capability Management (for future use)
Definition: clCommon.h:354
@ CL_CID_MED
Mediation Library.
Definition: clCommon.h:411
@ CL_CID_DSHM
Distributed Shared Memory.
Definition: clCommon.h:336
@ CL_CID_BITMAP
Bitmap Management.
Definition: clCommon.h:479
@ CL_CID_QUEUE
Queue Management.
Definition: clCommon.h:417
@ CL_CID_AMS
Availability Management Service.
Definition: clCommon.h:408
@ CL_CID_PROV
Provisioning Manager.
Definition: clCommon.h:444
@ CL_CID_CNT
Containers.
Definition: clCommon.h:378
@ CL_CID_NS
Name Service.
Definition: clCommon.h:426
@ CL_CID_RULE
Rule Base Engine.
Definition: clCommon.h:393
@ CL_CID_EVENTS
Event Service.
Definition: clCommon.h:363
@ CL_CID_COR
Clovis Object Registry.
Definition: clCommon.h:375
@ CL_CID_RCNT
Resilient Containers (for future use)
Definition: clCommon.h:384
@ CL_CID_NF
SAF Notification service.
Definition: clCommon.h:492
@ CL_CID_MSO
Mso Services Management.
Definition: clCommon.h:486
@ CL_CID_CLIST
Circular List Management.
Definition: clCommon.h:420
@ CL_CID_MSG
Message Service.
Definition: clCommon.h:342
@ CL_CID_RMD
Remote Method Dispatch.
Definition: clCommon.h:324
@ CL_CID_LOG
Logging.
Definition: clCommon.h:339
@ CL_CID_DM
Diagnostics Manager (for future use)
Definition: clCommon.h:438
@ CL_CID_OM
Object Manager.
Definition: clCommon.h:429
@ CL_CID_POOL
Pool Management.
Definition: clCommon.h:432
@ CL_CID_DBAL
Database Abstraction Layer.
Definition: clCommon.h:315
@ CL_CID_POLICY
Policy Engine.
Definition: clCommon.h:390
@ CL_CID_DIAG
Diagnostics.
Definition: clCommon.h:345
@ CL_CID_XDR
XDR Library.
Definition: clCommon.h:456
@ CL_CID_IDL
IDL.
Definition: clCommon.h:459
@ CL_CID_HANDLE
Handle Database.
Definition: clCommon.h:450
@ CL_CID_CPM
Component Management.
Definition: clCommon.h:351
@ CL_CID_VERSION
Version Checker Library.
Definition: clCommon.h:453
@ CL_CID_GMS
Group Membership Service.
Definition: clCommon.h:360
@ CL_CID_BUFFER
Buffer Management.
Definition: clCommon.h:414
@ CL_STATUS_UP
This determines that the node/component is up.
Definition: clCommon.h:85
@ CL_STATUS_DOWN
This determines that the node/component is down.
Definition: clCommon.h:80
A name.
Definition: clCommon.h:197
ClUint16T length
Length of the name in bytes excluding '\0'.
Definition: clCommon.h:199
Version Information for various services.
Definition: clCommon.h:250
ClUint8T minorVersion
Minor Number in range of [01-255].
Definition: clCommon.h:256
ClUint8T releaseCode
single ASCII capitol letter "A-Z"
Definition: clCommon.h:252
ClUint8T majorVersion
Major Number in range of [01-255].
Definition: clCommon.h:254