10Sstevel@tonic-gate /* 20Sstevel@tonic-gate * CDDL HEADER START 30Sstevel@tonic-gate * 40Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*8485SPeter.Memishian@Sun.COM * Common Development and Distribution License (the "License"). 6*8485SPeter.Memishian@Sun.COM * You may not use this file except in compliance with the License. 70Sstevel@tonic-gate * 80Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 90Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 100Sstevel@tonic-gate * See the License for the specific language governing permissions 110Sstevel@tonic-gate * and limitations under the License. 120Sstevel@tonic-gate * 130Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 140Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 150Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 160Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 170Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 180Sstevel@tonic-gate * 190Sstevel@tonic-gate * CDDL HEADER END 20*8485SPeter.Memishian@Sun.COM * 21*8485SPeter.Memishian@Sun.COM * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 220Sstevel@tonic-gate * Use is subject to license terms. 230Sstevel@tonic-gate */ 240Sstevel@tonic-gate 250Sstevel@tonic-gate #ifndef _IPMP_QUERY_IMPL_H 260Sstevel@tonic-gate #define _IPMP_QUERY_IMPL_H 270Sstevel@tonic-gate 280Sstevel@tonic-gate #include <ipmp_query.h> 290Sstevel@tonic-gate 300Sstevel@tonic-gate /* 310Sstevel@tonic-gate * Private IPMP query interfaces and structures. 320Sstevel@tonic-gate * 330Sstevel@tonic-gate * These are *only* for use by in.mpathd and libipmp itself. 340Sstevel@tonic-gate */ 350Sstevel@tonic-gate 360Sstevel@tonic-gate #ifdef __cplusplus 370Sstevel@tonic-gate extern "C" { 380Sstevel@tonic-gate #endif 390Sstevel@tonic-gate 400Sstevel@tonic-gate /* 410Sstevel@tonic-gate * List of ipmp_groupinfo_t structures. 420Sstevel@tonic-gate */ 430Sstevel@tonic-gate typedef struct ipmp_groupinfolist { 440Sstevel@tonic-gate struct ipmp_groupinfolist *grl_next; 450Sstevel@tonic-gate ipmp_groupinfo_t *grl_grinfop; 460Sstevel@tonic-gate } ipmp_groupinfolist_t; 470Sstevel@tonic-gate 480Sstevel@tonic-gate /* 490Sstevel@tonic-gate * List of ipmp_ifinfo_t structures. 500Sstevel@tonic-gate */ 510Sstevel@tonic-gate typedef struct ipmp_ifinfolist { 520Sstevel@tonic-gate struct ipmp_ifinfolist *ifl_next; 530Sstevel@tonic-gate ipmp_ifinfo_t *ifl_ifinfop; 540Sstevel@tonic-gate } ipmp_ifinfolist_t; 550Sstevel@tonic-gate 560Sstevel@tonic-gate /* 57*8485SPeter.Memishian@Sun.COM * List of ipmp_addrinfo_t structures. 58*8485SPeter.Memishian@Sun.COM */ 59*8485SPeter.Memishian@Sun.COM typedef struct ipmp_addrinfolist { 60*8485SPeter.Memishian@Sun.COM struct ipmp_addrinfolist *adl_next; 61*8485SPeter.Memishian@Sun.COM ipmp_addrinfo_t *adl_adinfop; 62*8485SPeter.Memishian@Sun.COM } ipmp_addrinfolist_t; 63*8485SPeter.Memishian@Sun.COM 64*8485SPeter.Memishian@Sun.COM /* 650Sstevel@tonic-gate * Snapshot of IPMP state. 660Sstevel@tonic-gate */ 670Sstevel@tonic-gate typedef struct ipmp_snap { 680Sstevel@tonic-gate ipmp_grouplist_t *sn_grlistp; 690Sstevel@tonic-gate ipmp_groupinfolist_t *sn_grinfolistp; 700Sstevel@tonic-gate ipmp_ifinfolist_t *sn_ifinfolistp; 71*8485SPeter.Memishian@Sun.COM ipmp_addrinfolist_t *sn_adinfolistp; 720Sstevel@tonic-gate unsigned int sn_ngroup; 730Sstevel@tonic-gate unsigned int sn_nif; 74*8485SPeter.Memishian@Sun.COM unsigned int sn_naddr; 750Sstevel@tonic-gate } ipmp_snap_t; 760Sstevel@tonic-gate 770Sstevel@tonic-gate /* 780Sstevel@tonic-gate * Snapshot-related routines. 790Sstevel@tonic-gate */ 800Sstevel@tonic-gate extern ipmp_snap_t *ipmp_snap_create(void); 810Sstevel@tonic-gate extern void ipmp_snap_free(ipmp_snap_t *); 820Sstevel@tonic-gate extern int ipmp_snap_addifinfo(ipmp_snap_t *, ipmp_ifinfo_t *); 83*8485SPeter.Memishian@Sun.COM extern int ipmp_snap_addaddrinfo(ipmp_snap_t *, ipmp_addrinfo_t *); 840Sstevel@tonic-gate extern int ipmp_snap_addgroupinfo(ipmp_snap_t *, ipmp_groupinfo_t *); 850Sstevel@tonic-gate 860Sstevel@tonic-gate /* 87*8485SPeter.Memishian@Sun.COM * IPMP structure creation/destruction routines. 880Sstevel@tonic-gate */ 890Sstevel@tonic-gate extern ipmp_ifinfo_t *ipmp_ifinfo_create(const char *, const char *, 90*8485SPeter.Memishian@Sun.COM ipmp_if_state_t, ipmp_if_type_t, ipmp_if_linkstate_t, ipmp_if_probestate_t, 91*8485SPeter.Memishian@Sun.COM ipmp_if_flags_t, ipmp_targinfo_t *, ipmp_targinfo_t *); 92*8485SPeter.Memishian@Sun.COM extern ipmp_groupinfo_t *ipmp_groupinfo_create(const char *, uint64_t, uint_t, 93*8485SPeter.Memishian@Sun.COM ipmp_group_state_t, uint_t, char (*)[LIFNAMSIZ], const char *, 94*8485SPeter.Memishian@Sun.COM const char *, const char *, const char *, uint_t, 95*8485SPeter.Memishian@Sun.COM struct sockaddr_storage *); 960Sstevel@tonic-gate extern ipmp_grouplist_t *ipmp_grouplist_create(uint64_t, unsigned int, 970Sstevel@tonic-gate char (*)[LIFGRNAMSIZ]); 98*8485SPeter.Memishian@Sun.COM extern ipmp_addrinfo_t *ipmp_addrinfo_create(struct sockaddr_storage *, 99*8485SPeter.Memishian@Sun.COM ipmp_addr_state_t, const char *, const char *); 100*8485SPeter.Memishian@Sun.COM extern ipmp_targinfo_t *ipmp_targinfo_create(const char *, 101*8485SPeter.Memishian@Sun.COM struct sockaddr_storage *, ipmp_if_targmode_t, uint_t, 102*8485SPeter.Memishian@Sun.COM struct sockaddr_storage *); 103*8485SPeter.Memishian@Sun.COM extern void ipmp_freetarginfo(ipmp_targinfo_t *); 104*8485SPeter.Memishian@Sun.COM 1050Sstevel@tonic-gate 1060Sstevel@tonic-gate #ifdef __cplusplus 1070Sstevel@tonic-gate } 1080Sstevel@tonic-gate #endif 1090Sstevel@tonic-gate 1100Sstevel@tonic-gate #endif /* _IPMP_QUERY_IMPL_H */ 111