Browse code

Doxygen updates on timer modules

- changing from \ and ! to javadoc format
- adding new doxygen file headers

oej authored on 22/10/2009 17:56:48
Showing 6 changed files
... ...
@@ -3,19 +3,14 @@
3 3
  *
4 4
  * Copyright (C) 2001-2003 FhG Fokus
5 5
  *
6
- * This file is part of ser, a free SIP server.
6
+ * This file is part of SIP-router, a free SIP server.
7 7
  *
8
- * ser is free software; you can redistribute it and/or modify
8
+ * SIP-router is free software; you can redistribute it and/or modify
9 9
  * it under the terms of the GNU General Public License as published by
10 10
  * the Free Software Foundation; either version 2 of the License, or
11 11
  * (at your option) any later version
12 12
  *
13
- * For a license to use the ser software under conditions
14
- * other than those described here, or to purchase support for this
15
- * software, please contact iptel.org by e-mail at the following addresses:
16
- *    info@iptel.org
17
- *
18
- * ser is distributed in the hope that it will be useful,
13
+ * SIP-router is distributed in the hope that it will be useful,
19 14
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 15
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 16
  * GNU General Public License for more details.
... ...
@@ -38,11 +33,11 @@
38 33
  */
39 34
 
40 35
 
41
-/*!
42
- * \file
43
- * \brief SIP-router core :: 
44
- * \ingroup core
45
- * Module: \ref core
36
+/**
37
+ * @file
38
+ * @brief SIP-router core :: 
39
+ * @ingroup core
40
+ * Module: @ref core
46 41
  */
47 42
 
48 43
 #include "timer.h"
... ...
@@ -6,19 +6,14 @@
6 6
  *
7 7
  * Copyright (C) 2001-2003 FhG Fokus
8 8
  *
9
- * This file is part of ser, a free SIP server.
9
+ * This file is part of SIP-router, a free SIP server.
10 10
  *
11
- * ser is free software; you can redistribute it and/or modify
11
+ * SIP-router is free software; you can redistribute it and/or modify
12 12
  * it under the terms of the GNU General Public License as published by
13 13
  * the Free Software Foundation; either version 2 of the License, or
14 14
  * (at your option) any later version
15 15
  *
16
- * For a license to use the ser software under conditions
17
- * other than those described here, or to purchase support for this
18
- * software, please contact iptel.org by e-mail at the following addresses:
19
- *    info@iptel.org
20
- *
21
- * ser is distributed in the hope that it will be useful,
16
+ * SIP-router is distributed in the hope that it will be useful,
22 17
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 18
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24 19
  * GNU General Public License for more details.
... ...
@@ -6,19 +6,14 @@
6 6
  *
7 7
  * Copyright (C) 2005 iptelorg GmbH
8 8
  *
9
- * This file is part of ser, a free SIP server.
9
+ * This file is part of SIP-router, a free SIP server.
10 10
  *
11
- * ser is free software; you can redistribute it and/or modify
11
+ * SIP-router is free software; you can redistribute it and/or modify
12 12
  * it under the terms of the GNU General Public License as published by
13 13
  * the Free Software Foundation; either version 2 of the License, or
14 14
  * (at your option) any later version
15 15
  *
16
- * For a license to use the ser software under conditions
17
- * other than those described here, or to purchase support for this
18
- * software, please contact iptel.org by e-mail at the following addresses:
19
- *    info@iptel.org
20
- *
21
- * ser is distributed in the hope that it will be useful,
16
+ * SIP-router is distributed in the hope that it will be useful,
22 17
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 18
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24 19
  * GNU General Public License for more details.
... ...
@@ -27,11 +22,19 @@
27 22
  * along with this program; if not, write to the Free Software 
28 23
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
29 24
  */
25
+
30 26
 /* History:
31 27
  * --------
32 28
  *  2005-07-27  complete re-design/re-implemnetation (andrei)
33 29
  */
34 30
 
31
+/**
32
+ * @file
33
+ * @brief SIP-router core :: Timer related functions (internal)
34
+ * @ingroup core
35
+ * Module: @ref core
36
+ */
37
+
35 38
 
36 39
 #ifndef timer_funcs_h
37 40
 #define timer_funcs_h
... ...
@@ -46,23 +49,27 @@ struct timer_head{
46 49
 
47 50
 
48 51
 
49
-/* hierarchical timing wheel with 3 levels
52
+/** @name hierarchical timing wheel with 3 levels
53
+ *
50 54
  * Most timeouts should go in the first "wheel" (h0)
51 55
  * h0 will contain timers expiring from crt. time up to
52 56
  * crt. time + (1<<H0_BITS)/TICKS_HZ s and will use
53 57
  * (1<<H0_BITS)*sizeof(struct timer_head) bytes of memory, so arrange it
54 58
  * accordingly
55
- */
56
-
57
-#define H0_BITS 14
58
-#define H1_BITS  9 
59
-#define H2_BITS  (32-H1_BITS-H0_BITS)
60
-/* Uses ~280K on a 64 bits system and ~140K on a 32 bit system; for TICKS_HZ=10
59
+ *
60
+x* Uses ~280K on a 64 bits system and ~140K on a 32 bit system; for TICKS_HZ=10
61 61
  * holds ~ 30 min in the first hash/wheel and ~233h in the first two.
62 62
  * More perfomant arrangement: 16, 8, 8 (but eats 1 MB on a 64 bit system, and
63 63
  *  512K on a 32 bit one). For TICKS_HZ=10 it holds almost 2h in the
64 64
  *  first hash/wheel and ~460h in the first two.
65 65
  */
66
+ */
67
+/*@{ */
68
+
69
+#define H0_BITS 14
70
+#define H1_BITS  9 
71
+#define H2_BITS  (32-H1_BITS-H0_BITS)
72
+
66 73
 
67 74
 #define H0_ENTRIES (1<<H0_BITS)
68 75
 #define H1_ENTRIES (1<<H1_BITS)
... ...
@@ -72,6 +79,7 @@ struct timer_head{
72 79
 #define H1_MASK (H1_ENTRIES-1)
73 80
 #define H1_H0_MASK ((1<<(H0_BITS+H1_BITS))-1)
74 81
 
82
+/*@} */
75 83
 
76 84
 struct timer_lists{
77 85
 	struct timer_head  h0[H0_ENTRIES];
... ...
@@ -99,7 +107,8 @@ extern struct timer_lists* timer_lst;
99 107
 
100 108
 
101 109
 
102
-/* generic add timer entry to the timer lists function (see _timer_add)
110
+/** @brief generic add timer entry to the timer lists function (see _timer_add)
111
+ *
103 112
  * tl->expire must be set previously, delta is the difference in ticks
104 113
  * from current time to the timer desired expire (should be tl->expire-*tick)
105 114
  * If you don't know delta, you probably want to call _timer_add instead.
... ...
@@ -193,7 +202,7 @@ static inline void timer_lst_mv1(ticks_t t, struct timer_head* h)
193 202
 }
194 203
 
195 204
 
196
-/* possible faster version */
205
+/** @brief possible faster version */
197 206
 static inline void timer_run(ticks_t t)
198 207
 {
199 208
 	/* trust the compiler for optimizing */
... ...
@@ -25,11 +25,14 @@
25 25
  *  2009-03-10  initial version (andrei)
26 26
 */
27 27
 
28
-/*!
29
- * \file
30
- * \brief SIP-router core :: 
31
- * \ingroup core
32
- * Module: \ref core
28
+/**
29
+ * @file
30
+ * @brief SIP-router core ::  timer - separate process timers
31
+ *
32
+ *  (unrelated to the main fast and slow timers)
33
+ *
34
+ * @ingroup core
35
+ * Module: @ref core
33 36
  */
34 37
 
35 38
 #include "timer_proc.h"
... ...
@@ -15,26 +15,32 @@
15 15
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 16
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 17
  */
18
-/*
19
- * timer_proc.h - separate process timers
20
- * (unrelated to the main fast and slow timers)
21
- */
18
+
22 19
 /*
23 20
  * History:
24 21
  * --------
25 22
  *  2009-03-10  initial version (andrei)
26 23
 */
27 24
 
25
+/**
26
+ * @file
27
+ * @brief SIP-router core :: timer_proc.h - separate process timers
28
+ *
29
+ * (unrelated to the main fast and slow timers)
30
+ * @ingroup core
31
+ * Module: @ref core
32
+ */
33
+
28 34
 #ifndef __timer_proc_h
29 35
 #define __timer_proc_h
30 36
 
31 37
 #include "local_timer.h"
32 38
 
33
-/* forks a separate simple sleep() periodic timer */
39
+/** @brief forks a separate simple sleep() periodic timer */
34 40
 int fork_dummy_timer(int child_id, char* desc, int make_sock,
35 41
 						timer_function* f, void* param, int interval);
36 42
 
37
-/* forks a timer process based on the local timer */
43
+/** @briefforks a timer process based on the local timer */
38 44
 int fork_local_timer_process(int child_id, char* desc, int make_sock,
39 45
 						struct local_timer** lt_h);
40 46
 
... ...
@@ -6,19 +6,14 @@
6 6
  *
7 7
  * Copyright (C) 2005 iptelorg GmbH
8 8
  *
9
- * This file is part of ser, a free SIP server.
9
+ * This file is part of SIP-router, a free SIP server.
10 10
  *
11
- * ser is free software; you can redistribute it and/or modify
11
+ * SIP-router is free software; you can redistribute it and/or modify
12 12
  * it under the terms of the GNU General Public License as published by
13 13
  * the Free Software Foundation; either version 2 of the License, or
14 14
  * (at your option) any later version
15 15
  *
16
- * For a license to use the ser software under conditions
17
- * other than those described here, or to purchase support for this
18
- * software, please contact iptel.org by e-mail at the following addresses:
19
- *    info@iptel.org
20
- *
21
- * ser is distributed in the hope that it will be useful,
16
+ * SIP-router is distributed in the hope that it will be useful,
22 17
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 18
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24 19
  * GNU General Public License for more details.
... ...
@@ -33,38 +28,45 @@
33 28
  *  2007-07-02  added ticks comparison macros (andrei)
34 29
  */
35 30
 
31
+/**
32
+ * @file
33
+ * @brief SIP-router core :: timer frequency and ticks conversions
34
+ * @ingroup core
35
+ * Module: @ref core
36
+ */
37
+
36 38
 #ifndef _timer_ticks_h
37 39
 #define _timer_ticks_h
38 40
 
39
-/* how many ticks per second (must >1 and < 100 (on linux x86))
41
+/** @brief how many ticks per second (must >1 and < 100 (on linux x86))
40 42
  * recomended values >=8, <=32 (a 2^k value is better/faster)*/
41 43
 #define TIMER_TICKS_HZ	16U
42 44
 
43
-/* how many ticks per m milliseconds? (rounded up) */
45
+/** @brief how many ticks per m milliseconds? (rounded up) */
44 46
 #define MS_TO_TICKS(m)  (((m)*TIMER_TICKS_HZ+999U)/1000U)
45 47
 
46 48
 
47
-/* how many ticks per s seconds? */
49
+/** @brief how many ticks per s seconds? */
48 50
 #define S_TO_TICKS(s)	((s)*TIMER_TICKS_HZ)
49 51
 
50 52
 
51
-/* how many s pe per t ticks, integer value */
53
+/** @brief how many s pe per t ticks, integer value */
52 54
 #define TICKS_TO_S(t)	((t)/TIMER_TICKS_HZ)
53 55
 
54
-/* how many ms per t ticks, integer value */
56
+/** @brief how many ms per t ticks, integer value */
55 57
 #define TICKS_TO_MS(t) (((t)*1000U)/TIMER_TICKS_HZ)
56 58
 
57 59
 
58
-/* ticks comparison operations: t1 OP t2, where OP can be <, >, <=, >= */
60
+/** @brief ticks comparison operations: t1 OP t2, where OP can be <, >, <=, >= */
59 61
 #define TICKS_CMP_OP(t1, t2, OP) \
60 62
 	(((s_ticks_t)((ticks_t)(t1)-(ticks_t)(t2))) OP (s_ticks_t)0)
61
-/* t1 < t2 */
63
+/** @brief t1 < t2 */
62 64
 #define TICKS_LT(t1, t2)  TICKS_CMP_OP(t1, t2, <)
63
-/* t1 <= t2 */
65
+/** @brief t1 <= t2 */
64 66
 #define TICKS_LE(t1, t2)  TICKS_CMP_OP(t1, t2, <=)
65
-/* t1 > t2 */
67
+/** @brief t1 > t2 */
66 68
 #define TICKS_GT(t1, t2)  TICKS_CMP_OP(t1, t2, >)
67
-/* t1 >= t2 */
69
+/** @brief t1 >= t2 */
68 70
 #define TICKS_GE(t1, t2)  TICKS_CMP_OP(t1, t2, >=)
69 71
 
70 72