aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/sctp/structs.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/sctp/structs.h')
-rw-r--r--include/net/sctp/structs.h77
1 files changed, 72 insertions, 5 deletions
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 9a5ccf03a59b..03e92dda1813 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -89,6 +89,7 @@ struct sctp_stream;
89#include <net/sctp/tsnmap.h> 89#include <net/sctp/tsnmap.h>
90#include <net/sctp/ulpevent.h> 90#include <net/sctp/ulpevent.h>
91#include <net/sctp/ulpqueue.h> 91#include <net/sctp/ulpqueue.h>
92#include <net/sctp/stream_interleave.h>
92 93
93/* Structures useful for managing bind/connect. */ 94/* Structures useful for managing bind/connect. */
94 95
@@ -202,12 +203,17 @@ struct sctp_sock {
202 /* Flags controlling Heartbeat, SACK delay, and Path MTU Discovery. */ 203 /* Flags controlling Heartbeat, SACK delay, and Path MTU Discovery. */
203 __u32 param_flags; 204 __u32 param_flags;
204 205
205 struct sctp_initmsg initmsg;
206 struct sctp_rtoinfo rtoinfo; 206 struct sctp_rtoinfo rtoinfo;
207 struct sctp_paddrparams paddrparam; 207 struct sctp_paddrparams paddrparam;
208 struct sctp_event_subscribe subscribe;
209 struct sctp_assocparams assocparams; 208 struct sctp_assocparams assocparams;
210 209
210 /*
211 * These two structures must be grouped together for the usercopy
212 * whitelist region.
213 */
214 struct sctp_event_subscribe subscribe;
215 struct sctp_initmsg initmsg;
216
211 int user_frag; 217 int user_frag;
212 218
213 __u32 autoclose; 219 __u32 autoclose;
@@ -217,6 +223,7 @@ struct sctp_sock {
217 disable_fragments:1, 223 disable_fragments:1,
218 v4mapped:1, 224 v4mapped:1,
219 frag_interleave:1, 225 frag_interleave:1,
226 strm_interleave:1,
220 recvrcvinfo:1, 227 recvrcvinfo:1,
221 recvnxtinfo:1, 228 recvnxtinfo:1,
222 data_ready_signalled:1; 229 data_ready_signalled:1;
@@ -397,6 +404,28 @@ void sctp_stream_update(struct sctp_stream *stream, struct sctp_stream *new);
397#define sctp_ssn_skip(stream, type, sid, ssn) \ 404#define sctp_ssn_skip(stream, type, sid, ssn) \
398 ((stream)->type[sid].ssn = ssn + 1) 405 ((stream)->type[sid].ssn = ssn + 1)
399 406
407/* What is the current MID number for this stream? */
408#define sctp_mid_peek(stream, type, sid) \
409 ((stream)->type[sid].mid)
410
411/* Return the next MID number for this stream. */
412#define sctp_mid_next(stream, type, sid) \
413 ((stream)->type[sid].mid++)
414
415/* Skip over this mid and all below. */
416#define sctp_mid_skip(stream, type, sid, mid) \
417 ((stream)->type[sid].mid = mid + 1)
418
419#define sctp_stream_in(asoc, sid) (&(asoc)->stream.in[sid])
420
421/* What is the current MID_uo number for this stream? */
422#define sctp_mid_uo_peek(stream, type, sid) \
423 ((stream)->type[sid].mid_uo)
424
425/* Return the next MID_uo number for this stream. */
426#define sctp_mid_uo_next(stream, type, sid) \
427 ((stream)->type[sid].mid_uo++)
428
400/* 429/*
401 * Pointers to address related SCTP functions. 430 * Pointers to address related SCTP functions.
402 * (i.e. things that depend on the address family.) 431 * (i.e. things that depend on the address family.)
@@ -574,6 +603,8 @@ struct sctp_chunk {
574 struct sctp_addiphdr *addip_hdr; 603 struct sctp_addiphdr *addip_hdr;
575 struct sctp_fwdtsn_hdr *fwdtsn_hdr; 604 struct sctp_fwdtsn_hdr *fwdtsn_hdr;
576 struct sctp_authhdr *auth_hdr; 605 struct sctp_authhdr *auth_hdr;
606 struct sctp_idatahdr *idata_hdr;
607 struct sctp_ifwdtsn_hdr *ifwdtsn_hdr;
577 } subh; 608 } subh;
578 609
579 __u8 *chunk_end; 610 __u8 *chunk_end;
@@ -620,6 +651,7 @@ struct sctp_chunk {
620 __u16 rtt_in_progress:1, /* This chunk used for RTT calc? */ 651 __u16 rtt_in_progress:1, /* This chunk used for RTT calc? */
621 has_tsn:1, /* Does this chunk have a TSN yet? */ 652 has_tsn:1, /* Does this chunk have a TSN yet? */
622 has_ssn:1, /* Does this chunk have a SSN yet? */ 653 has_ssn:1, /* Does this chunk have a SSN yet? */
654#define has_mid has_ssn
623 singleton:1, /* Only chunk in the packet? */ 655 singleton:1, /* Only chunk in the packet? */
624 end_of_packet:1, /* Last chunk in the packet? */ 656 end_of_packet:1, /* Last chunk in the packet? */
625 ecn_ce_done:1, /* Have we processed the ECN CE bit? */ 657 ecn_ce_done:1, /* Have we processed the ECN CE bit? */
@@ -1073,6 +1105,7 @@ void sctp_retransmit_mark(struct sctp_outq *, struct sctp_transport *, __u8);
1073void sctp_outq_uncork(struct sctp_outq *, gfp_t gfp); 1105void sctp_outq_uncork(struct sctp_outq *, gfp_t gfp);
1074void sctp_prsctp_prune(struct sctp_association *asoc, 1106void sctp_prsctp_prune(struct sctp_association *asoc,
1075 struct sctp_sndrcvinfo *sinfo, int msg_len); 1107 struct sctp_sndrcvinfo *sinfo, int msg_len);
1108void sctp_generate_fwdtsn(struct sctp_outq *q, __u32 sack_ctsn);
1076/* Uncork and flush an outqueue. */ 1109/* Uncork and flush an outqueue. */
1077static inline void sctp_outq_cork(struct sctp_outq *q) 1110static inline void sctp_outq_cork(struct sctp_outq *q)
1078{ 1111{
@@ -1357,13 +1390,25 @@ struct sctp_stream_out_ext {
1357}; 1390};
1358 1391
1359struct sctp_stream_out { 1392struct sctp_stream_out {
1360 __u16 ssn; 1393 union {
1361 __u8 state; 1394 __u32 mid;
1395 __u16 ssn;
1396 };
1397 __u32 mid_uo;
1362 struct sctp_stream_out_ext *ext; 1398 struct sctp_stream_out_ext *ext;
1399 __u8 state;
1363}; 1400};
1364 1401
1365struct sctp_stream_in { 1402struct sctp_stream_in {
1366 __u16 ssn; 1403 union {
1404 __u32 mid;
1405 __u16 ssn;
1406 };
1407 __u32 mid_uo;
1408 __u32 fsn;
1409 __u32 fsn_uo;
1410 char pd_mode;
1411 char pd_mode_uo;
1367}; 1412};
1368 1413
1369struct sctp_stream { 1414struct sctp_stream {
@@ -1387,11 +1432,32 @@ struct sctp_stream {
1387 struct sctp_stream_out_ext *rr_next; 1432 struct sctp_stream_out_ext *rr_next;
1388 }; 1433 };
1389 }; 1434 };
1435 struct sctp_stream_interleave *si;
1390}; 1436};
1391 1437
1392#define SCTP_STREAM_CLOSED 0x00 1438#define SCTP_STREAM_CLOSED 0x00
1393#define SCTP_STREAM_OPEN 0x01 1439#define SCTP_STREAM_OPEN 0x01
1394 1440
1441static inline __u16 sctp_datachk_len(const struct sctp_stream *stream)
1442{
1443 return stream->si->data_chunk_len;
1444}
1445
1446static inline __u16 sctp_datahdr_len(const struct sctp_stream *stream)
1447{
1448 return stream->si->data_chunk_len - sizeof(struct sctp_chunkhdr);
1449}
1450
1451static inline __u16 sctp_ftsnchk_len(const struct sctp_stream *stream)
1452{
1453 return stream->si->ftsn_chunk_len;
1454}
1455
1456static inline __u16 sctp_ftsnhdr_len(const struct sctp_stream *stream)
1457{
1458 return stream->si->ftsn_chunk_len - sizeof(struct sctp_chunkhdr);
1459}
1460
1395/* SCTP_GET_ASSOC_STATS counters */ 1461/* SCTP_GET_ASSOC_STATS counters */
1396struct sctp_priv_assoc_stats { 1462struct sctp_priv_assoc_stats {
1397 /* Maximum observed rto in the association during subsequent 1463 /* Maximum observed rto in the association during subsequent
@@ -1940,6 +2006,7 @@ struct sctp_association {
1940 __u8 need_ecne:1, /* Need to send an ECNE Chunk? */ 2006 __u8 need_ecne:1, /* Need to send an ECNE Chunk? */
1941 temp:1, /* Is it a temporary association? */ 2007 temp:1, /* Is it a temporary association? */
1942 force_delay:1, 2008 force_delay:1,
2009 intl_enable:1,
1943 prsctp_enable:1, 2010 prsctp_enable:1,
1944 reconf_enable:1; 2011 reconf_enable:1;
1945 2012