OpenClovis Logo

clNameApi.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 : name
21  * File : clNameApi.h
22  *******************************************************************************/
23 
24 /*******************************************************************************
25  * Description :
26  *
27  * This file contains Name Service Client Library related
28  * datastructures and APIs.
29  *
30  *
31  *****************************************************************************/
32 
45 #ifndef _CL_NAME_API_H_
46 #define _CL_NAME_API_H_
47 
48 #include "clBufferApi.h"
49 #include <clEoApi.h>
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53 
54 /*****************************************************************************/
55 /******************************** Defines/constants **************************/
56 /*****************************************************************************/
57 
61 #define CL_NS_MAX_NO_ATTR 5
62 
63 
67 #define CL_NS_MAX_STR_LENGTH 20
68 
72 #define CL_NS_DEFT_GLOBAL_CONTEXT 0xFFFFFFF
73 
74 
78 #define CL_NS_DEFT_LOCAL_CONTEXT 0xFFFFFFE
79 
83 #define CL_NS_DEFT_GLOBAL_MAP_COOKIE 0xFFFFFFF
84 
88 #define CL_NS_DEFT_LOCAL_MAP_COOKIE 0xFFFFFFE
89 
93 #define CL_NS_DEFT_ATTR_LIST 0x0
94 
98 #define CL_NS_GET_OBJ_REF 0xFFFFFFF
99 
103 #define CL_NAME_PUB_CHANNEL "NAME_SVC_PUB_CHANNEL"
104 
105 
109 #define CL_NAME_EVENT_TYPE 0x100
110 
114 # define CL_NAME_VERSION {'B', 0x1, 0x1}
115 # define CL_NAME_VERSION_SET(version) (version).releaseCode = 'B', \
116  (version).majorVersion = 0x1,\
117  (version).minorVersion = 0x1
118 
119 /********************* Name Service related data structures **********************/
120 /*********************************************************************************/
121 
125 typedef enum
126 {
127 
132 
138 
139 
143 typedef enum
144 {
149 
154 
155 
160 
166 
171 
173 
174 
178 typedef enum
179 {
184 
189 
194 
196 
197 
202 typedef struct
203 {
204 
209 
213  ClUint64T objReference;
214 
219 
223  ClUint32T contextMapCookie;
225 
226 
230 typedef struct
231 {
232 
236 ClUint8T type[CL_NS_MAX_STR_LENGTH];
237 
241 ClUint8T value[CL_NS_MAX_STR_LENGTH];
243 
245 
246 
250 typedef struct
251 {
252 
257 
261  ClUint32T attrCount;
262 
266  ClUint32T opCode[CL_NS_MAX_NO_ATTR-1];
268 
270 
271 
275 typedef struct
276 {
277 
282 
286  ClUint32T compId;
287 
292 
296  ClUint32T attrCount;
297 
303 
305 
306 
310 typedef struct ClNameSvcCompList
311 {
312  ClUint32T dsId;
316  ClUint32T compId;
317 
322 
327 
332 
337 
343 
345 
346 
350 typedef struct
351 {
352 
353 
358 
362  ClUint64T objReference;
363 
367  ClUint32T refCount;
368 
373 
377  ClUint32T attrCount;
378 
384 
386 
387 /*********************************************************************************/
388 /************************** Client side APIs *********************************/
389 /*********************************************************************************/
390 
391 /*********************************************************************************/
392 /************************** API to Core Module ***********************************/
393 
419 
420 
444 
445 
488 ClRcT clNameRegister(CL_IN ClUint32T contextId,
489  CL_IN ClNameSvcRegisterT* pNSRegisInfo,
490  CL_INOUT ClUint64T *pObjReference);
491 
492 ClRcT clNameRegisterAndOverwrite(CL_IN ClUint32T contextId, CL_IN ClNameSvcRegisterT* pNSRegisInfo, CL_INOUT ClUint64T *pObjReference);
493 
519 
520 
521 
553 ClRcT clNameServiceDeregister(CL_IN ClUint32T contextId,
554  CL_IN ClUint32T compId,
555  CL_IN ClNameT* serviceName);
556 
557 
594  CL_IN ClUint32T contextMapCookie,
595  CL_OUT ClUint32T *contextId);
596 
597 
625 ClRcT clNameContextDelete(CL_IN ClUint32T contextId);
626 
627 /**********************************************************************************/
628 /************************** API to Query Module ***********************************/
629 
630 
671  CL_IN ClUint32T attrCount,
672  CL_IN ClNameSvcAttrEntryT *pAttr,
673  CL_IN ClUint32T contextMapCookie,
674  CL_OUT ClUint64T* pObjReference);
675 
676 
717  CL_IN ClUint32T attrCount,
718  CL_IN ClNameSvcAttrEntryT *pAttr,
719  CL_IN ClUint32T contextMapCookie,
720  CL_OUT ClNameSvcEntryPtrT* pOutBuff);
721 
722 
745 
769 /**************************************************************************************/
770 
771 #ifdef __cplusplus
772 }
773 #endif
774 
775 #endif /* _CL_NAME_API_H_ */
776 
Header file of Buffer Management related APIs.
Header file of EO related APIs.
ClUint32T ClRcT
Clovis return code type.
Definition: clCommon.h:168
#define CL_INOUT
CL_INOUT macro assists in clearly defining arguments of an API, but has no actual meaning.
Definition: clCommon.h:108
#define CL_OUT
CL_OUT macro assists in clearly defining arguments of an API, but has no actual meaning.
Definition: clCommon.h:110
#define CL_IN
CL_IN macro assists in clearly defining arguments of an API, but has no actual meaning.
Definition: clCommon.h:106
ClUint64T ClEoIdT
The type of the EOId, assigned to an EO as part of registration to the Component Manager.
Definition: clEoConfigApi.h:63
ClUint32T ClIocPortT
The IOC communication port.
Definition: clIocApi.h:348
ClUint32T ClIocNodeAddressT
The IOC node address.
Definition: clIocApi.h:343
ClRcT clNameObjectMappingCleanup(CL_IN ClNameSvcEntryPtrT pObjMapping)
Frees the object mapping entry.
ClNameSvcContextT
Type of context to be created.
Definition: clNameApi.h:126
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.
struct ClNameSvcCompList ClNameSvcCompListT
List of components.
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.
ClRcT clNameServiceDeregister(CL_IN ClUint32T contextId, CL_IN ClUint32T compId, CL_IN ClNameT *serviceName)
De-registers a particular service provided by a component.
ClRcT clNameLibVersionVerify(CL_INOUT ClVersionT *pVersion)
Verifies the version with the name service library.
#define CL_NS_MAX_NO_ATTR
Maximum number of attributes per entry.
Definition: clNameApi.h:61
ClRcT clNameContextDelete(CL_IN ClUint32T contextId)
Deletes a context.
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.
ClNameSvcPriorityT
Component Priority values.
Definition: clNameApi.h:179
ClRcT clNameLibInitialize()
Initializes the name service library.
ClNameSvcOpT
Type of operation that invoked event publish.
Definition: clNameApi.h:144
ClRcT clNameRegister(CL_IN ClUint32T contextId, CL_IN ClNameSvcRegisterT *pNSRegisInfo, CL_INOUT ClUint64T *pObjReference)
Registers name to object reference mapping with Name Service.
#define CL_NS_MAX_STR_LENGTH
Maximum length of strings used in name service.
Definition: clNameApi.h:67
ClRcT clNameLibFinalize(void)
Finalizes the name service library.
@ CL_NS_USER_NODELOCAL
User defined node local context.
Definition: clNameApi.h:131
@ CL_NS_USER_GLOBAL
User defined global context.
Definition: clNameApi.h:136
@ CL_NS_PRIORITY_MEDIUM
Medium priority.
Definition: clNameApi.h:188
@ CL_NS_PRIORITY_LOW
Low priority.
Definition: clNameApi.h:183
@ CL_NS_PRIORITY_HIGH
High priority.
Definition: clNameApi.h:193
@ CL_NS_COMP_DEATH_DEREGISTER_OP
Deregister the entries based on the component death event.
Definition: clNameApi.h:165
@ CL_NS_NODE_DEREGISTER_OP
Deregister entries based on the node IOC address.
Definition: clNameApi.h:170
@ CL_NS_SERVICE_DEREGISTER_OP
Deregistration of service provided by a component.
Definition: clNameApi.h:153
@ CL_NS_EO_DEREGISTER_OP
Deregister the entries based on EoID.
Definition: clNameApi.h:159
@ CL_NS_COMPONENT_DEREGISTER_OP
Deregistration of a component on an API request.
Definition: clNameApi.h:148
A name.
Definition: clCommon.h:197
Version Information for various services.
Definition: clCommon.h:250
Information passed to Name Service users via events whenever there is a change in Name Service databa...
Definition: clNameApi.h:203
ClUint64T objReference
Object Reference.
Definition: clNameApi.h:213
ClNameT name
Name of the serivce.
Definition: clNameApi.h:208
ClUint32T contextMapCookie
Context where service exists.
Definition: clNameApi.h:223
ClNameSvcOpT operation
Operation type.
Definition: clNameApi.h:218
Attribute structure.
Definition: clNameApi.h:231
For attribute related search.
Definition: clNameApi.h:251
ClUint32T attrCount
Number of attributes.
Definition: clNameApi.h:261
The structure ClNameSvcRegisterT contains the name service registration information.
Definition: clNameApi.h:276
ClNameT name
Name of the service.
Definition: clNameApi.h:281
ClUint32T attrCount
Number of attributes associated with the entry.
Definition: clNameApi.h:296
ClNameSvcPriorityT priority
Priority of the Component for the given service.
Definition: clNameApi.h:291
ClUint32T compId
Id of the Component.
Definition: clNameApi.h:286
List of components.
Definition: clNameApi.h:311
ClNameSvcPriorityT priority
Priority of the Component for the service being provided.
Definition: clNameApi.h:336
ClIocNodeAddressT nodeAddress
IOC address of the client.
Definition: clNameApi.h:326
struct ClNameSvcCompList * pNext
Pointer to the next element.
Definition: clNameApi.h:341
ClEoIdT eoID
EoID of the component.
Definition: clNameApi.h:321
ClIocPortT clientIocPort
Client IOC port.
Definition: clNameApi.h:331
ClUint32T compId
Id of the Component.
Definition: clNameApi.h:316
Name Service Entry.
Definition: clNameApi.h:351
ClNameT name
Name of the component.
Definition: clNameApi.h:357
ClUint32T refCount
Count of components providing the service.
Definition: clNameApi.h:367
ClUint64T objReference
Object Reference.
Definition: clNameApi.h:362
ClNameSvcCompListT compId
List of components providing the service.
Definition: clNameApi.h:372
ClUint32T attrCount
Number of attributes associated with the entry.
Definition: clNameApi.h:377

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