Browse Source

sctp: new module for SCTP transport

- moved the sctp specific code from core to a module to make it easy to
  enable/disable sctp by loading/not loading the module instead of
  recompiling
Daniel-Constantin Mierla 12 years ago
parent
commit
7f8e7a8568

+ 2 - 0
Makefile.defs

@@ -155,6 +155,8 @@ endif
 
 # application server support on
 WITHAS ?= 1
+# enable core hooks for SCTP
+SCTP ?= 1
 
 # what to install
 INSTALL_FLAVOUR=$(FLAVOUR)

+ 1 - 1
action.c

@@ -89,7 +89,7 @@
 #include "tcp_server.h"
 #endif
 #ifdef USE_SCTP
-#include "sctp_server.h"
+#include "sctp_core.h"
 #endif
 #include "switch.h"
 #include "events.h"

+ 0 - 57
cfg.lex

@@ -453,25 +453,6 @@ TLS_SEND_TIMEOUT	"tls_send_timeout"
 DISABLE_SCTP	"disable_sctp"
 ENABLE_SCTP	"enable_sctp"
 SCTP_CHILDREN	"sctp_children"
-SCTP_SOCKET_RCVBUF	"sctp_socket_rcvbuf"|"sctp_socket_receive_buffer"
-SCTP_SOCKET_SNDBUF	"sctp_socket_sndbuf"|"sctp_socket_send_buffer"
-SCTP_AUTOCLOSE	"sctp_autoclose"
-SCTP_SEND_TTL	"sctp_send_ttl"
-SCTP_SEND_RETRIES	"sctp_send_retries"
-SCTP_ASSOC_TRACKING	"sctp_assoc_tracking"
-SCTP_ASSOC_REUSE	"sctp_assoc_reuse"
-SCTP_MAX_ASSOCS		"sctp_max_assocs"
-SCTP_SRTO_INITIAL	"sctp_srto_initial"
-SCTP_SRTO_MAX		"sctp_srto_max"
-SCTP_SRTO_MIN		"sctp_srto_min"
-SCTP_ASOCMAXRXT		"sctp_asocmaxrxt"
-SCTP_INIT_MAX_ATTEMPTS		"sctp_init_max_attempts"
-SCTP_INIT_MAX_TIMEO			"sctp_init_max_timeo"
-SCTP_HBINTERVAL				"sctp_hbinterval"
-SCTP_PATHMAXRXT				"sctp_pathmaxrxt"
-SCTP_SACK_DELAY				"sctp_sack_delay"
-SCTP_SACK_FREQ				"sctp_sack_freq"
-SCTP_MAX_BURST				"sctp_max_burst"
 
 ADVERTISED_ADDRESS	"advertised_address"
 ADVERTISED_PORT		"advertised_port"
@@ -881,44 +862,6 @@ IMPORTFILE      "import_file"
 <INITIAL>{ENABLE_SCTP}	{ count(); yylval.strval=yytext; return ENABLE_SCTP;}
 <INITIAL>{SCTP_CHILDREN}	{ count(); yylval.strval=yytext;
 										return SCTP_CHILDREN; }
-<INITIAL>{SCTP_SOCKET_RCVBUF}	{ count(); yylval.strval=yytext;
-										return SCTP_SOCKET_RCVBUF; }
-<INITIAL>{SCTP_SOCKET_SNDBUF}	{ count(); yylval.strval=yytext;
-										return SCTP_SOCKET_SNDBUF; }
-<INITIAL>{SCTP_AUTOCLOSE}	{ count(); yylval.strval=yytext;
-										return SCTP_AUTOCLOSE; }
-<INITIAL>{SCTP_SEND_TTL}	{ count(); yylval.strval=yytext;
-										return SCTP_SEND_TTL; }
-<INITIAL>{SCTP_SEND_RETRIES}	{ count(); yylval.strval=yytext;
-										return SCTP_SEND_RETRIES; }
-<INITIAL>{SCTP_ASSOC_TRACKING}	{ count(); yylval.strval=yytext;
-										return SCTP_ASSOC_TRACKING; }
-<INITIAL>{SCTP_ASSOC_REUSE}		{ count(); yylval.strval=yytext;
-										return SCTP_ASSOC_REUSE; }
-<INITIAL>{SCTP_MAX_ASSOCS}		{ count(); yylval.strval=yytext;
-										return SCTP_MAX_ASSOCS; }
-<INITIAL>{SCTP_SRTO_INITIAL}	{ count(); yylval.strval=yytext;
-										return SCTP_SRTO_INITIAL; }
-<INITIAL>{SCTP_SRTO_MAX}	{ count(); yylval.strval=yytext;
-										return SCTP_SRTO_MAX; }
-<INITIAL>{SCTP_SRTO_MIN}	{ count(); yylval.strval=yytext;
-										return SCTP_SRTO_MIN; }
-<INITIAL>{SCTP_ASOCMAXRXT}	{ count(); yylval.strval=yytext;
-										return SCTP_ASOCMAXRXT; }
-<INITIAL>{SCTP_INIT_MAX_ATTEMPTS}	{ count(); yylval.strval=yytext;
-										return SCTP_INIT_MAX_ATTEMPTS; }
-<INITIAL>{SCTP_INIT_MAX_TIMEO}	{ count(); yylval.strval=yytext;
-										return SCTP_INIT_MAX_TIMEO; }
-<INITIAL>{SCTP_HBINTERVAL}	{ count(); yylval.strval=yytext;
-										return SCTP_HBINTERVAL; }
-<INITIAL>{SCTP_PATHMAXRXT}	{ count(); yylval.strval=yytext;
-										return SCTP_PATHMAXRXT; }
-<INITIAL>{SCTP_SACK_DELAY}	{ count(); yylval.strval=yytext;
-										return SCTP_SACK_DELAY; }
-<INITIAL>{SCTP_SACK_FREQ}	{ count(); yylval.strval=yytext;
-										return SCTP_SACK_FREQ; }
-<INITIAL>{SCTP_MAX_BURST}	{ count(); yylval.strval=yytext;
-										return SCTP_MAX_BURST; }
 <INITIAL>{SERVER_SIGNATURE}	{ count(); yylval.strval=yytext; return SERVER_SIGNATURE; }
 <INITIAL>{SERVER_HEADER}	{ count(); yylval.strval=yytext; return SERVER_HEADER; }
 <INITIAL>{USER_AGENT_HEADER}	{ count(); yylval.strval=yytext; return USER_AGENT_HEADER; }

+ 1 - 181
cfg.y

@@ -135,7 +135,7 @@
 #include "flags.h"
 #include "tcp_init.h"
 #include "tcp_options.h"
-#include "sctp_options.h"
+#include "sctp_core.h"
 #include "pvar.h"
 #include "lvalue.h"
 #include "rvalue.h"
@@ -509,25 +509,6 @@ extern char *finame;
 %token DISABLE_SCTP
 %token ENABLE_SCTP
 %token SCTP_CHILDREN
-%token SCTP_SOCKET_RCVBUF
-%token SCTP_SOCKET_SNDBUF
-%token SCTP_AUTOCLOSE
-%token SCTP_SEND_TTL
-%token SCTP_SEND_RETRIES
-%token SCTP_ASSOC_TRACKING
-%token SCTP_ASSOC_REUSE
-%token SCTP_MAX_ASSOCS
-%token SCTP_SRTO_INITIAL
-%token SCTP_SRTO_MAX
-%token SCTP_SRTO_MIN
-%token SCTP_ASOCMAXRXT
-%token SCTP_INIT_MAX_ATTEMPTS
-%token SCTP_INIT_MAX_TIMEO
-%token SCTP_HBINTERVAL
-%token SCTP_PATHMAXRXT
-%token SCTP_SACK_DELAY
-%token SCTP_SACK_FREQ
-%token SCTP_MAX_BURST
 %token ADVERTISED_ADDRESS
 %token ADVERTISED_PORT
 %token DISABLE_CORE
@@ -1408,122 +1389,6 @@ assign_stm:
 		#endif
 	}
 	| SCTP_CHILDREN EQUAL error { yyerror("number expected"); }
-	| SCTP_SOCKET_RCVBUF EQUAL NUMBER {
-		#ifdef USE_SCTP
-			sctp_default_cfg.so_rcvbuf=$3;
-		#else
-			warn("sctp support not compiled in");
-		#endif
-	}
-	| SCTP_SOCKET_RCVBUF EQUAL error { yyerror("number expected"); }
-	| SCTP_SOCKET_SNDBUF EQUAL NUMBER {
-		#ifdef USE_SCTP
-			sctp_default_cfg.so_sndbuf=$3;
-		#else
-			warn("sctp support not compiled in");
-		#endif
-	}
-	| SCTP_SOCKET_SNDBUF EQUAL error { yyerror("number expected"); }
-	| SCTP_AUTOCLOSE EQUAL NUMBER {
-		#ifdef USE_SCTP
-			sctp_default_cfg.autoclose=$3;
-		#else
-			warn("sctp support not compiled in");
-		#endif
-	}
-	| SCTP_AUTOCLOSE EQUAL error { yyerror("number expected"); }
-	| SCTP_SEND_TTL EQUAL NUMBER {
-		#ifdef USE_SCTP
-			sctp_default_cfg.send_ttl=$3;
-		#else
-			warn("sctp support not compiled in");
-		#endif
-	}
-	| SCTP_SEND_TTL EQUAL error { yyerror("number expected"); }
-	| SCTP_SEND_RETRIES EQUAL NUMBER {
-		#ifdef USE_SCTP
-			sctp_default_cfg.send_retries=$3;
-		#else
-			warn("sctp support not compiled in");
-		#endif
-	}
-	| SCTP_SEND_RETRIES EQUAL error { yyerror("number expected"); }
-	| SCTP_ASSOC_TRACKING EQUAL NUMBER {
-		#ifdef USE_SCTP
-			#ifdef SCTP_CONN_REUSE
-				sctp_default_cfg.assoc_tracking=$3;
-			#else
-				if ($3)
-					warn("sctp association tracking/reuse (SCTP_CONN_REUSE) "
-							"support not compiled in");
-			#endif /* SCTP_CONN_REUSE */
-		#else
-			warn("sctp support not compiled in");
-		#endif /* USE_SCTP */
-	}
-	| SCTP_ASSOC_TRACKING EQUAL error { yyerror("number expected"); }
-	| SCTP_ASSOC_REUSE EQUAL NUMBER {
-		#ifdef USE_SCTP
-			#ifdef SCTP_CONN_REUSE
-				sctp_default_cfg.assoc_reuse=$3;
-			#else
-				if ($3)
-					warn("sctp association reuse (SCTP_CONN_REUSE) support"
-							" not compiled in");
-			#endif /* SCTP_CONN_REUSE */
-		#else
-			warn("sctp support not compiled in");
-		#endif /* USE_SCTP */
-	}
-	| SCTP_ASSOC_REUSE EQUAL error { yyerror("number expected"); }
-	| SCTP_MAX_ASSOCS EQUAL intno {
-			IF_SCTP(sctp_default_cfg.max_assocs=$3);
-	}
-	| SCTP_MAX_ASSOCS EQUAL error { yyerror("number expected"); }
-	| SCTP_SRTO_INITIAL EQUAL NUMBER {
-			IF_SCTP(sctp_default_cfg.srto_initial=$3);
-	}
-	| SCTP_SRTO_INITIAL EQUAL error { yyerror("number expected"); }
-	| SCTP_SRTO_MAX EQUAL NUMBER {
-			IF_SCTP(sctp_default_cfg.srto_max=$3);
-	}
-	| SCTP_SRTO_MAX EQUAL error { yyerror("number expected"); }
-	| SCTP_SRTO_MIN EQUAL NUMBER {
-			IF_SCTP(sctp_default_cfg.srto_min=$3);
-	}
-	| SCTP_SRTO_MIN EQUAL error { yyerror("number expected"); }
-	| SCTP_ASOCMAXRXT EQUAL NUMBER {
-			IF_SCTP(sctp_default_cfg.asocmaxrxt=$3);
-	}
-	| SCTP_ASOCMAXRXT EQUAL error { yyerror("number expected"); }
-	| SCTP_INIT_MAX_ATTEMPTS EQUAL NUMBER {
-			IF_SCTP(sctp_default_cfg.init_max_attempts=$3);
-	}
-	| SCTP_INIT_MAX_ATTEMPTS EQUAL error { yyerror("number expected"); }
-	| SCTP_INIT_MAX_TIMEO EQUAL NUMBER {
-			IF_SCTP(sctp_default_cfg.init_max_timeo=$3);
-	}
-	| SCTP_INIT_MAX_TIMEO EQUAL error { yyerror("number expected"); }
-	| SCTP_HBINTERVAL EQUAL intno {
-			IF_SCTP(sctp_default_cfg.hbinterval=$3);
-	}
-	| SCTP_HBINTERVAL EQUAL error { yyerror("number expected"); }
-	| SCTP_PATHMAXRXT EQUAL NUMBER {
-			IF_SCTP(sctp_default_cfg.pathmaxrxt=$3);
-	}
-	| SCTP_PATHMAXRXT EQUAL error { yyerror("number expected"); }
-	| SCTP_SACK_DELAY EQUAL NUMBER {
-			IF_SCTP(sctp_default_cfg.sack_delay=$3);
-	}
-	| SCTP_SACK_DELAY EQUAL error { yyerror("number expected"); }
-	| SCTP_SACK_FREQ EQUAL NUMBER {
-			IF_SCTP(sctp_default_cfg.sack_freq=$3);
-	}
-	| SCTP_SACK_FREQ EQUAL error { yyerror("number expected"); }
-	| SCTP_MAX_BURST EQUAL NUMBER {
-			IF_SCTP(sctp_default_cfg.max_burst=$3);
-	}
-	| SCTP_MAX_BURST EQUAL error { yyerror("number expected"); }
 	| SERVER_SIGNATURE EQUAL NUMBER { server_signature=$3; }
 	| SERVER_SIGNATURE EQUAL error { yyerror("boolean value expected"); }
 	| SERVER_HEADER EQUAL STRING { server_hdr.s=$3;
@@ -3065,80 +2930,35 @@ cmd:
 	| FORWARD_TLS LPAREN error RPAREN { $$=0; 
 									yyerror("bad forward_tls argument"); }
 	| FORWARD_SCTP LPAREN host RPAREN {
-		#ifdef USE_SCTP
 			$$=mk_action(FORWARD_SCTP_T, 2, STRING_ST, $3, NUMBER_ST, 0); set_cfg_pos($$);
-		#else
-			$$=0;
-			yyerror("sctp support not compiled in");
-		#endif
 	}
 	| FORWARD_SCTP LPAREN STRING RPAREN {
-		#ifdef USE_SCTP
 			$$=mk_action(FORWARD_SCTP_T, 2, STRING_ST, $3, NUMBER_ST, 0); set_cfg_pos($$);
-		#else
-			$$=0;
-			yyerror("sctp support not compiled in");
-		#endif
 	}
 	| FORWARD_SCTP LPAREN ip RPAREN	{
-		#ifdef USE_SCTP
 			$$=mk_action(FORWARD_SCTP_T, 2, IP_ST, (void*)$3, NUMBER_ST, 0); set_cfg_pos($$);
-		#else
-			$$=0;
-			yyerror("sctp support not compiled in");
-		#endif
 	}
 	| FORWARD_SCTP LPAREN host COMMA NUMBER RPAREN {
-		#ifdef USE_SCTP
 			$$=mk_action(FORWARD_SCTP_T, 2, STRING_ST, $3, NUMBER_ST,
 							(void*)$5); set_cfg_pos($$);
-		#else
-			$$=0;
-			yyerror("sctp support not compiled in");
-		#endif
 	}
 	| FORWARD_SCTP LPAREN STRING COMMA NUMBER RPAREN {
-		#ifdef USE_SCTP
 			$$=mk_action(FORWARD_SCTP_T, 2, STRING_ST, $3, NUMBER_ST,
 							(void*)$5); set_cfg_pos($$);
-		#else
-			$$=0;
-			yyerror("sctp support not compiled in");
-		#endif
 	}
 	| FORWARD_SCTP LPAREN ip COMMA NUMBER RPAREN {
-		#ifdef USE_SCTP
 			$$=mk_action(FORWARD_SCTP_T, 2, IP_ST, (void*)$3, NUMBER_ST, 
 							(void*)$5); set_cfg_pos($$);
-		#else
-			$$=0;
-			yyerror("sctp support not compiled in");
-		#endif
 					}
 	| FORWARD_SCTP LPAREN URIHOST COMMA URIPORT RPAREN {
-		#ifdef USE_SCTP
 			$$=mk_action(FORWARD_SCTP_T, 2, URIHOST_ST, 0, URIPORT_ST, 0); set_cfg_pos($$);
-		#else
-			$$=0;
-			yyerror("sctp support not compiled in");
-		#endif
 	}
 	| FORWARD_SCTP LPAREN URIHOST COMMA NUMBER RPAREN {
-		#ifdef USE_SCTP
 			$$=mk_action(FORWARD_SCTP_T, 2, URIHOST_ST, 0, NUMBER_ST,
 							(void*)$5); set_cfg_pos($$);
-		#else
-			$$=0;
-			yyerror("sctp support not compiled in");
-		#endif
 	}
 	| FORWARD_SCTP LPAREN URIHOST RPAREN {
-		#ifdef USE_SCTP
 			$$=mk_action(FORWARD_SCTP_T, 2, URIHOST_ST, 0, NUMBER_ST, 0); set_cfg_pos($$);
-		#else
-			$$=0;
-			yyerror("tls support not compiled in");
-		#endif
 	}
 	| FORWARD_SCTP error { $$=0; yyerror("missing '(' or ')' ?"); }
 	| FORWARD_SCTP LPAREN error RPAREN { $$=0; 

+ 0 - 134
core_cmd.c

@@ -47,10 +47,6 @@
 #include "tcp_options.h"
 #include "core_cmd.h"
 #include "cfg_core.h"
-#ifdef USE_SCTP
-#include "sctp_options.h"
-#include "sctp_server.h"
-#endif
 
 #ifdef USE_DNS_CACHE
 void dns_cache_debug(rpc_t* rpc, void* ctx);
@@ -834,133 +830,6 @@ static void core_tcp_list(rpc_t* rpc, void* c)
 }
 
 
-
-static const char* core_sctp_options_doc[] = {
-	"Returns active sctp options. With one parameter"
-	" it returns the sctp options set in the kernel for a specific socket"
-	"(debugging), with 0 filled in for non-kernel related options."
-	" The parameter can be: \"default\" | \"first\" | address[:port] ."
-	" With no parameters it returns ser's idea of the current sctp options"
-	 " (intended non-debugging use).",
-	/* Documentation string */
-	0                                 /* Method signature(s) */
-};
-
-static void core_sctp_options(rpc_t* rpc, void* c)
-{
-#ifdef USE_SCTP
-	void *handle;
-	struct cfg_group_sctp t;
-	char* param;
-	struct socket_info* si;
-	char* host;
-	str hs;
-	int hlen;
-	int port;
-	int proto;
-
-	param=0;
-	if (!sctp_disable){
-		/* look for optional socket parameter */
-		if (rpc->scan(c, "*s", &param)>0){
-			si=0;
-			if (strcasecmp(param, "default")==0){
-				si=sendipv4_sctp?sendipv4_sctp:sendipv6_sctp;
-			}else if (strcasecmp(param, "first")==0){
-				si=sctp_listen;
-			}else{
-				if (parse_phostport(param, &host, &hlen, &port, &proto)!=0){
-					rpc->fault(c, 500, "bad param (use address, address:port,"
-										" default or first)");
-					return;
-				}
-				if (proto && proto!=PROTO_SCTP){
-					rpc->fault(c, 500, "bad protocol in param (only SCTP"
-										" allowed)");
-					return;
-				}
-				hs.s=host;
-				hs.len=hlen;
-				si=grep_sock_info(&hs, port, PROTO_SCTP);
-				if (si==0){
-					rpc->fault(c, 500, "not listening on sctp %s", param);
-					return;
-				}
-			}
-			if (si==0 || si->socket==-1){
-				rpc->fault(c, 500, "could not find a sctp socket");
-				return;
-			}
-			memset(&t, 0, sizeof(t));
-			if (sctp_get_cfg_from_sock(si->socket, &t)!=0){
-				rpc->fault(c, 500, "failed to get socket options");
-				return;
-			}
-		}else{
-			sctp_options_get(&t);
-		}
-		rpc->add(c, "{", &handle);
-		rpc->struct_add(handle, "ddddddddddddddddddd",
-			"sctp_socket_rcvbuf",	t.so_rcvbuf,
-			"sctp_socket_sndbuf",	t.so_sndbuf,
-			"sctp_autoclose",		t.autoclose,
-			"sctp_send_ttl",	t.send_ttl,
-			"sctp_send_retries",	t.send_retries,
-			"sctp_assoc_tracking",	t.assoc_tracking,
-			"sctp_assoc_reuse",	t.assoc_reuse,
-			"sctp_max_assocs", t.max_assocs,
-			"sctp_srto_initial",	t.srto_initial,
-			"sctp_srto_max",		t.srto_max,
-			"sctp_srto_min",		t.srto_min,
-			"sctp_asocmaxrxt",	t.asocmaxrxt,
-			"sctp_init_max_attempts",	t.init_max_attempts,
-			"sctp_init_max_timeo",t.init_max_timeo,
-			"sctp_hbinterval",	t.hbinterval,
-			"sctp_pathmaxrxt",	t.pathmaxrxt,
-			"sctp_sack_delay",	t.sack_delay,
-			"sctp_sack_freq",	t.sack_freq,
-			"sctp_max_burst",	t.max_burst
-		);
-	}else{
-		rpc->fault(c, 500, "sctp support disabled");
-	}
-#else
-	rpc->fault(c, 500, "sctp support not compiled");
-#endif
-}
-
-
-
-static const char* core_sctpinfo_doc[] = {
-	"Returns sctp related info.",    /* Documentation string */
-	0                               /* Method signature(s) */
-};
-
-static void core_sctpinfo(rpc_t* rpc, void* c)
-{
-#ifdef USE_SCTP
-	void *handle;
-	struct sctp_gen_info i;
-
-	if (!sctp_disable){
-		sctp_get_info(&i);
-		rpc->add(c, "{", &handle);
-		rpc->struct_add(handle, "ddd",
-			"opened_connections", i.sctp_connections_no,
-			"tracked_connections", i.sctp_tracked_no,
-			"total_connections", i.sctp_total_connections
-		);
-	}else{
-		rpc->fault(c, 500, "sctp support disabled");
-	}
-#else
-	rpc->fault(c, 500, "sctp support not compiled");
-#endif
-}
-
-
-
-
 static const char* core_udp4rawinfo_doc[] = {
 	"Returns udp4_raw related info.",    /* Documentation string */
 	0                                     /* Method signature(s) */
@@ -1106,9 +975,6 @@ static rpc_export_t core_rpc_methods[] = {
 	{"core.tcp_info",          core_tcpinfo,           core_tcpinfo_doc,    0},
 	{"core.tcp_options",       core_tcp_options,       core_tcp_options_doc,0},
 	{"core.tcp_list",          core_tcp_list,          core_tcp_list_doc,0},
-	{"core.sctp_options",      core_sctp_options,      core_sctp_options_doc,
-		0},
-	{"core.sctp_info",         core_sctpinfo,          core_sctpinfo_doc,   0},
 	{"core.udp4_raw_info",     core_udp4rawinfo,       core_udp4rawinfo_doc,
 		0},
 	{"core.aliases_list",      core_aliases_list,      core_aliases_list_doc,   0},

+ 2 - 2
forward.h

@@ -57,7 +57,7 @@
 #include "tcp_conn.h"
 #endif
 #ifdef USE_SCTP
-#include "sctp_server.h"
+#include "sctp_core.h"
 #endif
 
 #include "compiler_opt.h"
@@ -258,7 +258,7 @@ static inline int msg_send(struct dest_info* dst, char* buf, int len)
 				}
 				dst=&new_dst;
 			}
-			if (unlikely(sctp_msg_send(dst, outb.s, outb.len)<0)){
+			if (unlikely(sctp_core_msg_send(dst, outb.s, outb.len)<0)){
 				STATS_TX_DROPS;
 				LOG(L_ERR, "msg_send: ERROR: sctp_msg_send failed\n");
 				goto error;

+ 8 - 15
main.c

@@ -162,8 +162,7 @@
 #endif /* CORE_TLS */
 #endif /* USE_TCP */
 #ifdef USE_SCTP
-#include "sctp_options.h"
-#include "sctp_server.h"
+#include "sctp_core.h"
 #endif
 #include "usr_avp.h"
 #include "rpc_lookup.h"
@@ -582,7 +581,7 @@ void cleanup(show_status)
 #endif /* USE_TLS */
 #endif /* USE_TCP */
 #ifdef USE_SCTP
-	destroy_sctp();
+	sctp_core_destroy();
 #endif
 	destroy_timer();
 	pv_destroy_api();
@@ -1491,7 +1490,7 @@ int main_loop(void)
 #ifdef USE_SCTP
 		if (!sctp_disable){
 			for(si=sctp_listen; si; si=si->next){
-				if (sctp_init_sock(si)==-1)  goto error;
+				if (sctp_core_init_sock(si)==-1)  goto error;
 				/* get first ipv4/ipv6 socket*/
 				if ((si->address.af==AF_INET) &&
 						((sendipv4_sctp==0) ||
@@ -1646,7 +1645,7 @@ int main_loop(void)
 #ifdef STATS
 						setstats( i+r*children_no );
 #endif
-						return sctp_rcv_loop();
+						return sctp_core_rcv_loop();
 					}
 				}
 			/*parent*/
@@ -1903,7 +1902,7 @@ int main(int argc, char** argv)
 	init_tcp_options(); /* set the defaults before the config */
 #endif
 #ifdef USE_SCTP
-	init_sctp_options(); /* set defaults before the config */
+	sctp_core_init_options(); /* set defaults before the config */
 #endif
 	/* process command line (cfg. file path etc) */
 	optind = 1;  /* reset getopt */
@@ -1944,7 +1943,7 @@ int main(int argc, char** argv)
 					print_ct_constants();
 #ifdef USE_SCTP
 					tmp=malloc(256);
-					if (tmp && (sctp_check_compiled_sockopts(tmp, 256)!=0))
+					if (tmp && (sctp_core_check_compiled_sockopts(tmp, 256)!=0))
 						printf("sctp unsupported socket options: %s\n", tmp);
 					if (tmp) free(tmp);
 #endif
@@ -2282,7 +2281,7 @@ try_again:
 #ifdef USE_SCTP
 	if (sctp_disable!=1){
 		/* fix it */
-		if (sctp_check_support()==-1){
+		if (sctp_core_check_support()==-1){
 			/* check if sctp support is auto, if not warn about disabling it */
 			if (sctp_disable!=2){
 				fprintf(stderr, "ERROR: " "sctp enabled, but not supported by"
@@ -2403,12 +2402,6 @@ try_again:
 		goto error;
 	}
 #endif /* USE_TCP */
-#ifdef USE_SCTP
-	if (sctp_register_cfg()){
-		LOG(L_CRIT, "could not register the sctp configuration\n");
-		goto error;
-	}
-#endif /* USE_SCTP */
 	/*init timer, before parsing the cfg!*/
 	if (init_timer()<0){
 		LOG(L_CRIT, "could not initialize timer, exiting...\n");
@@ -2454,7 +2447,7 @@ try_again:
 #endif /* USE_TCP */
 #ifdef USE_SCTP
 	if (!sctp_disable){
-		if (init_sctp()<0){
+		if (sctp_core_init()<0){
 			LOG(L_CRIT, "Could not initialize sctp, exiting...\n");
 			goto error;
 		}

+ 0 - 0
sctp_ev.h → modules/sctp/sctp_ev.h


+ 0 - 0
sctp_options.c → modules/sctp/sctp_options.c


+ 0 - 0
sctp_options.h → modules/sctp/sctp_options.h


+ 0 - 0
sctp_server.c → modules/sctp/sctp_server.c


+ 0 - 0
sctp_server.h → modules/sctp/sctp_server.h


+ 0 - 0
sctp_sockopts.h → modules/sctp/sctp_sockopts.h


+ 0 - 0
sctp_stats.c → modules/sctp/sctp_stats.c


+ 0 - 0
sctp_stats.h → modules/sctp/sctp_stats.h