4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
21 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
22 * Use is subject to license terms.
25 #ifndef _IPMP_QUERY_IMPL_H
26 #define _IPMP_QUERY_IMPL_H
28 #include <ipmp_query.h>
31 * Private IPMP query interfaces and structures.
33 * These are *only* for use by in.mpathd and libipmp itself.
41 * List of ipmp_groupinfo_t structures.
43 typedef struct ipmp_groupinfolist
{
44 struct ipmp_groupinfolist
*grl_next
;
45 ipmp_groupinfo_t
*grl_grinfop
;
46 } ipmp_groupinfolist_t
;
49 * List of ipmp_ifinfo_t structures.
51 typedef struct ipmp_ifinfolist
{
52 struct ipmp_ifinfolist
*ifl_next
;
53 ipmp_ifinfo_t
*ifl_ifinfop
;
57 * List of ipmp_addrinfo_t structures.
59 typedef struct ipmp_addrinfolist
{
60 struct ipmp_addrinfolist
*adl_next
;
61 ipmp_addrinfo_t
*adl_adinfop
;
62 } ipmp_addrinfolist_t
;
65 * Snapshot of IPMP state.
67 typedef struct ipmp_snap
{
68 ipmp_grouplist_t
*sn_grlistp
;
69 ipmp_groupinfolist_t
*sn_grinfolistp
;
70 ipmp_ifinfolist_t
*sn_ifinfolistp
;
71 ipmp_addrinfolist_t
*sn_adinfolistp
;
72 unsigned int sn_ngroup
;
74 unsigned int sn_naddr
;
78 * Snapshot-related routines.
80 extern ipmp_snap_t
*ipmp_snap_create(void);
81 extern void ipmp_snap_free(ipmp_snap_t
*);
82 extern int ipmp_snap_addifinfo(ipmp_snap_t
*, ipmp_ifinfo_t
*);
83 extern int ipmp_snap_addaddrinfo(ipmp_snap_t
*, ipmp_addrinfo_t
*);
84 extern int ipmp_snap_addgroupinfo(ipmp_snap_t
*, ipmp_groupinfo_t
*);
87 * IPMP structure creation/destruction routines.
89 extern ipmp_ifinfo_t
*ipmp_ifinfo_create(const char *, const char *,
90 ipmp_if_state_t
, ipmp_if_type_t
, ipmp_if_linkstate_t
, ipmp_if_probestate_t
,
91 ipmp_if_flags_t
, ipmp_targinfo_t
*, ipmp_targinfo_t
*);
92 extern ipmp_groupinfo_t
*ipmp_groupinfo_create(const char *, uint64_t, uint_t
,
93 ipmp_group_state_t
, uint_t
, char (*)[LIFNAMSIZ
], const char *,
94 const char *, const char *, const char *, uint_t
,
95 struct sockaddr_storage
*);
96 extern ipmp_grouplist_t
*ipmp_grouplist_create(uint64_t, unsigned int,
97 char (*)[LIFGRNAMSIZ
]);
98 extern ipmp_addrinfo_t
*ipmp_addrinfo_create(struct sockaddr_storage
*,
99 ipmp_addr_state_t
, const char *, const char *);
100 extern ipmp_targinfo_t
*ipmp_targinfo_create(const char *,
101 struct sockaddr_storage
*, ipmp_if_targmode_t
, uint_t
,
102 struct sockaddr_storage
*);
103 extern void ipmp_freetarginfo(ipmp_targinfo_t
*);
110 #endif /* _IPMP_QUERY_IMPL_H */