xref: /csrg-svn/sys/netns/ns_error.h (revision 34856)
123207Smckusick /*
2*34856Sbostic  * Copyright (c) 1984, 1988 Regents of the University of California.
333371Ssklower  * All rights reserved.
423207Smckusick  *
533371Ssklower  * Redistribution and use in source and binary forms are permitted
6*34856Sbostic  * provided that the above copyright notice and this paragraph are
7*34856Sbostic  * duplicated in all such forms and that any documentation,
8*34856Sbostic  * advertising materials, and other materials related to such
9*34856Sbostic  * distribution and use acknowledge that the software was developed
10*34856Sbostic  * by the University of California, Berkeley.  The name of the
11*34856Sbostic  * University may not be used to endorse or promote products derived
12*34856Sbostic  * from this software without specific prior written permission.
13*34856Sbostic  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14*34856Sbostic  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15*34856Sbostic  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
1633371Ssklower  *
17*34856Sbostic  *	@(#)ns_error.h	7.4 (Berkeley) 06/29/88
1823207Smckusick  */
1921484Ssklower 
2021484Ssklower /*
2121484Ssklower  * Xerox NS error messages
2221484Ssklower  */
2321484Ssklower 
2421484Ssklower struct ns_errp {
2521484Ssklower 	u_short		ns_err_num;		/* Error Number */
2621484Ssklower 	u_short		ns_err_param;		/* Error Parameter */
2721484Ssklower 	struct idp	ns_err_idp;		/* Initial segment of offending
2821484Ssklower 						   packet */
2921484Ssklower 	u_char		ns_err_lev2[12];	/* at least this much higher
3021484Ssklower 						   level protocol */
3121484Ssklower };
3221484Ssklower struct  ns_epidp {
3321484Ssklower 	struct idp ns_ep_idp;
3421484Ssklower 	struct ns_errp ns_ep_errp;
3521484Ssklower };
3621484Ssklower 
3721484Ssklower #define	NS_ERR_UNSPEC	0	/* Unspecified Error detected at dest. */
3821484Ssklower #define	NS_ERR_BADSUM	1	/* Bad Checksum detected at dest */
3921484Ssklower #define	NS_ERR_NOSOCK	2	/* Specified socket does not exist at dest*/
4021484Ssklower #define	NS_ERR_FULLUP	3	/* Dest. refuses packet due to resource lim.*/
4121484Ssklower #define	NS_ERR_UNSPEC_T	0x200	/* Unspec. Error occured before reaching dest*/
4221484Ssklower #define	NS_ERR_BADSUM_T	0x201	/* Bad Checksum detected in transit */
4321484Ssklower #define	NS_ERR_UNREACH_HOST	0x202	/* Dest cannot be reached from here*/
4421484Ssklower #define	NS_ERR_TOO_OLD	0x203	/* Packet x'd 15 routers without delivery*/
4521484Ssklower #define	NS_ERR_TOO_BIG	0x204	/* Packet too large to be forwarded through
4621484Ssklower 				   some intermediate gateway.  The error
4721484Ssklower 				   parameter field contains the max packet
4821484Ssklower 				   size that can be accommodated */
4933411Ssklower #define NS_ERR_MAX 20
5021484Ssklower 
5121484Ssklower /*
5221484Ssklower  * Variables related to this implementation
5321484Ssklower  * of the network systems error message protocol.
5421484Ssklower  */
5521484Ssklower struct	ns_errstat {
5621484Ssklower /* statistics related to ns_err packets generated */
5721484Ssklower 	int	ns_es_error;		/* # of calls to ns_error */
5821484Ssklower 	int	ns_es_oldshort;		/* no error 'cuz old ip too short */
5921484Ssklower 	int	ns_es_oldns_err;	/* no error 'cuz old was ns_err */
6021484Ssklower 	int	ns_es_outhist[NS_ERR_MAX];
6121484Ssklower /* statistics related to input messages processed */
6221484Ssklower 	int	ns_es_badcode;		/* ns_err_code out of range */
6321484Ssklower 	int	ns_es_tooshort;		/* packet < IDP_MINLEN */
6421484Ssklower 	int	ns_es_checksum;		/* bad checksum */
6521484Ssklower 	int	ns_es_badlen;		/* calculated bound mismatch */
6621484Ssklower 	int	ns_es_reflect;		/* number of responses */
6721484Ssklower 	int	ns_es_inhist[NS_ERR_MAX];
6833411Ssklower 	u_short	ns_es_codes[NS_ERR_MAX];/* which error code for outhist
6933411Ssklower 					   since we might not know all */
7021484Ssklower };
7121484Ssklower 
7221484Ssklower #ifdef KERNEL
7321484Ssklower struct	ns_errstat ns_errstat;
7421484Ssklower #endif
75