Browse code

core: filled sctp core api

- cleanup of not needed members

Daniel-Constantin Mierla authored on 25/05/2013 13:42:14
Showing 2 changed files
... ...
@@ -44,29 +44,20 @@ int sctp_core_init(void)
44 44
  */
45 45
 void sctp_core_destroy(void)
46 46
 {
47
-}
48
-
49
-/**
50
- *
51
- */
52
-int sctp_core_init_sock(struct socket_info* sock_info)
53
-{
54
-	return 0;
55
-}
47
+	if(_sctp_srapi_set==0) {
48
+		LM_INFO("SCTP API not initialized\n");
49
+		return;
50
+	}
56 51
 
57
-/**
58
- *
59
- */
60
-void sctp_core_init_options(void)
61
-{
52
+	_sctp_srapi.destroy();
62 53
 }
63 54
 
64 55
 /**
65 56
  *
66 57
  */
67
-int sctp_core_check_compiled_sockopts(char* buf, int size)
58
+int sctp_core_init_sock(struct socket_info* sock_info)
68 59
 {
69
-	return 0;
60
+	return _sctp_srapi.init_sock(sock_info);
70 61
 }
71 62
 
72 63
 /**
... ...
@@ -74,7 +65,7 @@ int sctp_core_check_compiled_sockopts(char* buf, int size)
74 74
  */
75 75
 int sctp_core_check_support(void)
76 76
 {
77
-	return 0;
77
+	return _sctp_srapi.check_support();
78 78
 }
79 79
 
80 80
 /**
... ...
@@ -82,7 +73,7 @@ int sctp_core_check_support(void)
82 82
  */
83 83
 int sctp_core_rcv_loop(void)
84 84
 {
85
-	return 0;
85
+	return _sctp_srapi.rcv_loop();
86 86
 }
87 87
 
88 88
 /**
... ...
@@ -90,7 +81,7 @@ int sctp_core_rcv_loop(void)
90 90
  */
91 91
 int sctp_core_msg_send(struct dest_info* dst, char* buf, unsigned len)
92 92
 {
93
-	return 0;
93
+	return _sctp_srapi.msg_send(dst, buf, len);
94 94
 }
95 95
 
96 96
 /**
... ...
@@ -52,8 +52,6 @@ typedef struct sctp_srapi {
52 52
 	sctp_srapi_init_f init;
53 53
 	sctp_srapi_destroy_f destroy;
54 54
 	sctp_srapi_init_sock_f init_sock;
55
-	sctp_srapi_init_options_f init_options;
56
-	sctp_srapi_check_compiled_sockopts_f check_compiled_sockopts;
57 55
 	sctp_srapi_check_support_f check_support;
58 56
 	sctp_srapi_rcv_loop_f rcv_loop;
59 57
 	sctp_srapi_msg_send_f msg_send;