Browse code

core: structure to pass cfg env attributes between components

(cherry picked from commit 4af9116951d0be9c3d042eabd632971b13df8ad1)

Daniel-Constantin Mierla authored on 06/07/2016 14:22:44
Showing 3 changed files
... ...
@@ -19,7 +19,7 @@
19 19
  *
20 20
  */
21 21
 
22
-/** Kamailio core :: main file (init, daemonize, startup) 
22
+/** Kamailio core :: main file (init, daemonize, startup)
23 23
  * @file main.c
24 24
  * @ingroup core
25 25
  * Module: core
... ...
@@ -133,6 +133,7 @@
133 133
 #include "async_task.h"
134 134
 #include "dset.h"
135 135
 #include "timer_proc.h"
136
+#include "srapi.h"
136 137
 
137 138
 #ifdef DEBUG_DMALLOC
138 139
 #include <dmalloc.h>
... ...
@@ -1836,6 +1837,7 @@ int main(int argc, char** argv)
1836 1836
 	debug_flag=0;
1837 1837
 	dont_fork_cnt=0;
1838 1838
 
1839
+	sr_cfgenv_init();
1839 1840
 	daemon_status_init();
1840 1841
 
1841 1842
 	dprint_init_colors();
... ...
@@ -44,3 +44,24 @@ sr_generate_callid_f sr_get_callid_func(void)
44 44
 {
45 45
 	return _sr_generate_callid_func;
46 46
 }
47
+
48
+/**
49
+ *
50
+ */
51
+static sr_cfgenv_t _sr_cfgenv;
52
+
53
+/**
54
+ *
55
+ */
56
+void sr_cfgenv_init(void)
57
+{
58
+	memset(&_sr_cfgenv, 0, sizeof(sr_cfgenv_t));
59
+}
60
+
61
+/**
62
+ *
63
+ */
64
+sr_cfgenv_t* sr_cfgenv_get(void)
65
+{
66
+	return &_sr_cfgenv;
67
+}
... ...
@@ -27,4 +27,11 @@ int sr_register_callid_func(sr_generate_callid_f f);
27 27
 
28 28
 sr_generate_callid_f sr_get_callid_func(void);
29 29
 
30
+typedef struct sr_cfgenv {
31
+	int cseq_update;
32
+} sr_cfgenv_t;
33
+
34
+void sr_cfgenv_init(void);
35
+sr_cfgenv_t* sr_cfgenv_get(void);
36
+
30 37
 #endif