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 (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  23  */
  24 
  25 #ifndef _LIBDLADM_H
  26 #define _LIBDLADM_H
  27 
  28 #include <sys/dls_mgmt.h>
  29 #include <sys/dld.h>
  30 #include <sys/dlpi.h>
  31 #include <libnvpair.h>
  32 
  33 /*
  34  * This file includes structures, macros and common routines shared by all
  35  * data-link administration, and routines which do not directly administrate
  36  * links. For example, dladm_status2str().
  37  */
  38 
  39 #ifdef  __cplusplus
  40 extern "C" {
  41 #endif
  42 
 
  54  *    The function requests to persist some configuration.
  55  *
  56  *  - DLADM_OPT_CREATE:
  57  *    Today, only used by dladm_set_secobj() - requests to create a secobj.
  58  *
  59  *  - DLADM_OPT_FORCE:
  60  *    The function requests to execute a specific operation forcefully.
  61  *
  62  *  - DLADM_OPT_PREFIX:
  63  *    The function requests to generate a link name using the specified prefix.
  64  *
  65  *  - DLADM_OPT_VLAN:
  66  *    Signifies VLAN creation code path
  67  *
  68  *  - DLADM_OPT_NOREFRESH:
  69  *    Do not refresh the daemon after setting parameter (used by STP mcheck).
  70  *
  71  *  - DLADM_OPT_BOOT:
  72  *    Bypass check functions during boot (used by pool property since pools
  73  *    can come up after link properties are set)
  74  */
  75 #define DLADM_OPT_ACTIVE        0x00000001
  76 #define DLADM_OPT_PERSIST       0x00000002
  77 #define DLADM_OPT_CREATE        0x00000004
  78 #define DLADM_OPT_FORCE         0x00000008
  79 #define DLADM_OPT_PREFIX        0x00000010
  80 #define DLADM_OPT_ANCHOR        0x00000020
  81 #define DLADM_OPT_VLAN          0x00000040
  82 #define DLADM_OPT_NOREFRESH     0x00000080
  83 #define DLADM_OPT_BOOT          0x00000100
  84 
  85 #define DLADM_WALK_TERMINATE    0
  86 #define DLADM_WALK_CONTINUE     -1
  87 
  88 #define DLADM_MAX_ARG_CNT       32
  89 #define DLADM_MAX_ARG_VALS      64
  90 
  91 typedef enum {
  92         DLADM_STATUS_OK = 0,
  93         DLADM_STATUS_BADARG,
  94         DLADM_STATUS_FAILED,
  95         DLADM_STATUS_TOOSMALL,
  96         DLADM_STATUS_NOTSUP,
  97         DLADM_STATUS_NOTFOUND,
  98         DLADM_STATUS_BADVAL,
  99         DLADM_STATUS_NOMEM,
 100         DLADM_STATUS_EXIST,
 101         DLADM_STATUS_LINKINVAL,
 102         DLADM_STATUS_PROPRDONLY,
 103         DLADM_STATUS_BADVALCNT,
 
 | 
 
 
   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 (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  23  * Copyright (c) 2011, Joyent, Inc. All rights reserved.
  24  */
  25 
  26 #ifndef _LIBDLADM_H
  27 #define _LIBDLADM_H
  28 
  29 #include <sys/dls_mgmt.h>
  30 #include <sys/dld.h>
  31 #include <sys/dlpi.h>
  32 #include <libnvpair.h>
  33 
  34 /*
  35  * This file includes structures, macros and common routines shared by all
  36  * data-link administration, and routines which do not directly administrate
  37  * links. For example, dladm_status2str().
  38  */
  39 
  40 #ifdef  __cplusplus
  41 extern "C" {
  42 #endif
  43 
 
  55  *    The function requests to persist some configuration.
  56  *
  57  *  - DLADM_OPT_CREATE:
  58  *    Today, only used by dladm_set_secobj() - requests to create a secobj.
  59  *
  60  *  - DLADM_OPT_FORCE:
  61  *    The function requests to execute a specific operation forcefully.
  62  *
  63  *  - DLADM_OPT_PREFIX:
  64  *    The function requests to generate a link name using the specified prefix.
  65  *
  66  *  - DLADM_OPT_VLAN:
  67  *    Signifies VLAN creation code path
  68  *
  69  *  - DLADM_OPT_NOREFRESH:
  70  *    Do not refresh the daemon after setting parameter (used by STP mcheck).
  71  *
  72  *  - DLADM_OPT_BOOT:
  73  *    Bypass check functions during boot (used by pool property since pools
  74  *    can come up after link properties are set)
  75  *
  76  *  - DLADM_OPT_TRANSIENT:
  77  *    Indicates that the link assigned to a zone is transient and will be
  78  *    removed when the zone shuts down.
  79  */
  80 #define DLADM_OPT_ACTIVE        0x00000001
  81 #define DLADM_OPT_PERSIST       0x00000002
  82 #define DLADM_OPT_CREATE        0x00000004
  83 #define DLADM_OPT_FORCE         0x00000008
  84 #define DLADM_OPT_PREFIX        0x00000010
  85 #define DLADM_OPT_ANCHOR        0x00000020
  86 #define DLADM_OPT_VLAN          0x00000040
  87 #define DLADM_OPT_NOREFRESH     0x00000080
  88 #define DLADM_OPT_BOOT          0x00000100
  89 #define DLADM_OPT_TRANSIENT     0x00000200
  90 
  91 #define DLADM_WALK_TERMINATE    0
  92 #define DLADM_WALK_CONTINUE     -1
  93 
  94 #define DLADM_MAX_ARG_CNT       32
  95 #define DLADM_MAX_ARG_VALS      64
  96 
  97 typedef enum {
  98         DLADM_STATUS_OK = 0,
  99         DLADM_STATUS_BADARG,
 100         DLADM_STATUS_FAILED,
 101         DLADM_STATUS_TOOSMALL,
 102         DLADM_STATUS_NOTSUP,
 103         DLADM_STATUS_NOTFOUND,
 104         DLADM_STATUS_BADVAL,
 105         DLADM_STATUS_NOMEM,
 106         DLADM_STATUS_EXIST,
 107         DLADM_STATUS_LINKINVAL,
 108         DLADM_STATUS_PROPRDONLY,
 109         DLADM_STATUS_BADVALCNT,
 
 |