Fix markup. Fix backslashes to surive roff.
[netbsd-mini2440.git] / dist / tcpdump / sctpHeader.h
blobf5800fe050bb59c8fb2c3cfef522a40b04606f0a
1 /* $NetBSD$ */
3 /* @(#) Header: /tcpdump/master/tcpdump/sctpHeader.h,v 1.6 2002/12/11 07:14:11 guy Exp (LBL) */
5 /* SCTP reference Implementation Copyright (C) 1999 Cisco And Motorola
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
18 * 4. Neither the name of Cisco nor of Motorola may be used
19 * to endorse or promote products derived from this software without
20 * specific prior written permission.
22 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
34 * This file is part of the SCTP reference Implementation
37 * Please send any bug reports or fixes you make to one of the following email
38 * addresses:
40 * rstewar1@email.mot.com
41 * kmorneau@cisco.com
42 * qxie1@email.mot.com
44 * Any bugs reported given to us we will try to fix... any fixes shared will
45 * be incorperated into the next SCTP release.
49 #ifndef __sctpHeader_h__
50 #define __sctpHeader_h__
52 #include <sctpConstants.h>
54 #ifdef __cplusplus
55 extern "C" {
56 #endif
58 /* the sctp common header */
60 #ifdef TRU64
61 #define _64BITS 1
62 #endif
64 struct sctpHeader{
65 u_int16_t source;
66 u_int16_t destination;
67 u_int32_t verificationTag;
68 u_int32_t adler32;
71 /* various descriptor parsers */
73 struct sctpChunkDesc{
74 u_int8_t chunkID;
75 u_int8_t chunkFlg;
76 u_int16_t chunkLength;
79 struct sctpParamDesc{
80 u_int16_t paramType;
81 u_int16_t paramLength;
85 struct sctpRelChunkDesc{
86 struct sctpChunkDesc chk;
87 u_int32_t serialNumber;
90 struct sctpVendorSpecificParam {
91 struct sctpParamDesc p; /* type must be 0xfffe */
92 u_int32_t vendorId; /* vendor ID from RFC 1700 */
93 u_int16_t vendorSpecificType;
94 u_int16_t vendorSpecificLen;
98 /* Structures for the control parts */
102 /* Sctp association init request/ack */
104 /* this is used for init ack, too */
105 struct sctpInitiation{
106 u_int32_t initTag; /* tag of mine */
107 u_int32_t rcvWindowCredit; /* rwnd */
108 u_int16_t NumPreopenStreams; /* OS */
109 u_int16_t MaxInboundStreams; /* MIS */
110 u_int32_t initialTSN;
111 /* optional param's follow in sctpParamDesc form */
114 struct sctpV4IpAddress{
115 struct sctpParamDesc p; /* type is set to SCTP_IPV4_PARAM_TYPE, len=10 */
116 u_int32_t ipAddress;
120 struct sctpV6IpAddress{
121 struct sctpParamDesc p; /* type is set to SCTP_IPV6_PARAM_TYPE, len=22 */
122 u_int8_t ipAddress[16];
125 struct sctpDNSName{
126 struct sctpParamDesc param;
127 u_int8_t name[1];
131 struct sctpCookiePreserve{
132 struct sctpParamDesc p; /* type is set to SCTP_COOKIE_PRESERVE, len=8 */
133 u_int32_t extraTime;
137 struct sctpTimeStamp{
138 u_int32_t ts_sec;
139 u_int32_t ts_usec;
142 /* wire structure of my cookie */
143 struct cookieMessage{
144 u_int32_t TieTag_curTag; /* copied from assoc if present */
145 u_int32_t TieTag_hisTag; /* copied from assoc if present */
146 int32_t cookieLife; /* life I will award this cookie */
147 struct sctpTimeStamp timeEnteringState; /* the time I built cookie */
148 struct sctpInitiation initAckISent; /* the INIT-ACK that I sent to my peer */
149 u_int32_t addressWhereISent[4]; /* I make this 4 ints so I get 128bits for future */
150 int32_t addrtype; /* address type */
151 u_int16_t locScope; /* V6 local scope flag */
152 u_int16_t siteScope; /* V6 site scope flag */
153 /* at the end is tacked on the INIT chunk sent in
154 * its entirety and of course our
155 * signature.
160 /* this guy is for use when
161 * I have a initiate message gloming the
162 * things together.
165 struct sctpUnifiedInit{
166 struct sctpChunkDesc uh;
167 struct sctpInitiation initm;
170 struct sctpSendableInit{
171 struct sctpHeader mh;
172 struct sctpUnifiedInit msg;
176 /* Selective Acknowledgement
177 * has the following structure with
178 * a optional ammount of trailing int's
179 * on the last part (based on the numberOfDesc
180 * field).
183 struct sctpSelectiveAck{
184 u_int32_t highestConseqTSN;
185 u_int32_t updatedRwnd;
186 u_int16_t numberOfdesc;
187 u_int16_t numDupTsns;
190 struct sctpSelectiveFrag{
191 u_int16_t fragmentStart;
192 u_int16_t fragmentEnd;
196 struct sctpUnifiedSack{
197 struct sctpChunkDesc uh;
198 struct sctpSelectiveAck sack;
201 /* for both RTT request/response the
202 * following is sent
205 struct sctpHBrequest {
206 u_int32_t time_value_1;
207 u_int32_t time_value_2;
210 /* here is what I read and respond with to. */
211 struct sctpHBunified{
212 struct sctpChunkDesc hdr;
213 struct sctpParamDesc hb;
217 /* here is what I send */
218 struct sctpHBsender{
219 struct sctpChunkDesc hdr;
220 struct sctpParamDesc hb;
221 struct sctpHBrequest rtt;
222 int8_t addrFmt[SCTP_ADDRMAX];
223 u_int16_t userreq;
228 /* for the abort and shutdown ACK
229 * we must carry the init tag in the common header. Just the
230 * common header is all that is needed with a chunk descriptor.
232 struct sctpUnifiedAbort{
233 struct sctpChunkDesc uh;
236 struct sctpUnifiedAbortLight{
237 struct sctpHeader mh;
238 struct sctpChunkDesc uh;
241 struct sctpUnifiedAbortHeavy{
242 struct sctpHeader mh;
243 struct sctpChunkDesc uh;
244 u_int16_t causeCode;
245 u_int16_t causeLen;
248 /* For the graceful shutdown we must carry
249 * the tag (in common header) and the highest consequitive acking value
251 struct sctpShutdown {
252 u_int32_t TSN_Seen;
255 struct sctpUnifiedShutdown{
256 struct sctpChunkDesc uh;
257 struct sctpShutdown shut;
260 /* in the unified message we add the trailing
261 * stream id since it is the only message
262 * that is defined as a operation error.
264 struct sctpOpErrorCause{
265 u_int16_t cause;
266 u_int16_t causeLen;
269 struct sctpUnifiedOpError{
270 struct sctpChunkDesc uh;
271 struct sctpOpErrorCause c;
274 struct sctpUnifiedStreamError{
275 struct sctpHeader mh;
276 struct sctpChunkDesc uh;
277 struct sctpOpErrorCause c;
278 u_int16_t strmNum;
279 u_int16_t reserved;
282 struct staleCookieMsg{
283 struct sctpHeader mh;
284 struct sctpChunkDesc uh;
285 struct sctpOpErrorCause c;
286 u_int32_t moretime;
289 /* the following is used in all sends
290 * where nothing is needed except the
291 * chunk/type i.e. shutdownAck Abort */
293 struct sctpUnifiedSingleMsg{
294 struct sctpHeader mh;
295 struct sctpChunkDesc uh;
298 struct sctpDataPart{
299 u_int32_t TSN;
300 u_int16_t streamId;
301 u_int16_t sequence;
302 u_int32_t payloadtype;
305 struct sctpUnifiedDatagram{
306 struct sctpChunkDesc uh;
307 struct sctpDataPart dp;
310 struct sctpECN_echo{
311 struct sctpChunkDesc uh;
312 u_int32_t Lowest_TSN;
316 struct sctpCWR{
317 struct sctpChunkDesc uh;
318 u_int32_t TSN_reduced_at;
321 #ifdef __cplusplus
323 #endif
325 #endif