xref: /titanic_50/usr/src/lib/libdladm/common/libdladm.h (revision f595a68a3b8953a12aa778c2abd7642df8da8c3a)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5ba2e4443Sseb  * Common Development and Distribution License (the "License").
6ba2e4443Sseb  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
22f4b3ec61Sdh155122  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate  */
257c478bd9Sstevel@tonic-gate 
267c478bd9Sstevel@tonic-gate #ifndef _LIBDLADM_H
277c478bd9Sstevel@tonic-gate #define	_LIBDLADM_H
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
307c478bd9Sstevel@tonic-gate 
31*f595a68aSyz147064 /*
32*f595a68aSyz147064  * This file includes structures, macros and common routines shared by all
33*f595a68aSyz147064  * data-link administration, and routines which do not directly administrate
34*f595a68aSyz147064  * links. For example, dladm_status2str().
35*f595a68aSyz147064  */
367c478bd9Sstevel@tonic-gate 
377c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
387c478bd9Sstevel@tonic-gate extern "C" {
397c478bd9Sstevel@tonic-gate #endif
407c478bd9Sstevel@tonic-gate 
410ba2cbe9Sxc151355 #define	DLADM_STRSIZE		256
420ba2cbe9Sxc151355 #define	DLADM_OPT_TEMP		0x00000001
430ba2cbe9Sxc151355 #define	DLADM_OPT_CREATE	0x00000002
440ba2cbe9Sxc151355 #define	DLADM_OPT_PERSIST	0x00000004
450ba2cbe9Sxc151355 
460ba2cbe9Sxc151355 typedef enum {
470ba2cbe9Sxc151355 	DLADM_STATUS_OK = 0,
480ba2cbe9Sxc151355 	DLADM_STATUS_BADARG,
490ba2cbe9Sxc151355 	DLADM_STATUS_FAILED,
500ba2cbe9Sxc151355 	DLADM_STATUS_TOOSMALL,
510ba2cbe9Sxc151355 	DLADM_STATUS_NOTSUP,
520ba2cbe9Sxc151355 	DLADM_STATUS_NOTFOUND,
530ba2cbe9Sxc151355 	DLADM_STATUS_BADVAL,
540ba2cbe9Sxc151355 	DLADM_STATUS_NOMEM,
550ba2cbe9Sxc151355 	DLADM_STATUS_EXIST,
560ba2cbe9Sxc151355 	DLADM_STATUS_LINKINVAL,
570ba2cbe9Sxc151355 	DLADM_STATUS_PROPRDONLY,
580ba2cbe9Sxc151355 	DLADM_STATUS_BADVALCNT,
590ba2cbe9Sxc151355 	DLADM_STATUS_DBNOTFOUND,
600ba2cbe9Sxc151355 	DLADM_STATUS_DENIED,
61f4b3ec61Sdh155122 	DLADM_STATUS_IOERR,
62*f595a68aSyz147064 	DLADM_STATUS_TEMPONLY,
63*f595a68aSyz147064 	DLADM_STATUS_TIMEDOUT,
64*f595a68aSyz147064 	DLADM_STATUS_ISCONN,
65*f595a68aSyz147064 	DLADM_STATUS_NOTCONN,
66*f595a68aSyz147064 	DLADM_STATUS_REPOSITORYINVAL,
67*f595a68aSyz147064 	DLADM_STATUS_MACADDRINVAL,
68*f595a68aSyz147064 	DLADM_STATUS_KEYINVAL
690ba2cbe9Sxc151355 } dladm_status_t;
700ba2cbe9Sxc151355 
710ba2cbe9Sxc151355 typedef enum {
720ba2cbe9Sxc151355 	DLADM_PROP_VAL_CURRENT = 1,
730ba2cbe9Sxc151355 	DLADM_PROP_VAL_DEFAULT,
740ba2cbe9Sxc151355 	DLADM_PROP_VAL_MODIFIABLE,
750ba2cbe9Sxc151355 	DLADM_PROP_VAL_PERSISTENT
760ba2cbe9Sxc151355 } dladm_prop_type_t;
770ba2cbe9Sxc151355 
780ba2cbe9Sxc151355 extern const char	*dladm_status2str(dladm_status_t, char *);
79*f595a68aSyz147064 extern dladm_status_t	dladm_set_rootdir(const char *);
800ba2cbe9Sxc151355 
817c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
827c478bd9Sstevel@tonic-gate }
837c478bd9Sstevel@tonic-gate #endif
847c478bd9Sstevel@tonic-gate 
857c478bd9Sstevel@tonic-gate #endif	/* _LIBDLADM_H */
86