xref: /original-bsd/sys/netns/ns_error.h (revision d45fc766)
1 /*
2  * Copyright (c) 1984, 1988, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)ns_error.h	8.1 (Berkeley) 06/10/93
8  */
9 
10 /*
11  * Xerox NS error messages
12  */
13 
14 struct ns_errp {
15 	u_short		ns_err_num;		/* Error Number */
16 	u_short		ns_err_param;		/* Error Parameter */
17 	struct idp	ns_err_idp;		/* Initial segment of offending
18 						   packet */
19 	u_char		ns_err_lev2[12];	/* at least this much higher
20 						   level protocol */
21 };
22 struct  ns_epidp {
23 	struct idp ns_ep_idp;
24 	struct ns_errp ns_ep_errp;
25 };
26 
27 #define	NS_ERR_UNSPEC	0	/* Unspecified Error detected at dest. */
28 #define	NS_ERR_BADSUM	1	/* Bad Checksum detected at dest */
29 #define	NS_ERR_NOSOCK	2	/* Specified socket does not exist at dest*/
30 #define	NS_ERR_FULLUP	3	/* Dest. refuses packet due to resource lim.*/
31 #define	NS_ERR_UNSPEC_T	0x200	/* Unspec. Error occured before reaching dest*/
32 #define	NS_ERR_BADSUM_T	0x201	/* Bad Checksum detected in transit */
33 #define	NS_ERR_UNREACH_HOST	0x202	/* Dest cannot be reached from here*/
34 #define	NS_ERR_TOO_OLD	0x203	/* Packet x'd 15 routers without delivery*/
35 #define	NS_ERR_TOO_BIG	0x204	/* Packet too large to be forwarded through
36 				   some intermediate gateway.  The error
37 				   parameter field contains the max packet
38 				   size that can be accommodated */
39 #define NS_ERR_MAX 20
40 
41 /*
42  * Variables related to this implementation
43  * of the network systems error message protocol.
44  */
45 struct	ns_errstat {
46 /* statistics related to ns_err packets generated */
47 	int	ns_es_error;		/* # of calls to ns_error */
48 	int	ns_es_oldshort;		/* no error 'cuz old ip too short */
49 	int	ns_es_oldns_err;	/* no error 'cuz old was ns_err */
50 	int	ns_es_outhist[NS_ERR_MAX];
51 /* statistics related to input messages processed */
52 	int	ns_es_badcode;		/* ns_err_code out of range */
53 	int	ns_es_tooshort;		/* packet < IDP_MINLEN */
54 	int	ns_es_checksum;		/* bad checksum */
55 	int	ns_es_badlen;		/* calculated bound mismatch */
56 	int	ns_es_reflect;		/* number of responses */
57 	int	ns_es_inhist[NS_ERR_MAX];
58 	u_short	ns_es_codes[NS_ERR_MAX];/* which error code for outhist
59 					   since we might not know all */
60 };
61 
62 #ifdef KERNEL
63 struct	ns_errstat ns_errstat;
64 #endif
65