Watt-32 tcp/ip  2.2 dev-rel.10
sctp.h
1 /*
2  * SCTP reference Implementation Copyright (C) 1999 Cisco And Motorola
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *
11  * 2. Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the distribution.
14  *
15  * 3. Neither the name of Cisco nor of Motorola may be used
16  * to endorse or promote products derived from this software without
17  * specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22  * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29  * SUCH DAMAGE.
30  *
31  * This file is part of the SCTP reference Implementation
32  *
33  *
34  * Please send any bug reports or fixes you make to one of the following email
35  * addresses:
36  *
37  * rstewar1@email.mot.com
38  * kmorneau@cisco.com
39  * qxie1@email.mot.com
40  *
41  * Any bugs reported given to us we will try to fix... any fixes shared will
42  * be incorperated into the next SCTP release.
43  */
44 
45 #ifndef _w32_SCTP_H__
46 #define _w32_SCTP_H__
47 
48 
49  /* If you wish to use MD5 instead of SLA uncomment the line
50  * below. Why you would like to do this:
51  * a) There may be IPR on SHA-1, or so the FIP-180-1 page says,
52  * b) MD5 is 3 times faster (has coded here).
53  *
54  * The disadvantage is, it is thought that MD5 has been
55  * cracked... see RFC2104.
56  */
57 /*#define USE_MD5 1*/
58 
59 /* the SCTP protocol signature
60  * this includes the version number
61  * encoded in the last 4 bits of the
62  * signature.
63  */
64 #define PROTO_SIGNATURE_A 0x30000000
65 
66 #define SCTP_VERSION_NUMBER 0x3
67 
68 #define MAX_TSN 0xffffffff
69 #define MAX_SEQ 0xffff
70 
71 /* option:
72  * If you comment out the following you will
73  * receive the old behavior of obeying cwnd for
74  * the fast retransmit algorithm. With this defined
75  * a FR happens right away with-out waiting for the
76  * flightsize to drop below the cwnd value (which
77  * is reduced by the FR to 1/2 the inflight packets).
78  */
79 #define SCTP_IGNORE_CWND_ON_FR 1
80 /* default max I can burst out after a fast retransmit */
81 #define SCTP_DEF_MAX_BURST 4
82 
83 /* Packet transmit states in the sent
84  * field in the SCTP_transmitOnQueue struct
85  */
86 #define SCTP_DATAGRAM_UNSENT 0
87 #define SCTP_DATAGRAM_SENT 1
88 #define SCTP_DATAGRAM_RESEND1 2 /* not used */
89 #define SCTP_DATAGRAM_RESEND2 3 /* not used */
90 #define SCTP_DATAGRAM_RESEND3 4 /* not used */
91 #define SCTP_DATAGRAM_RESEND 5
92 #define SCTP_DATAGRAM_ACKED 10010
93 #define SCTP_DATAGRAM_INBOUND 10011
94 #define SCTP_READY_TO_TRANSMIT 10012
95 #define SCTP_DATAGRAM_MARKED 20010
96 
97 #define MAX_FSID 64 /* debug 5 ints used for cc dynamic tracking */
98 
99 /* The valid defines for all message
100  * types know to SCTP. 0 is reserved
101  */
102 #define SCTP_MSGTYPE_MASK 0xff
103 
104 #define SCTP_DATA 0x00
105 #define SCTP_INITIATION 0x01
106 #define SCTP_INITIATION_ACK 0x02
107 #define SCTP_SELECTIVE_ACK 0x03
108 #define SCTP_HEARTBEAT_REQUEST 0x04
109 #define SCTP_HEARTBEAT_ACK 0x05
110 #define SCTP_ABORT_ASSOCIATION 0x06
111 #define SCTP_SHUTDOWN 0x07
112 #define SCTP_SHUTDOWN_ACK 0x08
113 #define SCTP_OPERATION_ERR 0x09
114 #define SCTP_COOKIE_ECHO 0x0a
115 #define SCTP_COOKIE_ACK 0x0b
116 #define SCTP_ECN_ECHO 0x0c
117 #define SCTP_ECN_CWR 0x0d
118 #define SCTP_SHUTDOWN_COMPLETE 0x0e
119 #define SCTP_ASCONF_ACK_CHUNK_ID 0x80
120 #define SCTP_PKTDROP_CHUNK_ID 0x81
121 #define SCTP_STREAM_RESET_CHUNK_ID 0x82
122 #define SCTP_FORWARD_CUM_TSN 0xc0
123 #define SCTP_RELIABLE_CNTL 0xc1
124 #define SCTP_RELIABLE_CNTL_ACK 0xc2
125 #define SCTP_IETF_EXT 0xFF
126 
127 /* ABORT and SHUTDOWN COMPLETE FLAG */
128 #define SCTP_HAD_NO_TCB 0x01
129 
130 /* Data Chuck Specific Flags */
131 #define SCTP_DATA_FRAG_MASK 0x03
132 #define SCTP_DATA_MIDDLE_FRAG 0x00
133 #define SCTP_DATA_LAST_FRAG 0x01
134 #define SCTP_DATA_FIRST_FRAG 0x02
135 #define SCTP_DATA_NOT_FRAG 0x03
136 #define SCTP_DATA_UNORDERED 0x04
137 
138 #define SCTP_CRC_ENABLE_BIT 0x01 /* lower bit of reserved */
139 
140 #define isSCTPControl(a) (a->chunkID != SCTP_DATA)
141 #define isSCTPData(a) (a->chunkID == SCTP_DATA)
142 
143 /* sctp parameter types for init/init-ack */
144 
145 #define SCTP_IPV4_PARAM_TYPE 0x0005
146 #define SCTP_IPV6_PARAM_TYPE 0x0006
147 #define SCTP_RESPONDER_COOKIE 0x0007
148 #define SCTP_UNRECOG_PARAM 0x0008
149 #define SCTP_COOKIE_PRESERVE 0x0009
150 #define SCTP_HOSTNAME_VIA_DNS 0x000b
151 #define SCTP_RESTRICT_ADDR_TO 0x000c
152 
153 #define SCTP_ECN_I_CAN_DO_ECN 0x8000
154 #define SCTP_RANDOM_PARAM 0x8002
155 #define SCTP_AUTH_CHUNK 0x8003
156 #define SCTP_REQ_HMAC_ALGO 0x8004
157 #define SCTP_SUPPORTED_EXT 0x8008
158 
159 #define SCTP_OPERATION_SUCCEED 0x4001
160 #define SCTP_ERROR_NOT_EXECUTED 0x4002
161 
162 #define SCTP_UNRELIABLE_STRM 0xc000
163 #define SCTP_ADD_IP_ADDRESS 0xc001
164 #define SCTP_DEL_IP_ADDRESS 0xc002
165 #define SCTP_STRM_FLOW_LIMIT 0xc003
166 #define SCTP_PARTIAL_CSUM 0xc004
167 #define SCTP_ERROR_CAUSE_TLV 0xc005
168 #define SCTP_MIT_STACK_NAME 0xc006
169 #define SCTP_SETADDRESS_PRIMARY 0xc007
170 
171 /* bits for TOS field */
172 #define SCTP_ECT_BIT 0x02
173 #define SCTP_CE_BIT 0x01
174 
175 /* error codes */
176 #define SCTP_OP_ERROR_NO_ERROR 0x0000
177 #define SCTP_OP_ERROR_INV_STRM 0x0001
178 #define SCTP_OP_ERROR_MISS_PARAM 0x0002
179 #define SCTP_OP_ERROR_STALE_COOKIE 0x0003
180 #define SCTP_OP_ERROR_NO_RESOURCE 0x0004
181 #define SCTP_OP_ERROR_DNS_FAILED 0x0005
182 #define SCTP_OP_ERROR_UNK_CHUNK 0x0006
183 #define SCTP_OP_ERROR_INV_PARAM 0x0007
184 #define SCTP_OP_ERROR_UNK_PARAM 0x0008
185 #define SCTP_OP_ERROR_NO_USERD 0x0009
186 #define SCTP_OP_ERROR_COOKIE_SHUT 0x000a
187 #define SCTP_OP_ERROR_DELETE_LAST 0x000b
188 #define SCTP_OP_ERROR_RESOURCE_SHORT 0x000c
189 
190 #define SCTP_MAX_ERROR_CAUSE 12
191 
192 /* empty error causes i.e. nothing but the cause
193  * are SCTP_OP_ERROR_NO_RESOURCE, SCTP_OP_ERROR_INV_PARAM,
194  * SCTP_OP_ERROR_COOKIE_SHUT.
195  */
196 
197 /* parameter for Heart Beat */
198 #define HEART_BEAT_PARAM 0x0001
199 
200 
201 
202 /* send options for SCTP
203  */
204 #define SCTP_ORDERED_DELIVERY 0x01
205 #define SCTP_NON_ORDERED_DELIVERY 0x02
206 #define SCTP_DO_CRC16 0x08
207 #define SCTP_MY_ADDRESS_ONLY 0x10
208 
209 /* below turns off above */
210 #define SCTP_FLEXIBLE_ADDRESS 0x20
211 #define SCTP_NO_HEARTBEAT 0x40
212 
213 /* mask to get sticky */
214 #define SCTP_STICKY_OPTIONS_MASK 0x0c
215 
216 /* MTU discovery flags */
217 #define SCTP_DONT_FRAGMENT 0x0100
218 #define SCTP_FRAGMENT_OK 0x0200
219 
220 /* SCTP state defines for internal state machine */
221 #define SCTP_STATE_EMPTY 0x0000
222 #define SCTP_STATE_INUSE 0x0001
223 #define SCTP_STATE_COOKIE_WAIT 0x0002
224 #define SCTP_STATE_COOKIE_SENT 0x0004
225 #define SCTP_STATE_OPEN 0x0008
226 #define SCTP_STATE_SHUTDOWN 0x0010
227 #define SCTP_STATE_SHUTDOWN_RECV 0x0020
228 #define SCTP_STATE_SHUTDOWN_ACK_SENT 0x0040
229 #define SCTP_STATE_SHUTDOWN_PEND 0x0080
230 #define SCTP_STATE_MASK 0x007f
231 
232 /* SCTP reachability state for each address */
233 #define SCTP_ADDR_NOT_REACHABLE 1
234 #define SCTP_ADDR_REACHABLE 2
235 #define SCTP_ADDR_NOHB 4
236 #define SCTP_ADDR_BEING_DELETED 8
237 
238 /* How long a cookie lives */
239 #define SCTP_DEFAULT_COOKIE_LIFE 60 /* seconds */
240 
241 /* resource limit of streams */
242 #define MAX_SCTP_STREAMS 2048
243 
244 
245 /* guess at how big to make the TSN mapping array */
246 #define SCTP_STARTING_MAPARRAY 10000
247 
248 /* Here we define the timer types used
249  * by the implementation has
250  * arguments in the set/get timer type calls.
251  */
252 #define SCTP_TIMER_INIT 0
253 #define SCTP_TIMER_RECV 1
254 #define SCTP_TIMER_SEND 2
255 #define SCTP_TIMER_SHUTDOWN 3
256 #define SCTP_TIMER_HEARTBEAT 4
257 #define SCTP_TIMER_PMTU 5
258 
259 /* number of timer types in the base SCTP
260  * structure used in the set/get and has
261  * the base default.
262  */
263 #define SCTP_NUM_TMRS 6
264 
265 #define SCTP_IPV4_ADDRESS 2
266 #define SCTP_IPV6_ADDRESS 4
267 
268 /* timer types
269  */
270 #define SctpTimerTypeNone 0
271 #define SctpTimerTypeSend 1
272 #define SctpTimerTypeInit 2
273 #define SctpTimerTypeRecv 3
274 #define SctpTimerTypeShutdown 4
275 #define SctpTimerTypeHeartbeat 5
276 #define SctpTimerTypeCookie 6
277 #define SctpTimerTypeNewCookie 7
278 #define SctpTimerTypePathMtuRaise 8
279 #define SctpTimerTypeShutdownAck 9
280 #define SctpTimerTypeRelReq 10
281 
282 /* Here are the timer directives given to the
283  * user provided function
284  */
285 #define SCTP_TIMER_START 1
286 #define SCTP_TIMER_STOP 2
287 
288 /* running flag states in timer structure */
289 #define SCTP_TIMER_IDLE 0x0
290 #define SCTP_TIMER_EXPIRED 0x1
291 #define SCTP_TIMER_RUNNING 0x2
292 
293 
294 /* number of simultaneous timers running */
295 #define SCTP_MAX_NET_TIMERS 6 /* base of where net timers start */
296 #define SCTP_NUMBER_TIMERS 12 /* allows up to 6 destinations */
297 
298 
299 /* Of course we really don't collect stale cookies, being
300  * folks of decerning taste. However we do count them, if
301  * we get to many before the association comes up.. we
302  * give up. Below is the constant that dictates when
303  * we give it up...this is a implemenation dependant
304  * treatment. In ours we do not ask for a extension of
305  * time, but just retry this many times...
306  */
307 #define SCTP_MAX_STALE_COOKIES_I_COLLECT 10
308 
309 /* max number of TSN's dup'd that I will hold */
310 #define SCTP_MAX_DUP_TSNS 20
311 
312 /* Here we define the types used when
313  * setting the retry ammounts.
314  */
315 /* constants for type of set */
316 #define SCTP_MAXATTEMPT_INIT 2
317 #define SCTP_MAXATTEMPT_SEND 3
318 
319 /* Here we define the default timers and the
320  * default number of attemts we make for
321  * each respective side (send/init).
322  */
323 
324 /* init timer def = 3sec */
325 #define SCTP_INIT_SEC 3
326 #define SCTP_INIT_NSEC 0
327 
328 /* send timer def = 3 seconds */
329 #define SCTP_SEND_SEC 1
330 #define SCTP_SEND_NSEC 0
331 
332 /* recv timer def = 200ms (in nsec) */
333 #define SCTP_RECV_SEC 0
334 #define SCTP_RECV_NSEC 200000000
335 
336 /* 30 seconds + RTO */
337 #define SCTP_HB_SEC 30
338 #define SCTP_HB_NSEC 0
339 
340 /* 300 ms */
341 #define SCTP_SHUTDOWN_SEC 0
342 #define SCTP_SHUTDOWN_NSEC 300000000
343 
344 #define SCTP_RTO_UPPER_BOUND 60000000 /* 60 sec in micro-second's */
345 #define SCTP_RTO_UPPER_BOUND_SEC 60 /* for the init timer */
346 #define SCTP_RTO_LOWER_BOUND 1000000 /* 1 sec in micro-sec's */
347 
348 #define SCTP_DEF_MAX_INIT 8
349 #define SCTP_DEF_MAX_SEND 10
350 
351 #define SCTP_DEF_PMTU_RAISE 600 /* 10 Minutes between raise attempts */
352 #define SCTP_DEF_PMTU_MIN 600
353 
354 #define SCTP_MSEC_IN_A_SEC 1000
355 #define SCTP_USEC_IN_A_SEC 1000000
356 #define SCTP_NSEC_IN_A_SEC 1000000000
357 
358 
359 /* Events that SCTP will look for, these
360  * are or'd together to declare what SCTP
361  * wants. Each select mask/poll list should be
362  * set for the fd, if the bit is on.
363  */
364 #define SCTP_EVENT_READ 0x000001
365 #define SCTP_EVENT_WRITE 0x000002
366 #define SCTP_EVENT_EXCEPT 0x000004
367 
368 /* The following constant is a value for this
369  * particular implemenation. It is quite arbitrary and
370  * is used to limit how much data will be queued up to
371  * a sender, waiting for cwnd to be larger than flightSize.
372  * All implementations will need this protection is some
373  * way due to buffer size constraints.
374  */
375 
376 #define SCTP_MAX_OUTSTANDING_DG 10000
377 
378 
379 
380 /* This constant (SCTP_MAX_READBUFFER) define
381  * how big the read/write buffer is
382  * when we enter the fd event notification
383  * the buffer is put on the stack, so the bigger
384  * it is the more stack you chew up, however it
385  * has got to be big enough to handle the bigest
386  * message this O/S will send you. In solaris
387  * with sockets (not TLI) we end up at a value
388  * of 64k. In TLI we could do partial reads to
389  * get it all in with less hassel.. but we
390  * write to sockets for generality.
391  */
392 #define SCTP_MAX_READBUFFER 65536
393 #define SCTP_ADDRMAX 60
394 
395 /* amount peer is obligated to have in rwnd or
396  * I will abort
397  */
398 #define SCTP_MIN_RWND 1500
399 
400 #define SCTP_WINDOW_MIN 1500 /* smallest rwnd can be */
401 #define SCTP_WINDOW_MAX 1048576 /* biggest I can grow rwnd to
402  * My playing around suggests a value greater
403  * than 64k does notdo much, I guess via the
404  * kernel limitations on the stream/socket.
405  */
406 
407 #define SCTP_MAX_BUNDLE_UP 256 /* max number of chunks I can bundle */
408 
409 /* I can handle a 1meg re-assembly */
410 #define SCTP_DEFAULT_MAXMSGREASM 1048576
411 
412 #define SCTP_DEFAULT_MAXWINDOW 32768 /* default rwnd size */
413 #define SCTP_DEFAULT_MAXSEGMENT 1500 /* MTU size, this is the default
414  * to which we set the smallestMTU
415  * size to. This governs what is the
416  * largest size we will use, of course
417  * PMTU will raise this up to
418  * the largest interface MTU or the
419  * ceiling below if there is no
420  * SIOCGIFMTU.
421  */
422 #define DEFAULT_MTU_CEILING 2048 /* If no SIOCGIFMTU, highest value
423  * to raise the PMTU to, i.e.
424  * don't try to raise above this
425  * value. Tune this per your
426  * largest MTU interface if your
427  * system does not support the
428  * SIOCGIFMTU ioctl.
429  */
430 
431 #define SCTP_DEFAULT_MINSEGMENT 512 /* MTU size ... if no mtu disc */
432 #define SCTP_HOW_MANY_SECRETS 2 /* how many secrets I keep */
433 
434 /* This is how long a secret lives, NOT how long a cookie lives */
435 #define SCTP_HOW_LONG_COOKIE_LIVE 3600 /* how many seconds the current secret will live */
436 
437 #define SCTP_NUMBER_OF_SECRETS 8 /* or 8 * 4 = 32 octets */
438 #define SCTP_SECRET_SIZE 32 /* number of octets in a 256 bits */
439 
440 #ifdef USE_MD5
441  #define SCTP_SIGNATURE_SIZE 16 /* size of a MD5 signature */
442 #else
443  #define SCTP_SIGNATURE_SIZE 20 /* size of a SLA-1 signature */
444 #endif
445 
446 /* Here are the notification constants
447  * that the code and upper layer will get
448  */
449 
450 /* association is up */
451 #define SCTP_NOTIFY_ASSOC_UP 1
452 
453 /* association is down */
454 #define SCTP_NOTIFY_ASSOC_DOWN 2
455 
456 /* interface on a association is down
457  * and out of consideration for selection.
458  */
459 #define SCTP_NOTIFY_INTF_DOWN 3
460 
461 /* interface on a association is up
462  * and now back in consideration for selection.
463  */
464 #define SCTP_NOTIFY_INTF_UP 4
465 
466 /* The given datagram cannot be delivered
467  * to the peer, this will probably be followed
468  * by a SCTP_NOTFIY_ASSOC_DOWN.
469  */
470 #define SCTP_NOTIFY_DG_FAIL 5
471 
472 /* Sent dg on non-open stream extreme code error!
473  */
474 #define SCTP_NOTIFY_STRDATA_ERR 6
475 
476 #define SCTP_NOTIFY_ASSOC_ABORTED 7
477 
478 /* The stream ones are not used yet, but could
479  * be when a association opens.
480  */
481 #define SCTP_NOTIFY_PEER_OPENED_STR 8
482 #define SCTP_NOTIFY_STREAM_OPENED_OK 9
483 
484 /* association sees a restart event */
485 #define SCTP_NOTIFY_ASSOC_RESTART 10
486 
487 /* a user requested HB returned */
488 #define SCTP_NOTIFY_HB_RESP 11
489 
490 /* a result from a REL-REQ */
491 #define SCTP_NOTIFY_RELREQ_RESULT_OK 12
492 #define SCTP_NOTIFY_RELREQ_RESULT_FAILED 13
493 
494 /* clock variance is 10ms or 10,000 us's */
495 #define SCTP_CLOCK_GRAINULARITY 10000
496 
497 #define IP_HDR_SIZE 40 /* we use the size of a IP6 header here
498  * this detracts a small amount for ipv4
499  * but it simplifies the ipv6 addition
500  */
501 
502 #define SCTP_NUM_FDS 3
503 
504 /* raw IP filedescriptor */
505 #define SCTP_FD_IP 0
506 
507 /* raw ICMP filedescriptor */
508 #define SCTP_FD_ICMP 1
509 
510 /* processes contact me for requests here */
511 #define SCTP_REQUEST 2
512 
513 #define SCTP_DEAMON_PORT 9899
514 
515 /* Deamon registration message types/responses */
516 #define DEAMON_REGISTER 0x01
517 #define DEAMON_REGISTER_ACK 0x02
518 #define DEAMON_DEREGISTER 0x03
519 #define DEAMON_DEREGISTER_ACK 0x04
520 #define DEAMON_CHECKADDR_LIST 0x05
521 
522 #define DEAMON_MAGIC_VER_LEN 0xff
523 
524 /* max times I will attempt to send a message to deamon */
525 #define SCTP_MAX_ATTEMPTS_AT_DEAMON 5
526 #define SCTP_TIMEOUT_IN_POLL_FOR_DEAMON 1500 /* 1.5 seconds */
527 
528 /* modular comparison */
529 /* True if a > b (mod = M) */
530 #define compare_with_wrap(a,b,M) ((a > b) && ((a - b) < (M >> 1))) || \
531  ((b > a) && ((b - a) > (M >> 1)))
532 
533 #ifndef TIMEVAL_TO_TIMESPEC
534  #define TIMEVAL_TO_TIMESPEC(tv,ts) { \
535  (ts)->tv_sec = (tv)->tv_sec; \
536  (ts)->tv_nsec = (tv)->tv_usec * 1000; \
537  }
538 #endif
539 
540 /* pegs */
541 #define SCTP_NUMBER_OF_PEGS 21
542 
543 /* peg index's */
544 #define SCTP_PEG_SACKS_SEEN 0
545 #define SCTP_PEG_SACKS_SENT 1
546 #define SCTP_PEG_TSNS_SENT 2
547 #define SCTP_PEG_TSNS_RCVD 3
548 #define SCTP_DATAGRAMS_SENT 4
549 #define SCTP_DATAGRAMS_RCVD 5
550 #define SCTP_RETRANTSN_SENT 6
551 #define SCTP_DUPTSN_RECVD 7
552 #define SCTP_HBR_RECV 8
553 #define SCTP_HBA_RECV 9
554 #define SCTP_HB_SENT 10
555 #define SCTP_DATA_DG_SENT 11
556 #define SCTP_DATA_DG_RECV 12
557 #define SCTP_TMIT_TIMER 13
558 #define SCTP_RECV_TIMER 14
559 #define SCTP_HB_TIMER 15
560 #define SCTP_FAST_RETRAN 16
561 #define SCTP_PEG_TSNS_READ 17
562 #define SCTP_NONE_LFT_TO 18
563 #define SCTP_NONE_LFT_RWND 19
564 #define SCTP_NONE_LFT_CWND 20
565 
566 #include <sys/pack_on.h>
567 
568 struct sctp_Header {
569  WORD source;
570  WORD destination;
571  DWORD verificationTag;
572  DWORD adler32;
573  };
574 
575 /* various descriptor parsers */
576 
578  BYTE chunkID;
579  BYTE chunkFlg;
580  WORD chunkLength;
581  };
582 
584  WORD paramType;
585  WORD paramLength;
586  };
587 
588 
590  struct sctp_ChunkDesc chk;
591  DWORD serialNumber;
592  };
593 
595  struct sctp_ParamDesc p; /* type must be 0xfffe */
596  DWORD vendorId; /* vendor ID from RFC 1700 */
597  WORD vendorSpecificType;
598  WORD vendorSpecificLen;
599  };
600 
601 
602 /* Structures for the control parts
603  */
604 
605 /* Sctp association init request/ack */
606 
607 /* this is used for init ack, too */
609  DWORD initTag; /* tag of mine */
610  DWORD rcvWindowCredit; /* rwnd */
611  WORD NumPreopenStreams; /* OS */
612  WORD MaxInboundStreams; /* MIS */
613  DWORD initialTSN;
614  /* optional param's follow in sctp_ParamDesc form */
615  };
616 
618  struct sctp_ParamDesc p; /* type is set to SCTP_IPV4_PARAM_TYPE, len=10 */
619  DWORD ipAddress;
620  };
621 
622 
624  struct sctp_ParamDesc p; /* type is set to SCTP_IPV6_PARAM_TYPE, len=22 */
625  BYTE ipAddress[16];
626  };
627 
628 struct sctp_DNSName {
629  struct sctp_ParamDesc param;
630  BYTE name[1];
631  };
632 
633 
635  struct sctp_ParamDesc p; /* type is set to SCTP_COOKIE_PRESERVE, len=8 */
636  DWORD extraTime;
637 };
638 
639 
641  DWORD ts_sec;
642  DWORD ts_usec;
643 };
644 
645 /* wire structure of my cookie */
647  DWORD TieTag_curTag; /* copied from assoc if present */
648  DWORD TieTag_hisTag; /* copied from assoc if present */
649  DWORD cookieLife; /* life I will award this cookie */
650  struct sctp_TimeStamp timeEnteringState; /* the time I built cookie */
651  struct sctp_Initiation initAckISent; /* the INIT-ACK that I sent to my peer */
652  DWORD addressWhereISent[4]; /* I make this 4 ints so I get 128bits for future */
653  DWORD addrtype; /* address type */
654  WORD locScope; /* V6 local scope flag */
655  WORD siteScope; /* V6 site scope flag */
656 
657  /* at the end is tacked on the INIT chunk sent in
658  * its entirety and of course our
659  * signature.
660  */
661  };
662 
663 
664 /* this guy is for use when
665  * I have a initiate message gloming the
666  * things together.
667 
668  */
670  struct sctp_ChunkDesc uh;
671  struct sctp_Initiation initm;
672  };
673 
675  struct sctp_Header mh;
676  struct sctp_UnifiedInit msg;
677  };
678 
679 
680 /* Selective Acknowledgement
681  * has the following structure with
682  * a optional ammount of trailing int's
683  * on the last part (based on the numberOfDesc
684  * field).
685  */
686 
688  DWORD highestConseqTSN;
689  DWORD updatedRwnd;
690  WORD numberOfdesc;
691  WORD numDupTsns;
692 };
693 
695  WORD fragmentStart;
696  WORD fragmentEnd;
697 };
698 
699 
701  struct sctp_ChunkDesc uh;
702  struct sctp_SelectiveAck sack;
703 };
704 
705 /* for both RTT request/response the
706  * following is sent
707  */
708 
710  DWORD time_value_1;
711  DWORD time_value_2;
712 };
713 
714 /* here is what I read and respond with to. */
716  struct sctp_ChunkDesc hdr;
717  struct sctp_ParamDesc hb;
718 };
719 
720 
721 /* here is what I send */
723  struct sctp_ChunkDesc hdr;
724  struct sctp_ParamDesc hb;
725  struct sctp_HBrequest rtt;
726  BYTE addrFmt[SCTP_ADDRMAX];
727  WORD userreq;
728 };
729 
730 
731 
732 /* for the abort and shutdown ACK
733  * we must carry the init tag in the common header. Just the
734  * common header is all that is needed with a chunk descriptor.
735  */
737  struct sctp_ChunkDesc uh;
738 };
739 
741  struct sctp_Header mh;
742  struct sctp_ChunkDesc uh;
743 };
744 
746  struct sctp_Header mh;
747  struct sctp_ChunkDesc uh;
748  WORD causeCode;
749  WORD causeLen;
750 };
751 
752 /* For the graceful shutdown we must carry
753  * the tag (in common header) and the highest consequitive acking value
754  */
756  DWORD TSN_Seen;
757 };
758 
760  struct sctp_ChunkDesc uh;
761  struct sctp_Shutdown shut;
762 };
763 
764 /* in the unified message we add the trailing
765  * stream id since it is the only message
766  * that is defined as a operation error.
767  */
769  WORD cause;
770  WORD causeLen;
771 };
772 
774  struct sctp_ChunkDesc uh;
775  struct sctp_OpErrorCause c;
776 };
777 
779  struct sctp_Header mh;
780  struct sctp_ChunkDesc uh;
781  struct sctp_OpErrorCause c;
782  WORD strmNum;
783  WORD reserved;
784 };
785 
787  struct sctp_Header mh;
788  struct sctp_ChunkDesc uh;
789  struct sctp_OpErrorCause c;
790  DWORD moretime;
791 };
792 
793 /* the following is used in all sends
794  * where nothing is needed except the
795  * chunk/type i.e. shutdownAck Abort */
796 
798  struct sctp_Header mh;
799  struct sctp_ChunkDesc uh;
800 };
801 
803  DWORD TSN;
804  WORD streamId;
805  WORD sequence;
806  DWORD payloadtype;
807 };
808 
810  struct sctp_ChunkDesc uh;
811  struct sctp_DataPart dp;
812 };
813 
815  struct sctp_ChunkDesc uh;
816  DWORD Lowest_TSN;
817 };
818 
819 
820 struct sctp_CWR {
821  struct sctp_ChunkDesc uh;
822  DWORD TSN_reduced_at;
823 };
824 
825 #include <sys/pack_off.h>
826 
827 #endif
828 
829 
Definition: sctp.h:820