xref: /illumos-gate/usr/src/cmd/cmd-inet/usr.sbin/snoop/fw.h (revision 7a6d80f1660abd4755c68cbd094d4a914681d26e)
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 #include <rpc/rpc.h>
30 #include "fakewin.h"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 /*
37  * Header file for the framework.
38  */
39 #define	CTXTLEN 1024
40 
41 struct Op_arg_item {
42 	char _TKFAR *name;
43 	char _TKFAR *value;
44 	struct Op_arg_item _TKFAR *next;
45 };
46 typedef struct Op_arg_item Op_arg_item;
47 
48 struct Op_row_link {
49 	Op_arg_item _TKFAR *first;
50 	Op_arg_item _TKFAR *last;
51 	struct Op_row_link _TKFAR *next;
52 };
53 typedef struct Op_row_link Op_row_link;
54 
55 struct Op_arg {
56 	Op_row_link _TKFAR *first;
57 	Op_row_link _TKFAR *last;
58 	Op_row_link _TKFAR *curr;
59 	Op_arg_item _TKFAR *cura;
60 	u_long rows;
61 	bool_t xdr_flag;
62 };
63 typedef struct Op_arg Op_arg;
64 
65 enum Fw_err {
66 	FW_ERR_NONE = 0,
67 	FW_ERR_FW = 1,
68 	FW_ERR_OP = 2
69 };
70 typedef enum Fw_err Fw_err;
71 
72 struct Op_err {
73 	Fw_err type;
74 	u_long code;
75 	bool_t xdr_flag;
76 	char _TKFAR *message;
77 };
78 typedef struct Op_err Op_err;
79 
80 typedef char invk_context[CTXTLEN];
81 
82 struct invk_result {
83 	Op_err _TKFAR *err;
84 	Op_arg _TKFAR *arg;
85 	bool_t eof;
86 };
87 typedef struct invk_result invk_result;
88 
89 struct invk_request {
90 	char _TKFAR *category;
91 	char _TKFAR *op;
92 	char _TKFAR *vers;
93 	char _TKFAR *locale;
94 	u_long threshold;
95 	invk_context context;
96 	Op_arg _TKFAR *arg;
97 };
98 typedef struct invk_request invk_request;
99 
100 struct more_request {
101 	invk_context context;
102 	u_long threshold;
103 };
104 typedef struct more_request more_request;
105 
106 struct kill_request {
107 	invk_context context;
108 };
109 typedef struct kill_request kill_request;
110 
111 #define	FW_KV_DELIM		"="
112 #define	FW_KV_DELIM_CH		'='
113 #define	FW_VK_DELIM		"\n"
114 #define	FW_VK_DELIM_CH		'\n';
115 #define	FW_INPUT_VERS_VAL	1
116 #define	FW_INPUT_VERS_STR	"1"
117 #define	FW_OUTPUT_VERS_VAL	1
118 #define	FW_OUTPUT_VERS_STR	"1"
119 #define	FW_INPUT_VERS_KEY	"_SUNW_AO_INPUT_VERS"
120 #define	FW_OUTPUT_VERS_KEY	"_SUNW_AO_OUTPUT_VERS"
121 #define	FW_ROW_MARKER_KEY	"_SUNW_AO_BEGIN_ROW"
122 #define	FW_ROW_MARKER	FW_ROW_MARKER_KEY FW_KV_DELIM FW_OUTPUT_VERS_STR \
123     FW_VK_DELIM
124 #define	FW_INPUT_VERS	FW_INPUT_VERS_KEY FW_KV_DELIM FW_INPUT_VERS_STR \
125     FW_VK_DELIM
126 #define	FW_OUTPUT_VERS	FW_OUTPUT_VERS_KEY FW_KV_DELIM FW_OUTPUT_VERS_STR \
127     FW_VK_DELIM
128 #define	FW_ERR_MSG_MAX		2047
129 #define	FW_UNIX_USER		"UU"
130 
131 #define	FW_SUCCESS		0
132 #define	FW_ERROR		-1
133 #define	FW_TIMEOUT		-2
134 
135 #define	SN_LOCALE_PATH_VAR	"_SN_LOCALE_PATH"
136 #define	SN_UNAME_VAR	"_SN_UNAME"
137 #define	SN_UID_VAR	"_SN_UID"
138 
139 #include "fw_lib.h"
140 
141 #ifdef __cplusplus
142 }
143 #endif
144 
145 #endif /* !_FW_H */
146