Patch to add new api to logsys to get priority names from subsystem names.
[openais.git] / include / saClm.h
blobc4c6203b9051d39cbde68d8f2a159a5f6113f787
1 /*
2 * Copyright (c) 2002-2005 MontaVista Software, Inc.
4 * All rights reserved.
6 * Author: Steven Dake (sdake@mvista.com)
8 * This software licensed under BSD license, the text of which follows:
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions are met:
13 * - Redistributions of source code must retain the above copyright notice,
14 * this list of conditions and the following disclaimer.
15 * - Redistributions in binary form must reproduce the above copyright notice,
16 * this list of conditions and the following disclaimer in the documentation
17 * and/or other materials provided with the distribution.
18 * - Neither the name of the MontaVista Software, Inc. nor the names of its
19 * contributors may be used to endorse or promote products derived from this
20 * software without specific prior written permission.
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
26 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
32 * THE POSSIBILITY OF SUCH DAMAGE.
35 #include "saAis.h"
37 #ifndef AIS_CLM_H_DEFINED
38 #define AIS_CLM_H_DEFINED
40 typedef SaUint64T SaClmHandleT;
42 typedef SaUint32T SaClmNodeIdT;
44 #define SA_CLM_LOCAL_NODE_ID 0xffffffff
46 #define SA_CLM_MAX_ADDRESS_LENGTH 64
48 typedef enum {
49 SA_CLM_AF_INET = 1,
50 SA_CLM_AF_INET6 = 2
51 } SaClmNodeAddressFamilyT;
53 typedef struct {
54 SaClmNodeAddressFamilyT family;
55 SaUint16T length;
56 SaUint8T value[SA_CLM_MAX_ADDRESS_LENGTH];
57 } SaClmNodeAddressT;
59 typedef struct {
60 SaClmNodeIdT nodeId;
61 SaClmNodeAddressT nodeAddress;
62 SaNameT nodeName;
63 SaBoolT member;
64 SaTimeT bootTimestamp;
65 SaUint64T initialViewNumber;
66 } SaClmClusterNodeT;
68 typedef enum {
69 SA_CLM_NODE_NO_CHANGE = 1,
70 SA_CLM_NODE_JOINED = 2,
71 SA_CLM_NODE_LEFT = 3,
72 SA_CLM_NODE_RECONFIGURED = 4
73 } SaClmClusterChangesT;
75 typedef struct {
76 SaClmClusterNodeT clusterNode;
77 SaClmClusterChangesT clusterChange;
78 } SaClmClusterNotificationT;
80 typedef struct {
81 SaUint64T viewNumber;
82 SaUint32T numberOfItems;
83 SaClmClusterNotificationT *notification;
84 } SaClmClusterNotificationBufferT;
86 typedef void (*SaClmClusterNodeGetCallbackT)(
87 SaInvocationT invocation,
88 const SaClmClusterNodeT *clusterNode,
89 SaAisErrorT error);
91 typedef void (*SaClmClusterTrackCallbackT) (
92 const SaClmClusterNotificationBufferT *notificationBuffer,
93 SaUint32T numberOfMembers,
94 SaAisErrorT error);
96 typedef struct {
97 SaClmClusterNodeGetCallbackT saClmClusterNodeGetCallback;
98 SaClmClusterTrackCallbackT saClmClusterTrackCallback;
99 } SaClmCallbacksT;
101 #ifdef __cplusplus
102 extern "C" {
103 #endif
105 SaAisErrorT
106 saClmInitialize (
107 SaClmHandleT *clmHandle,
108 const SaClmCallbacksT *clmCallbacks,
109 SaVersionT *version);
112 SaAisErrorT
113 saClmSelectionObjectGet (
114 SaClmHandleT clmHandle,
115 SaSelectionObjectT *selectionObject);
117 SaAisErrorT
118 saClmDispatch (
119 SaClmHandleT clmHandle,
120 SaDispatchFlagsT dispatchFlags);
122 SaAisErrorT
123 saClmFinalize (
124 SaClmHandleT clmHandle);
126 SaAisErrorT
127 saClmClusterTrack (
128 SaClmHandleT clmHandle,
129 SaUint8T trackFlags,
130 SaClmClusterNotificationBufferT *notificationBuffer);
132 SaAisErrorT
133 saClmClusterTrackStop (
134 SaClmHandleT clmHandle);
136 SaAisErrorT
137 saClmClusterNodeGet (
138 SaClmHandleT clmHandle,
139 SaClmNodeIdT nodeId,
140 SaTimeT timeout,
141 SaClmClusterNodeT *clusterNode);
143 SaAisErrorT
144 saClmClusterNodeGetAsync (
145 SaClmHandleT clmHandle,
146 SaInvocationT invocation,
147 SaClmNodeIdT nodeId);
149 #ifdef __cplusplus
151 #endif
153 #endif /* AIS_CLM_H_DEFINED */