xref: /csrg-svn/sys/netiso/clnp.h (revision 36762)
136366Ssklower /***********************************************************
236366Ssklower 		Copyright IBM Corporation 1987
336366Ssklower 
436366Ssklower                       All Rights Reserved
536366Ssklower 
636366Ssklower Permission to use, copy, modify, and distribute this software and its
736366Ssklower documentation for any purpose and without fee is hereby granted,
836366Ssklower provided that the above copyright notice appear in all copies and that
936366Ssklower both that copyright notice and this permission notice appear in
1036366Ssklower supporting documentation, and that the name of IBM not be
1136366Ssklower used in advertising or publicity pertaining to distribution of the
1236366Ssklower software without specific, written prior permission.
1336366Ssklower 
1436366Ssklower IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
1536366Ssklower ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
1636366Ssklower IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
1736366Ssklower ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
1836366Ssklower WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
1936366Ssklower ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
2036366Ssklower SOFTWARE.
2136366Ssklower 
2236366Ssklower ******************************************************************/
2336366Ssklower 
2436366Ssklower /*
2536366Ssklower  * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
2636366Ssklower  */
27*36762Ssklower /* $Header: /var/src/sys/netiso/RCS/clnp.h,v 5.1 89/02/09 16:17:22 hagens Exp $ */
28*36762Ssklower /* $Source: /var/src/sys/netiso/RCS/clnp.h,v $ */
29*36762Ssklower /*	@(#)clnp.h	7.3 (Berkeley) 02/14/89 */
3036366Ssklower 
3136366Ssklower #ifndef BYTE_ORDER
3236366Ssklower /*
3336366Ssklower  * Definitions for byte order,
3436366Ssklower  * according to byte significance from low address to high.
3536366Ssklower  */
3636366Ssklower #define	LITTLE_ENDIAN	1234	/* least-significant byte first (vax) */
3736366Ssklower #define	BIG_ENDIAN	4321	/* most-significant byte first (IBM, net) */
3836366Ssklower #define	PDP_ENDIAN	3412	/* LSB first in word, MSW first in long (pdp) */
3936366Ssklower 
4036366Ssklower #ifdef vax
4136366Ssklower #define	BYTE_ORDER	LITTLE_ENDIAN
4236366Ssklower #else
4336366Ssklower #define	BYTE_ORDER	BIG_ENDIAN	/* mc68000, tahoe, most others */
4436366Ssklower #endif
4536366Ssklower #endif BYTE_ORDER
4636366Ssklower 
47*36762Ssklower /* should be config option but cpp breaks with too many #defines */
48*36762Ssklower #define	DECBIT
49*36762Ssklower 
5036366Ssklower /*
5136366Ssklower  *	Return true if the mbuf is a cluster mbuf
5236366Ssklower  */
5336761Ssklower #define	IS_CLUSTER(m)	((m)->m_flags & M_EXT)
5436366Ssklower 
5536366Ssklower /*
5636366Ssklower  *	Move the halfword into the two characters
5736366Ssklower  */
5836366Ssklower #define	HTOC(msb, lsb, hword)\
5936366Ssklower 	(msb) = (u_char)((hword) >> 8);\
6036366Ssklower 	(lsb) = (u_char)((hword) & 0xff)
6136366Ssklower /*
6236366Ssklower  *	Move the two charcters into the halfword
6336366Ssklower  */
6436366Ssklower #define	CTOH(msb, lsb, hword)\
6536366Ssklower 	(hword) = ((msb) << 8) | (lsb)
6636366Ssklower 
6736366Ssklower /*
6836366Ssklower  *	Return true if the checksum has been set - ie. the checksum is
6936366Ssklower  *	not zero
7036366Ssklower  */
7136366Ssklower #define	CKSUM_REQUIRED(clnp)\
7236366Ssklower 	(((clnp)->cnf_cksum_msb != 0) || ((clnp)->cnf_cksum_lsb != 0))
7336366Ssklower 
7436366Ssklower /*
7536366Ssklower  *	Fixed part of clnp header
7636366Ssklower  */
7736366Ssklower struct clnp_fixed {
7836366Ssklower 	u_char	cnf_proto_id;		/* network layer protocol identifier */
7936366Ssklower 	u_char	cnf_hdr_len;		/* length indicator (octets) */
8036366Ssklower 	u_char	cnf_vers;			/* version/protocol identifier extension */
8136366Ssklower 	u_char	cnf_ttl;			/* lifetime (500 milliseconds) */
8236366Ssklower #if BYTE_ORDER == LITTLE_ENDIAN
8336366Ssklower 	u_char	cnf_type:5,			/* type code */
8436366Ssklower 			cnf_err_ok:1,		/* flag: error report */
8536366Ssklower 			cnf_more_segs:1,	/* flag: more segments */
8636366Ssklower 			cnf_seg_ok:1;		/* flag: segmentation permitted */
8736366Ssklower #endif
8836366Ssklower #if BYTE_ORDER == BIG_ENDIAN
8936366Ssklower 	u_char	cnf_seg_ok:1,		/* flag: segmentation permitted */
9036366Ssklower 			cnf_more_segs:1,	/* flag: more segments */
9136366Ssklower 			cnf_err_ok:1,		/* flag: error report */
9236366Ssklower 			cnf_type:5;			/* type code */
9336366Ssklower #endif
9436366Ssklower 	u_char	cnf_seglen_msb;		/* pdu segment length (octets) high byte */
9536366Ssklower 	u_char	cnf_seglen_lsb;		/* pdu segment length (octets) low byte */
9636366Ssklower 	u_char	cnf_cksum_msb;		/* checksum high byte */
9736366Ssklower 	u_char	cnf_cksum_lsb;		/* checksum low byte */
9836366Ssklower };
9936366Ssklower #define CLNP_CKSUM_OFF	0x07	/* offset of checksum */
10036366Ssklower 
10136366Ssklower #define	clnl_fixed	clnp_fixed
10236366Ssklower 
10336366Ssklower /*
10436366Ssklower  *	Segmentation part of clnp header
10536366Ssklower  */
10636366Ssklower struct clnp_segment {
10736366Ssklower 	u_short	cng_id;				/* data unit identifier */
10836366Ssklower 	u_short	cng_off;			/* segment offset */
10936366Ssklower 	u_short	cng_tot_len;		/* total length */
11036366Ssklower };
11136366Ssklower 
11236366Ssklower /*
11336366Ssklower  *	Clnp fragment reassembly structures:
11436366Ssklower  *
11536366Ssklower  *	All packets undergoing reassembly are linked together in
11636366Ssklower  *	clnp_fragl structures. Each clnp_fragl structure contains a
11736366Ssklower  *	pointer to the original clnp packet header, as well as a
11836366Ssklower  *	list of packet fragments. Each packet fragment
11936366Ssklower  *	is headed by a clnp_frag structure. This structure contains the
12036366Ssklower  *	offset of the first and last byte of the fragment, as well as
12136366Ssklower  *	a pointer to the data (an mbuf chain) of the fragment.
12236366Ssklower  */
12336366Ssklower 
12436366Ssklower /*
12536366Ssklower  *	NOTE:
12636366Ssklower  *		The clnp_frag structure is stored in an mbuf immedately preceeding
12736366Ssklower  *	the fragment data. Since there are words in this struct,
12836366Ssklower  *	it must be word aligned.
12936366Ssklower  *
13036366Ssklower  *	NOTE:
13136366Ssklower  *		All the fragment code assumes that the entire clnp header is
13236366Ssklower  *	contained in the first mbuf.
13336366Ssklower  */
13436366Ssklower struct clnp_frag {
13536366Ssklower 	u_int				cfr_first;		/* offset of first byte of this frag */
13636366Ssklower 	u_int				cfr_last;		/* offset of last byte of this frag */
13736366Ssklower 	u_int				cfr_bytes;		/* bytes to shave to get to data */
13836366Ssklower 	struct mbuf			*cfr_data;		/* ptr to data for this frag */
13936366Ssklower 	struct clnp_frag	*cfr_next;		/* next fragment in list */
14036366Ssklower };
14136366Ssklower 
14236366Ssklower struct clnp_fragl {
14336366Ssklower 	struct iso_addr		cfl_src;		/* source of the pkt */
14436366Ssklower 	struct iso_addr		cfl_dst;		/* destination of the pkt */
14536366Ssklower 	u_short				cfl_id;			/* id of the pkt */
14636366Ssklower 	u_char				cfl_ttl;		/* current ttl of pkt */
14736366Ssklower 	u_short				cfl_last;		/* offset of last byte of packet */
14836366Ssklower 	struct mbuf 		*cfl_orighdr;	/* ptr to original header */
14936366Ssklower 	struct clnp_frag	*cfl_frags;		/* linked list of fragments for pkt */
15036366Ssklower 	struct clnp_fragl	*cfl_next;		/* next pkt being reassembled */
15136366Ssklower };
15236366Ssklower 
15336366Ssklower /*
15436366Ssklower  *	The following structure is used to index into an options section
15536366Ssklower  *	of a clnp datagram. These values can be used without worry that
15636366Ssklower  *	offset or length fields are invalid or too big, etc. That is,
15736366Ssklower  *	the consistancy of the options will be guaranteed before this
15836366Ssklower  *	structure is filled in. Any pointer (field ending in p) is
15936366Ssklower  *	actually the offset from the beginning of the mbuf the option
16036366Ssklower  *	is contained in.  A value of NULL for any pointer
16136366Ssklower  *	means that the option is not present. The length any option
16236366Ssklower  *	does not include the option code or option length fields.
16336366Ssklower  */
16436366Ssklower struct clnp_optidx {
16536366Ssklower 	u_short	cni_securep;		/* ptr to beginning of security option */
16636366Ssklower 	char	cni_secure_len;		/* length of entire security option */
16736366Ssklower 
16836366Ssklower 	u_short	cni_srcrt_s;		/* offset of start of src rt option */
16936366Ssklower 	u_short	cni_srcrt_len;		/* length of entire src rt option */
17036366Ssklower 
17136366Ssklower 	u_short	cni_recrtp;			/* ptr to beginning of recrt option */
17236366Ssklower 	char	cni_recrt_len;		/* length of entire recrt option */
17336366Ssklower 
17436366Ssklower 	char	cni_priorp;			/* ptr to priority option */
17536366Ssklower 
17636366Ssklower 	u_short	cni_qos_formatp;	/* ptr to format of qos option */
17736366Ssklower 	char	cni_qos_len;		/* length of entire qos option */
17836366Ssklower 
17936366Ssklower 	u_char	cni_er_reason;		/* reason from ER pdu option */
18036366Ssklower };
18136366Ssklower 
18236366Ssklower #define	ER_INVALREAS	0xff	/* code for invalid ER pdu discard reason */
18336366Ssklower 
184*36762Ssklower /* given an mbuf and addr of option, return offset from data of mbuf */
185*36762Ssklower #define CLNP_OPTTOOFF(m, opt)\
186*36762Ssklower 	((u_short) (opts - mtod(m, caddr_t)))
187*36762Ssklower 
188*36762Ssklower /* given an mbuf and offset of option, return address of option */
189*36762Ssklower #define CLNP_OFFTOOPT(m, off)\
190*36762Ssklower 	((caddr_t) (mtod(m, caddr_t) + off))
191*36762Ssklower 
19236366Ssklower /*	return true iff src route is valid */
19336366Ssklower #define	CLNPSRCRT_VALID(oidx)\
19436366Ssklower 	((oidx) && (oidx->cni_srcrt_s))
19536366Ssklower 
19636366Ssklower /*	return the offset field of the src rt */
19736366Ssklower #define CLNPSRCRT_OFF(oidx, options)\
198*36762Ssklower 	(*((u_char *)(CLNP_OFFTOOPT(options, oidx->cni_srcrt_s) + 1)))
19936366Ssklower 
20036366Ssklower /*	return the type field of the src rt */
20136366Ssklower #define CLNPSRCRT_TYPE(oidx, options)\
202*36762Ssklower 	((u_char)(*(CLNP_OFFTOOPT(options, oidx->cni_srcrt_s))))
20336366Ssklower 
20436366Ssklower /* return the length of the current address */
20536366Ssklower #define CLNPSRCRT_CLEN(oidx, options)\
206*36762Ssklower 	((u_char)(*(CLNP_OFFTOOPT(options, oidx->cni_srcrt_s) + CLNPSRCRT_OFF(oidx, options) - 1)))
20736366Ssklower 
20836366Ssklower /* return the address of the current address */
20936366Ssklower #define CLNPSRCRT_CADDR(oidx, options)\
210*36762Ssklower 	((caddr_t)(CLNP_OFFTOOPT(options, oidx->cni_srcrt_s) + CLNPSRCRT_OFF(oidx, options)))
21136366Ssklower 
21236366Ssklower /*
21336366Ssklower  *	return true if the src route has run out of routes
21436366Ssklower  *	this is true if the offset of next route is greater than the end of the rt
21536366Ssklower  */
21636366Ssklower #define	CLNPSRCRT_TERM(oidx, options)\
21736366Ssklower 	(CLNPSRCRT_OFF(oidx, options) > oidx->cni_srcrt_len)
21836366Ssklower 
21936366Ssklower /*
22036366Ssklower  *	Options a user can set/get
22136366Ssklower  */
22236366Ssklower #define	CLNPOPT_FLAGS	0x01	/* flags: seg permitted, no er xmit, etc  */
22336366Ssklower #define	CLNPOPT_OPTS	0x02	/* datagram options */
22436366Ssklower 
22536366Ssklower /*
22636366Ssklower  *	Values for particular datagram options
22736366Ssklower  */
22836366Ssklower #define	CLNPOVAL_PAD		0xcc	/* padding */
22936366Ssklower #define	CLNPOVAL_SECURE		0xc5	/* security */
23036366Ssklower #define	CLNPOVAL_SRCRT		0xc8	/* source routing */
23136366Ssklower #define	CLNPOVAL_RECRT		0xcb	/* record route */
23236366Ssklower #define	CLNPOVAL_QOS		0xc3	/* quality of service */
23336366Ssklower #define	CLNPOVAL_PRIOR		0xcd	/* priority */
23436366Ssklower #define CLNPOVAL_ERREAS		0xc1	/* ER PDU ONLY: reason for discard */
23536366Ssklower 
23636366Ssklower #define	CLNPOVAL_SRCSPEC	0x40	/* source address specific */
23736366Ssklower #define	CLNPOVAL_DSTSPEC	0x80	/* destination address specific */
23836366Ssklower #define	CLNPOVAL_GLOBAL		0xc0	/* globally unique */
23936366Ssklower 
240*36762Ssklower /* Globally Unique QOS */
241*36762Ssklower #define	CLNPOVAL_SEQUENCING	0x10	/* sequencing preferred */
242*36762Ssklower #define CLNPOVAL_CONGESTED	0x08	/* congestion experienced */
243*36762Ssklower #define CLNPOVAL_LOWDELAY	0x04	/* low transit delay */
244*36762Ssklower 
24536366Ssklower #define	CLNPOVAL_PARTRT		0x00	/* partial source routing */
24636366Ssklower #define CLNPOVAL_COMPRT		0x01	/* complete source routing */
24736366Ssklower 
24836366Ssklower /*
24936366Ssklower  *	Clnp flags used in a control block flags field.
25036366Ssklower  *	NOTE: these must be out of the range of bits defined in ../net/raw_cb.h
25136366Ssklower  */
25236366Ssklower #define	CLNP_NO_SEG		0x010	/* segmentation not permitted */
25336366Ssklower #define	CLNP_NO_ER		0x020	/* do not generate ERs */
25436366Ssklower #define CLNP_SEND_RAW	0x080	/* send pkt as RAW DT rather than TP DT */
25536366Ssklower #define	CLNP_NO_CKSUM	0x100	/* don't use clnp checksum */
25636366Ssklower #define CLNP_ECHO		0x200	/* fake echo function */
25736366Ssklower #define	CLNP_NOCACHE	0x400	/* don't store cache information */
25836366Ssklower 
25936366Ssklower /* valid clnp flags */
26036366Ssklower #define CLNP_VFLAGS		(CLNP_SEND_RAW|CLNP_NO_SEG|CLNP_NO_ER|CLNP_NO_CKSUM\
26136366Ssklower 	|CLNP_ECHO|CLNP_NOCACHE)
26236366Ssklower 
26336366Ssklower /*
26436366Ssklower  *	Constants used by clnp
26536366Ssklower  */
26636366Ssklower #define	CLNP_HDR_MIN	(sizeof (struct clnp_fixed))
26736366Ssklower #define	CLNP_HDR_MAX	(254)
26836366Ssklower #define	CLNP_TTL_UNITS	2					/* 500 milliseconds */
26936366Ssklower #define CLNP_TTL		15*CLNP_TTL_UNITS	/* time to live (seconds) */
27036366Ssklower #define	ISO8473_V1		0x01
27136366Ssklower 
27236366Ssklower /*
27336366Ssklower  *	Clnp packet types
27436366Ssklower  *	In order to test raw clnp and tp/clnp simultaneously, a third type of
27536366Ssklower  *	packet has been defined: CLNP_RAW. This is done so that the input
27636366Ssklower  *	routine can switch to the correct input routine (rclnp_input or
27736366Ssklower  *	tpclnp_input) based on the type field. If clnp had a higher level protocol
27836366Ssklower  *	field, this would not be necessary.
27936366Ssklower  */
28036366Ssklower #define	CLNP_DT			0x1C	/* normal data */
28136366Ssklower #define	CLNP_ER			0x01	/* error report */
28236366Ssklower #define	CLNP_RAW		0x1D	/* debug only */
28336366Ssklower #define CLNP_EC			0x1E	/* echo packet */
28436366Ssklower #define CLNP_ECR		0x1F	/* echo reply */
28536366Ssklower 
28636366Ssklower /*
28736366Ssklower  *	ER pdu error codes
28836366Ssklower  */
28936366Ssklower #define GEN_NOREAS			0x00	/* reason not specified */
29036366Ssklower #define GEN_PROTOERR		0x01	/* protocol procedure error */
29136366Ssklower #define GEN_BADCSUM			0x02	/* incorrect checksum */
29236366Ssklower #define GEN_CONGEST			0x03	/* pdu discarded due to congestion */
29336366Ssklower #define GEN_HDRSYNTAX		0x04	/* header syntax error */
29436366Ssklower #define GEN_SEGNEEDED		0x05	/* segmentation needed, but not permitted */
29536366Ssklower #define GEN_INCOMPLETE		0x06	/* incomplete pdu received */
29636366Ssklower #define GEN_DUPOPT			0x07	/* duplicate option */
29736366Ssklower 
29836366Ssklower /* address errors */
29936366Ssklower #define ADDR_DESTUNREACH	0x80	/* destination address unreachable */
30036366Ssklower #define ADDR_DESTUNKNOWN	0x81	/* destination address unknown */
30136366Ssklower 
30236366Ssklower /* source routing */
30336366Ssklower #define SRCRT_UNSPECERR		0x90	/* unspecified src rt error */
30436366Ssklower #define SRCRT_SYNTAX		0x91	/* syntax error in src rt field */
30536366Ssklower #define SRCRT_UNKNOWNADDR	0x92	/* unknown addr in src rt field */
30636366Ssklower #define SRCRT_BADPATH		0x93	/* path not acceptable */
30736366Ssklower 
30836366Ssklower /* lifetime */
30936366Ssklower #define TTL_EXPTRANSIT		0xa0	/* lifetime expired during transit */
31036366Ssklower #define TTL_EXPREASS		0xa1	/* lifetime expired during reassembly */
31136366Ssklower 
31236366Ssklower /* pdu discarded */
31336366Ssklower #define DISC_UNSUPPOPT		0xb0	/* unsupported option not specified? */
31436366Ssklower #define DISC_UNSUPPVERS		0xb1	/* unsupported protocol version */
31536366Ssklower #define DISC_UNSUPPSECURE	0xb2	/* unsupported security option */
31636366Ssklower #define DISC_UNSUPPSRCRT	0xb3	/* unsupported src rt option */
31736366Ssklower #define DISC_UNSUPPRECRT	0xb4	/* unsupported rec rt option */
31836366Ssklower 
31936366Ssklower /* reassembly */
32036366Ssklower #define REASS_INTERFERE		0xc0	/* reassembly interference */
32136366Ssklower 
32236366Ssklower #ifdef	TROLL
32336366Ssklower 
32436366Ssklower #define	TR_DUPEND		0x01	/* duplicate end of fragment */
32536366Ssklower #define TR_DUPPKT		0x02	/* duplicate entire packet */
32636366Ssklower #define	TR_DROPPKT		0x04	/* drop packet on output */
32736366Ssklower #define TR_TRIM			0x08	/* trim bytes from packet */
32836366Ssklower #define TR_CHANGE		0x10	/* change bytes in packet */
32936366Ssklower #define TR_MTU			0x20	/* delta to change device mtu */
33036366Ssklower #define	TR_CHUCK		0x40	/* drop packet in rclnp_input */
33136366Ssklower #define	TR_BLAST		0x80	/* force rclnp_output to blast many packet */
33236366Ssklower #define	TR_RAWLOOP		0x100	/* make if_loop call clnpintr directly */
33336366Ssklower struct troll {
33436366Ssklower 	int		tr_ops;				/* operations to perform */
33536366Ssklower 	float	tr_dup_size;		/* % to duplicate */
33636366Ssklower 	float	tr_dup_freq;		/* frequency to duplicate packets */
33736366Ssklower 	float	tr_drop_freq;		/* frequence to drop packets */
33836366Ssklower 	int		tr_mtu_adj;			/* delta to adjust if mtu */
33936366Ssklower 	int		tr_blast_cnt;		/* # of pkts to blast out */
34036366Ssklower };
34136366Ssklower 
34236366Ssklower #define	SN_OUTPUT(clcp, m)\
34336366Ssklower 	troll_output(clcp->clc_ifp, m, clcp->clc_firsthop)
34436366Ssklower 
34536366Ssklower #define	SN_MTU(ifp)\
34636366Ssklower 	(ifp->if_mtu - trollctl.tr_mtu_adj)
34736366Ssklower 
34836366Ssklower #else	/* NO TROLL */
34936366Ssklower 
35036366Ssklower #define	SN_OUTPUT(clcp, m)\
35136366Ssklower 	(*clcp->clc_ifp->if_output)(clcp->clc_ifp, m, clcp->clc_firsthop)
35236366Ssklower 
35336366Ssklower #define	SN_MTU(ifp)\
35436366Ssklower 	(ifp->if_mtu)
35536366Ssklower 
35636366Ssklower #endif	TROLL
35736366Ssklower 
35836366Ssklower /*
35936366Ssklower  *	Macro to remove an address from a clnp header
36036366Ssklower  */
36136366Ssklower #define CLNP_EXTRACT_ADDR(isoa, hoff, hend)\
36236366Ssklower 	{\
36336366Ssklower 		isoa.isoa_len = (u_char)*hoff;\
36436366Ssklower 		if ((((++hoff) + isoa.isoa_len) > hend) ||\
36536366Ssklower 			(isoa.isoa_len > 20) || (isoa.isoa_len == 0)) {\
36636366Ssklower 			hoff = (caddr_t)0;\
36736366Ssklower 		} else {\
36836366Ssklower 			(void) bcopy(hoff, (caddr_t)&isoa, isoa.isoa_len);\
36936366Ssklower 			hoff += isoa.isoa_len;\
37036366Ssklower 		}\
37136366Ssklower 	}
37236366Ssklower 
37336366Ssklower /*
37436366Ssklower  *	Macro to insert an address into a clnp header
37536366Ssklower  */
37636366Ssklower #define CLNP_INSERT_ADDR(hoff, isoap)\
37736366Ssklower 	*hoff++ = (isoap)->isoa_len;\
37836366Ssklower 	(void) bcopy((caddr_t)(isoap), hoff, (isoap)->isoa_len);\
37936366Ssklower 	hoff += (isoap)->isoa_len;
38036366Ssklower 
38136366Ssklower /*
38236366Ssklower  *	Clnp hdr cache.	Whenever a clnp packet is sent, a copy of the
38336366Ssklower  *	header is made and kept in this cache. In addition to a copy of
38436366Ssklower  *	the cached clnp hdr, the cache contains
38536366Ssklower  *	information necessary to determine whether the new packet
38636366Ssklower  *	to send requires a new header to be built.
38736366Ssklower  */
38836366Ssklower struct clnp_cache {
38936366Ssklower 	/* these fields are used to check the validity of the cache */
39036366Ssklower 	struct iso_addr		clc_dst;		/* destination of packet */
39136366Ssklower 	struct mbuf 		*clc_options;	/* ptr to options mbuf */
39236366Ssklower 	int					clc_flags;		/* flags passed to clnp_output */
39336366Ssklower 
39436366Ssklower 	/* these fields are state that clnp_output requires to finish the pkt */
39536366Ssklower 	int					clc_segoff;		/* offset of seg part of header */
39636366Ssklower 	struct sockaddr		*clc_firsthop;	/* first hop of packet (points into
39736366Ssklower 											the route structure) */
39836366Ssklower 	struct ifnet		*clc_ifp;		/* ptr to interface (points into
39936366Ssklower 											the route structure) */
40036366Ssklower 	struct mbuf 		*clc_hdr;		/* cached pkt hdr (finally)! */
40136366Ssklower };
40236366Ssklower 
40336366Ssklower #ifndef	satosiso
40436366Ssklower #define	satosiso(sa)\
40536366Ssklower 	((struct sockaddr_iso *)(sa))
40636366Ssklower #endif
40736366Ssklower 
40836366Ssklower #ifdef	KERNEL
40936366Ssklower caddr_t			clnp_insert_addr();
41036366Ssklower struct iso_addr	*clnp_srcaddr();
41136366Ssklower struct mbuf		*clnp_reass();
41236366Ssklower #ifdef	TROLL
41336366Ssklower struct troll	trollctl;
41436366Ssklower #endif	TROLL
41536366Ssklower #endif	KERNEL
416