1*3871Syz147064 /* 2*3871Syz147064 * CDDL HEADER START 3*3871Syz147064 * 4*3871Syz147064 * The contents of this file are subject to the terms of the 5*3871Syz147064 * Common Development and Distribution License (the "License"). 6*3871Syz147064 * You may not use this file except in compliance with the License. 7*3871Syz147064 * 8*3871Syz147064 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*3871Syz147064 * or http://www.opensolaris.org/os/licensing. 10*3871Syz147064 * See the License for the specific language governing permissions 11*3871Syz147064 * and limitations under the License. 12*3871Syz147064 * 13*3871Syz147064 * When distributing Covered Code, include this CDDL HEADER in each 14*3871Syz147064 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*3871Syz147064 * If applicable, add the following below this CDDL HEADER, with the 16*3871Syz147064 * fields enclosed by brackets "[]" replaced with your own identifying 17*3871Syz147064 * information: Portions Copyright [yyyy] [name of copyright owner] 18*3871Syz147064 * 19*3871Syz147064 * CDDL HEADER END 20*3871Syz147064 */ 21*3871Syz147064 /* 22*3871Syz147064 * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 23*3871Syz147064 * Use is subject to license terms. 24*3871Syz147064 */ 25*3871Syz147064 26*3871Syz147064 #ifndef _LIBDLLINK_H 27*3871Syz147064 #define _LIBDLLINK_H 28*3871Syz147064 29*3871Syz147064 #pragma ident "%Z%%M% %I% %E% SMI" 30*3871Syz147064 31*3871Syz147064 /* 32*3871Syz147064 * This file includes strcutures, macros and routines used by general 33*3871Syz147064 * link administration, which applies not limited to one specific 34*3871Syz147064 * type of link. 35*3871Syz147064 */ 36*3871Syz147064 37*3871Syz147064 #include <sys/types.h> 38*3871Syz147064 #include <sys/param.h> 39*3871Syz147064 #include <sys/mac.h> 40*3871Syz147064 #include <libdladm.h> 41*3871Syz147064 42*3871Syz147064 #ifdef __cplusplus 43*3871Syz147064 extern "C" { 44*3871Syz147064 #endif 45*3871Syz147064 46*3871Syz147064 typedef struct dladm_attr { 47*3871Syz147064 char da_dev[MAXNAMELEN]; 48*3871Syz147064 uint_t da_max_sdu; 49*3871Syz147064 uint16_t da_vid; 50*3871Syz147064 } dladm_attr_t; 51*3871Syz147064 52*3871Syz147064 /* 53*3871Syz147064 * Maximum size of secobj value. Note that it should not be greater than 54*3871Syz147064 * DLD_SECOBJ_VAL_MAX. 55*3871Syz147064 */ 56*3871Syz147064 #define DLADM_SECOBJ_VAL_MAX 256 57*3871Syz147064 58*3871Syz147064 /* 59*3871Syz147064 * Maximum size of secobj name. Note that it should not be greater than 60*3871Syz147064 * DLD_SECOBJ_NAME_MAX. 61*3871Syz147064 */ 62*3871Syz147064 #define DLADM_SECOBJ_NAME_MAX 32 63*3871Syz147064 64*3871Syz147064 #define DLADM_PROP_VAL_MAX 25 65*3871Syz147064 66*3871Syz147064 #define DLADM_SECOBJ_CLASS_WEP 0 67*3871Syz147064 typedef int dladm_secobj_class_t; 68*3871Syz147064 69*3871Syz147064 typedef void (dladm_walkcb_t)(void *, const char *); 70*3871Syz147064 71*3871Syz147064 extern int dladm_walk(dladm_walkcb_t *, void *); 72*3871Syz147064 extern int dladm_mac_walk(void (*fn)(void *, const char *), void *); 73*3871Syz147064 extern int dladm_info(const char *, dladm_attr_t *); 74*3871Syz147064 extern int dladm_hold_link(const char *, zoneid_t, boolean_t); 75*3871Syz147064 extern int dladm_rele_link(const char *, zoneid_t, boolean_t); 76*3871Syz147064 77*3871Syz147064 extern dladm_status_t dladm_set_prop(const char *, const char *, 78*3871Syz147064 char **, uint_t, uint_t, char **); 79*3871Syz147064 extern dladm_status_t dladm_get_prop(const char *, dladm_prop_type_t, 80*3871Syz147064 const char *, char **, uint_t *); 81*3871Syz147064 extern dladm_status_t dladm_walk_prop(const char *, void *, 82*3871Syz147064 boolean_t (*)(void *, const char *)); 83*3871Syz147064 extern dladm_status_t dladm_set_secobj(const char *, dladm_secobj_class_t, 84*3871Syz147064 uint8_t *, uint_t, uint_t); 85*3871Syz147064 extern dladm_status_t dladm_get_secobj(const char *, dladm_secobj_class_t *, 86*3871Syz147064 uint8_t *, uint_t *, uint_t); 87*3871Syz147064 extern dladm_status_t dladm_unset_secobj(const char *, uint_t); 88*3871Syz147064 extern dladm_status_t dladm_walk_secobj(void *, 89*3871Syz147064 boolean_t (*)(void *, const char *), uint_t); 90*3871Syz147064 91*3871Syz147064 extern const char *dladm_linkstate2str(link_state_t, char *); 92*3871Syz147064 extern const char *dladm_linkduplex2str(link_duplex_t, char *); 93*3871Syz147064 extern const char *dladm_secobjclass2str(dladm_secobj_class_t, char *); 94*3871Syz147064 extern dladm_status_t dladm_str2secobjclass(const char *, 95*3871Syz147064 dladm_secobj_class_t *); 96*3871Syz147064 97*3871Syz147064 extern dladm_status_t dladm_init_linkprop(void); 98*3871Syz147064 extern dladm_status_t dladm_init_secobj(void); 99*3871Syz147064 100*3871Syz147064 #ifdef __cplusplus 101*3871Syz147064 } 102*3871Syz147064 #endif 103*3871Syz147064 104*3871Syz147064 #endif /* _LIBDLLINK_H */ 105