Browse code

xhttp: exported http reply function to kemi framework

Daniel-Constantin Mierla authored on 15/04/2017 06:21:23
Showing 1 changed files
... ...
@@ -41,6 +41,7 @@
41 41
 #include "../../core/sip_msg_clone.h"
42 42
 #include "../../core/mod_fix.h"
43 43
 #include "../../core/pvar.h"
44
+#include "../../core/kemi.h"
44 45
 
45 46
 #include "api.h"
46 47
 #include "xhttp_trans.h"
... ...
@@ -168,10 +169,6 @@ static int mod_init(void)
168 169
 	return 0;
169 170
 }
170 171
 
171
-int mod_register(char *path, int *dlflags, void *p1, void *p2)
172
-{
173
-	return register_trans_mod(path, mod_trans);
174
-}
175 172
 
176 173
 /** 
177 174
  * 
... ...
@@ -517,4 +514,28 @@ int bind_xhttp(xhttp_api_t* api)
517 514
 	return 0;
518 515
 }
519 516
 
520
-/** @} */
517
+/**
518
+ *
519
+ */
520
+/* clang-format off */
521
+static sr_kemi_t sr_kemi_xhttp_exports[] = {
522
+	{ str_init("xhttp"), str_init("reply"),
523
+		SR_KEMIP_INT, xhttp_send_reply,
524
+		{ SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_STR,
525
+			SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE }
526
+	},
527
+
528
+	{ {0, 0}, {0, 0}, 0, NULL, { 0, 0, 0, 0, 0, 0 } }
529
+};
530
+/* clang-format on */
531
+
532
+/**
533
+ *
534
+ */
535
+int mod_register(char *path, int *dlflags, void *p1, void *p2)
536
+{
537
+	sr_kemi_modules_add(sr_kemi_xhttp_exports);
538
+	return register_trans_mod(path, mod_trans);
539
+}
540
+
541
+/** @} */
521 542
\ No newline at end of file