aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/sctp
diff options
context:
space:
mode:
authorGeir Ola Vaagland <geirola@gmail.com>2014-07-12 14:30:38 -0400
committerDavid S. Miller <davem@davemloft.net>2014-07-16 17:40:03 -0400
commit2347c80ff127b94ddaa675e2b78ab4cef46dc905 (patch)
tree5fe57c8b7814f629cb773bbea0c1a9f8eba035d0 /include/net/sctp
parent0d3a421d284812d07970b4ccee74d4fa38737e4d (diff)
net: sctp: implement rfc6458, 5.3.6. SCTP_NXTINFO cmsg support
This patch implements section 5.3.6. of RFC6458, that is, support for 'SCTP Next Receive Information Structure' (SCTP_NXTINFO) which is placed into ancillary data cmsghdr structure for each recvmsg() call, if this information is already available when delivering the current message. This option can be enabled/disabled via setsockopt(2) on SOL_SCTP level by setting an int value with 1/0 for SCTP_RECVNXTINFO in user space applications as per RFC6458, section 8.1.30. The sctp_nxtinfo structure is defined as per RFC as below ... struct sctp_nxtinfo { uint16_t nxt_sid; uint16_t nxt_flags; uint32_t nxt_ppid; uint32_t nxt_length; sctp_assoc_t nxt_assoc_id; }; ... and provided under cmsg_level IPPROTO_SCTP, cmsg_type SCTP_NXTINFO, while cmsg_data[] contains struct sctp_nxtinfo. Joint work with Daniel Borkmann. Signed-off-by: Geir Ola Vaagland <geirola@gmail.com> Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/sctp')
-rw-r--r--include/net/sctp/sctp.h1
-rw-r--r--include/net/sctp/structs.h1
-rw-r--r--include/net/sctp/ulpevent.h9
3 files changed, 4 insertions, 7 deletions
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index c2035c96a2ee..90c1cccd164d 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -109,6 +109,7 @@ void sctp_copy_sock(struct sock *newsk, struct sock *sk,
109 struct sctp_association *asoc); 109 struct sctp_association *asoc);
110extern struct percpu_counter sctp_sockets_allocated; 110extern struct percpu_counter sctp_sockets_allocated;
111int sctp_asconf_mgmt(struct sctp_sock *, struct sctp_sockaddr_entry *); 111int sctp_asconf_mgmt(struct sctp_sock *, struct sctp_sockaddr_entry *);
112struct sk_buff *sctp_skb_recv_datagram(struct sock *, int, int, int *);
112 113
113/* 114/*
114 * sctp/primitive.c 115 * sctp/primitive.c
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 11d5df015370..7741d1b66967 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -218,6 +218,7 @@ struct sctp_sock {
218 __u32 adaptation_ind; 218 __u32 adaptation_ind;
219 __u32 pd_point; 219 __u32 pd_point;
220 __u8 recvrcvinfo; 220 __u8 recvrcvinfo;
221 __u8 recvnxtinfo;
221 222
222 atomic_t pd_mode; 223 atomic_t pd_mode;
223 /* Receive to here while partial delivery is in effect. */ 224 /* Receive to here while partial delivery is in effect. */
diff --git a/include/net/sctp/ulpevent.h b/include/net/sctp/ulpevent.h
index e8095f973e94..cccdcfd14973 100644
--- a/include/net/sctp/ulpevent.h
+++ b/include/net/sctp/ulpevent.h
@@ -132,6 +132,8 @@ void sctp_ulpevent_read_sndrcvinfo(const struct sctp_ulpevent *event,
132 struct msghdr *); 132 struct msghdr *);
133void sctp_ulpevent_read_rcvinfo(const struct sctp_ulpevent *event, 133void sctp_ulpevent_read_rcvinfo(const struct sctp_ulpevent *event,
134 struct msghdr *); 134 struct msghdr *);
135void sctp_ulpevent_read_nxtinfo(const struct sctp_ulpevent *event,
136 struct msghdr *, struct sock *sk);
135 137
136__u16 sctp_ulpevent_get_notification_type(const struct sctp_ulpevent *event); 138__u16 sctp_ulpevent_get_notification_type(const struct sctp_ulpevent *event);
137 139
@@ -158,10 +160,3 @@ static inline int sctp_ulpevent_is_enabled(const struct sctp_ulpevent *event,
158} 160}
159 161
160#endif /* __sctp_ulpevent_h__ */ 162#endif /* __sctp_ulpevent_h__ */
161
162
163
164
165
166
167