xref: /titanic_44/usr/src/lib/libipmp/common/ipmp_query_impl.h (revision 2b4a78020b9c38d1b95e2f3fefa6d6e4be382d1f)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2002 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef _IPMP_QUERY_IMPL_H
28 #define	_IPMP_QUERY_IMPL_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #include <ipmp_query.h>
33 
34 /*
35  * Private IPMP query interfaces and structures.
36  *
37  * These are *only* for use by in.mpathd and libipmp itself.
38  */
39 
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 
44 /*
45  * List of ipmp_groupinfo_t structures.
46  */
47 typedef struct ipmp_groupinfolist {
48 	struct ipmp_groupinfolist *grl_next;
49 	ipmp_groupinfo_t	*grl_grinfop;
50 } ipmp_groupinfolist_t;
51 
52 /*
53  * List of ipmp_ifinfo_t structures.
54  */
55 typedef struct ipmp_ifinfolist {
56 	struct ipmp_ifinfolist	*ifl_next;
57 	ipmp_ifinfo_t		*ifl_ifinfop;
58 } ipmp_ifinfolist_t;
59 
60 /*
61  * Snapshot of IPMP state.
62  */
63 typedef struct ipmp_snap {
64 	ipmp_grouplist_t	*sn_grlistp;
65 	ipmp_groupinfolist_t	*sn_grinfolistp;
66 	ipmp_ifinfolist_t	*sn_ifinfolistp;
67 	unsigned int		sn_ngroup;
68 	unsigned int		sn_nif;
69 } ipmp_snap_t;
70 
71 /*
72  * Snapshot-related routines.
73  */
74 extern ipmp_snap_t *ipmp_snap_create(void);
75 extern void ipmp_snap_free(ipmp_snap_t *);
76 extern int ipmp_snap_addifinfo(ipmp_snap_t *, ipmp_ifinfo_t *);
77 extern int ipmp_snap_addgroupinfo(ipmp_snap_t *, ipmp_groupinfo_t *);
78 
79 /*
80  * IPMP structure creation routines.
81  */
82 extern ipmp_ifinfo_t *ipmp_ifinfo_create(const char *, const char *,
83     ipmp_if_state_t, ipmp_if_type_t);
84 extern ipmp_groupinfo_t *ipmp_groupinfo_create(const char *, uint64_t,
85     ipmp_group_state_t, unsigned int, char (*)[LIFNAMSIZ]);
86 extern ipmp_grouplist_t *ipmp_grouplist_create(uint64_t, unsigned int,
87     char (*)[LIFGRNAMSIZ]);
88 
89 #ifdef __cplusplus
90 }
91 #endif
92 
93 #endif /* _IPMP_QUERY_IMPL_H */
94