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