dls_mgmt.h revision 4eaa471005973e11a6110b69fe990530b3b95a38
/*
* 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
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _DLS_MGMT_H
#define _DLS_MGMT_H
/*
* Data-Link Services Module
*/
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
DATALINK_CLASS_PHYS = 0x01,
DATALINK_CLASS_VLAN = 0x02,
DATALINK_CLASS_AGGR = 0x04,
DATALINK_CLASS_VNIC = 0x08,
DATALINK_CLASS_ETHERSTUB = 0x10,
DATALINK_CLASS_SIMNET = 0x20,
DATALINK_CLASS_BRIDGE = 0x40
#define DATALINK_CLASS_ALL (DATALINK_CLASS_PHYS | \
/*
* A combination of flags and media.
* flags is the higher 32 bits, and if it is 0x01, it indicates all media
* types can be accepted; otherwise, only the given media type (specified
* in the lower 32 bits) is accepted.
*/
typedef uint64_t datalink_media_t;
#define DATALINK_ANY_MEDIATYPE \
#define MAXLINKATTRLEN 32
#define MAXLINKATTRVALLEN 1024
/*
* Link attributes used by the kernel.
*/
/*
* The major number and instance number of the underlying physical device
* are kept as FPHYMAJ and FPHYINST (major, instance + 1).
*
* Set for physical links only.
*/
/*
* The devname of the physical link. For example, bge0, ce1. Set for physical
* links only.
*/
/*
* The door file for the dlmgmtd (data-link management) daemon.
*/
#define DLMGMT_DOOR "/etc/svc/volatile/dladm/dlmgmt_door"
/*
* Door upcall commands.
*/
#define DLMGMT_CMD_DLS_CREATE 1
#define DLMGMT_CMD_DLS_GETATTR 2
#define DLMGMT_CMD_DLS_DESTROY 3
#define DLMGMT_CMD_GETNAME 4
#define DLMGMT_CMD_GETLINKID 5
#define DLMGMT_CMD_GETNEXT 6
#define DLMGMT_CMD_DLS_UPDATE 7
#define DLMGMT_CMD_LINKPROP_INIT 8
#define DLMGMT_CMD_BASE 128
/*
* Indicate the link mapping is active or persistent
*/
#define DLMGMT_ACTIVE 0x01
#define DLMGMT_PERSIST 0x02
/* upcall argument */
typedef struct dlmgmt_door_arg {
typedef struct dlmgmt_upcall_arg_create {
int ld_cmd;
char ld_devname[MAXNAMELEN];
/*
* Note: ld_padding is necessary to keep the size of the structure the
* same on amd64 and i386. The same note applies to other ld_padding
* and lr_paddding fields in structures throughout this file.
*/
typedef struct dlmgmt_upcall_arg_destroy {
int ld_cmd;
int ld_padding;
typedef struct dlmgmt_upcall_arg_update {
int ld_cmd;
char ld_devname[MAXNAMELEN];
typedef struct dlmgmt_upcall_arg_getattr {
int ld_cmd;
char ld_attr[MAXLINKATTRLEN];
typedef struct dlmgmt_door_getname {
int ld_cmd;
typedef struct dlmgmt_door_getlinkid {
int ld_cmd;
char ld_link[MAXLINKNAMELEN];
typedef struct dlmgmt_door_getnext_s {
int ld_cmd;
typedef struct dlmgmt_door_linkprop_init {
int ld_cmd;
/* upcall return value */
typedef struct dlmgmt_retval_s {
typedef dlmgmt_retval_t dlmgmt_destroy_retval_t,
struct dlmgmt_linkid_retval_s {
};
typedef struct dlmgmt_linkid_retval_s dlmgmt_create_retval_t,
typedef struct dlmgmt_getname_retval_s {
char lr_link[MAXLINKNAMELEN];
typedef struct dlmgmt_getattr_retval_s {
char lr_attrval[MAXLINKATTRVALLEN];
#ifdef __cplusplus
}
#endif
#endif /* _DLS_MGMT_H */