13871Syz147064 /*
23871Syz147064  * CDDL HEADER START
33871Syz147064  *
43871Syz147064  * The contents of this file are subject to the terms of the
53871Syz147064  * Common Development and Distribution License (the "License").
63871Syz147064  * You may not use this file except in compliance with the License.
73871Syz147064  *
83871Syz147064  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
93871Syz147064  * or http://www.opensolaris.org/os/licensing.
103871Syz147064  * See the License for the specific language governing permissions
113871Syz147064  * and limitations under the License.
123871Syz147064  *
133871Syz147064  * When distributing Covered Code, include this CDDL HEADER in each
143871Syz147064  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
153871Syz147064  * If applicable, add the following below this CDDL HEADER, with the
163871Syz147064  * fields enclosed by brackets "[]" replaced with your own identifying
173871Syz147064  * information: Portions Copyright [yyyy] [name of copyright owner]
183871Syz147064  *
193871Syz147064  * CDDL HEADER END
203871Syz147064  */
213871Syz147064 /*
223871Syz147064  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
233871Syz147064  * Use is subject to license terms.
243871Syz147064  */
253871Syz147064 
263871Syz147064 #ifndef _LIBDLLINK_H
273871Syz147064 #define	_LIBDLLINK_H
283871Syz147064 
293871Syz147064 #pragma ident	"%Z%%M%	%I%	%E% SMI"
303871Syz147064 
313871Syz147064 /*
323871Syz147064  * This file includes strcutures, macros and routines used by general
333871Syz147064  * link administration, which applies not limited to one specific
343871Syz147064  * type of link.
353871Syz147064  */
363871Syz147064 
373871Syz147064 #include <sys/types.h>
383871Syz147064 #include <sys/param.h>
393871Syz147064 #include <sys/mac.h>
403871Syz147064 #include <libdladm.h>
413871Syz147064 
423871Syz147064 #ifdef	__cplusplus
433871Syz147064 extern "C" {
443871Syz147064 #endif
453871Syz147064 
463871Syz147064 typedef struct dladm_attr {
473871Syz147064 	char		da_dev[MAXNAMELEN];
483871Syz147064 	uint_t		da_max_sdu;
493871Syz147064 	uint16_t	da_vid;
503871Syz147064 } dladm_attr_t;
513871Syz147064 
523871Syz147064 /*
533871Syz147064  * Maximum size of secobj value. Note that it should not be greater than
543871Syz147064  * DLD_SECOBJ_VAL_MAX.
553871Syz147064  */
563871Syz147064 #define	DLADM_SECOBJ_VAL_MAX	256
573871Syz147064 
583871Syz147064 /*
593871Syz147064  * Maximum size of secobj name. Note that it should not be greater than
603871Syz147064  * DLD_SECOBJ_NAME_MAX.
613871Syz147064  */
623871Syz147064 #define	DLADM_SECOBJ_NAME_MAX	32
633871Syz147064 
643871Syz147064 #define	DLADM_PROP_VAL_MAX	25
653871Syz147064 
663871Syz147064 #define		DLADM_SECOBJ_CLASS_WEP	0
67*4126Szf162725 #define		DLADM_SECOBJ_CLASS_WPA	1
683871Syz147064 typedef int	dladm_secobj_class_t;
693871Syz147064 
703871Syz147064 typedef void (dladm_walkcb_t)(void *, const char *);
713871Syz147064 
723871Syz147064 extern int	dladm_walk(dladm_walkcb_t *, void *);
733871Syz147064 extern int	dladm_mac_walk(void (*fn)(void *, const char *), void *);
743871Syz147064 extern int	dladm_info(const char *, dladm_attr_t *);
753871Syz147064 extern int	dladm_hold_link(const char *, zoneid_t, boolean_t);
763871Syz147064 extern int	dladm_rele_link(const char *, zoneid_t, boolean_t);
773871Syz147064 
783871Syz147064 extern dladm_status_t	dladm_set_prop(const char *, const char *,
793871Syz147064 			    char **, uint_t, uint_t, char **);
803871Syz147064 extern dladm_status_t	dladm_get_prop(const char *, dladm_prop_type_t,
813871Syz147064 			    const char *, char **, uint_t *);
823871Syz147064 extern dladm_status_t	dladm_walk_prop(const char *, void *,
833871Syz147064 			    boolean_t (*)(void *, const char *));
843871Syz147064 extern dladm_status_t	dladm_set_secobj(const char *, dladm_secobj_class_t,
853871Syz147064 			    uint8_t *, uint_t, uint_t);
863871Syz147064 extern dladm_status_t	dladm_get_secobj(const char *, dladm_secobj_class_t *,
873871Syz147064 			    uint8_t *, uint_t *, uint_t);
883871Syz147064 extern dladm_status_t	dladm_unset_secobj(const char *, uint_t);
893871Syz147064 extern dladm_status_t	dladm_walk_secobj(void *,
903871Syz147064 			    boolean_t (*)(void *, const char *), uint_t);
913871Syz147064 
923871Syz147064 extern const char	*dladm_linkstate2str(link_state_t, char *);
933871Syz147064 extern const char	*dladm_linkduplex2str(link_duplex_t, char *);
943871Syz147064 extern const char	*dladm_secobjclass2str(dladm_secobj_class_t, char *);
953871Syz147064 extern dladm_status_t	dladm_str2secobjclass(const char *,
963871Syz147064 			    dladm_secobj_class_t *);
973871Syz147064 
983871Syz147064 extern dladm_status_t	dladm_init_linkprop(void);
993871Syz147064 extern dladm_status_t	dladm_init_secobj(void);
1003871Syz147064 
1013871Syz147064 #ifdef	__cplusplus
1023871Syz147064 }
1033871Syz147064 #endif
1043871Syz147064 
1053871Syz147064 #endif	/* _LIBDLLINK_H */
106