SCTP: handle INIT corner-case handling

As per RFC4960 the INIT chunk could be received in unexpected scenarios
and - depending on the state of the internal state-machine - the INIT
chunk requires different treatment.
This patch addresses section 5.2.1 and 5.2.2 of the RFC4960.

Change-Id: Ib23ef490c6a5ca3da6c46a9584b75e7577cb7042
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
diff --git a/src/vnet/sctp/sctp.h b/src/vnet/sctp/sctp.h
index 048d153..de5eb8f 100644
--- a/src/vnet/sctp/sctp.h
+++ b/src/vnet/sctp/sctp.h
@@ -237,6 +237,9 @@
 
   u8 next_avail_sub_conn; /**< Represent the index of the next free slot in sub_conn */
 
+  u8 forming_association_changed; /**< This is a flag indicating whether the original association has been modified during
+  	  	  	  	  the life-span of the association itself. For instance, a new sub-connection might have been added. */
+
 } sctp_connection_t;
 
 typedef void (sctp_timer_expiration_handler) (u32 conn_index, u32 timer_id);
@@ -280,6 +283,16 @@
 void sctp_prepare_initack_chunk (sctp_connection_t * sctp_conn, u8 idx,
 				 vlib_buffer_t * b, ip4_address_t * ip4_addr,
 				 ip6_address_t * ip6_addr);
+void
+sctp_prepare_initack_chunk_for_collision (sctp_connection_t * sctp_conn,
+					  u8 idx, vlib_buffer_t * b,
+					  ip4_address_t * ip4_addr,
+					  ip6_address_t * ip6_addr);
+void sctp_prepare_abort_for_collision (sctp_connection_t * sctp_conn, u8 idx,
+				       vlib_buffer_t * b,
+				       ip4_address_t * ip4_addr,
+				       ip6_address_t * ip6_addr);
+
 void sctp_prepare_cookie_echo_chunk (sctp_connection_t * sctp_conn, u8 idx,
 				     vlib_buffer_t * b,
 				     sctp_state_cookie_param_t * sc);