xref: /onnv-gate/usr/src/lib/libipmp/common/ipmp.h (revision 8485:633e5b5eb268)
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
200Sstevel@tonic-gate  */
210Sstevel@tonic-gate /*
22*8485SPeter.Memishian@Sun.COM  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
230Sstevel@tonic-gate  * Use is subject to license terms.
240Sstevel@tonic-gate  */
250Sstevel@tonic-gate 
260Sstevel@tonic-gate #ifndef _IPMP_H
270Sstevel@tonic-gate #define	_IPMP_H
280Sstevel@tonic-gate 
290Sstevel@tonic-gate /*
300Sstevel@tonic-gate  * General IPMP-related definitions and functions.
310Sstevel@tonic-gate  *
320Sstevel@tonic-gate  * These interfaces may only be used within ON or after signing a contract
330Sstevel@tonic-gate  * with ON.  For documentation, refer to PSARC/2002/615.
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 #include <sys/sysevent/ipmp.h>
410Sstevel@tonic-gate 
420Sstevel@tonic-gate /*
430Sstevel@tonic-gate  * IPMP library error codes.
440Sstevel@tonic-gate  */
450Sstevel@tonic-gate enum {
460Sstevel@tonic-gate 	IPMP_SUCCESS,		/* operation succeeded */
470Sstevel@tonic-gate 	IPMP_FAILURE,		/* operation failed (check errno) */
480Sstevel@tonic-gate 	IPMP_EMINRED,		/* minimum failover redundancy not met */
490Sstevel@tonic-gate 	IPMP_EFBDISABLED,	/* failback disabled */
50*8485SPeter.Memishian@Sun.COM 	IPMP_EUNKADDR,		/* unknown IPMP data address */
510Sstevel@tonic-gate 	IPMP_EINVAL,		/* invalid argument */
520Sstevel@tonic-gate 	IPMP_ENOMEM,		/* out of memory */
530Sstevel@tonic-gate 	IPMP_ENOMPATHD,		/* cannot contact in.mpathd */
540Sstevel@tonic-gate 	IPMP_EUNKGROUP,		/* unknown IPMP group */
550Sstevel@tonic-gate 	IPMP_EUNKIF,		/* interface is not using IPMP */
560Sstevel@tonic-gate 	IPMP_EPROTO,		/* unable to communicate with in.mpathd */
57*8485SPeter.Memishian@Sun.COM 	IPMP_EHWADDRDUP,	/* interface has duplicate hardware address */
580Sstevel@tonic-gate 	IPMP_NERR		/* number of error codes */
590Sstevel@tonic-gate };
600Sstevel@tonic-gate 
610Sstevel@tonic-gate typedef struct ipmp_state *ipmp_handle_t;
620Sstevel@tonic-gate 
630Sstevel@tonic-gate extern int ipmp_open(ipmp_handle_t *);
640Sstevel@tonic-gate extern void ipmp_close(ipmp_handle_t);
650Sstevel@tonic-gate extern const char *ipmp_errmsg(int);
660Sstevel@tonic-gate 
670Sstevel@tonic-gate #ifdef __cplusplus
680Sstevel@tonic-gate }
690Sstevel@tonic-gate #endif
700Sstevel@tonic-gate 
710Sstevel@tonic-gate #endif /* _IPMP_H */
72