OpenClovis Logo

Files | Classes | Macros | Typedefs | Enumerations | Functions
API Reference Pages
Name Service

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

Files

file  clNameApi.h
 Header file of Name Service Related APIs.
file  clNameConfigApi.h
 Header file of Name Service lifecycle module related datastructures and APIs.
file  clNameErrors.h
 Header file of Name Service Related Error Codes.

Classes

struct  ClNameSvcAttrEntryT
 Attribute structure. More...
struct  ClNameSvcAttrSearchT
 For attribute related search. More...
struct  ClNameSvcCompList
 List of components. More...
struct  ClNameSvcConfigT
 The structure ClNameSvcConfigT contains the Name Service configuration information. More...
struct  ClNameSvcEntryT
 Name Service Entry. More...
struct  ClNameSvcEventInfoT
 Information passed to Name Service users via events whenever there is a change in Name Service database. More...
struct  ClNameSvcRegisterT
 The structure ClNameSvcRegisterT contains the name service registration information. More...

Macros

#define CL_NAME_EVENT_TYPE   0x100
 Id of the event published by Name Service.
#define CL_NAME_PUB_CHANNEL   "NAME_SVC_PUB_CHANNEL"
 Name Service event channel name.
#define CL_NAME_VERSION   {'B', 0x1, 0x1}
 Latest Supported Version for Name Service.
#define CL_NS_DEFT_ATTR_LIST   0x0
 For getting service from highest priority service provider.
#define CL_NS_DEFT_GLOBAL_CONTEXT   0xFFFFFFF
 Id of default global context.
#define CL_NS_DEFT_GLOBAL_MAP_COOKIE   0xFFFFFFF
 Context map cookie for default global scope context.
#define CL_NS_DEFT_LOCAL_CONTEXT   0xFFFFFFE
 Id of default node local context.
#define CL_NS_DEFT_LOCAL_MAP_COOKIE   0xFFFFFFE
 Context map cookie for default local scope context.
#define CL_NS_ERR_CONTEXT_ALREADY_CREATED   0x106
 While trying to create a context that is already created.
#define CL_NS_ERR_CONTEXT_CREATION_FAILED   0x104
 Context creation failed.
#define CL_NS_ERR_CONTEXT_NOT_CREATED   0x102
 On registering, deregistering or querying a context that does not exist.
#define CL_NS_ERR_ENTRY_NOT_FOUND   0x100
 On querying an entry that is not present.
#define CL_NS_ERR_LIMIT_EXCEEDED   0x101
 On creating or registering the contexts and entries more than the maximum allowed.
#define CL_NS_ERR_OPERATION_NOT_PERMITTED   0x105
 Requested operation not permitted.
#define CL_NS_ERR_SERVICE_NOT_REGISTERED   0x103
 Trying to delete a service that was not registered.
#define CL_NS_GET_OBJ_REF   0xFFFFFFF
 For getting service from highest priority service provider.
#define CL_NS_MAX_NO_ATTR   5
 Maximum number of attributes per entry.
#define CL_NS_MAX_STR_LENGTH   20
 Maximum length of strings used in name service.
#define CL_NS_RC(ERROR_CODE)   CL_RC(CL_CID_NS, (ERROR_CODE))
 Macro for appending NS component id to the error code.

Typedefs

typedef struct ClNameSvcCompList ClNameSvcCompListT
 List of components.

Enumerations

enum  ClNameSvcContextT {
  CL_NS_USER_NODELOCAL,
  CL_NS_USER_GLOBAL
}
 Type of context to be created. More...
enum  ClNameSvcOpT {
  CL_NS_COMPONENT_DEREGISTER_OP,
  CL_NS_SERVICE_DEREGISTER_OP,
  CL_NS_EO_DEREGISTER_OP,
  CL_NS_COMP_DEATH_DEREGISTER_OP,
  CL_NS_NODE_DEREGISTER_OP
}
 Type of operation that invoked event publish. More...
enum  ClNameSvcPriorityT {
  CL_NS_PRIORITY_LOW,
  CL_NS_PRIORITY_MEDIUM,
  CL_NS_PRIORITY_HIGH
}
 Component Priority values. More...

Functions

ClRcT clNameComponentDeregister (CL_IN ClUint32T compId)
 De-registers all entries of a component with Name Service.
ClRcT clNameContextCreate (CL_IN ClNameSvcContextT contextType, CL_IN ClUint32T contextMapCookie, CL_OUT ClUint32T *contextId)
 Creates a context.
ClRcT clNameContextDelete (CL_IN ClUint32T contextId)
 Deletes a context.
ClRcT clNameLibFinalize (void)
 Finalizes the name service library.
ClRcT clNameLibInitialize ()
 Initializes the name service library.
ClRcT clNameLibVersionVerify (CL_INOUT ClVersionT *pVersion)
 Verifies the version with the name service library.
ClRcT clNameObjectMappingCleanup (CL_IN ClNameSvcEntryPtrT pObjMapping)
 Frees the object mapping entry.
ClRcT clNameRegister (CL_IN ClUint32T contextId, CL_IN ClNameSvcRegisterT *pNSRegisInfo, CL_INOUT ClUint64T *pObjReference)
 Registers name to object reference mapping with Name Service.
ClRcT clNameServiceDeregister (CL_IN ClUint32T contextId, CL_IN ClUint32T compId, CL_IN ClNameT *serviceName)
 De-registers a particular service provided by a component.
ClRcT clNameToObjectMappingGet (CL_IN ClNameT *pName, CL_IN ClUint32T attrCount, CL_IN ClNameSvcAttrEntryT *pAttr, CL_IN ClUint32T contextMapCookie, CL_OUT ClNameSvcEntryPtrT *pOutBuff)
 Returns the entry of the service.
ClRcT clNameToObjectReferenceGet (CL_IN ClNameT *pName, CL_IN ClUint32T attrCount, CL_IN ClNameSvcAttrEntryT *pAttr, CL_IN ClUint32T contextMapCookie, CL_OUT ClUint64T *pObjReference)
 Returns the object reference for a service.

Detailed Description

Defines, Structures, Typedefs, Functions.

Enumeration Type Documentation

Type of context to be created.

Enumerator:
CL_NS_USER_NODELOCAL 

User defined node local context.

CL_NS_USER_GLOBAL 

User defined global context.

Type of operation that invoked event publish.

Enumerator:
CL_NS_COMPONENT_DEREGISTER_OP 

Deregistration of a component on an API request.

CL_NS_SERVICE_DEREGISTER_OP 

Deregistration of service provided by a component.

CL_NS_EO_DEREGISTER_OP 

Deregister the entries based on EoID.

CL_NS_COMP_DEATH_DEREGISTER_OP 

Deregister the entries based on the component death event.

CL_NS_NODE_DEREGISTER_OP 

Deregister entries based on the node IOC address.

Component Priority values.

Enumerator:
CL_NS_PRIORITY_LOW 

Low priority.

CL_NS_PRIORITY_MEDIUM 

Medium priority.

CL_NS_PRIORITY_HIGH 

High priority.

Function Documentation

ClRcT clNameComponentDeregister ( CL_IN ClUint32T  compId)

De-registers all entries of a component with Name Service.

Header File:
clNameApi.h
Parameters
compIdId of the component.
Return values
CL_OKThe API executed successfully.
CL_ERR_NOT_INITIALIZEDNS Library not initialized.
Description:
This API is used to deregister entries of all the services being provided by a given component. In Clovis High Availability scenario, this is called by Component Manager whenever it detects that a component has died. This can also be called by a component when it does down gracefully.
Library Files:
libClNameClient
See Also
clNameServiceDeregister(), clNameRegister()
ClRcT clNameContextCreate ( CL_IN ClNameSvcContextT  contextType,
CL_IN ClUint32T  contextMapCookie,
CL_OUT ClUint32T *  contextId 
)

Creates a context.

Header File:
clNameApi.h
Parameters
contextTypeWhether user-defined global or node local
contextMapCookieThis will be used during lookup. There is one-to-one mapping between contextMapCookie and contextId that is returned by this API. CL_NS_DEFT_GLOBAL_MAP_COOKIE(0xFFFFFFF) and CL_NS_DEFT_LOCAL_MAP_COOKIE(0xFFFFFFE) are RESERVED and should not be used.
contextId(out) Id of the context created.
Return values
CL_OKThe API executed successfully.
CL_NS_ERR_LIMIT_EXCEEDEDOn creating or registering the contexts and entries more than the maximum allowed.
CL_ERR_NO_MEMORYOn memory allocation failure.
CL_ERR_INVALID_PARAMETEROn passing an invalid parameter.
CL_ERR_NULL_POINTEROn passing a NULL pointer.
CL_NS_ERR_CONTEXT_ALREADY_CREATEDOn trying to cretae a context with a contextMapCookie which is already in use.
CL_ERR_NOT_INITIALIZEDNS Library not initialized.
Description:
This API is used to create a user-defined context (both global scope and node local scope).
Library Files:
libClNameClient
See Also
clNameContextDelete()
ClRcT clNameContextDelete ( CL_IN ClUint32T  contextId)

Deletes a context.

Header File:
clNameApi.h
Parameters
contextIdContext to be deleted.
Return values
CL_OKThe API executed successfully.
CL_NS_ERR_CONTEXT_NOT_CREATEDOn registering, deregistering or querying a context that does not exist.
CL_NS_ERR_OPERATION_NOT_PERMITTEDOn trying to delete default contexts.
CL_ERR_NOT_INITIALIZEDNS Library not initialized.
Description:
This API is used to delete a user-defined context (both global scope and node local scope).
Library Files:
libClNameClient
See Also
clNameContextCreate()
ClRcT clNameLibFinalize ( void  )

Finalizes the name service library.

Header File:
clNameApi.h
Parameters
none
Return values
CL_OKThe API executed successfully.
Description:
This API is for initializing the name service library. It must be invoked before invoking any of the Log service APIs.
Library Files:
libClNameClient
See Also
clNameLibInitialize()
ClRcT clNameLibInitialize ( )

Initializes the name service library.

Header File:
clNameApi.h
Parameters
none
Return values
CL_OKThe API executed successfully.
CL_ERR_NULL_POINTEROn passing a NULL pointer.
CL_ERR_INITIALIZEDLibrary already initialized
Description:
This API is for initializing the name service library. It must be invoked before invoking any of the Name service APIs.
Library Files:
libClNameClient
See Also
clNameLibFinalize()
ClRcT clNameLibVersionVerify ( CL_INOUT ClVersionT pVersion)

Verifies the version with the name service library.

Header File:
clNameApi.h
Parameters
pVersionVersion of NS Library with the user. If version mismatch happens then this will carry out the version supported by the NS Library.
Return values
CL_OKThe API executed successfully.
CL_ERR_NULL_POINTEROn passing a NULL pointer.
Description:
This API is for verifing the version with name service library. It must be invoked after initializing the NS library and before invoking any of the Name service APIs.
Library Files:
libClNameClient
ClRcT clNameObjectMappingCleanup ( CL_IN ClNameSvcEntryPtrT  pObjMapping)

Frees the object mapping entry.

Header File:
clNameApi.h
Parameters
pObjMappingPointer to the object mapping being deleted.
Return values
CL_OKThe API executed successfully.
CL_ERR_NULL_POINTEROn passing a NULL pointer.
Description:
This API is used to clean up the object mapping returned during the lookup.
Library Files:
libClNameClient
See Also
clNameToObjectMappingGet()
ClRcT clNameRegister ( CL_IN ClUint32T  contextId,
CL_IN ClNameSvcRegisterT pNSRegisInfo,
CL_INOUT ClUint64T *  pObjReference 
)

Registers name to object reference mapping with Name Service.

Header File:
clNameApi.h
Note
For registering to user defined context, first the context must be created using clNameContextCreate API.
Parameters
contextIdContext in which the service will be provided. It can have the following values:
  • CL_NS_DEFT_GLOBAL_CONTEXT: for registering to default global context.
  • CL_NS_DEFT_LOCAL_CONTEXT: for registering to default node local context.
  • Id returned by clNameContextCreate API: for user-defined contexts.
pNSRegisInfoRegistration related information
pObjReferenceThis will carry the object reference. If object reference is known, pObjReference will carry the known value. If object reference is unknown, pObjReference SHOULD carry CL_NS_GET_OBJ_REF. The allocated object reference will be returned in pObjReference.
Return values
CL_OKThe API executed successfully.
CL_ERR_NULL_POINTEROn passing a NULL pointer.
CL_NS_ERR_CONTEXT_NOT_CREATEDOn registering, deregistering or querying a context that does not exist.
CL_NS_ERR_LIMIT_EXCEEDEDOn creating or registering the contexts and entries more than the maximum allowed.
CL_ERR_NO_MEMORYOn memory allocation failure.
CL_ERR_NOT_INITIALIZEDNS Library not initialized.
Description:
This API is used to register a name to object reference mapping with Name Service. In Clovis High Availability scenario, whenever a component is assigned as an ACTIVE HA state for a given service, it registers the same with Name Service.
Library Files:
libClNameClient
See Also
clNameComponentRegister(), clNameServiceDeregister()
ClRcT clNameServiceDeregister ( CL_IN ClUint32T  contextId,
CL_IN ClUint32T  compId,
CL_IN ClNameT serviceName 
)

De-registers a particular service provided by a component.

Header File:
clNameApi.h
Parameters
contextIdContext in which the service will be provided. It can have the following values:
  • CL_NS_DEFT_GLOBAL_CONTEXT: for deregistering to default global context.
  • CL_NS_DEFT_LOCAL_CONTEXT: for deregistering to default node local context.
  • Id returned by clNameContextCreate API: for user-defined contexts.
compIdId of the component.
serviceNameName of the service
Return values
CL_OKThe API executed successfully.
CL_ERR_NULL_POINTEROn passing a NULL pointer.
CL_NS_ERR_CONTEXT_NOT_CREATEDOn registering, deregistering or querying a context that does not exist.
CL_NS_ERR_SERVICE_NOT_REGISTEREDTrying to deregister an unregistered service.
CL_ERR_NOT_INITIALIZEDNS Library not initialized.
Description:
This API is to deregister a service being provided by a given component.
Library Files:
libClNameClient
See Also
clNameComponentDeregister(), clNameRegister()
ClRcT clNameToObjectMappingGet ( CL_IN ClNameT pName,
CL_IN ClUint32T  attrCount,
CL_IN ClNameSvcAttrEntryT pAttr,
CL_IN ClUint32T  contextMapCookie,
CL_OUT ClNameSvcEntryPtrT pOutBuff 
)

Returns the entry of the service.

Header File:
clNameApi.h
Parameters
pNameName of the service.
attrCountNumber of attributes being passed in the query. If the number of attributes is unknown, then this value can be passed as CL_NS_DEFT_ATTR_LIST In such case, the object reference of component with the highest priority will be returned.
pAttrList of attributes. If attrCount=CL_NS_DEFT_ATTR_LIST, then this parameter must be passed as NULL.
contextMapCookieCookie to find the context. There is one-to-one mapping between contextMapCookie and context. This parameter can accept the following two values:
  • CL_NS_DEFT_GLOBAL_MAP_COOKIE: for querying the default global context.
  • CL_NS_DEFT_LOCAL_MAP_COOKIE: for querying the default local context.
pOutBuff(out) Contains the entry. You must free the memory after successful execution of this API.
Return values
CL_OKThe API executed successfully.
CL_NS_ERR_CONTEXT_NOT_CREATEDOn registering, deregistering or querying a context that does not exist.
CL_NS_ERR_ENTRY_NOT_FOUNDOn querying an entry that is not present.
CL_ERR_NULL_POINTEROn passing a NULL pointer.
CL_ERR_NOT_INITIALIZEDNS Library not initialized.
Description:
This API is used to query and return the entire entry for a given service name.
Library Files:
libClNameClient
See Also
clNameObjectMappingCleanup(), clNameToObjectReferenceGet()
ClRcT clNameToObjectReferenceGet ( CL_IN ClNameT pName,
CL_IN ClUint32T  attrCount,
CL_IN ClNameSvcAttrEntryT pAttr,
CL_IN ClUint32T  contextMapCookie,
CL_OUT ClUint64T *  pObjReference 
)

Returns the object reference for a service.

Header File:
clNameApi.h
Parameters
pNameName of the service.
attrCountNumber of attributes being passed in the query. If the number of attributes is unknown, then this value can be passed as CL_NS_DEFT_ATTR_LIST In such case, the object reference of component with the highest priority will be returned.
pAttrList of attributes. If attrCount=CL_NS_DEFT_ATTR_LIST, then this parameter must be passed as NULL.
contextMapCookieCookie to find the context. There is one-to-one mapping between contextMapCookie and context. This parameter can accept the following two values:
  • CL_NS_DEFT_GLOBAL_MAP_COOKIE: for querying the default global context.
  • CL_NS_DEFT_LOCAL_MAP_COOKIE: for querying the default local context.
pObjReference(out) Object reference associated with the service.
Return values
CL_OKThe API executed successfully.
CL_NS_ERR_CONTEXT_NOT_CREATEDOn registering, deregistering or querying a context that does not exist.
CL_NS_ERR_ENTRY_NOT_FOUNDOn querying an entry that is not present.
CL_ERR_NULL_POINTEROn passing a NULL pointer.
CL_ERR_NOT_INITIALIZEDNS Library not initialized.
Description:
This API is used to query and retrieve the object reference for a given service name.
Library Files:
libClNameClient
See Also
clNameToObjectMappingGet()

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