2N/A/*
2N/A * CDDL HEADER START
2N/A *
2N/A * The contents of this file are subject to the terms of the
2N/A * Common Development and Distribution License (the "License").
2N/A * You may not use this file except in compliance with the License.
2N/A *
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * or http://www.opensolaris.org/os/licensing.
2N/A * See the License for the specific language governing permissions
2N/A * and limitations under the License.
2N/A *
2N/A * When distributing Covered Code, include this CDDL HEADER in each
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A * If applicable, add the following below this CDDL HEADER, with the
2N/A * fields enclosed by brackets "[]" replaced with your own identifying
2N/A * information: Portions Copyright [yyyy] [name of copyright owner]
2N/A *
2N/A * CDDL HEADER END
2N/A */
2N/A/*
2N/A * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
2N/A */
2N/A
2N/A#ifndef _LIBDLFLOW_IMPL_H
2N/A#define _LIBDLFLOW_IMPL_H
2N/A
2N/A#include <sys/types.h>
2N/A#include <sys/param.h>
2N/A#include <sys/mac.h>
2N/A#include <libdladm.h>
2N/A
2N/A#ifdef __cplusplus
2N/Aextern "C" {
2N/A#endif
2N/A
2N/Astruct fprop_desc;
2N/Astruct fattr_desc;
2N/A
2N/Atypedef dladm_status_t fpd_getf_t(dladm_handle_t, const char *, char **,
2N/A uint_t *);
2N/Atypedef dladm_status_t fpd_setf_t(dladm_handle_t, const char *, val_desc_t *,
2N/A uint_t);
2N/Atypedef dladm_status_t fpd_checkf_t(struct fprop_desc *, char **, uint_t,
2N/A val_desc_t **);
2N/A
2N/Atypedef struct fprop_desc {
2N/A char *pd_name;
2N/A val_desc_t pd_defval;
2N/A val_desc_t *pd_modval;
2N/A uint_t pd_nmodval;
2N/A boolean_t pd_temponly;
2N/A fpd_setf_t *pd_set;
2N/A fpd_getf_t *pd_getmod;
2N/A fpd_getf_t *pd_get;
2N/A fpd_checkf_t *pd_check;
2N/A} fprop_desc_t;
2N/A
2N/Atypedef struct prop_table {
2N/A fprop_desc_t *pt_table;
2N/A uint_t pt_size;
2N/A} prop_table_t;
2N/A
2N/Atypedef dladm_status_t fad_checkf_t(char *, flow_desc_t *);
2N/A
2N/Atypedef struct fattr_desc {
2N/A const char *ad_name;
2N/A fad_checkf_t *ad_check;
2N/A} fattr_desc_t;
2N/A
2N/Aextern dladm_status_t i_dladm_get_prop_temp(dladm_handle_t, const char *,
2N/A dladm_prop_type_t, const char *, char **, uint_t *,
2N/A prop_table_t *);
2N/Aextern dladm_status_t i_dladm_set_prop_temp(dladm_handle_t, const char *,
2N/A const char *, char **, uint_t, uint_t, char **,
2N/A prop_table_t *);
2N/Aextern boolean_t i_dladm_is_prop_temponly(const char *prop_name,
2N/A char **, prop_table_t *);
2N/Aextern dladm_status_t i_dladm_flow_add(dladm_handle_t, char *, datalink_id_t,
2N/A flow_desc_t *, mac_resource_props_t *);
2N/Aextern dladm_status_t i_dladm_flow_remove(dladm_handle_t, char *, zoneid_t);
2N/A
2N/A/*
2N/A * Data structures used for implementing persistent properties
2N/A */
2N/Atypedef struct prop_val {
2N/A const char *lv_name;
2N/A struct prop_val *lv_nextval;
2N/A} prop_val_t;
2N/A
2N/Atypedef struct prop_db_info {
2N/A const char *li_name;
2N/A struct prop_db_info *li_nextprop;
2N/A struct prop_val *li_val;
2N/A} prop_db_info_t;
2N/A
2N/Atypedef struct prop_db_state prop_db_state_t;
2N/A
2N/Atypedef boolean_t (*prop_db_op_t)(dladm_handle_t, prop_db_state_t *,
2N/A char *, prop_db_info_t *, dladm_status_t *);
2N/A
2N/Atypedef dladm_status_t (*prop_db_initop_t)(dladm_handle_t, const char *,
2N/A const char *, char **, uint_t, uint_t, char **);
2N/A
2N/Astruct prop_db_state {
2N/A prop_db_op_t ls_op;
2N/A const char *ls_name;
2N/A const char *ls_propname;
2N/A char **ls_propval;
2N/A uint_t *ls_valcntp;
2N/A prop_db_initop_t ls_initop;
2N/A};
2N/A
2N/Aextern boolean_t process_prop_set(dladm_handle_t, prop_db_state_t *lsp,
2N/A char *buf, prop_db_info_t *listp,
2N/A dladm_status_t *statusp);
2N/Aextern boolean_t process_prop_get(dladm_handle_t, prop_db_state_t *lsp,
2N/A char *buf, prop_db_info_t *listp,
2N/A dladm_status_t *statusp);
2N/Aextern boolean_t process_prop_init(dladm_handle_t, prop_db_state_t *lsp,
2N/A char *buf, prop_db_info_t *listp,
2N/A dladm_status_t *statusp);
2N/Aextern dladm_status_t process_prop_db(dladm_handle_t, void *arg, FILE *fp,
2N/A FILE *nfp);
2N/A
2N/Aextern dladm_status_t i_dladm_init_flowprop_db(dladm_handle_t);
2N/Aextern dladm_status_t i_dladm_flow_check_restriction(datalink_id_t,
2N/A flow_desc_t *, mac_resource_props_t *, boolean_t);
2N/A
2N/Aextern dladm_status_t dladm_flow_attrlist_extract(dladm_arg_list_t *,
2N/A flow_desc_t *);
2N/Aextern zoneid_t dladm_extra_names(const char *, char *, char *);
2N/A
2N/A#ifdef __cplusplus
2N/A}
2N/A#endif
2N/A
2N/A#endif /* _LIBDLFLOW_IMPL_H */