xref: /titanic_51/usr/src/uts/common/inet/nca/ncadoorhdr.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	_INET_NCADOORHDR_H
28*7c478bd9Sstevel@tonic-gate #define	_INET_NCADOORHDR_H
29*7c478bd9Sstevel@tonic-gate 
30*7c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*7c478bd9Sstevel@tonic-gate 
32*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
33*7c478bd9Sstevel@tonic-gate extern "C" {
34*7c478bd9Sstevel@tonic-gate #endif
35*7c478bd9Sstevel@tonic-gate 
36*7c478bd9Sstevel@tonic-gate #ifndef _KERNEL
37*7c478bd9Sstevel@tonic-gate #include <stddef.h>
38*7c478bd9Sstevel@tonic-gate #endif /* _KERNEL */
39*7c478bd9Sstevel@tonic-gate 
40*7c478bd9Sstevel@tonic-gate #include <sys/types.h>
41*7c478bd9Sstevel@tonic-gate #include <sys/socket.h>
42*7c478bd9Sstevel@tonic-gate #include <netinet/in.h>
43*7c478bd9Sstevel@tonic-gate 
44*7c478bd9Sstevel@tonic-gate #define	ONE_KB				(1024)
45*7c478bd9Sstevel@tonic-gate #define	NCA_IO_MAX_SIZE			(256 * ONE_KB)
46*7c478bd9Sstevel@tonic-gate #define	NCA_IO_OFFSET			(sizeof (nca_io2_t))
47*7c478bd9Sstevel@tonic-gate 
48*7c478bd9Sstevel@tonic-gate #define	NCA_IO_TRUE			1
49*7c478bd9Sstevel@tonic-gate #define	NCA_IO_FALSE			0
50*7c478bd9Sstevel@tonic-gate 
51*7c478bd9Sstevel@tonic-gate /*
52*7c478bd9Sstevel@tonic-gate  * Defines the data structures used by NCA and Webservers.
53*7c478bd9Sstevel@tonic-gate  */
54*7c478bd9Sstevel@tonic-gate 
55*7c478bd9Sstevel@tonic-gate typedef enum {
56*7c478bd9Sstevel@tonic-gate 	/*
57*7c478bd9Sstevel@tonic-gate 	 * NCA-to-HTTP-server protocol operation values:
58*7c478bd9Sstevel@tonic-gate 	 */
59*7c478bd9Sstevel@tonic-gate 	http_op		= 100,	/* NCA<>HTTP normal request/response */
60*7c478bd9Sstevel@tonic-gate 	error_op	= 101,	/* NCA<-HTTP server error */
61*7c478bd9Sstevel@tonic-gate 	error_retry_op	= 102,	/* NCA<-HTTP server transient error */
62*7c478bd9Sstevel@tonic-gate 	resource_op	= 120,	/* NCA->HTTP server release resources */
63*7c478bd9Sstevel@tonic-gate 	timeout_op	= 150,	/* NCA<-HTTP server timed out */
64*7c478bd9Sstevel@tonic-gate 	door_attach_op	= 160,	/* NCA->HTTP NCA supports door fattach */
65*7c478bd9Sstevel@tonic-gate 	/*
66*7c478bd9Sstevel@tonic-gate 	 * NCA-to-Logging-server protocol operation values:
67*7c478bd9Sstevel@tonic-gate 	 */
68*7c478bd9Sstevel@tonic-gate 	log_op		= 10000,	/* NCA->Logger normal request */
69*7c478bd9Sstevel@tonic-gate 	log_ok_op	= 10001,	/* NCA<-Logger request ok */
70*7c478bd9Sstevel@tonic-gate 	log_error_op	= 10002,	/* NCA<-Logger request error */
71*7c478bd9Sstevel@tonic-gate 	log_op_fiov	= 10003		/* NCA<>Logger file i/o vector */
72*7c478bd9Sstevel@tonic-gate } nca_op_t;
73*7c478bd9Sstevel@tonic-gate 
74*7c478bd9Sstevel@tonic-gate typedef enum {
75*7c478bd9Sstevel@tonic-gate 	NCA_HTTP_VERSION1 = 1001,	/* NCA-to-HTTP-server protocol */
76*7c478bd9Sstevel@tonic-gate 	NCA_HTTP_VERSION2 = 1002,	/* NCA-to-HTTP-server protocol V2 */
77*7c478bd9Sstevel@tonic-gate 	NCA_LOG_VERSION1 = 5001,	/* NCA-to-Logging-server protocol */
78*7c478bd9Sstevel@tonic-gate 	NCA_LOG_VERSION2 = 5002		/* with in-kernel logging support */
79*7c478bd9Sstevel@tonic-gate 	/*
80*7c478bd9Sstevel@tonic-gate 	 * Note: Other version values are reserved for other client-to-server
81*7c478bd9Sstevel@tonic-gate 	 * Solaris door base protocols and as these protocols may or may not
82*7c478bd9Sstevel@tonic-gate 	 * be for use with NCA a new datatype (door_version_t ?) will be
83*7c478bd9Sstevel@tonic-gate 	 * defined.
84*7c478bd9Sstevel@tonic-gate 	 *
85*7c478bd9Sstevel@tonic-gate 	 * Note: NCA_HTTP_VERSION1 has been deprecated, NCA_HTTP_VERSION2 must
86*7c478bd9Sstevel@tonic-gate 	 * be used instead and is functionally a superset of (however, requires
87*7c478bd9Sstevel@tonic-gate 	 * porting as some member names and symantics have changed).
88*7c478bd9Sstevel@tonic-gate 	 */
89*7c478bd9Sstevel@tonic-gate } nca_version_t;
90*7c478bd9Sstevel@tonic-gate 
91*7c478bd9Sstevel@tonic-gate #define	HTTP_ERR	(-1)
92*7c478bd9Sstevel@tonic-gate #define	HTTP_0_0	0x00000
93*7c478bd9Sstevel@tonic-gate #define	HTTP_0_9	0x00009
94*7c478bd9Sstevel@tonic-gate #define	HTTP_1_0	0x10000
95*7c478bd9Sstevel@tonic-gate #define	HTTP_1_1	0x10001
96*7c478bd9Sstevel@tonic-gate 
97*7c478bd9Sstevel@tonic-gate typedef uint32_t	nca_tag_t;	/* Request id */
98*7c478bd9Sstevel@tonic-gate typedef uint32_t	nca_offset_t;	/* Offset */
99*7c478bd9Sstevel@tonic-gate 
100*7c478bd9Sstevel@tonic-gate /*
101*7c478bd9Sstevel@tonic-gate  * Use pack(4) to make sizeof(struct nca_direct_cd_s) the same
102*7c478bd9Sstevel@tonic-gate  * on x86 and amd64.
103*7c478bd9Sstevel@tonic-gate  */
104*7c478bd9Sstevel@tonic-gate 
105*7c478bd9Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
106*7c478bd9Sstevel@tonic-gate #pragma pack(4)
107*7c478bd9Sstevel@tonic-gate #endif
108*7c478bd9Sstevel@tonic-gate 
109*7c478bd9Sstevel@tonic-gate typedef struct nca_direct_cd_s {	/* Direct i/o connection descriptor */
110*7c478bd9Sstevel@tonic-gate 	uint64_t	cid;		/* The connection id */
111*7c478bd9Sstevel@tonic-gate 	nca_tag_t	tag;		/* The connect tag */
112*7c478bd9Sstevel@tonic-gate } nca_direct_cd_t;
113*7c478bd9Sstevel@tonic-gate 
114*7c478bd9Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
115*7c478bd9Sstevel@tonic-gate #pragma pack()
116*7c478bd9Sstevel@tonic-gate #endif
117*7c478bd9Sstevel@tonic-gate 
118*7c478bd9Sstevel@tonic-gate /*
119*7c478bd9Sstevel@tonic-gate  * nca_io2_t.advisory values:
120*7c478bd9Sstevel@tonic-gate  *
121*7c478bd9Sstevel@tonic-gate  *    NCA_IO_ADVISE - on cache miss upcall/return or preempted downcall
122*7c478bd9Sstevel@tonic-gate  *	advise that on susequent cache hit an advise upcall is required.
123*7c478bd9Sstevel@tonic-gate  *
124*7c478bd9Sstevel@tonic-gate  *    NCA_IO_ADVISE_REPLACE - on advisory upcall/return or unsolicited
125*7c478bd9Sstevel@tonic-gate  *	downcall (for a ctag'ed object) replace the object data with
126*7c478bd9Sstevel@tonic-gate  *	returned object data.
127*7c478bd9Sstevel@tonic-gate  *
128*7c478bd9Sstevel@tonic-gate  *    NCA_IO_ADVISE_FLUSH - on advisory upcall/return or unsolicited downcall
129*7c478bd9Sstevel@tonic-gate  *	(for a ctag'ed object) flush the object from the cache.
130*7c478bd9Sstevel@tonic-gate  *
131*7c478bd9Sstevel@tonic-gate  *    NCA_IO_ADVISE_TEMP - on advisory upcall/return use the returned object
132*7c478bd9Sstevel@tonic-gate  *	data instead of the cached object data, the cached object is unaltered.
133*7c478bd9Sstevel@tonic-gate  *
134*7c478bd9Sstevel@tonic-gate  *    NCA_IO_ADVISE_NONE - on cache miss upcall/return or preempted downcall
135*7c478bd9Sstevel@tonic-gate  *	no advise is needed and on advisory upcall/return no advise was needed.
136*7c478bd9Sstevel@tonic-gate  */
137*7c478bd9Sstevel@tonic-gate #define	NCA_IO_ADVISE		0x01
138*7c478bd9Sstevel@tonic-gate #define	NCA_IO_ADVISE_REPLACE	0x02
139*7c478bd9Sstevel@tonic-gate #define	NCA_IO_ADVISE_FLUSH	0x04
140*7c478bd9Sstevel@tonic-gate #define	NCA_IO_ADVISE_TEMP	0x08
141*7c478bd9Sstevel@tonic-gate #define	NCA_IO_ADVISE_NONE	0x00
142*7c478bd9Sstevel@tonic-gate 
143*7c478bd9Sstevel@tonic-gate 
144*7c478bd9Sstevel@tonic-gate /*
145*7c478bd9Sstevel@tonic-gate  * nca_io2_t.direct_type values:
146*7c478bd9Sstevel@tonic-gate  *
147*7c478bd9Sstevel@tonic-gate  *  For upcall or downcall/return:
148*7c478bd9Sstevel@tonic-gate  *
149*7c478bd9Sstevel@tonic-gate  *    NCA_IO_DIRECT_NONE - none, any data is delivered via the optional
150*7c478bd9Sstevel@tonic-gate  *	meta data specifiers data/data_len and/or trailer/trailer_len.
151*7c478bd9Sstevel@tonic-gate  *
152*7c478bd9Sstevel@tonic-gate  *    NCA_IO_DIRECT_FILENAME - file name, Invalid.
153*7c478bd9Sstevel@tonic-gate  *
154*7c478bd9Sstevel@tonic-gate  *    NCA_IO_DIRECT_SHMSEG - shared memory segment, Invalid.
155*7c478bd9Sstevel@tonic-gate  *
156*7c478bd9Sstevel@tonic-gate  *    NCA_IO_DIRECT_FILEDESC - file descriptor, Invalid.
157*7c478bd9Sstevel@tonic-gate  *
158*7c478bd9Sstevel@tonic-gate  *    NCA_IO_DIRECT_CTAG - cache tag(s), like NCA_IO_DIRECT_NONE any data
159*7c478bd9Sstevel@tonic-gate  *	is delivered via the meta data specifiers data/data_len, in addition
160*7c478bd9Sstevel@tonic-gate  *	the meta data specifiers direct/direct_len point to an array of ctag
161*7c478bd9Sstevel@tonic-gate  *	uint64_t value(s) of previously returned ctag'ed response(s) for URI
162*7c478bd9Sstevel@tonic-gate  *	relative pathnamed variant(s).
163*7c478bd9Sstevel@tonic-gate  *
164*7c478bd9Sstevel@tonic-gate  *    NCA_IO_DIRECT_SPLICE - splice of a connection is complete, on last
165*7c478bd9Sstevel@tonic-gate  *	transaction for a connection (i.e. when both the call and return
166*7c478bd9Sstevel@tonic-gate  *	nca_io2_t.more values are set to zero) indicates splice to the
167*7c478bd9Sstevel@tonic-gate  *	previously named preempted connection is complete.
168*7c478bd9Sstevel@tonic-gate  *
169*7c478bd9Sstevel@tonic-gate  *    NCA_IO_DIRECT_TEE - tee of a connection is complete, on last
170*7c478bd9Sstevel@tonic-gate  *	transaction for a connection (i.e. when both the call and return
171*7c478bd9Sstevel@tonic-gate  *	nca_io2_t.more values are set to zero) indicates tee to the
172*7c478bd9Sstevel@tonic-gate  *	previously named connection is complete.
173*7c478bd9Sstevel@tonic-gate  *
174*7c478bd9Sstevel@tonic-gate  *  For upcall/return or downcall:
175*7c478bd9Sstevel@tonic-gate  *
176*7c478bd9Sstevel@tonic-gate  *    NCA_IO_DIRECT_NONE - none, any data is delivered via the optional
177*7c478bd9Sstevel@tonic-gate  *	meta data specifiers data/data_len and/or trailer/trailer_len.
178*7c478bd9Sstevel@tonic-gate  *
179*7c478bd9Sstevel@tonic-gate  *    NCA_IO_DIRECT_FILENAME - file name, data is read from the named file,
180*7c478bd9Sstevel@tonic-gate  *	the meta data specifiers direct/direct_len point to a zero byte
181*7c478bd9Sstevel@tonic-gate  *	terminated string containing the path to the named file.
182*7c478bd9Sstevel@tonic-gate  *
183*7c478bd9Sstevel@tonic-gate  *    NCA_IO_DIRECT_SHMSEG - shared memory segment, not implemented.
184*7c478bd9Sstevel@tonic-gate  *
185*7c478bd9Sstevel@tonic-gate  *    NCA_IO_DIRECT_FILEDESC - file descriptor, not implemented.
186*7c478bd9Sstevel@tonic-gate  *
187*7c478bd9Sstevel@tonic-gate  *    NCA_IO_DIRECT_CTAG - cache tag, data is to be gotten from the named
188*7c478bd9Sstevel@tonic-gate  *	ctag value (a previously returned ctag'ed response).
189*7c478bd9Sstevel@tonic-gate  *
190*7c478bd9Sstevel@tonic-gate  *    NCA_IO_DIRECT_SPLICE - splice a connection, response data from the
191*7c478bd9Sstevel@tonic-gate  *	current connection is output to the named connection (previously
192*7c478bd9Sstevel@tonic-gate  *	preempted connection), the meta data specifiers direct/direct_len
193*7c478bd9Sstevel@tonic-gate  *	point to a nca_direct_cd_t (a cid/tag pair connection descriptor)
194*7c478bd9Sstevel@tonic-gate  *	used to specify the named connection. Note, no repsonse data is
195*7c478bd9Sstevel@tonic-gate  * 	delivered to the current connection.
196*7c478bd9Sstevel@tonic-gate  *
197*7c478bd9Sstevel@tonic-gate  *    NCA_IO_DIRECT_TEE - tee a connection, response data from the current
198*7c478bd9Sstevel@tonic-gate  *	connection is output to the named connection (previously preempted
199*7c478bd9Sstevel@tonic-gate  *	connection), the meta data specifiers direct/direct_len	point to a
200*7c478bd9Sstevel@tonic-gate  *	nca_direct_cd_t (a cid/tag pair connection descriptor) used to
201*7c478bd9Sstevel@tonic-gate  *	specify the named connection. Note, response data is delivered to
202*7c478bd9Sstevel@tonic-gate  *	the current connection as normal.
203*7c478bd9Sstevel@tonic-gate  */
204*7c478bd9Sstevel@tonic-gate #define	NCA_IO_DIRECT_NONE	0
205*7c478bd9Sstevel@tonic-gate #define	NCA_IO_DIRECT_FILENAME	1
206*7c478bd9Sstevel@tonic-gate #define	NCA_IO_DIRECT_SHMSEG	2
207*7c478bd9Sstevel@tonic-gate #define	NCA_IO_DIRECT_FILEDESC	3
208*7c478bd9Sstevel@tonic-gate #define	NCA_IO_DIRECT_CTAG	4
209*7c478bd9Sstevel@tonic-gate #define	NCA_IO_DIRECT_SPLICE	5
210*7c478bd9Sstevel@tonic-gate #define	NCA_IO_DIRECT_TEE	6
211*7c478bd9Sstevel@tonic-gate #define	NCA_IO_DIRECT_FILE_FD	7
212*7c478bd9Sstevel@tonic-gate 
213*7c478bd9Sstevel@tonic-gate /*
214*7c478bd9Sstevel@tonic-gate  * NCA_HTTP_VERSION2 nca_io definition:
215*7c478bd9Sstevel@tonic-gate  */
216*7c478bd9Sstevel@tonic-gate typedef struct nca_io2_s {
217*7c478bd9Sstevel@tonic-gate 
218*7c478bd9Sstevel@tonic-gate 	nca_version_t	version;	/* version number */
219*7c478bd9Sstevel@tonic-gate 	nca_op_t	op;		/* type of operation */
220*7c478bd9Sstevel@tonic-gate 	nca_tag_t	tag;		/* connect tag */
221*7c478bd9Sstevel@tonic-gate 
222*7c478bd9Sstevel@tonic-gate 	uint32_t	sid;		/* server instance id */
223*7c478bd9Sstevel@tonic-gate 	uint64_t	ctag;		/* user cache tag */
224*7c478bd9Sstevel@tonic-gate 
225*7c478bd9Sstevel@tonic-gate 	uint64_t	tid;		/* caller's thread id */
226*7c478bd9Sstevel@tonic-gate 	uint64_t	cid;		/* connection id */
227*7c478bd9Sstevel@tonic-gate 
228*7c478bd9Sstevel@tonic-gate 	uint8_t		more;		/* more chunks to follow */
229*7c478bd9Sstevel@tonic-gate 	uint8_t		first;		/* first chunk for tag */
230*7c478bd9Sstevel@tonic-gate 
231*7c478bd9Sstevel@tonic-gate 	uint8_t		advisory;	/* ask before using cache */
232*7c478bd9Sstevel@tonic-gate 	uint8_t		nocache;	/* don't cache */
233*7c478bd9Sstevel@tonic-gate 
234*7c478bd9Sstevel@tonic-gate 	uint8_t		preempt;	/* preempt subsequent upcall */
235*7c478bd9Sstevel@tonic-gate 	uint8_t		direct_type;	/* direct specifier type */
236*7c478bd9Sstevel@tonic-gate 
237*7c478bd9Sstevel@tonic-gate 	uint8_t		shadow;		/* flag used by kernel when copyin */
238*7c478bd9Sstevel@tonic-gate 	uint8_t		pad2;		/* padd to 32 bit align */
239*7c478bd9Sstevel@tonic-gate 
240*7c478bd9Sstevel@tonic-gate 	uint32_t	peer_len;	/* sockaddr of client */
241*7c478bd9Sstevel@tonic-gate 	nca_offset_t	peer;		/* offset into meta data area */
242*7c478bd9Sstevel@tonic-gate 
243*7c478bd9Sstevel@tonic-gate 	uint32_t	local_len;	/* sockaddr of NCA server */
244*7c478bd9Sstevel@tonic-gate 	nca_offset_t	local;		/* offset into meta data area */
245*7c478bd9Sstevel@tonic-gate 
246*7c478bd9Sstevel@tonic-gate 	uint32_t	data_len;	/* request/response data */
247*7c478bd9Sstevel@tonic-gate 	nca_offset_t	data;		/* offset into meta data area */
248*7c478bd9Sstevel@tonic-gate 
249*7c478bd9Sstevel@tonic-gate 	uint32_t	direct_len;	/* direct data specifier */
250*7c478bd9Sstevel@tonic-gate 	nca_offset_t	direct;		/* offset into meta data area */
251*7c478bd9Sstevel@tonic-gate 
252*7c478bd9Sstevel@tonic-gate 	uint32_t	trailer_len;	/* request/response trailer data */
253*7c478bd9Sstevel@tonic-gate 	nca_offset_t	trailer;	/* offset into meta data area */
254*7c478bd9Sstevel@tonic-gate 
255*7c478bd9Sstevel@tonic-gate 	/*
256*7c478bd9Sstevel@tonic-gate 	 * Following this structure is optional meta data, peer and local
257*7c478bd9Sstevel@tonic-gate 	 * sockaddr, (header) data, direct data, and trailer data.
258*7c478bd9Sstevel@tonic-gate 	 *
259*7c478bd9Sstevel@tonic-gate 	 * All nca_offset_t's above are byte offsets from the begining of
260*7c478bd9Sstevel@tonic-gate 	 * this structure. A meta data length specifier of zero indicates
261*7c478bd9Sstevel@tonic-gate 	 * no meta data.
262*7c478bd9Sstevel@tonic-gate 	 *
263*7c478bd9Sstevel@tonic-gate 	 * Request (i.e. in-bound) data is specified by the data_len/data
264*7c478bd9Sstevel@tonic-gate 	 * members only.
265*7c478bd9Sstevel@tonic-gate 	 *
266*7c478bd9Sstevel@tonic-gate 	 * Response (i.e. out-bound) data is specified by the data_len/data,
267*7c478bd9Sstevel@tonic-gate 	 * direct_type/direct_len/direct, trailer_len/trailer members and is
268*7c478bd9Sstevel@tonic-gate 	 * processed in-order.
269*7c478bd9Sstevel@tonic-gate 	 *
270*7c478bd9Sstevel@tonic-gate 	 * Note: sockaddr meta data are IPv4 addresses, future revisions
271*7c478bd9Sstevel@tonic-gate 	 * of the NCA-to-HTTP-server protocol will support IPv6.  So, the
272*7c478bd9Sstevel@tonic-gate 	 * length of the sockaddr meta data must be honored as it will be
273*7c478bd9Sstevel@tonic-gate 	 * increased for future IPv6 support.
274*7c478bd9Sstevel@tonic-gate 	 */
275*7c478bd9Sstevel@tonic-gate 
276*7c478bd9Sstevel@tonic-gate } nca_io2_t;
277*7c478bd9Sstevel@tonic-gate 
278*7c478bd9Sstevel@tonic-gate #define	DOWNCALLINFO_MAGIC	0x19121969
279*7c478bd9Sstevel@tonic-gate 
280*7c478bd9Sstevel@tonic-gate typedef struct downcallinfo_s {
281*7c478bd9Sstevel@tonic-gate 	uint32_t	dci_magic;
282*7c478bd9Sstevel@tonic-gate 	nca_io2_t	*dci_iop;
283*7c478bd9Sstevel@tonic-gate 	uio_t		*dci_uiop;
284*7c478bd9Sstevel@tonic-gate } downcallinfo_t;
285*7c478bd9Sstevel@tonic-gate 
286*7c478bd9Sstevel@tonic-gate typedef enum {
287*7c478bd9Sstevel@tonic-gate 	NCA_UNKNOWN,
288*7c478bd9Sstevel@tonic-gate 	NCA_OPTIONS,
289*7c478bd9Sstevel@tonic-gate 	NCA_GET,
290*7c478bd9Sstevel@tonic-gate 	NCA_HEAD,
291*7c478bd9Sstevel@tonic-gate 	NCA_POST,
292*7c478bd9Sstevel@tonic-gate 	NCA_PUT,
293*7c478bd9Sstevel@tonic-gate 	NCA_DELETE,
294*7c478bd9Sstevel@tonic-gate 	NCA_TRACE,
295*7c478bd9Sstevel@tonic-gate 
296*7c478bd9Sstevel@tonic-gate 	NCA_RAW		/* Special case for active connections */
297*7c478bd9Sstevel@tonic-gate } nca_http_method_t;
298*7c478bd9Sstevel@tonic-gate 
299*7c478bd9Sstevel@tonic-gate typedef enum {
300*7c478bd9Sstevel@tonic-gate 	HS_OK = 200,
301*7c478bd9Sstevel@tonic-gate 	HS_CREATED = 201,
302*7c478bd9Sstevel@tonic-gate 	HS_ACCEPTED = 202,
303*7c478bd9Sstevel@tonic-gate 	HS_PARTIAL_CONTENT = 206,
304*7c478bd9Sstevel@tonic-gate 	HS_MOVED_PERMANENT = 301,
305*7c478bd9Sstevel@tonic-gate 	HS_MOVED = 302,
306*7c478bd9Sstevel@tonic-gate 	HS_NOT_MODIFIED = 304,
307*7c478bd9Sstevel@tonic-gate 	HS_BAD_REQUEST = 400,
308*7c478bd9Sstevel@tonic-gate 	HS_AUTH_REQUIRED = 401,
309*7c478bd9Sstevel@tonic-gate 	HS_FORBIDDEN = 403,
310*7c478bd9Sstevel@tonic-gate 	HS_NOT_FOUND = 404,
311*7c478bd9Sstevel@tonic-gate 	HS_PRECONDITION_FAILED = 412,
312*7c478bd9Sstevel@tonic-gate 	HS_SERVER_ERROR = 500,
313*7c478bd9Sstevel@tonic-gate 	HS_NOT_IMPLEMENTED = 501,
314*7c478bd9Sstevel@tonic-gate 	HS_SERVICE_UNAVAILABLE = 503,
315*7c478bd9Sstevel@tonic-gate 	HS_CONNECTION_CLOSED = 1000
316*7c478bd9Sstevel@tonic-gate } nca_http_status_code;
317*7c478bd9Sstevel@tonic-gate 
318*7c478bd9Sstevel@tonic-gate /* httpd (miss user space daemon) is attached to this door */
319*7c478bd9Sstevel@tonic-gate #define	MISS_DOOR_FILE	"/var/run/nca_httpd_1.door"
320*7c478bd9Sstevel@tonic-gate 
321*7c478bd9Sstevel@tonic-gate /* httpd downcall door server name */
322*7c478bd9Sstevel@tonic-gate #define	DOWNCALL_DOOR_FILE	"/var/run/nca_httpd_1.down_door"
323*7c478bd9Sstevel@tonic-gate 
324*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
325*7c478bd9Sstevel@tonic-gate }
326*7c478bd9Sstevel@tonic-gate #endif
327*7c478bd9Sstevel@tonic-gate 
328*7c478bd9Sstevel@tonic-gate #endif	/* _INET_NCADOORHDR_H */
329