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.
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.
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]
22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 #ifndef _LIBDLFLOW_IMPL_H
27 #define _LIBDLFLOW_IMPL_H
29 #include <sys/types.h>
30 #include <sys/param.h>
41 typedef dladm_status_t
fpd_getf_t(dladm_handle_t
, const char *, char **,
43 typedef dladm_status_t
fpd_setf_t(dladm_handle_t
, const char *, val_desc_t
*,
45 typedef dladm_status_t
fpd_checkf_t(struct fprop_desc
*, char **, uint_t
,
48 typedef struct fprop_desc
{
51 val_desc_t
*pd_modval
;
53 boolean_t pd_temponly
;
55 fpd_getf_t
*pd_getmod
;
57 fpd_checkf_t
*pd_check
;
60 typedef struct prop_table
{
61 fprop_desc_t
*pt_table
;
66 DLADM_PROP_VAL_CURRENT
= 1,
67 DLADM_PROP_VAL_DEFAULT
,
68 DLADM_PROP_VAL_MODIFIABLE
,
69 DLADM_PROP_VAL_PERSISTENT
72 typedef dladm_status_t
fad_checkf_t(char *, flow_desc_t
*);
74 extern dladm_status_t
do_check_ip_addr(char *, boolean_t
, flow_desc_t
*);
75 extern dladm_status_t
do_check_dsfield(char *, flow_desc_t
*);
77 typedef struct fattr_desc
{
79 fad_checkf_t
*ad_check
;
82 extern dladm_status_t
i_dladm_get_prop_temp(dladm_handle_t
, const char *,
83 prop_type_t
, const char *, char **, uint_t
*,
85 extern dladm_status_t
i_dladm_set_prop_temp(dladm_handle_t
, const char *,
86 const char *, char **, uint_t
, uint_t
, char **,
88 extern boolean_t
i_dladm_is_prop_temponly(const char *prop_name
,
89 char **, prop_table_t
*);
91 * Data structures used for implementing persistent properties
93 typedef struct prop_val
{
95 struct prop_val
*lv_nextval
;
98 typedef struct prop_db_info
{
100 struct prop_db_info
*li_nextprop
;
101 struct prop_val
*li_val
;
104 typedef struct prop_db_state prop_db_state_t
;
106 typedef boolean_t (*prop_db_op_t
)(dladm_handle_t
, prop_db_state_t
*,
107 char *, prop_db_info_t
*, dladm_status_t
*);
109 typedef dladm_status_t (*prop_db_initop_t
)(dladm_handle_t
, const char *,
110 const char *, char **, uint_t
, uint_t
, char **);
112 struct prop_db_state
{
115 const char *ls_propname
;
118 prop_db_initop_t ls_initop
;
121 extern boolean_t
process_prop_set(dladm_handle_t
, prop_db_state_t
*lsp
,
122 char *buf
, prop_db_info_t
*listp
,
123 dladm_status_t
*statusp
);
124 extern boolean_t
process_prop_get(dladm_handle_t
, prop_db_state_t
*lsp
,
125 char *buf
, prop_db_info_t
*listp
,
126 dladm_status_t
*statusp
);
127 extern boolean_t
process_prop_init(dladm_handle_t
, prop_db_state_t
*lsp
,
128 char *buf
, prop_db_info_t
*listp
,
129 dladm_status_t
*statusp
);
130 extern dladm_status_t
process_prop_db(dladm_handle_t
, void *arg
, FILE *fp
,
133 extern dladm_status_t
i_dladm_init_flowprop_db(dladm_handle_t
);
134 extern dladm_status_t
i_dladm_set_flow_proplist_db(dladm_handle_t
, char *,
136 extern dladm_status_t
i_dladm_flow_check_restriction(datalink_id_t
,
137 flow_desc_t
*, mac_resource_props_t
*, boolean_t
);
139 extern dladm_status_t
dladm_flow_attrlist_extract(dladm_arg_list_t
*,
146 #endif /* _LIBDLFLOW_IMPL_H */