xref: /illumos-gate/usr/src/lib/libdladm/common/libdladm.h (revision 32d691569ca22c51f869d1b22efb734a453a8c23)
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 (the "License").
6  * You may not use this file except in compliance with the License.
7  *
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.
12  *
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]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef _LIBDLADM_H
27 #define	_LIBDLADM_H
28 
29 #pragma ident	"%Z%%M%	%I%	%E% SMI"
30 
31 /*
32  * This file includes structures, macros and common routines shared by all
33  * data-link administration, and routines which do not directly administrate
34  * links. For example, dladm_status2str().
35  */
36 
37 #ifdef	__cplusplus
38 extern "C" {
39 #endif
40 
41 #define	DLADM_STRSIZE		256
42 #define	DLADM_OPT_TEMP		0x00000001
43 #define	DLADM_OPT_CREATE	0x00000002
44 #define	DLADM_OPT_PERSIST	0x00000004
45 
46 typedef enum {
47 	DLADM_STATUS_OK = 0,
48 	DLADM_STATUS_BADARG,
49 	DLADM_STATUS_FAILED,
50 	DLADM_STATUS_TOOSMALL,
51 	DLADM_STATUS_NOTSUP,
52 	DLADM_STATUS_NOTFOUND,
53 	DLADM_STATUS_BADVAL,
54 	DLADM_STATUS_NOMEM,
55 	DLADM_STATUS_EXIST,
56 	DLADM_STATUS_LINKINVAL,
57 	DLADM_STATUS_PROPRDONLY,
58 	DLADM_STATUS_BADVALCNT,
59 	DLADM_STATUS_DBNOTFOUND,
60 	DLADM_STATUS_DENIED,
61 	DLADM_STATUS_IOERR,
62 	DLADM_STATUS_TEMPONLY,
63 	DLADM_STATUS_TIMEDOUT,
64 	DLADM_STATUS_ISCONN,
65 	DLADM_STATUS_NOTCONN,
66 	DLADM_STATUS_REPOSITORYINVAL,
67 	DLADM_STATUS_MACADDRINVAL,
68 	DLADM_STATUS_KEYINVAL,
69 	DLADM_STATUS_INVALIDID,
70 	DLADM_STATUS_INVALIDMACADDRLEN,
71 	DLADM_STATUS_INVALIDMACADDRTYPE,
72 	DLADM_STATUS_AUTOIDNOTEMP,
73 	DLADM_STATUS_AUTOIDNOAVAILABLEID,
74 	DLADM_STATUS_BUSY
75 } dladm_status_t;
76 
77 typedef enum {
78 	DLADM_PROP_VAL_CURRENT = 1,
79 	DLADM_PROP_VAL_DEFAULT,
80 	DLADM_PROP_VAL_MODIFIABLE,
81 	DLADM_PROP_VAL_PERSISTENT
82 } dladm_prop_type_t;
83 
84 extern const char	*dladm_status2str(dladm_status_t, char *);
85 extern dladm_status_t	dladm_set_rootdir(const char *);
86 
87 #ifdef	__cplusplus
88 }
89 #endif
90 
91 #endif	/* _LIBDLADM_H */
92