13147Sxc151355 /* 23147Sxc151355 * CDDL HEADER START 33147Sxc151355 * 43147Sxc151355 * The contents of this file are subject to the terms of the 53147Sxc151355 * Common Development and Distribution License (the "License"). 63147Sxc151355 * You may not use this file except in compliance with the License. 73147Sxc151355 * 83147Sxc151355 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 93147Sxc151355 * or http://www.opensolaris.org/os/licensing. 103147Sxc151355 * See the License for the specific language governing permissions 113147Sxc151355 * and limitations under the License. 123147Sxc151355 * 133147Sxc151355 * When distributing Covered Code, include this CDDL HEADER in each 143147Sxc151355 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 153147Sxc151355 * If applicable, add the following below this CDDL HEADER, with the 163147Sxc151355 * fields enclosed by brackets "[]" replaced with your own identifying 173147Sxc151355 * information: Portions Copyright [yyyy] [name of copyright owner] 183147Sxc151355 * 193147Sxc151355 * CDDL HEADER END 203147Sxc151355 */ 213147Sxc151355 /* 22*5895Syz147064 * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 233147Sxc151355 * Use is subject to license terms. 243147Sxc151355 */ 253147Sxc151355 263147Sxc151355 #ifndef _LIBDLADM_IMPL_H 273147Sxc151355 #define _LIBDLADM_IMPL_H 283147Sxc151355 293147Sxc151355 #pragma ident "%Z%%M% %I% %E% SMI" 303147Sxc151355 313147Sxc151355 #include <libdladm.h> 323147Sxc151355 #include <stdio.h> 333147Sxc151355 343147Sxc151355 #ifdef __cplusplus 353147Sxc151355 extern "C" { 363147Sxc151355 #endif 373147Sxc151355 383147Sxc151355 #define MAXLINELEN 1024 393147Sxc151355 #define BUFLEN(lim, ptr) (((lim) > (ptr)) ? ((lim) - (ptr)) : 0) 403147Sxc151355 41*5895Syz147064 typedef struct val_desc { 42*5895Syz147064 char *vd_name; 43*5895Syz147064 uintptr_t vd_val; 44*5895Syz147064 } val_desc_t; 45*5895Syz147064 46*5895Syz147064 #define VALCNT(vals) (sizeof ((vals)) / sizeof (val_desc_t)) 47*5895Syz147064 483147Sxc151355 extern int i_dladm_ioctl(int, int, void *, int); 493147Sxc151355 extern dladm_status_t dladm_errno2status(int); 50*5895Syz147064 extern dladm_status_t i_dladm_rw_db(const char *, mode_t, 513147Sxc151355 dladm_status_t (*)(void *, FILE *, FILE *), 523147Sxc151355 void *, boolean_t); 533147Sxc151355 54*5895Syz147064 /* 55*5895Syz147064 * Link attributes persisted by dlmgmtd. 56*5895Syz147064 */ 57*5895Syz147064 /* 58*5895Syz147064 * Set for VLANs only 59*5895Syz147064 */ 60*5895Syz147064 #define FVLANID "vid" /* uint64_t */ 61*5895Syz147064 #define FLINKOVER "linkover" /* uint64_t */ 62*5895Syz147064 63*5895Syz147064 /* 64*5895Syz147064 * Set for AGGRs only 65*5895Syz147064 */ 66*5895Syz147064 #define FKEY "key" /* uint64_t */ 67*5895Syz147064 #define FNPORTS "nports" /* uint64_t */ 68*5895Syz147064 #define FPORTS "portnames" /* string */ 69*5895Syz147064 #define FPOLICY "policy" /* uint64_t */ 70*5895Syz147064 #define FFIXMACADDR "fix_macaddr" /* boolean_t */ 71*5895Syz147064 #define FMACADDR "macaddr" /* string */ 72*5895Syz147064 #define FFORCE "force" /* boolean_t */ 73*5895Syz147064 #define FLACPMODE "lacp_mode" /* uint64_t */ 74*5895Syz147064 #define FLACPTIMER "lacp_timer" /* uint64_t */ 75*5895Syz147064 763147Sxc151355 #ifdef __cplusplus 773147Sxc151355 } 783147Sxc151355 #endif 793147Sxc151355 803147Sxc151355 #endif /* _LIBDLADM_IMPL_H */ 81