xref: /onnv-gate/usr/src/cmd/cmd-inet/usr.sbin/snoop/fw.h (revision 0:68f95e015346)
1*0Sstevel@tonic-gate /*
2*0Sstevel@tonic-gate  * CDDL HEADER START
3*0Sstevel@tonic-gate  *
4*0Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*0Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*0Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*0Sstevel@tonic-gate  * with the License.
8*0Sstevel@tonic-gate  *
9*0Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*0Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*0Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*0Sstevel@tonic-gate  * and limitations under the License.
13*0Sstevel@tonic-gate  *
14*0Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*0Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*0Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*0Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*0Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*0Sstevel@tonic-gate  *
20*0Sstevel@tonic-gate  * CDDL HEADER END
21*0Sstevel@tonic-gate  */
22*0Sstevel@tonic-gate /*
23*0Sstevel@tonic-gate  * Copyright (c) 1993 by Sun Microsystems, Inc.
24*0Sstevel@tonic-gate  */
25*0Sstevel@tonic-gate 
26*0Sstevel@tonic-gate #ifndef _FW_H
27*0Sstevel@tonic-gate #define	_FW_H
28*0Sstevel@tonic-gate 
29*0Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
30*0Sstevel@tonic-gate 
31*0Sstevel@tonic-gate #include <rpc/rpc.h>
32*0Sstevel@tonic-gate #include "fakewin.h"
33*0Sstevel@tonic-gate 
34*0Sstevel@tonic-gate #ifdef __cplusplus
35*0Sstevel@tonic-gate extern "C" {
36*0Sstevel@tonic-gate #endif
37*0Sstevel@tonic-gate 
38*0Sstevel@tonic-gate /*
39*0Sstevel@tonic-gate  * Header file for the framework.
40*0Sstevel@tonic-gate  */
41*0Sstevel@tonic-gate #define	CTXTLEN 1024
42*0Sstevel@tonic-gate 
43*0Sstevel@tonic-gate struct Op_arg_item {
44*0Sstevel@tonic-gate 	char _TKFAR *name;
45*0Sstevel@tonic-gate 	char _TKFAR *value;
46*0Sstevel@tonic-gate 	struct Op_arg_item _TKFAR *next;
47*0Sstevel@tonic-gate };
48*0Sstevel@tonic-gate typedef struct Op_arg_item Op_arg_item;
49*0Sstevel@tonic-gate 
50*0Sstevel@tonic-gate struct Op_row_link {
51*0Sstevel@tonic-gate 	Op_arg_item _TKFAR *first;
52*0Sstevel@tonic-gate 	Op_arg_item _TKFAR *last;
53*0Sstevel@tonic-gate 	struct Op_row_link _TKFAR *next;
54*0Sstevel@tonic-gate };
55*0Sstevel@tonic-gate typedef struct Op_row_link Op_row_link;
56*0Sstevel@tonic-gate 
57*0Sstevel@tonic-gate struct Op_arg {
58*0Sstevel@tonic-gate 	Op_row_link _TKFAR *first;
59*0Sstevel@tonic-gate 	Op_row_link _TKFAR *last;
60*0Sstevel@tonic-gate 	Op_row_link _TKFAR *curr;
61*0Sstevel@tonic-gate 	Op_arg_item _TKFAR *cura;
62*0Sstevel@tonic-gate 	u_long rows;
63*0Sstevel@tonic-gate 	bool_t xdr_flag;
64*0Sstevel@tonic-gate };
65*0Sstevel@tonic-gate typedef struct Op_arg Op_arg;
66*0Sstevel@tonic-gate 
67*0Sstevel@tonic-gate enum Fw_err {
68*0Sstevel@tonic-gate 	FW_ERR_NONE = 0,
69*0Sstevel@tonic-gate 	FW_ERR_FW = 1,
70*0Sstevel@tonic-gate 	FW_ERR_OP = 2
71*0Sstevel@tonic-gate };
72*0Sstevel@tonic-gate typedef enum Fw_err Fw_err;
73*0Sstevel@tonic-gate 
74*0Sstevel@tonic-gate struct Op_err {
75*0Sstevel@tonic-gate 	Fw_err type;
76*0Sstevel@tonic-gate 	u_long code;
77*0Sstevel@tonic-gate 	bool_t xdr_flag;
78*0Sstevel@tonic-gate 	char _TKFAR *message;
79*0Sstevel@tonic-gate };
80*0Sstevel@tonic-gate typedef struct Op_err Op_err;
81*0Sstevel@tonic-gate 
82*0Sstevel@tonic-gate typedef char invk_context[CTXTLEN];
83*0Sstevel@tonic-gate 
84*0Sstevel@tonic-gate struct invk_result {
85*0Sstevel@tonic-gate 	Op_err _TKFAR *err;
86*0Sstevel@tonic-gate 	Op_arg _TKFAR *arg;
87*0Sstevel@tonic-gate 	bool_t eof;
88*0Sstevel@tonic-gate };
89*0Sstevel@tonic-gate typedef struct invk_result invk_result;
90*0Sstevel@tonic-gate 
91*0Sstevel@tonic-gate struct invk_request {
92*0Sstevel@tonic-gate 	char _TKFAR *category;
93*0Sstevel@tonic-gate 	char _TKFAR *op;
94*0Sstevel@tonic-gate 	char _TKFAR *vers;
95*0Sstevel@tonic-gate 	char _TKFAR *locale;
96*0Sstevel@tonic-gate 	u_long threshold;
97*0Sstevel@tonic-gate 	invk_context context;
98*0Sstevel@tonic-gate 	Op_arg _TKFAR *arg;
99*0Sstevel@tonic-gate };
100*0Sstevel@tonic-gate typedef struct invk_request invk_request;
101*0Sstevel@tonic-gate 
102*0Sstevel@tonic-gate struct more_request {
103*0Sstevel@tonic-gate 	invk_context context;
104*0Sstevel@tonic-gate 	u_long threshold;
105*0Sstevel@tonic-gate };
106*0Sstevel@tonic-gate typedef struct more_request more_request;
107*0Sstevel@tonic-gate 
108*0Sstevel@tonic-gate struct kill_request {
109*0Sstevel@tonic-gate 	invk_context context;
110*0Sstevel@tonic-gate };
111*0Sstevel@tonic-gate typedef struct kill_request kill_request;
112*0Sstevel@tonic-gate 
113*0Sstevel@tonic-gate #define	FW_KV_DELIM		"="
114*0Sstevel@tonic-gate #define	FW_KV_DELIM_CH		'='
115*0Sstevel@tonic-gate #define	FW_VK_DELIM		"\n"
116*0Sstevel@tonic-gate #define	FW_VK_DELIM_CH		'\n';
117*0Sstevel@tonic-gate #define	FW_INPUT_VERS_VAL	1
118*0Sstevel@tonic-gate #define	FW_INPUT_VERS_STR	"1"
119*0Sstevel@tonic-gate #define	FW_OUTPUT_VERS_VAL	1
120*0Sstevel@tonic-gate #define	FW_OUTPUT_VERS_STR	"1"
121*0Sstevel@tonic-gate #define	FW_INPUT_VERS_KEY	"_SUNW_AO_INPUT_VERS"
122*0Sstevel@tonic-gate #define	FW_OUTPUT_VERS_KEY	"_SUNW_AO_OUTPUT_VERS"
123*0Sstevel@tonic-gate #define	FW_ROW_MARKER_KEY	"_SUNW_AO_BEGIN_ROW"
124*0Sstevel@tonic-gate #define	FW_ROW_MARKER	FW_ROW_MARKER_KEY FW_KV_DELIM FW_OUTPUT_VERS_STR \
125*0Sstevel@tonic-gate     FW_VK_DELIM
126*0Sstevel@tonic-gate #define	FW_INPUT_VERS	FW_INPUT_VERS_KEY FW_KV_DELIM FW_INPUT_VERS_STR \
127*0Sstevel@tonic-gate     FW_VK_DELIM
128*0Sstevel@tonic-gate #define	FW_OUTPUT_VERS	FW_OUTPUT_VERS_KEY FW_KV_DELIM FW_OUTPUT_VERS_STR \
129*0Sstevel@tonic-gate     FW_VK_DELIM
130*0Sstevel@tonic-gate #define	FW_ERR_MSG_MAX		2047
131*0Sstevel@tonic-gate #define	FW_UNIX_USER		"UU"
132*0Sstevel@tonic-gate 
133*0Sstevel@tonic-gate #define	FW_SUCCESS		0
134*0Sstevel@tonic-gate #define	FW_ERROR		-1
135*0Sstevel@tonic-gate #define	FW_TIMEOUT		-2
136*0Sstevel@tonic-gate 
137*0Sstevel@tonic-gate #define	SN_LOCALE_PATH_VAR	"_SN_LOCALE_PATH"
138*0Sstevel@tonic-gate #define	SN_UNAME_VAR	"_SN_UNAME"
139*0Sstevel@tonic-gate #define	SN_UID_VAR	"_SN_UID"
140*0Sstevel@tonic-gate 
141*0Sstevel@tonic-gate #include "fw_lib.h"
142*0Sstevel@tonic-gate 
143*0Sstevel@tonic-gate #ifdef __cplusplus
144*0Sstevel@tonic-gate }
145*0Sstevel@tonic-gate #endif
146*0Sstevel@tonic-gate 
147*0Sstevel@tonic-gate #endif /* !_FW_H */
148