]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - sys/netipx/spx_var.h
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / sys / netipx / spx_var.h
1 /*-
2  * Copyright (c) 1984, 1985, 1986, 1987, 1993
3  *      The Regents of the University of California.  All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  * 4. Neither the name of the University nor the names of its contributors
14  *    may be used to endorse or promote products derived from this software
15  *    without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27  * SUCH DAMAGE.
28  *
29  * Copyright (c) 1995, Mike Mitchell
30  *
31  * Redistribution and use in source and binary forms, with or without
32  * modification, are permitted provided that the following conditions
33  * are met:
34  * 1. Redistributions of source code must retain the above copyright
35  *    notice, this list of conditions and the following disclaimer.
36  * 2. Redistributions in binary form must reproduce the above copyright
37  *    notice, this list of conditions and the following disclaimer in the
38  *    documentation and/or other materials provided with the distribution.
39  * 3. All advertising materials mentioning features or use of this software
40  *    must display the following acknowledgement:
41  *      This product includes software developed by the University of
42  *      California, Berkeley and its contributors.
43  * 4. Neither the name of the University nor the names of its contributors
44  *    may be used to endorse or promote products derived from this software
45  *    without specific prior written permission.
46  *
47  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
48  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
49  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
50  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
51  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
52  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
53  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
54  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
55  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
56  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
57  * SUCH DAMAGE.
58  *
59  *      @(#)spx_var.h
60  *
61  * $FreeBSD$
62  */
63
64 #ifndef _NETIPX_SPX_VAR_H_
65 #define _NETIPX_SPX_VAR_H_
66
67 struct  spxstat {
68         long    spxs_connattempt;       /* connections initiated */
69         long    spxs_accepts;           /* connections accepted */
70         long    spxs_connects;          /* connections established */
71         long    spxs_drops;             /* connections dropped */
72         long    spxs_conndrops;         /* embryonic connections dropped */
73         long    spxs_closed;            /* conn. closed (includes drops) */
74         long    spxs_segstimed;         /* segs where we tried to get rtt */
75         long    spxs_rttupdated;        /* times we succeeded */
76         long    spxs_delack;            /* delayed acks sent */
77         long    spxs_timeoutdrop;       /* conn. dropped in rxmt timeout */
78         long    spxs_rexmttimeo;        /* retransmit timeouts */
79         long    spxs_persisttimeo;      /* persist timeouts */
80         long    spxs_keeptimeo;         /* keepalive timeouts */
81         long    spxs_keepprobe;         /* keepalive probes sent */
82         long    spxs_keepdrops;         /* connections dropped in keepalive */
83
84         long    spxs_sndtotal;          /* total packets sent */
85         long    spxs_sndpack;           /* data packets sent */
86         long    spxs_sndbyte;           /* data bytes sent */
87         long    spxs_sndrexmitpack;     /* data packets retransmitted */
88         long    spxs_sndrexmitbyte;     /* data bytes retransmitted */
89         long    spxs_sndacks;           /* ack-only packets sent */
90         long    spxs_sndprobe;          /* window probes sent */
91         long    spxs_sndurg;            /* packets sent with URG only */
92         long    spxs_sndwinup;          /* window update-only packets sent */
93         long    spxs_sndctrl;           /* control (SYN|FIN|RST) packets sent */
94         long    spxs_sndvoid;           /* couldn't find requested packet*/
95
96         long    spxs_rcvtotal;          /* total packets received */
97         long    spxs_rcvpack;           /* packets received in sequence */
98         long    spxs_rcvbyte;           /* bytes received in sequence */
99         long    spxs_rcvbadsum;         /* packets received with ccksum errs */
100         long    spxs_rcvbadoff;         /* packets received with bad offset */
101         long    spxs_rcvshort;          /* packets received too short */
102         long    spxs_rcvduppack;        /* duplicate-only packets received */
103         long    spxs_rcvdupbyte;        /* duplicate-only bytes received */
104         long    spxs_rcvpartduppack;    /* packets with some duplicate data */
105         long    spxs_rcvpartdupbyte;    /* dup. bytes in part-dup. packets */
106         long    spxs_rcvoopack;         /* out-of-order packets received */
107         long    spxs_rcvoobyte;         /* out-of-order bytes received */
108         long    spxs_rcvpackafterwin;   /* packets with data after window */
109         long    spxs_rcvbyteafterwin;   /* bytes rcvd after window */
110         long    spxs_rcvafterclose;     /* packets rcvd after "close" */
111         long    spxs_rcvwinprobe;       /* rcvd window probe packets */
112         long    spxs_rcvdupack;         /* rcvd duplicate acks */
113         long    spxs_rcvacktoomuch;     /* rcvd acks for unsent data */
114         long    spxs_rcvackpack;        /* rcvd ack packets */
115         long    spxs_rcvackbyte;        /* bytes acked by rcvd acks */
116         long    spxs_rcvwinupd;         /* rcvd window update packets */
117 };
118 struct  spx_istat {
119         short   hdrops;
120         short   badsum;
121         short   badlen;
122         short   slotim;
123         short   fastim;
124         short   nonucn;
125         short   noconn;
126         short   notme;
127         short   wrncon;
128         short   bdreas;
129         short   gonawy;
130         short   notyet;
131         short   lstdup;
132         struct spxstat newstats;
133 };
134
135 #define SPX_ISSINCR     128
136 /*
137  * spx sequence numbers are 16 bit integers operated
138  * on with modular arithmetic.  These macros can be
139  * used to compare such integers.
140  */
141 #define SSEQ_LT(a,b)    (((short)((a)-(b))) < 0)
142 #define SSEQ_LEQ(a,b)   (((short)((a)-(b))) <= 0)
143 #define SSEQ_GT(a,b)    (((short)((a)-(b))) > 0)
144 #define SSEQ_GEQ(a,b)   (((short)((a)-(b))) >= 0)
145
146 #ifdef _KERNEL
147 /* Following was struct spxstat spxstat; */
148 #ifndef spxstat
149 #define spxstat spx_istat.newstats
150 #endif
151 extern struct spx_istat spx_istat;
152 extern u_short  spx_newchecks[50];
153
154 int     spx_output(struct spxpcb *cb, struct mbuf *m0);
155 int     spx_reass(struct spxpcb *cb, struct mbuf *msi, struct spx *si);
156 void    spx_reass_flush(struct spxpcb *cb);
157 void    spx_reass_init(struct spxpcb *cb);
158 #endif
159
160 #endif /* !_NETIPX_SPX_VAR_H_ */