OpenClovis Logo

Files | Classes | Macros | Typedefs | Enumerations | Functions
API Reference Pages
Common defines, structures, and functions

Defines, Structures, Typedefs, Functions. More...

Files

file  clCommon.h
 Typical defines found in any software project.
file  clCommonErrors.h
 Common Error Codes shared across multiple Clovis ASP Components.

Classes

struct  ClNameT
 A name. More...
struct  ClVersionT
 Version Information for various services. More...

Macros

#define CL_CID_OFFSET   16 /* 16 bit positions */
 Component identifier offset.
#define CL_DISABLE   0
 define Disable
#define CL_ENABLE   1
 define Enable
#define CL_ERR_ALREADY_EXIST   0x10
 An entry is already existing.
#define CL_ERR_BAD_FLAG   0x22
 The passed flag is invalid.
#define CL_ERR_BAD_OPERATION   0x23
 The requested operation is invalid.
#define CL_ERR_BUFFER_OVERRUN   0x0d
 Buffer over run.
#define CL_ERR_COMMON_MAX   0xff
 2^8-1, the max for common errors
#define CL_ERR_DOESNT_EXIST   0x13
 An entry does not exist.
#define CL_ERR_DUPLICATE   0x08
 Duplicate entry.
#define CL_ERR_FAILED_OPERATION   0x1f
 The requested operation Failed.
#define CL_ERR_INITIALIZED   0x0c
 Already initialized.
#define CL_ERR_INTERRUPT   0x26
 The operation interrupted by application/user.
#define CL_ERR_INUSE   0x15
 Resource is in use.
#define CL_ERR_INVALID_BUFFER   0x06
 The buffer passed in is invalid.
#define CL_ERR_INVALID_HANDLE   0x05
 The handle passed is invalid.
#define CL_ERR_INVALID_PARAMETER   0x02
 Input parameters are invalid.
#define CL_ERR_INVALID_STATE   0x12
 Invalid State.
#define CL_ERR_LIBRARY   0x24
 System call invocation failed and returned an error.
#define CL_ERR_MESSAGE_ERROR   0x1c
 A communication error occurred.
#define CL_ERR_MUTEX_ERROR   0x18
 Thread mutex error.
#define CL_ERR_NAME_NOT_FOUND   0x1b
 Name doesnt exist or cannot be found.
#define CL_ERR_NAME_TOO_LONG   0x1a
 Name exceeds maximum allowed length.
#define CL_ERR_NO_CALLBACK   0x17
 No callback available for request.
#define CL_ERR_NO_MEMORY   0x01
 Memory is not available.
#define CL_ERR_NO_OP   0x19
 Null operation.
#define CL_ERR_NO_RESOURCE   0x0b
 No resources.
#define CL_ERR_NO_SECTIONS   0x1e
 There are no or no more sections matching the specified sections.
#define CL_ERR_NO_SPACE   0x21
 Space limitation.
#define CL_ERR_NOT_EXIST   0x04
 Requested resource does not exist.
#define CL_ERR_NOT_IMPLEMENTED   0x07
 The function not yet implemented.
#define CL_ERR_NOT_INITIALIZED   0x0e
 Component not initialized.
#define CL_ERR_NOT_SUPPORTED   0x25
 Requested feature is not supported.
#define CL_ERR_NULL_POINTER   0x03
 Input parameter is a NULL pointer.
#define CL_ERR_OP_NOT_PERMITTED   0x20
 Requested operation is not permitted.
#define CL_ERR_OUT_OF_RANGE   0x0a
 Out of range paramenters.
#define CL_ERR_QUEUE_NOT_AVAILABLE   0x09
 The destination queue is not available.
#define CL_ERR_TIMEOUT   0x14
 Timeout.
#define CL_ERR_TOO_BIG   0x1d
 A value is larger than the maximum value permitted.
#define CL_ERR_TRY_AGAIN   0x16
 Component is busy , Try again.
#define CL_ERR_UNSPECIFIED   0x11
 Unknown/Unspecified error.
#define CL_ERR_VERSION_MISMATCH   0x0f
 Version mismatch.
#define CL_ERROR_CODE_MASK   0xffff /* 16 bits */
 Error code mask.
#define CL_FALSE   0
 define the False
#define CL_GET_CID(RC)   ((ClUint32T) ((RC) >> CL_CID_OFFSET))
 This macro extracts the component identifier from the return code.
#define CL_GET_ERROR_CODE(RC)   ((ClUint32T) ((RC) & CL_ERROR_CODE_MASK))
 This macro extracts the error code from the return code.
#define CL_IN
 CL_IN macro assists in clearly defining arguments of an API, but has no actual meaning.
#define CL_INOUT
 CL_INOUT macro assists in clearly defining arguments of an API, but has no actual meaning.
#define CL_MAX(a, b)   ( (a) > (b) ? (a) : (b) )
 Maximum macro.
#define CL_MAX_NAME_LENGTH   256
 The Maximum length of most string names in the OpenClovis ASP framework.
#define CL_MICRO_TO_NANO   1000ULL
 nanoseconds in a microsecond
#define CL_MILLI_TO_MICRO   1000ULL
 microseconds in a millisecond
#define CL_MILLI_TO_NANO   (CL_MICRO_TO_NANO * CL_MILLI_TO_MICRO)
 nanoseconds in a millisecond
#define CL_MIN(a, b)   ( (a) < (b) ? (a) : (b) )
 Mininum macro.
#define CL_NO   0
 define No
#define CL_OK   0x00
 Every thing is OK.
#define CL_OUT
 CL_OUT macro assists in clearly defining arguments of an API, but has no actual meaning.
#define CL_RC(CID, ERROR_CODE)
 This macro constructs the return code from the component identifier and error code.
#define CL_ROUNDDOWN(VAL, BASE)   ((VAL)/(BASE) * (BASE))
 Rounddown macro assumes integers - char, short, int and long as argument.
#define CL_ROUNDUP(VAL, BASE)   (((VAL) + (BASE) - 1)/(BASE) * (BASE))
 Roundup macro assumes integers - char, short, int and long as argument.
#define CL_SEC_TO_MILLI   1000ULL
 milliseconds in a second
#define CL_SEC_TO_NANO   (CL_MILLI_TO_NANO * CL_SEC_TO_MILLI)
 nanoseconds in a second
#define CL_SIZEOF_ARRAY(__ArrayName__)   sizeof((__ArrayName__)) / sizeof((__ArrayName__)[0])
 The following macros returns the number of items in the given array.
#define CL_TIME_END   0x7fffffffffffffffULL
 In practice, this will never time out, since it is 292 years.
#define CL_TIME_FOREVER   0x7fffffffffffffffULL
 In practice, this will never time out, since it is 292 years.
#define CL_TRUE   1
 define the Truth
#define CL_YES   1
 define Yes
#define clNamePrintf(name,...)
 Load the ClNameT structure.

Typedefs

typedef ClRcT(* ClCallbackT )(CL_IN ClPtrT invocation)
 Definition of a generic single argument callback function.
typedef ClPtrT * ClEoActionArgListT
 The argument list that can be provided to the custom action taken on water mark hit.
typedef ClInt64T ClOffsetT
 Offset of a buffer or object within another.
typedef ClUint32T ClRcT
 Clovis return code type.
typedef ClUint64T ClSizeT
 

of bytes in a buffer or object


typedef ClInt64T ClTimeT
 Time duration specified in nanoseconds.

Enumerations

enum  ClCompIdT {
  CL_CID_UNSPECIFIED = 0x0,
  CL_CID_OSAL = 0x01,
  CL_CID_HAL = 0x02,
  CL_CID_DBAL = 0x03,
  CL_CID_EO = 0x04,
  CL_CID_IOC = 0x05,
  CL_CID_RMD = 0x06,
  CL_CID_NAMES = 0x07,
  CL_CID_TIMER = 0x08,
  CL_CID_SHM = 0x09,
  CL_CID_DSHM = 0x0a,
  CL_CID_LOG = 0x0b,
  CL_CID_MSG = 0x0c,
  CL_CID_DIAG = 0x0d,
  CL_CID_DEBUG = 0x0e,
  CL_CID_CPM = 0x0f,
  CL_CID_CAP = 0x10,
  CL_CID_RES = 0x11,
  CL_CID_GMS = 0x12,
  CL_CID_EVENTS = 0x13,
  CL_CID_DLOCK = 0x14,
  CL_CID_TXN = 0x15,
  CL_CID_CKPT = 0x16,
  CL_CID_COR = 0x17,
  CL_CID_CNT = 0x18,
  CL_CID_DCNT = 0x19,
  CL_CID_RCNT = 0x1a,
  CL_CID_ALARMS = 0x1b,
  CL_CID_POLICY = 0x1c,
  CL_CID_RULE = 0x1d,
  CL_CID_SCRIPTING = 0x1e,
  CL_CID_CM = 0x1f,
  CL_CID_HPI = 0x20,
  CL_CID_FAULTS = 0x21,
  CL_CID_AMS = 0x22,
  CL_CID_MED = 0x23,
  CL_CID_BUFFER = 0x24,
  CL_CID_QUEUE = 0x25,
  CL_CID_CLIST = 0x26,
  CL_CID_SNMP = 0x27,
  CL_CID_NS = 0x28,
  CL_CID_OM = 0x29,
  CL_CID_POOL = 0x2a,
  CL_CID_CD = 0x2b,
  CL_CID_DM = 0x2c,
  CL_CID_OAMP_RT = 0x2d,
  CL_CID_PROV = 0x2e,
  CL_CID_UM = 0x2f,
  CL_CID_HANDLE = 0x30,
  CL_CID_VERSION = 0x31,
  CL_CID_XDR = 0x32,
  CL_CID_IDL = 0x33,
  CL_CID_HEAP = 0x34,
  CL_CID_MEM = 0x35,
  CL_CID_PARSER = 0x36 ,
  CL_CID_BITMAP = 0x3a ,
  CL_CID_MSO = 0x3c,
  CL_CID_PM = 0x3d,
  CL_CID_NF = 0x3e,
  CL_CID_MAX
}
 Clovis Component Ids. More...
enum  ClDispatchFlagsT
 Dispatch flags.
enum  ClStatusT {
  CL_STATUS_DOWN = 0,
  CL_STATUS_UP = 1
}
 These define all the possible states that a component/node can be in. More...

Functions

void clNameConcat (ClNameT *nameOut, const ClNameT *prefix, const char *separator, const ClNameT *suffix)
 Join ClNameT structures.
void clNameCopy (ClNameT *nameOut, const ClNameT *nameIn)
 Load the ClNameT structure.
void clNameSet (ClNameT *name, const char *str)
 Load the ClNameT structure.
ClCharT * clStrdup (const ClCharT *str)
 Duplicate a string.

Detailed Description

Defines, Structures, Typedefs, Functions.

Macro Definition Documentation

#define clNamePrintf (   name,
  ... 
)
Value:
do \
{ \
name.length = snprintf(name.value, CL_MAX_NAME_LENGTH - 1, __VA_ARGS__);\
name.value[CL_MIN(name.length, CL_MAX_NAME_LENGTH - 1)] = '\0'; \
}while(0)

Load the ClNameT structure.

Parameters
nameThe structure you want to load
fmtString& params

Typedef Documentation

typedef ClRcT(* ClCallbackT)(CL_IN ClPtrT invocation)

Definition of a generic single argument callback function.

Parameters
invocationA "cookie". The caller can pass a piece of arbitrary data along with the function pointer in all calls that take a callback. This data passed as the "invocation" parameter to the callback.
typedef ClUint32T ClRcT

Clovis return code type.

See Also
clCommonErrors.h

Enumeration Type Documentation

enum ClCompIdT

Clovis Component Ids.

Enumerator:
CL_CID_UNSPECIFIED 

Unspecified.

CL_CID_OSAL 

OS Abstraction Layer.

CL_CID_HAL 

Hardware Abstraction Layer.

CL_CID_DBAL 

Database Abstraction Layer.

CL_CID_EO 

Execution Object.

CL_CID_IOC 

Intelligent Object Communication.

CL_CID_RMD 

Remote Method Dispatch.

CL_CID_NAMES 

Name Service.

CL_CID_TIMER 

Timer.

CL_CID_SHM 

Shared Memory Support.

CL_CID_DSHM 

Distributed Shared Memory.

CL_CID_LOG 

Logging.

CL_CID_MSG 

Message Service.

CL_CID_DIAG 

Diagnostics.

CL_CID_DEBUG 

Debug.

CL_CID_CPM 

Component Management.

CL_CID_CAP 

Capability Management (for future use)

CL_CID_RES 

Resource Management (for future use)

CL_CID_GMS 

Group Membership Service.

CL_CID_EVENTS 

Event Service.

CL_CID_DLOCK 

Distributed Locking (for future use)

CL_CID_TXN 

Transactions.

CL_CID_CKPT 

Checkpointing Service.

CL_CID_COR 

Clovis Object Registry.

CL_CID_CNT 

Containers.

CL_CID_DCNT 

Distributed Containers (for future use)

CL_CID_RCNT 

Resilient Containers (for future use)

CL_CID_ALARMS 

Alarm Manager.

CL_CID_POLICY 

Policy Engine.

CL_CID_RULE 

Rule Base Engine.

CL_CID_SCRIPTING 

Scripting Engine (for future use)

CL_CID_CM 

Chassis Manager.

CL_CID_HPI 

Hardware Platform Interface.

CL_CID_FAULTS 

Fault Management.

CL_CID_AMS 

Availability Management Service.

CL_CID_MED 

Mediation Library.

CL_CID_BUFFER 

Buffer Management.

CL_CID_QUEUE 

Queue Management.

CL_CID_CLIST 

Circular List Management.

CL_CID_SNMP 

SNMP Agent.

CL_CID_NS 

Name Service.

CL_CID_OM 

Object Manager.

CL_CID_POOL 

Pool Management.

CL_CID_CD 

Common Diagnostics (for future use)

CL_CID_DM 

Diagnostics Manager (for future use)

CL_CID_OAMP_RT 

OAMP RT parser.

CL_CID_PROV 

Provisioning Manager.

CL_CID_UM 

Upgrade Manager (for future use)

CL_CID_HANDLE 

Handle Database.

CL_CID_VERSION 

Version Checker Library.

CL_CID_XDR 

XDR Library.

CL_CID_IDL 

IDL.

CL_CID_HEAP 

Heap Management.

CL_CID_MEM 

Memory Management.

CL_CID_PARSER 

Parser.

CL_CID_BITMAP 

Bitmap Management.

CL_CID_MSO 

Mso Services Management.

CL_CID_PM 

Performance Management.

CL_CID_NF 

SAF Notification service.

CL_CID_MAX 

This will help validate if needs to be.

enum ClStatusT

These define all the possible states that a component/node can be in.

Enumerator:
CL_STATUS_DOWN 

This determines that the node/component is down.

CL_STATUS_UP 

This determines that the node/component is up.

Function Documentation

void clNameConcat ( ClNameT nameOut,
const ClNameT prefix,
const char *  separator,
const ClNameT suffix 
)

Join ClNameT structures.

Parameters
nameOutThe result
prefixThe beginning string. Pass NULL if there is no beginning
separatorThe middle string. Pass NULL for no separator
suffixThe ending string. Pass NULL for no ending

If the sum of the lengths of the prefix, separator, and suffix is too long, the function will crop.

void clNameCopy ( ClNameT nameOut,
const ClNameT nameIn 
)

Load the ClNameT structure.

Parameters
nameThe structure you want to load
nameThe structure to be put into the ClNameT structure

If length is too long, then this function will ASSERT in debug mode, and crop in production mode

void clNameSet ( ClNameT name,
const char *  str 
)

Load the ClNameT structure.

Parameters
nameThe structure you want to load
strThe value to be put into the ClNameT structure

If str is too long, then this function will ASSERT in debug mode, and crop in production mode

ClCharT* clStrdup ( const ClCharT *  str)

Duplicate a string.

Parameters
strThe string to be duplicated
Return values
Storagepointed to a duplicated string or NULL
Description:
This API is used to duplicate a string. The storage pointed by the returned string should be freed using ASP heap API: clHeapFree.

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