Add copyright
[unix-history] / usr / src / sys / netns / ns_error.h
CommitLineData
95eaf934
KS
1/* ns_error.h 6.1 85/05/30 */
2
3/*
4 * Xerox NS error messages
5 */
6
7struct ns_errp {
8 u_short ns_err_num; /* Error Number */
9 u_short ns_err_param; /* Error Parameter */
10 struct idp ns_err_idp; /* Initial segment of offending
11 packet */
12 u_char ns_err_lev2[12]; /* at least this much higher
13 level protocol */
14};
15struct ns_epidp {
16 struct idp ns_ep_idp;
17 struct ns_errp ns_ep_errp;
18};
19
20#define NS_ERR_UNSPEC 0 /* Unspecified Error detected at dest. */
21#define NS_ERR_BADSUM 1 /* Bad Checksum detected at dest */
22#define NS_ERR_NOSOCK 2 /* Specified socket does not exist at dest*/
23#define NS_ERR_FULLUP 3 /* Dest. refuses packet due to resource lim.*/
24#define NS_ERR_UNSPEC_T 0x200 /* Unspec. Error occured before reaching dest*/
25#define NS_ERR_BADSUM_T 0x201 /* Bad Checksum detected in transit */
26#define NS_ERR_UNREACH_HOST 0x202 /* Dest cannot be reached from here*/
27#define NS_ERR_TOO_OLD 0x203 /* Packet x'd 15 routers without delivery*/
28#define NS_ERR_TOO_BIG 0x204 /* Packet too large to be forwarded through
29 some intermediate gateway. The error
30 parameter field contains the max packet
31 size that can be accommodated */
32#define NS_ERR_ATHOST 4
33#define NS_ERR_ENROUTE 5
34#define NS_ERR_MAX (NS_ERR_ATHOST + NS_ERR_ENROUTE + 1)
35#define ns_err_x(c) (((c)&0x200) ? ((c) - 0x200 + NS_ERR_ATHOST) : c )
36
37/*
38 * Variables related to this implementation
39 * of the network systems error message protocol.
40 */
41struct ns_errstat {
42/* statistics related to ns_err packets generated */
43 int ns_es_error; /* # of calls to ns_error */
44 int ns_es_oldshort; /* no error 'cuz old ip too short */
45 int ns_es_oldns_err; /* no error 'cuz old was ns_err */
46 int ns_es_outhist[NS_ERR_MAX];
47/* statistics related to input messages processed */
48 int ns_es_badcode; /* ns_err_code out of range */
49 int ns_es_tooshort; /* packet < IDP_MINLEN */
50 int ns_es_checksum; /* bad checksum */
51 int ns_es_badlen; /* calculated bound mismatch */
52 int ns_es_reflect; /* number of responses */
53 int ns_es_inhist[NS_ERR_MAX];
54};
55
56#ifdef KERNEL
57struct ns_errstat ns_errstat;
58#endif