xref: /titanic_51/usr/src/cmd/cmd-inet/usr.sbin/ipqosconf/ipqosconf.h (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * CDDL HEADER START
3*7c478bd9Sstevel@tonic-gate  *
4*7c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*7c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*7c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*7c478bd9Sstevel@tonic-gate  * with the License.
8*7c478bd9Sstevel@tonic-gate  *
9*7c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*7c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*7c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*7c478bd9Sstevel@tonic-gate  * and limitations under the License.
13*7c478bd9Sstevel@tonic-gate  *
14*7c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*7c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*7c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*7c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*7c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*7c478bd9Sstevel@tonic-gate  *
20*7c478bd9Sstevel@tonic-gate  * CDDL HEADER END
21*7c478bd9Sstevel@tonic-gate  */
22*7c478bd9Sstevel@tonic-gate /*
23*7c478bd9Sstevel@tonic-gate  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24*7c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
25*7c478bd9Sstevel@tonic-gate  */
26*7c478bd9Sstevel@tonic-gate 
27*7c478bd9Sstevel@tonic-gate #ifndef	_IPQOS_CONF_H
28*7c478bd9Sstevel@tonic-gate #define	_IPQOS_CONF_H
29*7c478bd9Sstevel@tonic-gate 
30*7c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*7c478bd9Sstevel@tonic-gate 
32*7c478bd9Sstevel@tonic-gate #include <sys/stat.h>
33*7c478bd9Sstevel@tonic-gate #include <sys/types.h>
34*7c478bd9Sstevel@tonic-gate #include <sys/nvpair.h>
35*7c478bd9Sstevel@tonic-gate 
36*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus
37*7c478bd9Sstevel@tonic-gate extern "C" {
38*7c478bd9Sstevel@tonic-gate #endif
39*7c478bd9Sstevel@tonic-gate 
40*7c478bd9Sstevel@tonic-gate /* debug level bits */
41*7c478bd9Sstevel@tonic-gate #define	L0	0x01
42*7c478bd9Sstevel@tonic-gate #define	L1	0x02
43*7c478bd9Sstevel@tonic-gate #define	L2	0x04
44*7c478bd9Sstevel@tonic-gate #define	DIFF	0x08
45*7c478bd9Sstevel@tonic-gate #define	KRET	0x10
46*7c478bd9Sstevel@tonic-gate #define	APPLY	0x20
47*7c478bd9Sstevel@tonic-gate #define	MHME	0x40
48*7c478bd9Sstevel@tonic-gate #define	RBK	0x80
49*7c478bd9Sstevel@tonic-gate 
50*7c478bd9Sstevel@tonic-gate /* directory for types files */
51*7c478bd9Sstevel@tonic-gate #define	TYPES_FILE_DIR		"/usr/lib/ipqosconf/"
52*7c478bd9Sstevel@tonic-gate 
53*7c478bd9Sstevel@tonic-gate /* location of lock file */
54*7c478bd9Sstevel@tonic-gate #define	IPQOS_CONF_LOCK_FILE	"/var/run/ipqosconf.lock"
55*7c478bd9Sstevel@tonic-gate 
56*7c478bd9Sstevel@tonic-gate /* location of startup config file */
57*7c478bd9Sstevel@tonic-gate #define	IPQOS_CONF_INIT_PATH	"/etc/inet/ipqosinit.conf"
58*7c478bd9Sstevel@tonic-gate 
59*7c478bd9Sstevel@tonic-gate /* ipqosconf commands */
60*7c478bd9Sstevel@tonic-gate 
61*7c478bd9Sstevel@tonic-gate #define	IPQOS_CONF_APPLY	1
62*7c478bd9Sstevel@tonic-gate #define	IPQOS_CONF_VIEW		2
63*7c478bd9Sstevel@tonic-gate #define	IPQOS_CONF_COMMIT	3
64*7c478bd9Sstevel@tonic-gate #define	IPQOS_CONF_FLUSH	4
65*7c478bd9Sstevel@tonic-gate 
66*7c478bd9Sstevel@tonic-gate /* print ntabs to stream fp */
67*7c478bd9Sstevel@tonic-gate 
68*7c478bd9Sstevel@tonic-gate #define	PRINT_TABS(fp, ntabs)\
69*7c478bd9Sstevel@tonic-gate {\
70*7c478bd9Sstevel@tonic-gate 	int x;\
71*7c478bd9Sstevel@tonic-gate 	for (x = 0; x < ntabs; x++)\
72*7c478bd9Sstevel@tonic-gate 		(void) fprintf(fp, "\t");\
73*7c478bd9Sstevel@tonic-gate }
74*7c478bd9Sstevel@tonic-gate 
75*7c478bd9Sstevel@tonic-gate /* having to define this as ip6.h version in _KERNEL guard */
76*7c478bd9Sstevel@tonic-gate #ifndef	V4_PART_OF_V6
77*7c478bd9Sstevel@tonic-gate #define	V4_PART_OF_V6(v6)	v6._S6_un._S6_u32[3]
78*7c478bd9Sstevel@tonic-gate #endif
79*7c478bd9Sstevel@tonic-gate 
80*7c478bd9Sstevel@tonic-gate /*
81*7c478bd9Sstevel@tonic-gate  * given pointer cp advance it to the first non-space character.
82*7c478bd9Sstevel@tonic-gate  */
83*7c478bd9Sstevel@tonic-gate #define	SKIPWS(cp)	while (isspace(*cp) && (*cp != '\0')) cp++
84*7c478bd9Sstevel@tonic-gate 
85*7c478bd9Sstevel@tonic-gate /* extract the v4 and v6 bits of the ip_version enumeration from the filter */
86*7c478bd9Sstevel@tonic-gate #define	VERSION_IS_V4(flt)	((flt)->ip_versions & 0x01)
87*7c478bd9Sstevel@tonic-gate #define	VERSION_IS_V6(flt)	((flt)->ip_versions & 0x02)
88*7c478bd9Sstevel@tonic-gate 
89*7c478bd9Sstevel@tonic-gate /* retrieve short name from a module.name nvpair name */
90*7c478bd9Sstevel@tonic-gate #define	SHORT_NAME(longnme)	(strchr(longnme, '.') + 1)
91*7c478bd9Sstevel@tonic-gate 
92*7c478bd9Sstevel@tonic-gate /* latest version of cfg file supported (1.0) */
93*7c478bd9Sstevel@tonic-gate #define	IPQOS_CUR_FMT_MAJOR_VER	1
94*7c478bd9Sstevel@tonic-gate #define	IPQOS_CUR_FMT_MINOR_VER	0
95*7c478bd9Sstevel@tonic-gate 
96*7c478bd9Sstevel@tonic-gate /* length of string buffer used for storing an integer as a string */
97*7c478bd9Sstevel@tonic-gate #define	IPQOS_INT_STR_LEN	15
98*7c478bd9Sstevel@tonic-gate 
99*7c478bd9Sstevel@tonic-gate /* length of line buffer used to read types file */
100*7c478bd9Sstevel@tonic-gate #define	IPQOS_CONF_TYPE_LINE_LEN	1024
101*7c478bd9Sstevel@tonic-gate 
102*7c478bd9Sstevel@tonic-gate /* length of buffer used to store name of type when reading types file */
103*7c478bd9Sstevel@tonic-gate #define	IPQOS_CONF_TYPE_LEN	24
104*7c478bd9Sstevel@tonic-gate 
105*7c478bd9Sstevel@tonic-gate /* max length of value string in types file */
106*7c478bd9Sstevel@tonic-gate #define	IPQOS_VALST_MAXLEN 100
107*7c478bd9Sstevel@tonic-gate 
108*7c478bd9Sstevel@tonic-gate /* initial size of line buffer used by readtoken */
109*7c478bd9Sstevel@tonic-gate #define	IPQOS_CONF_LINEBUF_SZ	150
110*7c478bd9Sstevel@tonic-gate 
111*7c478bd9Sstevel@tonic-gate /* length of class/filter/action names */
112*7c478bd9Sstevel@tonic-gate #define	IPQOS_CONF_NAME_LEN	24
113*7c478bd9Sstevel@tonic-gate 
114*7c478bd9Sstevel@tonic-gate /* length of module names */
115*7c478bd9Sstevel@tonic-gate #define	IPQOS_CONF_MOD_NAME_LEN	10
116*7c478bd9Sstevel@tonic-gate 
117*7c478bd9Sstevel@tonic-gate /* IPQOS_CONF_NAME_LEN + IPQOS_CONF_MOD_NAME_LEN */
118*7c478bd9Sstevel@tonic-gate /* must be a numeric literal for use in scanf() format string */
119*7c478bd9Sstevel@tonic-gate #define	IPQOS_CONF_PNAME_LEN	34
120*7c478bd9Sstevel@tonic-gate 
121*7c478bd9Sstevel@tonic-gate /* length of buffer used to construct msgs for printing */
122*7c478bd9Sstevel@tonic-gate #define	IPQOS_MSG_BUF_SZ	200
123*7c478bd9Sstevel@tonic-gate /*
124*7c478bd9Sstevel@tonic-gate  * Define CURL here so that while you are reading
125*7c478bd9Sstevel@tonic-gate  * the code, it does not affect "vi" in pattern
126*7c478bd9Sstevel@tonic-gate  * matching.
127*7c478bd9Sstevel@tonic-gate  */
128*7c478bd9Sstevel@tonic-gate #define	CURL_BEGIN		'{'
129*7c478bd9Sstevel@tonic-gate #define	CURL_END		'}'
130*7c478bd9Sstevel@tonic-gate 
131*7c478bd9Sstevel@tonic-gate /* internal return codes */
132*7c478bd9Sstevel@tonic-gate #define	IPQOS_CONF_SUCCESS	0
133*7c478bd9Sstevel@tonic-gate #define	IPQOS_CONF_ERR		1
134*7c478bd9Sstevel@tonic-gate #define	IPQOS_CONF_RECOVER_ERR	2
135*7c478bd9Sstevel@tonic-gate #define	IPQOS_CONF_CURL_END	3
136*7c478bd9Sstevel@tonic-gate #define	IPQOS_CONF_CURL_BEGIN	4
137*7c478bd9Sstevel@tonic-gate #define	IPQOS_CONF_EOF		5
138*7c478bd9Sstevel@tonic-gate #define	IPQOS_CONF_NO_VER_STR	6
139*7c478bd9Sstevel@tonic-gate 
140*7c478bd9Sstevel@tonic-gate /* special tokens in config file */
141*7c478bd9Sstevel@tonic-gate #define	IPQOS_CONF_IP_VERSION_STR	"ip_version"
142*7c478bd9Sstevel@tonic-gate #define	IPQOS_CONF_NEXT_ACTION_STR	"next_action"
143*7c478bd9Sstevel@tonic-gate #define	IPQOS_CONF_NAME_STR 		"name"
144*7c478bd9Sstevel@tonic-gate #define	IPQOS_CONF_MODULE_STR 		"module"
145*7c478bd9Sstevel@tonic-gate #define	IPQOS_CONF_FILTER_STR 		"filter"
146*7c478bd9Sstevel@tonic-gate #define	IPQOS_CONF_ACTION_STR 		"action"
147*7c478bd9Sstevel@tonic-gate #define	IPQOS_CONF_CLASS_STR 		"class"
148*7c478bd9Sstevel@tonic-gate #define	IPQOS_CONF_PARAMS_STR 		"params"
149*7c478bd9Sstevel@tonic-gate #define	IPQOS_CONF_NEXT_STR		"next"
150*7c478bd9Sstevel@tonic-gate #define	IPQOS_CONF_STATS_ENABLE_STR	"enable_stats"
151*7c478bd9Sstevel@tonic-gate #define	IPQOS_CONF_GLOBAL_STATS_STR	"global_stats"
152*7c478bd9Sstevel@tonic-gate #define	IPQOS_CONF_DROP_STR		"drop"
153*7c478bd9Sstevel@tonic-gate #define	IPQOS_CONF_CONT_STR		"continue"
154*7c478bd9Sstevel@tonic-gate #define	IPQOS_CONF_DEFER_STR		"defer"
155*7c478bd9Sstevel@tonic-gate #define	IPQOS_CONF_TRUE_STR		"true"
156*7c478bd9Sstevel@tonic-gate #define	IPQOS_CONF_FALSE_STR		"false"
157*7c478bd9Sstevel@tonic-gate #define	IPQOS_FMT_VERSION_STR		"fmt_version"
158*7c478bd9Sstevel@tonic-gate #define	IPQOS_IFNAME_STR		"if_name"
159*7c478bd9Sstevel@tonic-gate #define	IPQOS_PLACE_PRM_STR		IPQOS_CONF_PARAMS_STR
160*7c478bd9Sstevel@tonic-gate #define	IPQOS_PLACE_FILTER_STR		IPQOS_CONF_FILTER_STR
161*7c478bd9Sstevel@tonic-gate #define	IPQOS_PLACE_MAP_STR		"map"
162*7c478bd9Sstevel@tonic-gate 
163*7c478bd9Sstevel@tonic-gate /* special tokens in types file */
164*7c478bd9Sstevel@tonic-gate #define	IPQOS_CONF_PERM_FILTER_MK	"#PERM_FILTER"
165*7c478bd9Sstevel@tonic-gate #define	IPQOS_CONF_PERM_CLASS_MK	"#PERM_CLASS"
166*7c478bd9Sstevel@tonic-gate #define	IPQOS_FMT_STR			"fmt_version"
167*7c478bd9Sstevel@tonic-gate #define	IPQOS_MOD_STR			"mod_version"
168*7c478bd9Sstevel@tonic-gate 
169*7c478bd9Sstevel@tonic-gate 
170*7c478bd9Sstevel@tonic-gate /* nvlist parameters */
171*7c478bd9Sstevel@tonic-gate #define	IPQOS_CONF_IP_VERSION		"ipgpc.ip_version"
172*7c478bd9Sstevel@tonic-gate 
173*7c478bd9Sstevel@tonic-gate /* name lookup errors returned from domultihome() */
174*7c478bd9Sstevel@tonic-gate #define	IPQOS_LOOKUP_RETRY	1
175*7c478bd9Sstevel@tonic-gate #define	IPQOS_LOOKUP_FAIL	2
176*7c478bd9Sstevel@tonic-gate 
177*7c478bd9Sstevel@tonic-gate /*
178*7c478bd9Sstevel@tonic-gate  * used in calls to ipp_action_info() to encapuslate both an action and
179*7c478bd9Sstevel@tonic-gate  * an ipqosconf internal return code.
180*7c478bd9Sstevel@tonic-gate  */
181*7c478bd9Sstevel@tonic-gate typedef struct ipqos_actinfo_prm_s {
182*7c478bd9Sstevel@tonic-gate 	struct ipqos_conf_action_s *action;
183*7c478bd9Sstevel@tonic-gate 	int intl_ret;
184*7c478bd9Sstevel@tonic-gate } ipqos_actinfo_prm_t;
185*7c478bd9Sstevel@tonic-gate 
186*7c478bd9Sstevel@tonic-gate /*
187*7c478bd9Sstevel@tonic-gate  * skeletal list element struct used in manipulating lists of more complex
188*7c478bd9Sstevel@tonic-gate  * structures.
189*7c478bd9Sstevel@tonic-gate  */
190*7c478bd9Sstevel@tonic-gate typedef struct ipqos_list_el_s {
191*7c478bd9Sstevel@tonic-gate 	struct ipqos_list_el_s *next;
192*7c478bd9Sstevel@tonic-gate } ipqos_list_el_t;
193*7c478bd9Sstevel@tonic-gate 
194*7c478bd9Sstevel@tonic-gate typedef struct str_str {
195*7c478bd9Sstevel@tonic-gate 	char *s1;
196*7c478bd9Sstevel@tonic-gate 	char *s2;
197*7c478bd9Sstevel@tonic-gate } str_str_t;
198*7c478bd9Sstevel@tonic-gate 
199*7c478bd9Sstevel@tonic-gate typedef struct str_val {
200*7c478bd9Sstevel@tonic-gate 	char *string;
201*7c478bd9Sstevel@tonic-gate 	int value;
202*7c478bd9Sstevel@tonic-gate } str_val_t;
203*7c478bd9Sstevel@tonic-gate 
204*7c478bd9Sstevel@tonic-gate typedef struct str_val_nd {
205*7c478bd9Sstevel@tonic-gate 	struct str_val sv;
206*7c478bd9Sstevel@tonic-gate 	struct str_val_nd *next;
207*7c478bd9Sstevel@tonic-gate } str_val_nd_t;
208*7c478bd9Sstevel@tonic-gate 
209*7c478bd9Sstevel@tonic-gate /* type of msg to be printed by ipqos_msg */
210*7c478bd9Sstevel@tonic-gate enum msg_type { MT_ERROR, MT_WARNING, MT_LOG, MT_ENOSTR };
211*7c478bd9Sstevel@tonic-gate 
212*7c478bd9Sstevel@tonic-gate /* enum for allowable parameter types */
213*7c478bd9Sstevel@tonic-gate 
214*7c478bd9Sstevel@tonic-gate typedef enum ipqos_nvtype_e {
215*7c478bd9Sstevel@tonic-gate IPQOS_DATA_TYPE_UINT8,
216*7c478bd9Sstevel@tonic-gate IPQOS_DATA_TYPE_INT16,
217*7c478bd9Sstevel@tonic-gate IPQOS_DATA_TYPE_UINT16,
218*7c478bd9Sstevel@tonic-gate IPQOS_DATA_TYPE_INT32,
219*7c478bd9Sstevel@tonic-gate IPQOS_DATA_TYPE_UINT32,
220*7c478bd9Sstevel@tonic-gate IPQOS_DATA_TYPE_BOOLEAN,
221*7c478bd9Sstevel@tonic-gate IPQOS_DATA_TYPE_STRING,
222*7c478bd9Sstevel@tonic-gate IPQOS_DATA_TYPE_ACTION,
223*7c478bd9Sstevel@tonic-gate IPQOS_DATA_TYPE_ADDRESS,
224*7c478bd9Sstevel@tonic-gate IPQOS_DATA_TYPE_PORT,
225*7c478bd9Sstevel@tonic-gate IPQOS_DATA_TYPE_PROTO,
226*7c478bd9Sstevel@tonic-gate IPQOS_DATA_TYPE_ENUM,
227*7c478bd9Sstevel@tonic-gate IPQOS_DATA_TYPE_IFNAME,
228*7c478bd9Sstevel@tonic-gate IPQOS_DATA_TYPE_M_INDEX,
229*7c478bd9Sstevel@tonic-gate IPQOS_DATA_TYPE_INT_ARRAY,
230*7c478bd9Sstevel@tonic-gate IPQOS_DATA_TYPE_USER,
231*7c478bd9Sstevel@tonic-gate IPQOS_DATA_TYPE_ADDRESS_MASK,
232*7c478bd9Sstevel@tonic-gate IPQOS_DATA_TYPE_IFINDEX
233*7c478bd9Sstevel@tonic-gate } ipqos_nvtype_t;
234*7c478bd9Sstevel@tonic-gate 
235*7c478bd9Sstevel@tonic-gate /*
236*7c478bd9Sstevel@tonic-gate  * passed to readnvpair to indicate which special meanings for nv names
237*7c478bd9Sstevel@tonic-gate  * to use.
238*7c478bd9Sstevel@tonic-gate  */
239*7c478bd9Sstevel@tonic-gate typedef enum place_e {
240*7c478bd9Sstevel@tonic-gate PL_ACTION, PL_FILTER, PL_CLASS, PL_PARAMS, PL_MAP, PL_ANY} place_t;
241*7c478bd9Sstevel@tonic-gate 
242*7c478bd9Sstevel@tonic-gate 
243*7c478bd9Sstevel@tonic-gate /* classifier filter representation */
244*7c478bd9Sstevel@tonic-gate 
245*7c478bd9Sstevel@tonic-gate typedef struct ipqos_conf_filter_s {
246*7c478bd9Sstevel@tonic-gate 	struct ipqos_conf_filter_s *next;
247*7c478bd9Sstevel@tonic-gate 	char name[IPQOS_CONF_NAME_LEN];
248*7c478bd9Sstevel@tonic-gate 	char class_name[IPQOS_CONF_NAME_LEN];
249*7c478bd9Sstevel@tonic-gate 	nvlist_t *nvlist;
250*7c478bd9Sstevel@tonic-gate 	boolean_t new;
251*7c478bd9Sstevel@tonic-gate 	boolean_t modified;
252*7c478bd9Sstevel@tonic-gate 	boolean_t cr_mod;
253*7c478bd9Sstevel@tonic-gate 	boolean_t todel;
254*7c478bd9Sstevel@tonic-gate 	boolean_t deleted;
255*7c478bd9Sstevel@tonic-gate 	uint32_t originator;
256*7c478bd9Sstevel@tonic-gate 	char *src_nd_name;
257*7c478bd9Sstevel@tonic-gate 	char *dst_nd_name;
258*7c478bd9Sstevel@tonic-gate 	int instance;
259*7c478bd9Sstevel@tonic-gate 	uint32_t lineno;
260*7c478bd9Sstevel@tonic-gate 	uint32_t ip_versions;
261*7c478bd9Sstevel@tonic-gate 	int nlerr;
262*7c478bd9Sstevel@tonic-gate } ipqos_conf_filter_t;
263*7c478bd9Sstevel@tonic-gate 
264*7c478bd9Sstevel@tonic-gate 
265*7c478bd9Sstevel@tonic-gate /*
266*7c478bd9Sstevel@tonic-gate  * action reference - used to store information and reference an action struct.
267*7c478bd9Sstevel@tonic-gate  */
268*7c478bd9Sstevel@tonic-gate 
269*7c478bd9Sstevel@tonic-gate typedef struct ipqos_conf_act_ref_s {
270*7c478bd9Sstevel@tonic-gate 	struct ipqos_conf_act_ref_s *next;
271*7c478bd9Sstevel@tonic-gate 	struct ipqos_conf_act_ref_s *prev;
272*7c478bd9Sstevel@tonic-gate 	char name[IPQOS_CONF_NAME_LEN];
273*7c478bd9Sstevel@tonic-gate 	char field[IPQOS_CONF_PNAME_LEN];
274*7c478bd9Sstevel@tonic-gate 	struct ipqos_conf_action_s *action;
275*7c478bd9Sstevel@tonic-gate 	nvlist_t *nvlist;
276*7c478bd9Sstevel@tonic-gate } ipqos_conf_act_ref_t;
277*7c478bd9Sstevel@tonic-gate 
278*7c478bd9Sstevel@tonic-gate 
279*7c478bd9Sstevel@tonic-gate /* classifier class representation */
280*7c478bd9Sstevel@tonic-gate 
281*7c478bd9Sstevel@tonic-gate typedef struct ipqos_conf_class_s {
282*7c478bd9Sstevel@tonic-gate 	struct ipqos_conf_class_s *next;
283*7c478bd9Sstevel@tonic-gate 	char name[IPQOS_CONF_NAME_LEN];
284*7c478bd9Sstevel@tonic-gate 	nvlist_t *nvlist;
285*7c478bd9Sstevel@tonic-gate 	ipqos_conf_act_ref_t *alist;
286*7c478bd9Sstevel@tonic-gate 	boolean_t modified;
287*7c478bd9Sstevel@tonic-gate 	boolean_t new;
288*7c478bd9Sstevel@tonic-gate 	boolean_t cr_mod;
289*7c478bd9Sstevel@tonic-gate 	boolean_t todel;
290*7c478bd9Sstevel@tonic-gate 	boolean_t deleted;
291*7c478bd9Sstevel@tonic-gate 	boolean_t stats_enable;
292*7c478bd9Sstevel@tonic-gate 	uint32_t originator;
293*7c478bd9Sstevel@tonic-gate 	uint32_t lineno;
294*7c478bd9Sstevel@tonic-gate } ipqos_conf_class_t;
295*7c478bd9Sstevel@tonic-gate 
296*7c478bd9Sstevel@tonic-gate /* action parameters representation */
297*7c478bd9Sstevel@tonic-gate 
298*7c478bd9Sstevel@tonic-gate typedef struct ipqos_conf_params_s {
299*7c478bd9Sstevel@tonic-gate 	struct ipqos_conf_params_s *next;
300*7c478bd9Sstevel@tonic-gate 	ipqos_conf_act_ref_t *actions;
301*7c478bd9Sstevel@tonic-gate 	nvlist_t *nvlist;
302*7c478bd9Sstevel@tonic-gate 	boolean_t modified;
303*7c478bd9Sstevel@tonic-gate 	boolean_t stats_enable;
304*7c478bd9Sstevel@tonic-gate 	uint32_t originator;
305*7c478bd9Sstevel@tonic-gate 	uint32_t lineno;
306*7c478bd9Sstevel@tonic-gate 	boolean_t cr_mod;
307*7c478bd9Sstevel@tonic-gate } ipqos_conf_params_t;
308*7c478bd9Sstevel@tonic-gate 
309*7c478bd9Sstevel@tonic-gate 
310*7c478bd9Sstevel@tonic-gate /* signifys which stage of configuration application has just past */
311*7c478bd9Sstevel@tonic-gate enum visit {ADD_VISITED = 1, MOD_VISITED, REM_VISITED, INCYCLE_VISITED};
312*7c478bd9Sstevel@tonic-gate 
313*7c478bd9Sstevel@tonic-gate /*
314*7c478bd9Sstevel@tonic-gate  * action representation, with parameters, and lists of filters and classes
315*7c478bd9Sstevel@tonic-gate  * if classifier action.
316*7c478bd9Sstevel@tonic-gate  */
317*7c478bd9Sstevel@tonic-gate typedef struct ipqos_conf_action_s {
318*7c478bd9Sstevel@tonic-gate 	struct ipqos_conf_action_s *next;
319*7c478bd9Sstevel@tonic-gate 	char name[IPQOS_CONF_NAME_LEN];
320*7c478bd9Sstevel@tonic-gate 	char module[IPQOS_CONF_NAME_LEN];
321*7c478bd9Sstevel@tonic-gate 	ipqos_conf_filter_t *filters;
322*7c478bd9Sstevel@tonic-gate 	ipqos_conf_class_t *classes;
323*7c478bd9Sstevel@tonic-gate 	ipqos_conf_params_t *params;
324*7c478bd9Sstevel@tonic-gate 	nvlist_t *nvlist;
325*7c478bd9Sstevel@tonic-gate 	boolean_t todel;
326*7c478bd9Sstevel@tonic-gate 	boolean_t deleted;
327*7c478bd9Sstevel@tonic-gate 	boolean_t new;
328*7c478bd9Sstevel@tonic-gate 	boolean_t modified;
329*7c478bd9Sstevel@tonic-gate 	boolean_t cr_mod;
330*7c478bd9Sstevel@tonic-gate 	ipqos_conf_act_ref_t *dependencies;
331*7c478bd9Sstevel@tonic-gate 	enum visit visited;
332*7c478bd9Sstevel@tonic-gate 	uint32_t lineno;
333*7c478bd9Sstevel@tonic-gate 	ipqos_conf_filter_t *retry_filters;
334*7c478bd9Sstevel@tonic-gate 	char **perm_classes;
335*7c478bd9Sstevel@tonic-gate 	int num_perm_classes;
336*7c478bd9Sstevel@tonic-gate 	int module_version;
337*7c478bd9Sstevel@tonic-gate } ipqos_conf_action_t;
338*7c478bd9Sstevel@tonic-gate 
339*7c478bd9Sstevel@tonic-gate 
340*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus
341*7c478bd9Sstevel@tonic-gate }
342*7c478bd9Sstevel@tonic-gate #endif
343*7c478bd9Sstevel@tonic-gate 
344*7c478bd9Sstevel@tonic-gate #endif /* _IPQOS_CONF_H */
345