/*
* 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
*/
/*
*/
/*
* Functions to maintain a table of datalink configuration information.
*/
#ifndef _DLMGMT_IMPL_H
#define _DLMGMT_IMPL_H
#ifdef __cplusplus
extern "C" {
#endif
#include <door.h>
#include <libdllink.h>
/*
* datalink attribute structure
*/
typedef struct dlmgmt_linkattr_s {
void *lp_val;
/*
* datalink structure
*/
typedef struct dlmgmt_link_s {
/*
* datalink configuration request structure
*/
typedef struct dlmgmt_dlconf_s {
int ld_id;
extern const char *progname;
extern char cachefile[];
extern dladm_handle_t dld_handle;
extern datalink_id_t dlmgmt_nextlinkid;
extern avl_tree_t dlmgmt_name_avl;
extern avl_tree_t dlmgmt_id_avl;
extern avl_tree_t dlmgmt_loan_avl;
extern avl_tree_t dlmgmt_dlconf_avl;
size_t);
void linkattr_unset(dlmgmt_linkattr_t **, const char *);
int linkattr_set(dlmgmt_linkattr_t **, const char *, void *,
int linkattr_get(dlmgmt_linkattr_t **, const char *, void **,
size_t *, dladm_datatype_t *);
void linkattr_destroy(dlmgmt_link_t *);
void link_destroy(dlmgmt_link_t *);
int link_activate(dlmgmt_link_t *);
int dlmgmt_create_common(const char *, datalink_class_t,
int dlmgmt_getattr_common(dlmgmt_linkattr_t **, const char *,
void dlmgmt_advance(dlmgmt_link_t *);
void dlmgmt_table_lock(boolean_t);
void dlmgmt_table_unlock();
void dlconf_destroy(dlmgmt_dlconf_t *);
void dlmgmt_advance_dlconfid(dlmgmt_dlconf_t *);
void dlmgmt_dlconf_table_unlock(void);
void dlmgmt_linktable_init(void);
void dlmgmt_linktable_fini(void);
int dlmgmt_zone_init(zoneid_t);
int dlmgmt_elevate_privileges(void);
int dlmgmt_drop_privileges();
void dlmgmt_log(int, const char *, ...);
int dlmgmt_db_init(zoneid_t);
void dlmgmt_db_fini(zoneid_t);
#ifdef __cplusplus
}
#endif
#endif /* _DLMGMT_IMPL_H */