libdladm.h revision 801093905f15f0f1a50095474e8a3f0e5b0cb126
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
#ifndef _LIBDLADM_H
#define _LIBDLADM_H
#include <sys/dls_mgmt.h>
/*
* This file includes structures, macros and common routines shared by all
* data-link administration, and routines which do not directly administrate
* links. For example, dladm_status2str().
*/
#ifdef __cplusplus
extern "C" {
#endif
#define LINKID_STR_WIDTH 10
#define DLADM_STRSIZE 256
/*
* option flags taken by the libdladm functions
*
* - DLADM_OPT_ACTIVE:
* The function requests to bringup some configuration that only take
* effect on active system (not persistent).
*
* - DLADM_OPT_PERSIST:
* The function requests to persist some configuration.
*
* - DLADM_OPT_CREATE:
* Today, only used by dladm_set_secobj() - requests to create a secobj.
*
* - DLADM_OPT_FORCE:
* The function requests to execute a specific operation forcefully.
*
* - DLADM_OPT_PREFIX:
* The function requests to generate a link name using the specified prefix.
*
* - DLADM_OPT_VLAN:
* Signifies VLAN creation code path
*
* - DLADM_OPT_NOREFRESH:
* Do not refresh the daemon after setting parameter (used by STP mcheck).
*
* - DLADM_OPT_BOOT:
* Bypass check functions during boot (used by pool property since pools
* can come up after link properties are set)
*/
#define DLADM_OPT_ACTIVE 0x00000001
#define DLADM_OPT_PERSIST 0x00000002
#define DLADM_OPT_CREATE 0x00000004
#define DLADM_OPT_FORCE 0x00000008
#define DLADM_OPT_PREFIX 0x00000010
#define DLADM_OPT_ANCHOR 0x00000020
#define DLADM_OPT_VLAN 0x00000040
#define DLADM_OPT_NOREFRESH 0x00000080
#define DLADM_OPT_BOOT 0x00000100
#define DLADM_WALK_TERMINATE 0
#define DLADM_WALK_CONTINUE -1
#define DLADM_MAX_ARG_CNT 32
#define DLADM_MAX_ARG_VALS 64
typedef enum {
DLADM_STATUS_OK = 0,
typedef enum {
typedef int dladm_conf_t;
#define DLADM_INVALID_CONF 0
/* opaque dladm handle to libdladm functions */
struct dladm_handle;
typedef struct dladm_handle *dladm_handle_t;
extern void dladm_close(dladm_handle_t);
/*
* retrieve the dld file descriptor from handle, only libdladm and
* dlmgmtd are given access to the door file descriptor.
*/
extern int dladm_dld_fd(dladm_handle_t);
typedef struct dladm_arg_info {
const char *ai_name;
char *ai_val[DLADM_MAX_ARG_VALS];
typedef struct dladm_arg_list {
char *al_buf;
typedef enum {
DLADM_LOGTYPE_LINK = 1,
typedef struct dladm_usage {
char du_name[MAXLINKNAMELEN];
extern const char *dladm_status2str(dladm_status_t, char *);
extern dladm_status_t dladm_set_rootdir(const char *);
extern const char *dladm_class2str(datalink_class_t, char *);
extern const char *dladm_media2str(uint32_t, char *);
extern uint32_t dladm_str2media(const char *);
extern boolean_t dladm_valid_linkname(const char *);
extern const char *dladm_bw2str(int64_t, char *);
extern const char *dladm_pri2str(mac_priority_level_t, char *);
extern const char *dladm_protect2str(uint32_t, char *);
extern dladm_status_t dladm_str2ipv4addr(char *, void *);
extern const char *dladm_ipv4addr2str(void *, char *);
extern dladm_status_t dladm_str2ipv6addr(char *, void *);
extern const char *dladm_ipv6addr2str(void *, char *);
extern void dladm_free_props(dladm_arg_list_t *);
extern void dladm_free_attrs(dladm_arg_list_t *);
uint_t);
int, char *, char *, char *, char *, void *);
int, char *, char *, char *, void *);
int, char *, void *);
int, char *, char *, void *);
#ifdef __cplusplus
}
#endif
#endif /* _LIBDLADM_H */