1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
|
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2014 Garrett D'Amore <garrett@damore.org>
*
* Copyright 1998-2002 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_CLADM_H
#define _SYS_CLADM_H
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/types.h>
#include <sys/clconf.h>
#include <netinet/in.h>
/*
* This file defines interfaces which are private to Sun Clustering.
* Others should not depend on this in any way as it may change or be
* removed completely.
*/
/*
* cladm() facilities; see below for definitions pertinent to each of these
* facilities.
*/
#define CL_INITIALIZE 0 /* bootstrapping information */
#define CL_CONFIG 1 /* configuration information */
/*
* Command definitions for each of the facilities.
* The type of the data pointer and the direction of the data transfer
* is listed for each command.
*/
/*
* CL_INITIALIZE facility commands.
*/
#define CL_GET_BOOTFLAG 0 /* Return cluster config/boot status */
/*
* Definitions for the flag bits returned by CL_GET_BOOTFLAG.
*/
#define CLUSTER_CONFIGURED 0x0001 /* system is configured as a cluster */
#define CLUSTER_BOOTED 0x0002 /* system is booted as a cluster */
#ifdef _KERNEL
#define CLUSTER_INSTALLING 0x0004 /* cluster is being installed */
#define CLUSTER_DCS_ENABLED 0x0008 /* cluster device framework enabled */
#endif /* _KERNEL */
/*
* CL_CONFIG facility commands.
* The CL_GET_NETADDRS and CL_GET_NUM_NETADDRS are contract private interfaces
* per PSARC/2001/579-01.
*/
#define CL_NODEID 0 /* Return nodeid of this node. */
#define CL_HIGHEST_NODEID 1 /* Return highest configured nodeid. */
#define CL_GDEV_PREFIX 2 /* Return path to global namespace. */
#define CL_GET_NETADDRS 3 /* Get array of network addresses */
/* controlled by Sun Cluster. */
#define CL_GET_NUM_NETADDRS 4 /* Get the number of data structure */
/* entries in the array that will be */
/* returned using CL_GET_NETADDRS. */
/*
* The cladm system call can provide an array of cluster controlled
* network addresses and associated netmasks. The cladm arguments
* must be as follows: the argument fac is specified as CL_CONFIG,
* the argument cmd is specified as CL_GET_NETADDRS, and argument arg
* is the location of a structure of type cladm_netaddrs_t. The
* cladm_num_netaddrs is used as input for the requested number
* of array entries, and is used as ouput for the number of valid array
* entries available.
*
* The caller must allocate sufficient memory for the array of
* structures of type cladm_netaddr_entry_t and specify the starting
* location as cladm_netaddrs_array. The number of entries included
* in the array is determined using cladm with argument fac specified
* as CL_CONFIG, argument cmd specified as CL_GET_NUM_NETADDRS, and
* argument arg is the location of a structure of type cladm_netaddrs_t.
* The determined number of array entries is returned in
* cladm_num_netaddrs.
*
* These commands support the yielding of DR operation control (by the
* RCM Framework) to Sun Cluster for cluster controlled adapters.
*
* These data structures are contract private per PSARC/2001/579-01.
*/
typedef struct {
int32_t cl_ipversion; /* IPV4_VERSION or IPV6_VERSION */
union {
struct {
ipaddr_t ipv4_netaddr;
ipaddr_t ipv4_netmask;
} cl_ipv4;
struct {
uint32_t ipv6_netaddr[4];
uint32_t ipv6_netmask[4];
} cl_ipv6;
} cl_ipv_un;
} cladm_netaddr_entry_t;
typedef struct {
uint32_t cladm_num_netaddrs;
cladm_netaddr_entry_t *cladm_netaddrs_array;
} cladm_netaddrs_t;
#if defined(_SYSCALL32)
typedef struct {
uint32_t cladm_num_netaddrs;
caddr32_t cladm_netaddrs_array;
} cladm_netaddrs32_t;
#endif /* defined(_SYSCALL32) */
#ifdef _KERNEL
extern int cladmin(int fac, int cmd, void *data);
extern int cluster_bootflags;
#else
extern int _cladm(int fac, int cmd, void *data);
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_CLADM_H */
|