Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1ce463dd authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'sctp-sender-side-stream-reconf-ssn-reset-request-chunk'



Xin Long says:

====================
sctp: add sender-side procedures for stream reconf ssn reset request chunk

Patch 6/6 is to implement sender-side procedures for the Outgoing
and Incoming SSN Reset Request Parameter described in rfc6525
section 5.1.2 and 5.1.3

Patches 1-5/6 are ahead of it to define some apis and asoc members
for it.

Note that with this patchset, asoc->reconf_enable has no chance yet to
be set, until the patch "sctp: add get and set sockopt for reconf_enable"
is applied in the future. As we can not just enable it when sctp is not
capable of processing reconf chunk yet.

v1->v2:
  - put these into a smaller group.
  - rename some temporary variables in the codes.
  - rename the titles of the commits and improve some changelogs.
v2->v3:
  - re-split the patchset and make sure it has no dead codes for review.
v3->v4:
  - move sctp_make_reconf() into patch 1/6 to avoid kbuild warning.
  - drop unused struct sctp_strreset_req.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents b16ed2b1 7f9d68ac
Loading
Loading
Loading
Loading
+27 −0
Original line number Diff line number Diff line
@@ -108,6 +108,7 @@ typedef enum {
	/* Use hex, as defined in ADDIP sec. 3.1 */
	SCTP_CID_ASCONF			= 0xC1,
	SCTP_CID_ASCONF_ACK		= 0x80,
	SCTP_CID_RECONF			= 0x82,
} sctp_cid_t; /* enum */


@@ -199,6 +200,13 @@ typedef enum {
	SCTP_PARAM_SUCCESS_REPORT	= cpu_to_be16(0xc005),
	SCTP_PARAM_ADAPTATION_LAYER_IND = cpu_to_be16(0xc006),

	/* RE-CONFIG. Section 4 */
	SCTP_PARAM_RESET_OUT_REQUEST		= cpu_to_be16(0x000d),
	SCTP_PARAM_RESET_IN_REQUEST		= cpu_to_be16(0x000e),
	SCTP_PARAM_RESET_TSN_REQUEST		= cpu_to_be16(0x000f),
	SCTP_PARAM_RESET_RESPONSE		= cpu_to_be16(0x0010),
	SCTP_PARAM_RESET_ADD_OUT_STREAMS	= cpu_to_be16(0x0011),
	SCTP_PARAM_RESET_ADD_IN_STREAMS		= cpu_to_be16(0x0012),
} sctp_param_t; /* enum */


@@ -710,4 +718,23 @@ struct sctp_infox {
	struct sctp_association *asoc;
};

struct sctp_reconf_chunk {
	sctp_chunkhdr_t chunk_hdr;
	__u8 params[0];
} __packed;

struct sctp_strreset_outreq {
	sctp_paramhdr_t param_hdr;
	__u32 request_seq;
	__u32 response_seq;
	__u32 send_reset_at_tsn;
	__u16 list_of_streams[0];
} __packed;

struct sctp_strreset_inreq {
	sctp_paramhdr_t param_hdr;
	__u32 request_seq;
	__u16 list_of_streams[0];
} __packed;

#endif /* __LINUX_SCTP_H__ */
+3 −0
Original line number Diff line number Diff line
@@ -118,6 +118,9 @@ struct netns_sctp {
	/* Flag to indicate if PR-SCTP is enabled. */
	int prsctp_enable;

	/* Flag to indicate if PR-CONFIG is enabled. */
	int reconf_enable;

	/* Flag to idicate if SCTP-AUTH is enabled */
	int auth_enable;

+3 −1
Original line number Diff line number Diff line
@@ -90,6 +90,7 @@ typedef enum {
	SCTP_EVENT_TIMEOUT_T4_RTO,
	SCTP_EVENT_TIMEOUT_T5_SHUTDOWN_GUARD,
	SCTP_EVENT_TIMEOUT_HEARTBEAT,
	SCTP_EVENT_TIMEOUT_RECONF,
	SCTP_EVENT_TIMEOUT_SACK,
	SCTP_EVENT_TIMEOUT_AUTOCLOSE,
} sctp_event_timeout_t;
@@ -113,9 +114,10 @@ typedef enum {
	SCTP_PRIMITIVE_SEND,
	SCTP_PRIMITIVE_REQUESTHEARTBEAT,
	SCTP_PRIMITIVE_ASCONF,
	SCTP_PRIMITIVE_RECONF,
} sctp_event_primitive_t;

#define SCTP_EVENT_PRIMITIVE_MAX	SCTP_PRIMITIVE_ASCONF
#define SCTP_EVENT_PRIMITIVE_MAX	SCTP_PRIMITIVE_RECONF
#define SCTP_NUM_PRIMITIVE_TYPES	(SCTP_EVENT_PRIMITIVE_MAX + 1)

/* We define here a utility type for manipulating subtypes.
+8 −0
Original line number Diff line number Diff line
@@ -141,6 +141,8 @@ int sctp_primitive_ABORT(struct net *, struct sctp_association *, void *arg);
int sctp_primitive_SEND(struct net *, struct sctp_association *, void *arg);
int sctp_primitive_REQUESTHEARTBEAT(struct net *, struct sctp_association *, void *arg);
int sctp_primitive_ASCONF(struct net *, struct sctp_association *, void *arg);
int sctp_primitive_RECONF(struct net *net, struct sctp_association *asoc,
			  void *arg);

/*
 * sctp/input.c
@@ -191,6 +193,12 @@ void sctp_remaddr_proc_exit(struct net *net);
 */
int sctp_offload_init(void);

/*
 * sctp/stream.c
 */
int sctp_send_reset_streams(struct sctp_association *asoc,
			    struct sctp_reset_streams *params);

/*
 * Module global variables
 */
+7 −1
Original line number Diff line number Diff line
@@ -157,6 +157,7 @@ sctp_state_fn_t sctp_sf_error_shutdown;
sctp_state_fn_t sctp_sf_ignore_primitive;
sctp_state_fn_t sctp_sf_do_prm_requestheartbeat;
sctp_state_fn_t sctp_sf_do_prm_asconf;
sctp_state_fn_t sctp_sf_do_prm_reconf;

/* Prototypes for other event state functions.  */
sctp_state_fn_t sctp_sf_do_no_pending_tsn;
@@ -167,6 +168,7 @@ sctp_state_fn_t sctp_sf_cookie_wait_icmp_abort;

/* Prototypes for timeout event state functions.  */
sctp_state_fn_t sctp_sf_do_6_3_3_rtx;
sctp_state_fn_t sctp_sf_send_reconf;
sctp_state_fn_t sctp_sf_do_6_2_sack;
sctp_state_fn_t sctp_sf_autoclose_timer_expire;

@@ -259,7 +261,10 @@ struct sctp_chunk *sctp_make_fwdtsn(const struct sctp_association *asoc,
				    __u32 new_cum_tsn, size_t nstreams,
				    struct sctp_fwdtsn_skip *skiplist);
struct sctp_chunk *sctp_make_auth(const struct sctp_association *asoc);

struct sctp_chunk *sctp_make_strreset_req(
				const struct sctp_association *asoc,
				__u16 stream_num, __u16 *stream_list,
				bool out, bool in);
void sctp_chunk_assign_tsn(struct sctp_chunk *);
void sctp_chunk_assign_ssn(struct sctp_chunk *);

@@ -275,6 +280,7 @@ int sctp_do_sm(struct net *net, sctp_event_t event_type, sctp_subtype_t subtype,
/* 2nd level prototypes */
void sctp_generate_t3_rtx_event(unsigned long peer);
void sctp_generate_heartbeat_event(unsigned long peer);
void sctp_generate_reconf_event(unsigned long peer);
void sctp_generate_proto_unreach_event(unsigned long peer);

void sctp_ootb_pkt_free(struct sctp_packet *);
Loading