aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/sctp/structs.h
diff options
context:
space:
mode:
authorMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>2017-10-03 18:20:12 -0400
committerDavid S. Miller <davem@davemloft.net>2017-10-03 19:27:28 -0400
commit2fc019f790312e703efa1a44204c586112a430dc (patch)
tree98a30357e60d4ec650318fd2c333636cfad8ef21 /include/net/sctp/structs.h
parentf952be79cebd49d04154781d99408867a069d375 (diff)
sctp: introduce sctp_chunk_stream_no
Add a helper to fetch the stream number from a given chunk. Tested-by: Xin Long <lucien.xin@gmail.com> Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/sctp/structs.h')
-rw-r--r--include/net/sctp/structs.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 9b2b30b3ba4d..c48f7999fe9b 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -642,6 +642,11 @@ void sctp_init_addrs(struct sctp_chunk *, union sctp_addr *,
642 union sctp_addr *); 642 union sctp_addr *);
643const union sctp_addr *sctp_source(const struct sctp_chunk *chunk); 643const union sctp_addr *sctp_source(const struct sctp_chunk *chunk);
644 644
645static inline __u16 sctp_chunk_stream_no(struct sctp_chunk *ch)
646{
647 return ntohs(ch->subh.data_hdr->stream);
648}
649
645enum { 650enum {
646 SCTP_ADDR_NEW, /* new address added to assoc/ep */ 651 SCTP_ADDR_NEW, /* new address added to assoc/ep */
647 SCTP_ADDR_SRC, /* address can be used as source */ 652 SCTP_ADDR_SRC, /* address can be used as source */