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