Skip to content

Commit

Permalink
sctp: introduce sctp_chunk_stream_no
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Marcelo Ricardo Leitner authored and David S. Miller committed Oct 3, 2017
1 parent f952be7 commit 2fc019f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/net/sctp/structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,11 @@ void sctp_init_addrs(struct sctp_chunk *, union sctp_addr *,
union sctp_addr *);
const union sctp_addr *sctp_source(const struct sctp_chunk *chunk);

static inline __u16 sctp_chunk_stream_no(struct sctp_chunk *ch)
{
return ntohs(ch->subh.data_hdr->stream);
}

enum {
SCTP_ADDR_NEW, /* new address added to assoc/ep */
SCTP_ADDR_SRC, /* address can be used as source */
Expand Down

0 comments on commit 2fc019f

Please sign in to comment.