diff options
Diffstat (limited to 'include/net/sctp/structs.h')
| -rw-r--r-- | include/net/sctp/structs.h | 52 |
1 files changed, 39 insertions, 13 deletions
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index dbe1b911a24d..28a7c8e44636 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
| @@ -48,7 +48,7 @@ | |||
| 48 | #define __sctp_structs_h__ | 48 | #define __sctp_structs_h__ |
| 49 | 49 | ||
| 50 | #include <linux/ktime.h> | 50 | #include <linux/ktime.h> |
| 51 | #include <linux/rhashtable.h> | 51 | #include <linux/rhashtable-types.h> |
| 52 | #include <linux/socket.h> /* linux/in.h needs this!! */ | 52 | #include <linux/socket.h> /* linux/in.h needs this!! */ |
| 53 | #include <linux/in.h> /* We get struct sockaddr_in. */ | 53 | #include <linux/in.h> /* We get struct sockaddr_in. */ |
| 54 | #include <linux/in6.h> /* We get struct in6_addr */ | 54 | #include <linux/in6.h> /* We get struct in6_addr */ |
| @@ -57,6 +57,7 @@ | |||
| 57 | #include <linux/atomic.h> /* This gets us atomic counters. */ | 57 | #include <linux/atomic.h> /* This gets us atomic counters. */ |
| 58 | #include <linux/skbuff.h> /* We need sk_buff_head. */ | 58 | #include <linux/skbuff.h> /* We need sk_buff_head. */ |
| 59 | #include <linux/workqueue.h> /* We need tq_struct. */ | 59 | #include <linux/workqueue.h> /* We need tq_struct. */ |
| 60 | #include <linux/flex_array.h> /* We need flex_array. */ | ||
| 60 | #include <linux/sctp.h> /* We need sctp* header structs. */ | 61 | #include <linux/sctp.h> /* We need sctp* header structs. */ |
| 61 | #include <net/sctp/auth.h> /* We need auth specific structs */ | 62 | #include <net/sctp/auth.h> /* We need auth specific structs */ |
| 62 | #include <net/ip.h> /* For inet_skb_parm */ | 63 | #include <net/ip.h> /* For inet_skb_parm */ |
| @@ -193,6 +194,9 @@ struct sctp_sock { | |||
| 193 | /* This is the max_retrans value for new associations. */ | 194 | /* This is the max_retrans value for new associations. */ |
| 194 | __u16 pathmaxrxt; | 195 | __u16 pathmaxrxt; |
| 195 | 196 | ||
| 197 | __u32 flowlabel; | ||
| 198 | __u8 dscp; | ||
| 199 | |||
| 196 | /* The initial Path MTU to use for new associations. */ | 200 | /* The initial Path MTU to use for new associations. */ |
| 197 | __u32 pathmtu; | 201 | __u32 pathmtu; |
| 198 | 202 | ||
| @@ -220,6 +224,7 @@ struct sctp_sock { | |||
| 220 | __u32 adaptation_ind; | 224 | __u32 adaptation_ind; |
| 221 | __u32 pd_point; | 225 | __u32 pd_point; |
| 222 | __u16 nodelay:1, | 226 | __u16 nodelay:1, |
| 227 | reuse:1, | ||
| 223 | disable_fragments:1, | 228 | disable_fragments:1, |
| 224 | v4mapped:1, | 229 | v4mapped:1, |
| 225 | frag_interleave:1, | 230 | frag_interleave:1, |
| @@ -394,37 +399,35 @@ void sctp_stream_update(struct sctp_stream *stream, struct sctp_stream *new); | |||
| 394 | 399 | ||
| 395 | /* What is the current SSN number for this stream? */ | 400 | /* What is the current SSN number for this stream? */ |
| 396 | #define sctp_ssn_peek(stream, type, sid) \ | 401 | #define sctp_ssn_peek(stream, type, sid) \ |
| 397 | ((stream)->type[sid].ssn) | 402 | (sctp_stream_##type((stream), (sid))->ssn) |
| 398 | 403 | ||
| 399 | /* Return the next SSN number for this stream. */ | 404 | /* Return the next SSN number for this stream. */ |
| 400 | #define sctp_ssn_next(stream, type, sid) \ | 405 | #define sctp_ssn_next(stream, type, sid) \ |
| 401 | ((stream)->type[sid].ssn++) | 406 | (sctp_stream_##type((stream), (sid))->ssn++) |
| 402 | 407 | ||
| 403 | /* Skip over this ssn and all below. */ | 408 | /* Skip over this ssn and all below. */ |
| 404 | #define sctp_ssn_skip(stream, type, sid, ssn) \ | 409 | #define sctp_ssn_skip(stream, type, sid, ssn) \ |
| 405 | ((stream)->type[sid].ssn = ssn + 1) | 410 | (sctp_stream_##type((stream), (sid))->ssn = ssn + 1) |
| 406 | 411 | ||
| 407 | /* What is the current MID number for this stream? */ | 412 | /* What is the current MID number for this stream? */ |
| 408 | #define sctp_mid_peek(stream, type, sid) \ | 413 | #define sctp_mid_peek(stream, type, sid) \ |
| 409 | ((stream)->type[sid].mid) | 414 | (sctp_stream_##type((stream), (sid))->mid) |
| 410 | 415 | ||
| 411 | /* Return the next MID number for this stream. */ | 416 | /* Return the next MID number for this stream. */ |
| 412 | #define sctp_mid_next(stream, type, sid) \ | 417 | #define sctp_mid_next(stream, type, sid) \ |
| 413 | ((stream)->type[sid].mid++) | 418 | (sctp_stream_##type((stream), (sid))->mid++) |
| 414 | 419 | ||
| 415 | /* Skip over this mid and all below. */ | 420 | /* Skip over this mid and all below. */ |
| 416 | #define sctp_mid_skip(stream, type, sid, mid) \ | 421 | #define sctp_mid_skip(stream, type, sid, mid) \ |
| 417 | ((stream)->type[sid].mid = mid + 1) | 422 | (sctp_stream_##type((stream), (sid))->mid = mid + 1) |
| 418 | |||
| 419 | #define sctp_stream_in(asoc, sid) (&(asoc)->stream.in[sid]) | ||
| 420 | 423 | ||
| 421 | /* What is the current MID_uo number for this stream? */ | 424 | /* What is the current MID_uo number for this stream? */ |
| 422 | #define sctp_mid_uo_peek(stream, type, sid) \ | 425 | #define sctp_mid_uo_peek(stream, type, sid) \ |
| 423 | ((stream)->type[sid].mid_uo) | 426 | (sctp_stream_##type((stream), (sid))->mid_uo) |
| 424 | 427 | ||
| 425 | /* Return the next MID_uo number for this stream. */ | 428 | /* Return the next MID_uo number for this stream. */ |
| 426 | #define sctp_mid_uo_next(stream, type, sid) \ | 429 | #define sctp_mid_uo_next(stream, type, sid) \ |
| 427 | ((stream)->type[sid].mid_uo++) | 430 | (sctp_stream_##type((stream), (sid))->mid_uo++) |
| 428 | 431 | ||
| 429 | /* | 432 | /* |
| 430 | * Pointers to address related SCTP functions. | 433 | * Pointers to address related SCTP functions. |
| @@ -894,6 +897,9 @@ struct sctp_transport { | |||
| 894 | */ | 897 | */ |
| 895 | __u16 pathmaxrxt; | 898 | __u16 pathmaxrxt; |
| 896 | 899 | ||
| 900 | __u32 flowlabel; | ||
| 901 | __u8 dscp; | ||
| 902 | |||
| 897 | /* This is the partially failed retrans value for the transport | 903 | /* This is the partially failed retrans value for the transport |
| 898 | * and will be initialized from the assocs value. This can be changed | 904 | * and will be initialized from the assocs value. This can be changed |
| 899 | * using the SCTP_PEER_ADDR_THLDS socket option | 905 | * using the SCTP_PEER_ADDR_THLDS socket option |
| @@ -1433,8 +1439,8 @@ struct sctp_stream_in { | |||
| 1433 | }; | 1439 | }; |
| 1434 | 1440 | ||
| 1435 | struct sctp_stream { | 1441 | struct sctp_stream { |
| 1436 | struct sctp_stream_out *out; | 1442 | struct flex_array *out; |
| 1437 | struct sctp_stream_in *in; | 1443 | struct flex_array *in; |
| 1438 | __u16 outcnt; | 1444 | __u16 outcnt; |
| 1439 | __u16 incnt; | 1445 | __u16 incnt; |
| 1440 | /* Current stream being sent, if any */ | 1446 | /* Current stream being sent, if any */ |
| @@ -1456,6 +1462,23 @@ struct sctp_stream { | |||
| 1456 | struct sctp_stream_interleave *si; | 1462 | struct sctp_stream_interleave *si; |
| 1457 | }; | 1463 | }; |
| 1458 | 1464 | ||
| 1465 | static inline struct sctp_stream_out *sctp_stream_out( | ||
| 1466 | const struct sctp_stream *stream, | ||
| 1467 | __u16 sid) | ||
| 1468 | { | ||
| 1469 | return flex_array_get(stream->out, sid); | ||
| 1470 | } | ||
| 1471 | |||
| 1472 | static inline struct sctp_stream_in *sctp_stream_in( | ||
| 1473 | const struct sctp_stream *stream, | ||
| 1474 | __u16 sid) | ||
| 1475 | { | ||
| 1476 | return flex_array_get(stream->in, sid); | ||
| 1477 | } | ||
| 1478 | |||
| 1479 | #define SCTP_SO(s, i) sctp_stream_out((s), (i)) | ||
| 1480 | #define SCTP_SI(s, i) sctp_stream_in((s), (i)) | ||
| 1481 | |||
| 1459 | #define SCTP_STREAM_CLOSED 0x00 | 1482 | #define SCTP_STREAM_CLOSED 0x00 |
| 1460 | #define SCTP_STREAM_OPEN 0x01 | 1483 | #define SCTP_STREAM_OPEN 0x01 |
| 1461 | 1484 | ||
| @@ -1771,6 +1794,9 @@ struct sctp_association { | |||
| 1771 | */ | 1794 | */ |
| 1772 | __u16 pathmaxrxt; | 1795 | __u16 pathmaxrxt; |
| 1773 | 1796 | ||
| 1797 | __u32 flowlabel; | ||
| 1798 | __u8 dscp; | ||
| 1799 | |||
| 1774 | /* Flag that path mtu update is pending */ | 1800 | /* Flag that path mtu update is pending */ |
| 1775 | __u8 pmtu_pending; | 1801 | __u8 pmtu_pending; |
| 1776 | 1802 | ||
