sctp: implement user interface definitions for STREAM-RESET
Subsystems (2)
PATCH 4/6 sctp: implement user interface definitions for STREAM-RESET
This patch implementation the user interface definitions for STREAM-RESET extension.
Signed-off-by Wei Yongjun <[email protected]>
--- include/net/sctp/user.h | 32 ++++++++++++++++++++++++++++++++ 1 files changed, 32 insertions(+), 0 deletions(-)
include/net/sctp/user.h +32 -0
@@ -147,6 +147,8 @@ enum sctp_optname {#define SCTP_GET_LOCAL_ADDRS SCTP_GET_LOCAL_ADDRS SCTP_SOCKOPT_CONNECTX, /* CONNECTX requests. */#define SCTP_SOCKOPT_CONNECTX SCTP_SOCKOPT_CONNECTX + SCTP_RESET_STREAMS, /* Stream Reconfiguration */ +#define SCTP_RESET_STREAMS SCTP_RESET_STREAMS };/*
@@ -402,6 +404,18 @@ struct sctp_authkey_event {enum {SCTP_AUTH_NEWKEY =0 , }; +struct sctp_stream_reset_event { +__u16 strrst_type; +__u16 strrst_flags; +__u32 strrst_length; +sctp_assoc_t strrst_assoc_id; +}; + +enum { +SCTP_STREAM_RESET_INBOUND =0 , +SCTP_STREAM_RESET_OUTBOUND , +SCTP_STREAM_RESET_FAILED , +};/* * Described in Section 7.3
@@ -417,6 +431,7 @@ struct sctp_event_subscribe {__u8 sctp_partial_delivery_event;__u8 sctp_adaptation_layer_event;__u8 sctp_authentication_event; +__u8 sctp_stream_reset_event; };/*
@@ -440,6 +455,7 @@ union sctp_notification {struct sctp_adaptation_event sn_adaptation_event;struct sctp_pdapi_event sn_pdapi_event;struct sctp_authkey_event sn_authkey_event; +struct sctp_stream_reset_event sn_strrst_event; };/* Section 5.3.1
@@ -457,6 +473,7 @@ enum sctp_sn_type {SCTP_PARTIAL_DELIVERY_EVENT ,SCTP_ADAPTATION_INDICATION ,SCTP_AUTHENTICATION_INDICATION , + SCTP_STREAM_RESET_EVENT, };/* Notification error codes used to fill up the error fields in some
@@ -758,4 +775,19 @@ typedef struct { int sd; } sctp_peeloff_arg_t; +enum sctp_strrst_flags { +SCTP_STREAM_RESET_IN =1 <<0 ,/* Outgoing SSN Reset Request */ +SCTP_STREAM_RESET_OUT =1 <<1 ,/* Incoming SSN Reset Request */ +SCTP_STREAM_RESET_BOTH =SCTP_STREAM_RESET_IN |SCTP_STREAM_RESET_OUT , +SCTP_STREAM_RESET_TSN =1 <<2 ,/* SSN/TSN Reset Request */ +SCTP_STREAM_RESET_ADD =1 <<3 ,/* Add Streams */ +}; + +struct sctp_stream_reset { +sctp_assoc_t strrst_assoc_id; +__u16 strrst_flags; +__u16 strrst_number_of_streams; +__u16 strrst_streams[]; +}; +#endif /* __net_sctp_user_h__ */
Signature · 1 line
1.5.3.8
Quoted 74 lines · Wei Yongjun
This patch implementation the user interface definitions for STREAM-RESET extension.
Signed-off-by Wei Yongjun <[email protected]>--- include/net/sctp/user.h | 32 ++++++++++++++++++++++++++++++++ 1 files changed, 32 insertions(+), 0 deletions(-)include/net/sctp/user.h +23
-0@@ -147,6 +147,8 @@ enum sctp_optname {#define SCTP_GET_LOCAL_ADDRS SCTP_GET_LOCAL_ADDRS SCTP_SOCKOPT_CONNECTX, /* CONNECTX requests. */#define SCTP_SOCKOPT_CONNECTX SCTP_SOCKOPT_CONNECTX + SCTP_RESET_STREAMS, /* Stream Reconfiguration */ +#define SCTP_RESET_STREAMS SCTP_RESET_STREAMS };/* @@ -402,6 +404,18 @@ struct sctp_authkey_event {enum {SCTP_AUTH_NEWKEY =0 , }; +struct sctp_stream_reset_event { +__u16 strrst_type; +__u16 strrst_flags; +__u32 strrst_length; +sctp_assoc_t strrst_assoc_id; +}; + +enum { +SCTP_STREAM_RESET_INBOUND =0 , +SCTP_STREAM_RESET_OUTBOUND , +SCTP_STREAM_RESET_FAILED , +};/* * Described in Section 7.3 @@ -417,6 +431,7 @@ struct sctp_event_subscribe {__u8 sctp_partial_delivery_event;__u8 sctp_adaptation_layer_event;__u8 sctp_authentication_event; +__u8 sctp_stream_reset_event; };/* @@ -440,6 +455,7 @@ union sctp_notification {struct sctp_adaptation_event sn_adaptation_event;struct sctp_pdapi_event sn_pdapi_event;struct sctp_authkey_event sn_authkey_event; +struct sctp_stream_reset_event sn_strrst_event; };/* Section 5.3.1 @@ -457,6 +473,7 @@ enum sctp_sn_type {SCTP_PARTIAL_DELIVERY_EVENT ,SCTP_ADAPTATION_INDICATION ,SCTP_AUTHENTICATION_INDICATION , + SCTP_STREAM_RESET_EVENT, };/* Notification error codes used to fill up the error fields in some @@ -758,4 +775,19 @@ typedef struct {int sd; } sctp_peeloff_arg_t; +enum sctp_strrst_flags { +SCTP_STREAM_RESET_IN =1 <<0 ,/* Outgoing SSN Reset Request */ +SCTP_STREAM_RESET_OUT =1 <<1 ,/* Incoming SSN Reset Request */ +SCTP_STREAM_RESET_BOTH =SCTP_STREAM_RESET_IN |SCTP_STREAM_RESET_OUT , +SCTP_STREAM_RESET_TSN =1 <<2 ,/* SSN/TSN Reset Request */ +SCTP_STREAM_RESET_ADD =1 <<3 ,/* Add Streams */
include/net/sctp/user.h typedef struct { · line 793
Quoted 10 lines
include/net/sctp/user.h +9
-0+}; + +struct sctp_stream_reset { +sctp_assoc_t strrst_assoc_id; +__u16 strrst_flags; +__u16 strrst_number_of_streams; +__u16 strrst_streams[]; +}; +#endif /* __net_sctp_user_h__ */
This is completely made up and is not documented anywhere. Once we export this, we are stuck living with this API and I am hesitant to do this.
As an example, it is possible to have more then one stream reset parameter in the stream reset chunk. It is also impossible to request different sets of streams to be reset between outgoing and incoming parameters.
All of these issues need to be addresses in the stream reset id.
-vlad