sctp.h (179157) | sctp.h (179783) |
---|---|
1/*- 2 * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions are met: 6 * 7 * a) Redistributions of source code must retain the above copyright notice, 8 * this list of conditions and the following disclaimer. --- 16 unchanged lines hidden (view full) --- 25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 * THE POSSIBILITY OF SUCH DAMAGE. 29 */ 30/* $KAME: sctp.h,v 1.18 2005/03/06 16:04:16 itojun Exp $ */ 31 32#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions are met: 6 * 7 * a) Redistributions of source code must retain the above copyright notice, 8 * this list of conditions and the following disclaimer. --- 16 unchanged lines hidden (view full) --- 25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 * THE POSSIBILITY OF SUCH DAMAGE. 29 */ 30/* $KAME: sctp.h,v 1.18 2005/03/06 16:04:16 itojun Exp $ */ 31 32#include <sys/cdefs.h> |
33__FBSDID("$FreeBSD: head/sys/netinet/sctp.h 179157 2008-05-20 13:47:46Z rrs $"); | 33__FBSDID("$FreeBSD: head/sys/netinet/sctp.h 179783 2008-06-14 07:58:05Z rrs $"); |
34 35#ifndef _NETINET_SCTP_H_ 36#define _NETINET_SCTP_H_ 37 38#include <sys/types.h> 39 | 34 35#ifndef _NETINET_SCTP_H_ 36#define _NETINET_SCTP_H_ 37 38#include <sys/types.h> 39 |
40 41#define SCTP_PACKED __attribute__((packed)) 42 |
|
40/* 41 * SCTP protocol - RFC2960. 42 */ 43struct sctphdr { 44 uint16_t src_port; /* source port */ 45 uint16_t dest_port; /* destination port */ 46 uint32_t v_tag; /* verification tag of packet */ 47 uint32_t checksum; /* Adler32 C-Sum */ 48 /* chunks follow... */ | 43/* 44 * SCTP protocol - RFC2960. 45 */ 46struct sctphdr { 47 uint16_t src_port; /* source port */ 48 uint16_t dest_port; /* destination port */ 49 uint32_t v_tag; /* verification tag of packet */ 50 uint32_t checksum; /* Adler32 C-Sum */ 51 /* chunks follow... */ |
49} | 52} SCTP_PACKED; |
50 | 53 |
51__attribute__((packed)); 52 | |
53/* 54 * SCTP Chunks 55 */ | 54/* 55 * SCTP Chunks 56 */ |
56 struct sctp_chunkhdr { 57 uint8_t chunk_type; /* chunk type */ 58 uint8_t chunk_flags; /* chunk flags */ 59 uint16_t chunk_length; /* chunk length */ 60 /* optional params follow */ 61 } __attribute__((packed)); | 57struct sctp_chunkhdr { 58 uint8_t chunk_type; /* chunk type */ 59 uint8_t chunk_flags; /* chunk flags */ 60 uint16_t chunk_length; /* chunk length */ 61 /* optional params follow */ 62} SCTP_PACKED; |
62 63/* 64 * SCTP chunk parameters 65 */ | 63 64/* 65 * SCTP chunk parameters 66 */ |
66 struct sctp_paramhdr { 67 uint16_t param_type; /* parameter type */ 68 uint16_t param_length; /* parameter length */ 69 } __attribute__((packed)); | 67struct sctp_paramhdr { 68 uint16_t param_type; /* parameter type */ 69 uint16_t param_length; /* parameter length */ 70} SCTP_PACKED; |
70 71/* 72 * user socket options: socket API defined 73 */ 74/* 75 * read-write options 76 */ 77#define SCTP_RTOINFO 0x00000001 --- 220 unchanged lines hidden (view full) --- 298#define SCTP_CAUSE_REQUEST_REFUSED 0xa4 299 300/* Error causes from RFC4895 */ 301#define SCTP_CAUSE_UNSUPPORTED_HMACID 0x0105 302 303/* 304 * error cause parameters (user visisble) 305 */ | 71 72/* 73 * user socket options: socket API defined 74 */ 75/* 76 * read-write options 77 */ 78#define SCTP_RTOINFO 0x00000001 --- 220 unchanged lines hidden (view full) --- 299#define SCTP_CAUSE_REQUEST_REFUSED 0xa4 300 301/* Error causes from RFC4895 */ 302#define SCTP_CAUSE_UNSUPPORTED_HMACID 0x0105 303 304/* 305 * error cause parameters (user visisble) 306 */ |
306 struct sctp_error_cause { 307 uint16_t code; 308 uint16_t length; 309 /* optional cause-specific info may follow */ 310 } __attribute__((packed)); | 307struct sctp_error_cause { 308 uint16_t code; 309 uint16_t length; 310 /* optional cause-specific info may follow */ 311} SCTP_PACKED; |
311 | 312 |
312 struct sctp_error_invalid_stream { 313 struct sctp_error_cause cause; /* code=SCTP_ERROR_INVALID_STRE 314 * AM */ 315 uint16_t stream_id; /* stream id of the DATA in error */ 316 uint16_t reserved; 317 } __attribute__((packed)); | 313struct sctp_error_invalid_stream { 314 struct sctp_error_cause cause; /* code=SCTP_ERROR_INVALID_STREAM */ 315 uint16_t stream_id; /* stream id of the DATA in error */ 316 uint16_t reserved; 317} SCTP_PACKED; |
318 | 318 |
319 struct sctp_error_missing_param { 320 struct sctp_error_cause cause; /* code=SCTP_ERROR_MISSING_PARA 321 * M */ 322 uint32_t num_missing_params; /* number of missing 323 * parameters */ 324 /* uint16_t param_type's follow */ 325 } __attribute__((packed)); | 319struct sctp_error_missing_param { 320 struct sctp_error_cause cause; /* code=SCTP_ERROR_MISSING_PARAM */ 321 uint32_t num_missing_params; /* number of missing parameters */ 322 /* uint16_t param_type's follow */ 323} SCTP_PACKED; |
326 | 324 |
327 struct sctp_error_stale_cookie { 328 struct sctp_error_cause cause; /* code=SCTP_ERROR_STALE_COOKIE 329 * */ 330 uint32_t stale_time; /* time in usec of staleness */ 331 } __attribute__((packed)); | 325struct sctp_error_stale_cookie { 326 struct sctp_error_cause cause; /* code=SCTP_ERROR_STALE_COOKIE */ 327 uint32_t stale_time; /* time in usec of staleness */ 328} SCTP_PACKED; |
332 | 329 |
333 struct sctp_error_out_of_resource { 334 struct sctp_error_cause cause; /* code=SCTP_ERROR_OUT_OF_RESOU 335 * RCES */ 336 } __attribute__((packed)); | 330struct sctp_error_out_of_resource { 331 struct sctp_error_cause cause; /* code=SCTP_ERROR_OUT_OF_RESOURCES */ 332} SCTP_PACKED; |
337 | 333 |
338 struct sctp_error_unresolv_addr { 339 struct sctp_error_cause cause; /* code=SCTP_ERROR_UNRESOLVABLE 340 * _ADDR */ | 334struct sctp_error_unresolv_addr { 335 struct sctp_error_cause cause; /* code=SCTP_ERROR_UNRESOLVABLE_ADDR */ |
341 | 336 |
342 } __attribute__((packed)); | 337} SCTP_PACKED; |
343 | 338 |
344 struct sctp_error_unrecognized_chunk { 345 struct sctp_error_cause cause; /* code=SCTP_ERROR_UNRECOG_CHUN 346 * K */ 347 struct sctp_chunkhdr ch; /* header from chunk in error */ 348 } __attribute__((packed)); | 339struct sctp_error_unrecognized_chunk { 340 struct sctp_error_cause cause; /* code=SCTP_ERROR_UNRECOG_CHUNK */ 341 struct sctp_chunkhdr ch;/* header from chunk in error */ 342} SCTP_PACKED; |
349 350/* 351 * Main SCTP chunk types we place these here so natd and f/w's in user land 352 * can find them. 353 */ 354/************0x00 series ***********/ 355#define SCTP_DATA 0x00 356#define SCTP_INITIATION 0x01 --- 39 unchanged lines hidden (view full) --- 396#define SCTP_PACKET_TRUNCATED 0x04 397 398#define SCTP_SAT_NETWORK_MIN 400 /* min ms for RTT to set satellite 399 * time */ 400#define SCTP_SAT_NETWORK_BURST_INCR 2 /* how many times to multiply maxburst 401 * in sat */ 402 403/* Data Chuck Specific Flags */ | 343 344/* 345 * Main SCTP chunk types we place these here so natd and f/w's in user land 346 * can find them. 347 */ 348/************0x00 series ***********/ 349#define SCTP_DATA 0x00 350#define SCTP_INITIATION 0x01 --- 39 unchanged lines hidden (view full) --- 390#define SCTP_PACKET_TRUNCATED 0x04 391 392#define SCTP_SAT_NETWORK_MIN 400 /* min ms for RTT to set satellite 393 * time */ 394#define SCTP_SAT_NETWORK_BURST_INCR 2 /* how many times to multiply maxburst 395 * in sat */ 396 397/* Data Chuck Specific Flags */ |
404#define SCTP_DATA_FRAG_MASK 0x03 405#define SCTP_DATA_MIDDLE_FRAG 0x00 406#define SCTP_DATA_LAST_FRAG 0x01 407#define SCTP_DATA_FIRST_FRAG 0x02 408#define SCTP_DATA_NOT_FRAG 0x03 409#define SCTP_DATA_UNORDERED 0x04 410 | 398#define SCTP_DATA_FRAG_MASK 0x03 399#define SCTP_DATA_MIDDLE_FRAG 0x00 400#define SCTP_DATA_LAST_FRAG 0x01 401#define SCTP_DATA_FIRST_FRAG 0x02 402#define SCTP_DATA_NOT_FRAG 0x03 403#define SCTP_DATA_UNORDERED 0x04 404#define SCTP_DATA_SACK_IMMEDIATELY 0x08 |
411/* ECN Nonce: SACK Chunk Specific Flags */ | 405/* ECN Nonce: SACK Chunk Specific Flags */ |
412#define SCTP_SACK_NONCE_SUM 0x01 | 406#define SCTP_SACK_NONCE_SUM 0x01 |
413 414/* CMT DAC algorithm SACK flag */ | 407 408/* CMT DAC algorithm SACK flag */ |
415#define SCTP_SACK_CMT_DAC 0x80 | 409#define SCTP_SACK_CMT_DAC 0x80 |
416 417/* 418 * PCB flags (in sctp_flags bitmask). 419 * Note the features and flags are meant 420 * for use by netstat. 421 */ 422#define SCTP_PCB_FLAGS_UDPTYPE 0x00000001 423#define SCTP_PCB_FLAGS_TCPTYPE 0x00000002 --- 112 unchanged lines hidden (view full) --- 536#define SCTP_LTRACE_ERROR_ENABLE 0x00800000 537#define SCTP_LAST_PACKET_TRACING 0x01000000 538#define SCTP_THRESHOLD_LOGGING 0x02000000 539#define SCTP_LOG_AT_SEND_2_SCTP 0x04000000 540#define SCTP_LOG_AT_SEND_2_OUTQ 0x08000000 541 542 543 | 410 411/* 412 * PCB flags (in sctp_flags bitmask). 413 * Note the features and flags are meant 414 * for use by netstat. 415 */ 416#define SCTP_PCB_FLAGS_UDPTYPE 0x00000001 417#define SCTP_PCB_FLAGS_TCPTYPE 0x00000002 --- 112 unchanged lines hidden (view full) --- 530#define SCTP_LTRACE_ERROR_ENABLE 0x00800000 531#define SCTP_LAST_PACKET_TRACING 0x01000000 532#define SCTP_THRESHOLD_LOGGING 0x02000000 533#define SCTP_LOG_AT_SEND_2_SCTP 0x04000000 534#define SCTP_LOG_AT_SEND_2_OUTQ 0x08000000 535 536 537 |
538#undef SCTP_PACKED 539 |
|
544#endif /* !_NETINET_SCTP_H_ */ | 540#endif /* !_NETINET_SCTP_H_ */ |