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 38
  */
39 39
 
40 40
 
41
-/*!
42
- * \file
43
- * \brief SIP-router core :: 
44
- * \ingroup core
45
- * Module: \ref core
41
+/**
42
+ * @file
43
+ * @brief SIP-router core :: 
44
+ * @ingroup core
45
+ * Module: @ref core
46 46
  */
47 47
 
48 48
 #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 27
  * along with this program; if not, write to the Free Software 
28 28
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
29 29
  */
30
+
30 31
 /* History:
31 32
  * --------
32 33
  *  2005-07-27  complete re-design/re-implemnetation (andrei)
33 34
  */
34 35
 
36
+/**
37
+ * @file
38
+ * @brief SIP-router core :: Timer related functions (internal)
39
+ * @ingroup core
40
+ * Module: @ref core
41
+ */
42
+
35 43
 
36 44
 #ifndef timer_funcs_h
37 45
 #define timer_funcs_h
... ...
@@ -46,23 +49,27 @@ struct timer_head{
46 46
 
47 47
 
48 48
 
49
-/* hierarchical timing wheel with 3 levels
49
+/** @name hierarchical timing wheel with 3 levels
50
+ *
50 51
  * Most timeouts should go in the first "wheel" (h0)
51 52
  * h0 will contain timers expiring from crt. time up to
52 53
  * crt. time + (1<<H0_BITS)/TICKS_HZ s and will use
53 54
  * (1<<H0_BITS)*sizeof(struct timer_head) bytes of memory, so arrange it
54 55
  * 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
56
+ *
57
+x* Uses ~280K on a 64 bits system and ~140K on a 32 bit system; for TICKS_HZ=10
61 58
  * holds ~ 30 min in the first hash/wheel and ~233h in the first two.
62 59
  * More perfomant arrangement: 16, 8, 8 (but eats 1 MB on a 64 bit system, and
63 60
  *  512K on a 32 bit one). For TICKS_HZ=10 it holds almost 2h in the
64 61
  *  first hash/wheel and ~460h in the first two.
65 62
  */
63
+ */
64
+/*@{ */
65
+
66
+#define H0_BITS 14
67
+#define H1_BITS  9 
68
+#define H2_BITS  (32-H1_BITS-H0_BITS)
69
+
66 70
 
67 71
 #define H0_ENTRIES (1<<H0_BITS)
68 72
 #define H1_ENTRIES (1<<H1_BITS)
... ...
@@ -72,6 +79,7 @@ struct timer_head{
72 72
 #define H1_MASK (H1_ENTRIES-1)
73 73
 #define H1_H0_MASK ((1<<(H0_BITS+H1_BITS))-1)
74 74
 
75
+/*@} */
75 76
 
76 77
 struct timer_lists{
77 78
 	struct timer_head  h0[H0_ENTRIES];
... ...
@@ -99,7 +107,8 @@ extern struct timer_lists* timer_lst;
99 99
 
100 100
 
101 101
 
102
-/* generic add timer entry to the timer lists function (see _timer_add)
102
+/** @brief generic add timer entry to the timer lists function (see _timer_add)
103
+ *
103 104
  * tl->expire must be set previously, delta is the difference in ticks
104 105
  * from current time to the timer desired expire (should be tl->expire-*tick)
105 106
  * 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 193
 }
194 194
 
195 195
 
196
-/* possible faster version */
196
+/** @brief possible faster version */
197 197
 static inline void timer_run(ticks_t t)
198 198
 {
199 199
 	/* 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 33
  *  2007-07-02  added ticks comparison macros (andrei)
34 34
  */
35 35
 
36
+/**
37
+ * @file
38
+ * @brief SIP-router core :: timer frequency and ticks conversions
39
+ * @ingroup core
40
+ * Module: @ref core
41
+ */
42
+
36 43
 #ifndef _timer_ticks_h
37 44
 #define _timer_ticks_h
38 45
 
39
-/* how many ticks per second (must >1 and < 100 (on linux x86))
46
+/** @brief how many ticks per second (must >1 and < 100 (on linux x86))
40 47
  * recomended values >=8, <=32 (a 2^k value is better/faster)*/
41 48
 #define TIMER_TICKS_HZ	16U
42 49
 
43
-/* how many ticks per m milliseconds? (rounded up) */
50
+/** @brief how many ticks per m milliseconds? (rounded up) */
44 51
 #define MS_TO_TICKS(m)  (((m)*TIMER_TICKS_HZ+999U)/1000U)
45 52
 
46 53
 
47
-/* how many ticks per s seconds? */
54
+/** @brief how many ticks per s seconds? */
48 55
 #define S_TO_TICKS(s)	((s)*TIMER_TICKS_HZ)
49 56
 
50 57
 
51
-/* how many s pe per t ticks, integer value */
58
+/** @brief how many s pe per t ticks, integer value */
52 59
 #define TICKS_TO_S(t)	((t)/TIMER_TICKS_HZ)
53 60
 
54
-/* how many ms per t ticks, integer value */
61
+/** @brief how many ms per t ticks, integer value */
55 62
 #define TICKS_TO_MS(t) (((t)*1000U)/TIMER_TICKS_HZ)
56 63
 
57 64
 
58
-/* ticks comparison operations: t1 OP t2, where OP can be <, >, <=, >= */
65
+/** @brief ticks comparison operations: t1 OP t2, where OP can be <, >, <=, >= */
59 66
 #define TICKS_CMP_OP(t1, t2, OP) \
60 67
 	(((s_ticks_t)((ticks_t)(t1)-(ticks_t)(t2))) OP (s_ticks_t)0)
61
-/* t1 < t2 */
68
+/** @brief t1 < t2 */
62 69
 #define TICKS_LT(t1, t2)  TICKS_CMP_OP(t1, t2, <)
63
-/* t1 <= t2 */
70
+/** @brief t1 <= t2 */
64 71
 #define TICKS_LE(t1, t2)  TICKS_CMP_OP(t1, t2, <=)
65
-/* t1 > t2 */
72
+/** @brief t1 > t2 */
66 73
 #define TICKS_GT(t1, t2)  TICKS_CMP_OP(t1, t2, >)
67
-/* t1 >= t2 */
74
+/** @brief t1 >= t2 */
68 75
 #define TICKS_GE(t1, t2)  TICKS_CMP_OP(t1, t2, >=)
69 76
 
70 77