summaryrefslogtreecommitdiff
path: root/usr/src/cmd/cmd-inet/usr.sbin/snoop/fw.h
blob: 32746237c33448d4e1829249ef8955e4b4681c57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License, Version 1.0 only
 * (the "License").  You may not use this file except in compliance
 * with the License.
 *
 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
 * or http://www.opensolaris.org/os/licensing.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
 * If applicable, add the following below this CDDL HEADER, with the
 * fields enclosed by brackets "[]" replaced with your own identifying
 * information: Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 */
/*
 * Copyright (c) 1993 by Sun Microsystems, Inc.
 */

#ifndef _FW_H
#define	_FW_H

#pragma ident	"%Z%%M%	%I%	%E% SMI"

#include <rpc/rpc.h>
#include "fakewin.h"

#ifdef __cplusplus
extern "C" {
#endif

/*
 * Header file for the framework.
 */
#define	CTXTLEN 1024

struct Op_arg_item {
	char _TKFAR *name;
	char _TKFAR *value;
	struct Op_arg_item _TKFAR *next;
};
typedef struct Op_arg_item Op_arg_item;

struct Op_row_link {
	Op_arg_item _TKFAR *first;
	Op_arg_item _TKFAR *last;
	struct Op_row_link _TKFAR *next;
};
typedef struct Op_row_link Op_row_link;

struct Op_arg {
	Op_row_link _TKFAR *first;
	Op_row_link _TKFAR *last;
	Op_row_link _TKFAR *curr;
	Op_arg_item _TKFAR *cura;
	u_long rows;
	bool_t xdr_flag;
};
typedef struct Op_arg Op_arg;

enum Fw_err {
	FW_ERR_NONE = 0,
	FW_ERR_FW = 1,
	FW_ERR_OP = 2
};
typedef enum Fw_err Fw_err;

struct Op_err {
	Fw_err type;
	u_long code;
	bool_t xdr_flag;
	char _TKFAR *message;
};
typedef struct Op_err Op_err;

typedef char invk_context[CTXTLEN];

struct invk_result {
	Op_err _TKFAR *err;
	Op_arg _TKFAR *arg;
	bool_t eof;
};
typedef struct invk_result invk_result;

struct invk_request {
	char _TKFAR *category;
	char _TKFAR *op;
	char _TKFAR *vers;
	char _TKFAR *locale;
	u_long threshold;
	invk_context context;
	Op_arg _TKFAR *arg;
};
typedef struct invk_request invk_request;

struct more_request {
	invk_context context;
	u_long threshold;
};
typedef struct more_request more_request;

struct kill_request {
	invk_context context;
};
typedef struct kill_request kill_request;

#define	FW_KV_DELIM		"="
#define	FW_KV_DELIM_CH		'='
#define	FW_VK_DELIM		"\n"
#define	FW_VK_DELIM_CH		'\n';
#define	FW_INPUT_VERS_VAL	1
#define	FW_INPUT_VERS_STR	"1"
#define	FW_OUTPUT_VERS_VAL	1
#define	FW_OUTPUT_VERS_STR	"1"
#define	FW_INPUT_VERS_KEY	"_SUNW_AO_INPUT_VERS"
#define	FW_OUTPUT_VERS_KEY	"_SUNW_AO_OUTPUT_VERS"
#define	FW_ROW_MARKER_KEY	"_SUNW_AO_BEGIN_ROW"
#define	FW_ROW_MARKER	FW_ROW_MARKER_KEY FW_KV_DELIM FW_OUTPUT_VERS_STR \
    FW_VK_DELIM
#define	FW_INPUT_VERS	FW_INPUT_VERS_KEY FW_KV_DELIM FW_INPUT_VERS_STR \
    FW_VK_DELIM
#define	FW_OUTPUT_VERS	FW_OUTPUT_VERS_KEY FW_KV_DELIM FW_OUTPUT_VERS_STR \
    FW_VK_DELIM
#define	FW_ERR_MSG_MAX		2047
#define	FW_UNIX_USER		"UU"

#define	FW_SUCCESS		0
#define	FW_ERROR		-1
#define	FW_TIMEOUT		-2

#define	SN_LOCALE_PATH_VAR	"_SN_LOCALE_PATH"
#define	SN_UNAME_VAR	"_SN_UNAME"
#define	SN_UID_VAR	"_SN_UID"

#include "fw_lib.h"

#ifdef __cplusplus
}
#endif

#endif /* !_FW_H */