Bläddra i källkod

core: filled sctp core api

- cleanup of not needed members
Daniel-Constantin Mierla 12 år sedan
förälder
incheckning
a2afc3d422
2 ändrade filer med 10 tillägg och 21 borttagningar
  1. 10 19
      sctp_core.c
  2. 0 2
      sctp_core.h

+ 10 - 19
sctp_core.c

@@ -44,29 +44,20 @@ int sctp_core_init(void)
  */
 void sctp_core_destroy(void)
 {
-}
-
-/**
- *
- */
-int sctp_core_init_sock(struct socket_info* sock_info)
-{
-	return 0;
-}
+	if(_sctp_srapi_set==0) {
+		LM_INFO("SCTP API not initialized\n");
+		return;
+	}
 
-/**
- *
- */
-void sctp_core_init_options(void)
-{
+	_sctp_srapi.destroy();
 }
 
 /**
  *
  */
-int sctp_core_check_compiled_sockopts(char* buf, int size)
+int sctp_core_init_sock(struct socket_info* sock_info)
 {
-	return 0;
+	return _sctp_srapi.init_sock(sock_info);
 }
 
 /**
@@ -74,7 +65,7 @@ int sctp_core_check_compiled_sockopts(char* buf, int size)
  */
 int sctp_core_check_support(void)
 {
-	return 0;
+	return _sctp_srapi.check_support();
 }
 
 /**
@@ -82,7 +73,7 @@ int sctp_core_check_support(void)
  */
 int sctp_core_rcv_loop(void)
 {
-	return 0;
+	return _sctp_srapi.rcv_loop();
 }
 
 /**
@@ -90,7 +81,7 @@ int sctp_core_rcv_loop(void)
  */
 int sctp_core_msg_send(struct dest_info* dst, char* buf, unsigned len)
 {
-	return 0;
+	return _sctp_srapi.msg_send(dst, buf, len);
 }
 
 /**

+ 0 - 2
sctp_core.h

@@ -52,8 +52,6 @@ typedef struct sctp_srapi {
 	sctp_srapi_init_f init;
 	sctp_srapi_destroy_f destroy;
 	sctp_srapi_init_sock_f init_sock;
-	sctp_srapi_init_options_f init_options;
-	sctp_srapi_check_compiled_sockopts_f check_compiled_sockopts;
 	sctp_srapi_check_support_f check_support;
 	sctp_srapi_rcv_loop_f rcv_loop;
 	sctp_srapi_msg_send_f msg_send;