Browse code

core, lib, modules: updated include paths for header files

Daniel-Constantin Mierla authored on 07/12/2016 11:07:22
Showing 1 changed files
... ...
@@ -8,8 +8,8 @@
8 8
 #ifndef RO_TIMER_H
9 9
 #define	RO_TIMER_H
10 10
 
11
-#include "../../locking.h"
12
-#include "../../timer.h"
11
+#include "../../core/locking.h"
12
+#include "../../core/timer.h"
13 13
 
14 14
 extern struct interim_ccr *i_req;
15 15
 
Browse code

core, lib, modules: restructured source code tree

- new folder src/ to hold the source code for main project applications
- main.c is in src/
- all core files are subfolder are in src/core/
- modules are in src/modules/
- libs are in src/lib/
- application Makefiles are in src/
- application binary is built in src/ (src/kamailio)

Daniel-Constantin Mierla authored on 07/12/2016 11:03:51
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,93 @@
1
+/* 
2
+ * File:   ro_timer.h
3
+ * Author: Jason Penton
4
+ *
5
+ * Created on 06 April 2011, 1:39 PM
6
+ */
7
+
8
+#ifndef RO_TIMER_H
9
+#define	RO_TIMER_H
10
+
11
+#include "../../locking.h"
12
+#include "../../timer.h"
13
+
14
+extern struct interim_ccr *i_req;
15
+
16
+/*! ro timeout list */
17
+struct ro_tl {
18
+    struct ro_tl *next;
19
+    struct ro_tl *prev;
20
+    volatile unsigned int timeout; /*!< timeout in seconds */
21
+};
22
+
23
+/*! ro_session timer */
24
+struct ro_timer {
25
+    struct ro_tl first; /*!< ro session timeout list */
26
+    gen_lock_t *lock; /*!< lock for the list */
27
+};
28
+
29
+/*! ro_session timer handler */
30
+typedef void (*ro_timer_handler)(struct ro_tl *);
31
+
32
+
33
+/*!
34
+ * \brief Initialize the ro_session timer handler
35
+ * Initialize the ro_session timer handler, allocate the lock and a global
36
+ * timer in shared memory. The global timer handler will be set on success.
37
+ * \param hdl dialog timer handler
38
+ * \return 0 on success, -1 on failure
39
+ */
40
+int init_ro_timer(ro_timer_handler);
41
+
42
+
43
+/*!
44
+ * \brief Destroy ro_session dialog timer
45
+ */
46
+void destroy_ro_timer(void);
47
+
48
+
49
+/*!
50
+ * \brief Insert a ro_session timer to the list
51
+ * \param tl ro_session timer list
52
+ * \param interval timeout value in seconds
53
+ * \return 0 on success, -1 when the input timer list is invalid
54
+ */
55
+int insert_ro_timer(struct ro_tl *tl, int interval);
56
+
57
+
58
+/*!
59
+ * \brief Remove a ro_session timer from the list
60
+ * \param tl ro_session timer that should be removed
61
+ * \return 1 when the input timer is empty, 0 when the timer was removed,
62
+ * -1 when the input timer list is invalid
63
+ */
64
+int remove_ro_timer(struct ro_tl *tl);
65
+
66
+
67
+/*!
68
+ * \brief Update a ro_session timer on the list
69
+ * \param tl ro_session timer
70
+ * \param timeout new timeout value in seconds
71
+ * \return 0 on success, -1 when the input list is invalid
72
+ * \note the update is implemented as a remove, insert
73
+ */
74
+int update_ro_timer(struct ro_tl *tl, int timeout);
75
+
76
+
77
+/*!
78
+ * \brief Timer routine for expiration of ro_session credit reservations
79
+ * Timer handler for expiration of ro_session credit reservations, runs the global timer handler on them.
80
+ * \param time for expiration checks on credit reservations
81
+ * \param attr unused
82
+ */
83
+void ro_timer_routine(unsigned int ticks, void * attr);
84
+
85
+/* this is the function called when a we need to request more funds/credit. We need to try and reserve more credit.
86
+ * If we cant we need to put a new timer to kill the call at the appropriate time
87
+ */
88
+void ro_session_ontimeout(struct ro_tl *tl);
89
+
90
+void resume_ro_session_ontimeout(struct interim_ccr *i_req, int timeour_or_error);
91
+
92
+#endif	/* RO_TIMER_H */
93
+