xref: /csrg-svn/sys/netiso/clnp.h (revision 36366)
1*36366Ssklower /***********************************************************
2*36366Ssklower 		Copyright IBM Corporation 1987
3*36366Ssklower 
4*36366Ssklower                       All Rights Reserved
5*36366Ssklower 
6*36366Ssklower Permission to use, copy, modify, and distribute this software and its
7*36366Ssklower documentation for any purpose and without fee is hereby granted,
8*36366Ssklower provided that the above copyright notice appear in all copies and that
9*36366Ssklower both that copyright notice and this permission notice appear in
10*36366Ssklower supporting documentation, and that the name of IBM not be
11*36366Ssklower used in advertising or publicity pertaining to distribution of the
12*36366Ssklower software without specific, written prior permission.
13*36366Ssklower 
14*36366Ssklower IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
15*36366Ssklower ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
16*36366Ssklower IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
17*36366Ssklower ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
18*36366Ssklower WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
19*36366Ssklower ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
20*36366Ssklower SOFTWARE.
21*36366Ssklower 
22*36366Ssklower ******************************************************************/
23*36366Ssklower 
24*36366Ssklower /*
25*36366Ssklower  * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
26*36366Ssklower  */
27*36366Ssklower /* $Header: clnp.h,v 4.3 88/09/12 13:34:40 hagens Exp $ */
28*36366Ssklower /* $Source: /usr/argo/sys/netiso/RCS/clnp.h,v $ */
29*36366Ssklower 
30*36366Ssklower #ifndef BYTE_ORDER
31*36366Ssklower /*
32*36366Ssklower  * Definitions for byte order,
33*36366Ssklower  * according to byte significance from low address to high.
34*36366Ssklower  */
35*36366Ssklower #define	LITTLE_ENDIAN	1234	/* least-significant byte first (vax) */
36*36366Ssklower #define	BIG_ENDIAN	4321	/* most-significant byte first (IBM, net) */
37*36366Ssklower #define	PDP_ENDIAN	3412	/* LSB first in word, MSW first in long (pdp) */
38*36366Ssklower 
39*36366Ssklower #ifdef vax
40*36366Ssklower #define	BYTE_ORDER	LITTLE_ENDIAN
41*36366Ssklower #else
42*36366Ssklower #define	BYTE_ORDER	BIG_ENDIAN	/* mc68000, tahoe, most others */
43*36366Ssklower #endif
44*36366Ssklower #endif BYTE_ORDER
45*36366Ssklower 
46*36366Ssklower /*
47*36366Ssklower  *	Return true if the mbuf is a cluster mbuf
48*36366Ssklower  */
49*36366Ssklower #define	IS_CLUSTER(m)\
50*36366Ssklower 	((m)->m_off > MMAXOFF)
51*36366Ssklower 
52*36366Ssklower /*
53*36366Ssklower  *	Move the halfword into the two characters
54*36366Ssklower  */
55*36366Ssklower #define	HTOC(msb, lsb, hword)\
56*36366Ssklower 	(msb) = (u_char)((hword) >> 8);\
57*36366Ssklower 	(lsb) = (u_char)((hword) & 0xff)
58*36366Ssklower /*
59*36366Ssklower  *	Move the two charcters into the halfword
60*36366Ssklower  */
61*36366Ssklower #define	CTOH(msb, lsb, hword)\
62*36366Ssklower 	(hword) = ((msb) << 8) | (lsb)
63*36366Ssklower 
64*36366Ssklower /*
65*36366Ssklower  *	Return true if the checksum has been set - ie. the checksum is
66*36366Ssklower  *	not zero
67*36366Ssklower  */
68*36366Ssklower #define	CKSUM_REQUIRED(clnp)\
69*36366Ssklower 	(((clnp)->cnf_cksum_msb != 0) || ((clnp)->cnf_cksum_lsb != 0))
70*36366Ssklower 
71*36366Ssklower /*
72*36366Ssklower  *	Fixed part of clnp header
73*36366Ssklower  */
74*36366Ssklower struct clnp_fixed {
75*36366Ssklower 	u_char	cnf_proto_id;		/* network layer protocol identifier */
76*36366Ssklower 	u_char	cnf_hdr_len;		/* length indicator (octets) */
77*36366Ssklower 	u_char	cnf_vers;			/* version/protocol identifier extension */
78*36366Ssklower 	u_char	cnf_ttl;			/* lifetime (500 milliseconds) */
79*36366Ssklower #if BYTE_ORDER == LITTLE_ENDIAN
80*36366Ssklower 	u_char	cnf_type:5,			/* type code */
81*36366Ssklower 			cnf_err_ok:1,		/* flag: error report */
82*36366Ssklower 			cnf_more_segs:1,	/* flag: more segments */
83*36366Ssklower 			cnf_seg_ok:1;		/* flag: segmentation permitted */
84*36366Ssklower #endif
85*36366Ssklower #if BYTE_ORDER == BIG_ENDIAN
86*36366Ssklower 	u_char	cnf_seg_ok:1,		/* flag: segmentation permitted */
87*36366Ssklower 			cnf_more_segs:1,	/* flag: more segments */
88*36366Ssklower 			cnf_err_ok:1,		/* flag: error report */
89*36366Ssklower 			cnf_type:5;			/* type code */
90*36366Ssklower #endif
91*36366Ssklower 	u_char	cnf_seglen_msb;		/* pdu segment length (octets) high byte */
92*36366Ssklower 	u_char	cnf_seglen_lsb;		/* pdu segment length (octets) low byte */
93*36366Ssklower 	u_char	cnf_cksum_msb;		/* checksum high byte */
94*36366Ssklower 	u_char	cnf_cksum_lsb;		/* checksum low byte */
95*36366Ssklower };
96*36366Ssklower #define CLNP_CKSUM_OFF	0x07	/* offset of checksum */
97*36366Ssklower 
98*36366Ssklower #define	clnl_fixed	clnp_fixed
99*36366Ssklower 
100*36366Ssklower /*
101*36366Ssklower  *	Segmentation part of clnp header
102*36366Ssklower  */
103*36366Ssklower struct clnp_segment {
104*36366Ssklower 	u_short	cng_id;				/* data unit identifier */
105*36366Ssklower 	u_short	cng_off;			/* segment offset */
106*36366Ssklower 	u_short	cng_tot_len;		/* total length */
107*36366Ssklower };
108*36366Ssklower 
109*36366Ssklower /*
110*36366Ssklower  *	Clnp fragment reassembly structures:
111*36366Ssklower  *
112*36366Ssklower  *	All packets undergoing reassembly are linked together in
113*36366Ssklower  *	clnp_fragl structures. Each clnp_fragl structure contains a
114*36366Ssklower  *	pointer to the original clnp packet header, as well as a
115*36366Ssklower  *	list of packet fragments. Each packet fragment
116*36366Ssklower  *	is headed by a clnp_frag structure. This structure contains the
117*36366Ssklower  *	offset of the first and last byte of the fragment, as well as
118*36366Ssklower  *	a pointer to the data (an mbuf chain) of the fragment.
119*36366Ssklower  */
120*36366Ssklower 
121*36366Ssklower /*
122*36366Ssklower  *	NOTE:
123*36366Ssklower  *		The clnp_frag structure is stored in an mbuf immedately preceeding
124*36366Ssklower  *	the fragment data. Since there are words in this struct,
125*36366Ssklower  *	it must be word aligned.
126*36366Ssklower  *
127*36366Ssklower  *	NOTE:
128*36366Ssklower  *		All the fragment code assumes that the entire clnp header is
129*36366Ssklower  *	contained in the first mbuf.
130*36366Ssklower  */
131*36366Ssklower struct clnp_frag {
132*36366Ssklower 	u_int				cfr_first;		/* offset of first byte of this frag */
133*36366Ssklower 	u_int				cfr_last;		/* offset of last byte of this frag */
134*36366Ssklower 	u_int				cfr_bytes;		/* bytes to shave to get to data */
135*36366Ssklower 	struct mbuf			*cfr_data;		/* ptr to data for this frag */
136*36366Ssklower 	struct clnp_frag	*cfr_next;		/* next fragment in list */
137*36366Ssklower };
138*36366Ssklower 
139*36366Ssklower struct clnp_fragl {
140*36366Ssklower 	struct iso_addr		cfl_src;		/* source of the pkt */
141*36366Ssklower 	struct iso_addr		cfl_dst;		/* destination of the pkt */
142*36366Ssklower 	u_short				cfl_id;			/* id of the pkt */
143*36366Ssklower 	u_char				cfl_ttl;		/* current ttl of pkt */
144*36366Ssklower 	u_short				cfl_last;		/* offset of last byte of packet */
145*36366Ssklower 	struct mbuf 		*cfl_orighdr;	/* ptr to original header */
146*36366Ssklower 	struct clnp_frag	*cfl_frags;		/* linked list of fragments for pkt */
147*36366Ssklower 	struct clnp_fragl	*cfl_next;		/* next pkt being reassembled */
148*36366Ssklower };
149*36366Ssklower 
150*36366Ssklower /*
151*36366Ssklower  *	The following structure is used to index into an options section
152*36366Ssklower  *	of a clnp datagram. These values can be used without worry that
153*36366Ssklower  *	offset or length fields are invalid or too big, etc. That is,
154*36366Ssklower  *	the consistancy of the options will be guaranteed before this
155*36366Ssklower  *	structure is filled in. Any pointer (field ending in p) is
156*36366Ssklower  *	actually the offset from the beginning of the mbuf the option
157*36366Ssklower  *	is contained in.  A value of NULL for any pointer
158*36366Ssklower  *	means that the option is not present. The length any option
159*36366Ssklower  *	does not include the option code or option length fields.
160*36366Ssklower  */
161*36366Ssklower struct clnp_optidx {
162*36366Ssklower 	u_short	cni_securep;		/* ptr to beginning of security option */
163*36366Ssklower 	char	cni_secure_len;		/* length of entire security option */
164*36366Ssklower 
165*36366Ssklower 	u_short	cni_srcrt_s;		/* offset of start of src rt option */
166*36366Ssklower 	u_short	cni_srcrt_len;		/* length of entire src rt option */
167*36366Ssklower 
168*36366Ssklower 	u_short	cni_recrtp;			/* ptr to beginning of recrt option */
169*36366Ssklower 	char	cni_recrt_len;		/* length of entire recrt option */
170*36366Ssklower 
171*36366Ssklower 	char	cni_priorp;			/* ptr to priority option */
172*36366Ssklower 
173*36366Ssklower 	u_short	cni_qos_formatp;	/* ptr to format of qos option */
174*36366Ssklower 	char	cni_qos_len;		/* length of entire qos option */
175*36366Ssklower 
176*36366Ssklower 	u_char	cni_er_reason;		/* reason from ER pdu option */
177*36366Ssklower };
178*36366Ssklower 
179*36366Ssklower #define	ER_INVALREAS	0xff	/* code for invalid ER pdu discard reason */
180*36366Ssklower 
181*36366Ssklower /*	return true iff src route is valid */
182*36366Ssklower #define	CLNPSRCRT_VALID(oidx)\
183*36366Ssklower 	((oidx) && (oidx->cni_srcrt_s))
184*36366Ssklower 
185*36366Ssklower /*	return the offset field of the src rt */
186*36366Ssklower #define CLNPSRCRT_OFF(oidx, options)\
187*36366Ssklower 	(*((u_char *)((caddr_t)options + oidx->cni_srcrt_s + 1)))
188*36366Ssklower 
189*36366Ssklower /*	return the type field of the src rt */
190*36366Ssklower #define CLNPSRCRT_TYPE(oidx, options)\
191*36366Ssklower 	((u_char)(*((caddr_t)options + oidx->cni_srcrt_s)))
192*36366Ssklower 
193*36366Ssklower /* return the length of the current address */
194*36366Ssklower #define CLNPSRCRT_CLEN(oidx, options)\
195*36366Ssklower 	((u_char)(*((caddr_t)options + oidx->cni_srcrt_s + CLNPSRCRT_OFF(oidx, options) - 1)))
196*36366Ssklower 
197*36366Ssklower /* return the address of the current address */
198*36366Ssklower #define CLNPSRCRT_CADDR(oidx, options)\
199*36366Ssklower 	((caddr_t)((caddr_t)options + oidx->cni_srcrt_s + CLNPSRCRT_OFF(oidx, options)))
200*36366Ssklower 
201*36366Ssklower /*
202*36366Ssklower  *	return true if the src route has run out of routes
203*36366Ssklower  *	this is true if the offset of next route is greater than the end of the rt
204*36366Ssklower  */
205*36366Ssklower #define	CLNPSRCRT_TERM(oidx, options)\
206*36366Ssklower 	(CLNPSRCRT_OFF(oidx, options) > oidx->cni_srcrt_len)
207*36366Ssklower 
208*36366Ssklower /*
209*36366Ssklower  *	Options a user can set/get
210*36366Ssklower  */
211*36366Ssklower #define	CLNPOPT_FLAGS	0x01	/* flags: seg permitted, no er xmit, etc  */
212*36366Ssklower #define	CLNPOPT_OPTS	0x02	/* datagram options */
213*36366Ssklower 
214*36366Ssklower /*
215*36366Ssklower  *	Values for particular datagram options
216*36366Ssklower  */
217*36366Ssklower #define	CLNPOVAL_PAD		0xcc	/* padding */
218*36366Ssklower #define	CLNPOVAL_SECURE		0xc5	/* security */
219*36366Ssklower #define	CLNPOVAL_SRCRT		0xc8	/* source routing */
220*36366Ssklower #define	CLNPOVAL_RECRT		0xcb	/* record route */
221*36366Ssklower #define	CLNPOVAL_QOS		0xc3	/* quality of service */
222*36366Ssklower #define	CLNPOVAL_PRIOR		0xcd	/* priority */
223*36366Ssklower #define CLNPOVAL_ERREAS		0xc1	/* ER PDU ONLY: reason for discard */
224*36366Ssklower 
225*36366Ssklower #define	CLNPOVAL_SRCSPEC	0x40	/* source address specific */
226*36366Ssklower #define	CLNPOVAL_DSTSPEC	0x80	/* destination address specific */
227*36366Ssklower #define	CLNPOVAL_GLOBAL		0xc0	/* globally unique */
228*36366Ssklower 
229*36366Ssklower #define	CLNPOVAL_PARTRT		0x00	/* partial source routing */
230*36366Ssklower #define CLNPOVAL_COMPRT		0x01	/* complete source routing */
231*36366Ssklower 
232*36366Ssklower /*
233*36366Ssklower  *	Clnp flags used in a control block flags field.
234*36366Ssklower  *	NOTE: these must be out of the range of bits defined in ../net/raw_cb.h
235*36366Ssklower  */
236*36366Ssklower #define	CLNP_NO_SEG		0x010	/* segmentation not permitted */
237*36366Ssklower #define	CLNP_NO_ER		0x020	/* do not generate ERs */
238*36366Ssklower #define CLNP_SEND_RAW	0x080	/* send pkt as RAW DT rather than TP DT */
239*36366Ssklower #define	CLNP_NO_CKSUM	0x100	/* don't use clnp checksum */
240*36366Ssklower #define CLNP_ECHO		0x200	/* fake echo function */
241*36366Ssklower #define	CLNP_NOCACHE	0x400	/* don't store cache information */
242*36366Ssklower 
243*36366Ssklower /* valid clnp flags */
244*36366Ssklower #define CLNP_VFLAGS		(CLNP_SEND_RAW|CLNP_NO_SEG|CLNP_NO_ER|CLNP_NO_CKSUM\
245*36366Ssklower 	|CLNP_ECHO|CLNP_NOCACHE)
246*36366Ssklower 
247*36366Ssklower /*
248*36366Ssklower  *	Constants used by clnp
249*36366Ssklower  */
250*36366Ssklower #define	CLNP_HDR_MIN	(sizeof (struct clnp_fixed))
251*36366Ssklower #define	CLNP_HDR_MAX	(254)
252*36366Ssklower #define	CLNP_TTL_UNITS	2					/* 500 milliseconds */
253*36366Ssklower #define CLNP_TTL		15*CLNP_TTL_UNITS	/* time to live (seconds) */
254*36366Ssklower #define	ISO8473_V1		0x01
255*36366Ssklower 
256*36366Ssklower /*
257*36366Ssklower  *	Clnp packet types
258*36366Ssklower  *	In order to test raw clnp and tp/clnp simultaneously, a third type of
259*36366Ssklower  *	packet has been defined: CLNP_RAW. This is done so that the input
260*36366Ssklower  *	routine can switch to the correct input routine (rclnp_input or
261*36366Ssklower  *	tpclnp_input) based on the type field. If clnp had a higher level protocol
262*36366Ssklower  *	field, this would not be necessary.
263*36366Ssklower  */
264*36366Ssklower #define	CLNP_DT			0x1C	/* normal data */
265*36366Ssklower #define	CLNP_ER			0x01	/* error report */
266*36366Ssklower #define	CLNP_RAW		0x1D	/* debug only */
267*36366Ssklower #define CLNP_EC			0x1E	/* echo packet */
268*36366Ssklower #define CLNP_ECR		0x1F	/* echo reply */
269*36366Ssklower 
270*36366Ssklower /*
271*36366Ssklower  *	ER pdu error codes
272*36366Ssklower  */
273*36366Ssklower #define GEN_NOREAS			0x00	/* reason not specified */
274*36366Ssklower #define GEN_PROTOERR		0x01	/* protocol procedure error */
275*36366Ssklower #define GEN_BADCSUM			0x02	/* incorrect checksum */
276*36366Ssklower #define GEN_CONGEST			0x03	/* pdu discarded due to congestion */
277*36366Ssklower #define GEN_HDRSYNTAX		0x04	/* header syntax error */
278*36366Ssklower #define GEN_SEGNEEDED		0x05	/* segmentation needed, but not permitted */
279*36366Ssklower #define GEN_INCOMPLETE		0x06	/* incomplete pdu received */
280*36366Ssklower #define GEN_DUPOPT			0x07	/* duplicate option */
281*36366Ssklower 
282*36366Ssklower /* address errors */
283*36366Ssklower #define ADDR_DESTUNREACH	0x80	/* destination address unreachable */
284*36366Ssklower #define ADDR_DESTUNKNOWN	0x81	/* destination address unknown */
285*36366Ssklower 
286*36366Ssklower /* source routing */
287*36366Ssklower #define SRCRT_UNSPECERR		0x90	/* unspecified src rt error */
288*36366Ssklower #define SRCRT_SYNTAX		0x91	/* syntax error in src rt field */
289*36366Ssklower #define SRCRT_UNKNOWNADDR	0x92	/* unknown addr in src rt field */
290*36366Ssklower #define SRCRT_BADPATH		0x93	/* path not acceptable */
291*36366Ssklower 
292*36366Ssklower /* lifetime */
293*36366Ssklower #define TTL_EXPTRANSIT		0xa0	/* lifetime expired during transit */
294*36366Ssklower #define TTL_EXPREASS		0xa1	/* lifetime expired during reassembly */
295*36366Ssklower 
296*36366Ssklower /* pdu discarded */
297*36366Ssklower #define DISC_UNSUPPOPT		0xb0	/* unsupported option not specified? */
298*36366Ssklower #define DISC_UNSUPPVERS		0xb1	/* unsupported protocol version */
299*36366Ssklower #define DISC_UNSUPPSECURE	0xb2	/* unsupported security option */
300*36366Ssklower #define DISC_UNSUPPSRCRT	0xb3	/* unsupported src rt option */
301*36366Ssklower #define DISC_UNSUPPRECRT	0xb4	/* unsupported rec rt option */
302*36366Ssklower 
303*36366Ssklower /* reassembly */
304*36366Ssklower #define REASS_INTERFERE		0xc0	/* reassembly interference */
305*36366Ssklower 
306*36366Ssklower #ifdef	TROLL
307*36366Ssklower 
308*36366Ssklower #define	TR_DUPEND		0x01	/* duplicate end of fragment */
309*36366Ssklower #define TR_DUPPKT		0x02	/* duplicate entire packet */
310*36366Ssklower #define	TR_DROPPKT		0x04	/* drop packet on output */
311*36366Ssklower #define TR_TRIM			0x08	/* trim bytes from packet */
312*36366Ssklower #define TR_CHANGE		0x10	/* change bytes in packet */
313*36366Ssklower #define TR_MTU			0x20	/* delta to change device mtu */
314*36366Ssklower #define	TR_CHUCK		0x40	/* drop packet in rclnp_input */
315*36366Ssklower #define	TR_BLAST		0x80	/* force rclnp_output to blast many packet */
316*36366Ssklower #define	TR_RAWLOOP		0x100	/* make if_loop call clnpintr directly */
317*36366Ssklower struct troll {
318*36366Ssklower 	int		tr_ops;				/* operations to perform */
319*36366Ssklower 	float	tr_dup_size;		/* % to duplicate */
320*36366Ssklower 	float	tr_dup_freq;		/* frequency to duplicate packets */
321*36366Ssklower 	float	tr_drop_freq;		/* frequence to drop packets */
322*36366Ssklower 	int		tr_mtu_adj;			/* delta to adjust if mtu */
323*36366Ssklower 	int		tr_blast_cnt;		/* # of pkts to blast out */
324*36366Ssklower };
325*36366Ssklower 
326*36366Ssklower #define	SN_OUTPUT(clcp, m)\
327*36366Ssklower 	troll_output(clcp->clc_ifp, m, clcp->clc_firsthop)
328*36366Ssklower 
329*36366Ssklower #define	SN_MTU(ifp)\
330*36366Ssklower 	(ifp->if_mtu - trollctl.tr_mtu_adj)
331*36366Ssklower 
332*36366Ssklower #else	/* NO TROLL */
333*36366Ssklower 
334*36366Ssklower #define	SN_OUTPUT(clcp, m)\
335*36366Ssklower 	(*clcp->clc_ifp->if_output)(clcp->clc_ifp, m, clcp->clc_firsthop)
336*36366Ssklower 
337*36366Ssklower #define	SN_MTU(ifp)\
338*36366Ssklower 	(ifp->if_mtu)
339*36366Ssklower 
340*36366Ssklower #endif	TROLL
341*36366Ssklower 
342*36366Ssklower /*
343*36366Ssklower  *	Macro to remove an address from a clnp header
344*36366Ssklower  */
345*36366Ssklower #define CLNP_EXTRACT_ADDR(isoa, hoff, hend)\
346*36366Ssklower 	{\
347*36366Ssklower 		isoa.isoa_len = (u_char)*hoff;\
348*36366Ssklower 		if ((((++hoff) + isoa.isoa_len) > hend) ||\
349*36366Ssklower 			(isoa.isoa_len > 20) || (isoa.isoa_len == 0)) {\
350*36366Ssklower 			hoff = (caddr_t)0;\
351*36366Ssklower 		} else {\
352*36366Ssklower 			(void) bcopy(hoff, (caddr_t)&isoa, isoa.isoa_len);\
353*36366Ssklower 			hoff += isoa.isoa_len;\
354*36366Ssklower 		}\
355*36366Ssklower 	}
356*36366Ssklower 
357*36366Ssklower /*
358*36366Ssklower  *	Macro to insert an address into a clnp header
359*36366Ssklower  */
360*36366Ssklower #define CLNP_INSERT_ADDR(hoff, isoap)\
361*36366Ssklower 	*hoff++ = (isoap)->isoa_len;\
362*36366Ssklower 	(void) bcopy((caddr_t)(isoap), hoff, (isoap)->isoa_len);\
363*36366Ssklower 	hoff += (isoap)->isoa_len;
364*36366Ssklower 
365*36366Ssklower /*
366*36366Ssklower  *	Clnp hdr cache.	Whenever a clnp packet is sent, a copy of the
367*36366Ssklower  *	header is made and kept in this cache. In addition to a copy of
368*36366Ssklower  *	the cached clnp hdr, the cache contains
369*36366Ssklower  *	information necessary to determine whether the new packet
370*36366Ssklower  *	to send requires a new header to be built.
371*36366Ssklower  */
372*36366Ssklower struct clnp_cache {
373*36366Ssklower 	/* these fields are used to check the validity of the cache */
374*36366Ssklower 	struct iso_addr		clc_dst;		/* destination of packet */
375*36366Ssklower 	struct mbuf 		*clc_options;	/* ptr to options mbuf */
376*36366Ssklower 	int					clc_flags;		/* flags passed to clnp_output */
377*36366Ssklower 
378*36366Ssklower 	/* these fields are state that clnp_output requires to finish the pkt */
379*36366Ssklower 	int					clc_segoff;		/* offset of seg part of header */
380*36366Ssklower 	struct sockaddr		*clc_firsthop;	/* first hop of packet (points into
381*36366Ssklower 											the route structure) */
382*36366Ssklower 	struct ifnet		*clc_ifp;		/* ptr to interface (points into
383*36366Ssklower 											the route structure) */
384*36366Ssklower 	struct mbuf 		*clc_hdr;		/* cached pkt hdr (finally)! */
385*36366Ssklower };
386*36366Ssklower 
387*36366Ssklower #ifndef	satosiso
388*36366Ssklower #define	satosiso(sa)\
389*36366Ssklower 	((struct sockaddr_iso *)(sa))
390*36366Ssklower #endif
391*36366Ssklower 
392*36366Ssklower #ifdef	KERNEL
393*36366Ssklower caddr_t			clnp_insert_addr();
394*36366Ssklower struct iso_addr	*clnp_srcaddr();
395*36366Ssklower struct mbuf		*clnp_reass();
396*36366Ssklower #ifdef	TROLL
397*36366Ssklower struct troll	trollctl;
398*36366Ssklower #endif	TROLL
399*36366Ssklower #endif	KERNEL
400