git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@4444 689a6050-402a-0410-94f2-e92a70836424
... | ... |
@@ -29,6 +29,11 @@ |
29 | 29 |
* (bogdan) |
30 | 30 |
*/ |
31 | 31 |
|
32 |
+/*! \file |
|
33 |
+ * \brief USRLOC - List of registered domains |
|
34 |
+ * \ingroup usrloc |
|
35 |
+ */ |
|
36 |
+ |
|
32 | 37 |
|
33 | 38 |
#include "dlist.h" |
34 | 39 |
#include <stdlib.h> /* abort */ |
... | ... |
@@ -45,15 +50,15 @@ |
45 | 50 |
#include "ul_mod.h" |
46 | 51 |
|
47 | 52 |
|
48 |
-/* |
|
53 |
+/*! \brief |
|
49 | 54 |
* List of all registered domains |
50 | 55 |
*/ |
51 | 56 |
dlist_t* root = 0; |
52 | 57 |
|
53 | 58 |
|
54 |
-/* |
|
59 |
+/*! \brief |
|
55 | 60 |
* Find domain with the given name |
56 |
- * Returns 0 if the domain was found |
|
61 |
+ * \return 0 if the domain was found |
|
57 | 62 |
* and 1 of not |
58 | 63 |
*/ |
59 | 64 |
static inline int find_dlist(str* _n, dlist_t** _d) |
... | ... |
@@ -337,7 +342,7 @@ static inline int get_all_mem_ucontacts(void *buf, int len, unsigned int flags, |
337 | 342 |
|
338 | 343 |
|
339 | 344 |
|
340 |
-/* |
|
345 |
+/*! \brief |
|
341 | 346 |
* Return list of all contacts for all currently registered |
342 | 347 |
* users in all domains. Caller must provide buffer of |
343 | 348 |
* sufficient length for fitting all those contacts. In the |
... | ... |
@@ -371,12 +376,11 @@ int get_all_ucontacts(void *buf, int len, unsigned int flags, |
371 | 376 |
|
372 | 377 |
|
373 | 378 |
|
374 |
-/* |
|
379 |
+/*! \brief |
|
375 | 380 |
* Create a new domain structure |
376 |
- * Returns 0 if everything went OK, otherwise value < 0 |
|
377 |
- * is returned |
|
381 |
+ * \return 0 if everything went OK, otherwise value < 0 is returned |
|
378 | 382 |
* |
379 |
- * The structure is NOT created in shared memory so the |
|
383 |
+ * \note The structure is NOT created in shared memory so the |
|
380 | 384 |
* function must be called before ser forks if it should |
381 | 385 |
* be available to all processes |
382 | 386 |
*/ |
... | ... |
@@ -418,7 +422,7 @@ static inline int new_dlist(str* _n, dlist_t** _d) |
418 | 422 |
} |
419 | 423 |
|
420 | 424 |
|
421 |
-/* |
|
425 |
+/*! \brief |
|
422 | 426 |
* Function registers a new domain with usrloc |
423 | 427 |
* if the domain exists, pointer to existing structure |
424 | 428 |
* will be returned, otherwise a new domain will be |
... | ... |
@@ -481,7 +485,7 @@ err: |
481 | 485 |
} |
482 | 486 |
|
483 | 487 |
|
484 |
-/* |
|
488 |
+/*! \brief |
|
485 | 489 |
* Free all allocated memory |
486 | 490 |
*/ |
487 | 491 |
void free_all_udomains(void) |
... | ... |
@@ -499,7 +503,7 @@ void free_all_udomains(void) |
499 | 503 |
} |
500 | 504 |
|
501 | 505 |
|
502 |
-/* |
|
506 |
+/*! \brief |
|
503 | 507 |
* Just for debugging |
504 | 508 |
*/ |
505 | 509 |
void print_all_udomains(FILE* _f) |
... | ... |
@@ -517,7 +521,9 @@ void print_all_udomains(FILE* _f) |
517 | 521 |
} |
518 | 522 |
|
519 | 523 |
|
520 |
-/* Loops through all domains summing up the number of users. */ |
|
524 |
+/*! \brief |
|
525 |
+ * Loops through all domains summing up the number of users. |
|
526 |
+ */ |
|
521 | 527 |
unsigned long get_number_of_users(void) |
522 | 528 |
{ |
523 | 529 |
int numberOfUsers = 0; |
... | ... |
@@ -536,7 +542,7 @@ unsigned long get_number_of_users(void) |
536 | 542 |
} |
537 | 543 |
|
538 | 544 |
|
539 |
-/* |
|
545 |
+/*! \brief |
|
540 | 546 |
* Run timer handler of all domains |
541 | 547 |
*/ |
542 | 548 |
int synchronize_all_udomains(void) |
... | ... |
@@ -558,7 +564,7 @@ int synchronize_all_udomains(void) |
558 | 564 |
} |
559 | 565 |
|
560 | 566 |
|
561 |
-/* |
|
567 |
+/*! \brief |
|
562 | 568 |
* Find a particular domain |
563 | 569 |
*/ |
564 | 570 |
int find_domain(str* _d, udomain_t** _p) |
... | ... |
@@ -28,6 +28,12 @@ |
28 | 28 |
* (bogdan) |
29 | 29 |
*/ |
30 | 30 |
|
31 |
+/*! \file |
|
32 |
+ * \brief USRLOC - List of registered domains |
|
33 |
+ * \ingroup usrloc |
|
34 |
+ */ |
|
35 |
+ |
|
36 |
+ |
|
31 | 37 |
|
32 | 38 |
#ifndef DLIST_H |
33 | 39 |
#define DLIST_H |
... | ... |
@@ -71,13 +77,13 @@ void free_all_udomains(void); |
71 | 77 |
void print_all_udomains(FILE* _f); |
72 | 78 |
|
73 | 79 |
|
74 |
-/* |
|
80 |
+/*! \brief |
|
75 | 81 |
* Called from timer |
76 | 82 |
*/ |
77 | 83 |
int synchronize_all_udomains(void); |
78 | 84 |
|
79 | 85 |
|
80 |
-/* |
|
86 |
+/*! \brief |
|
81 | 87 |
* Get contacts to all registered users |
82 | 88 |
*/ |
83 | 89 |
typedef int (*get_all_ucontacts_t) (void* buf, int len, unsigned int flags, |
... | ... |
@@ -90,7 +96,7 @@ int get_all_ucontacts(void *, int, unsigned int, |
90 | 96 |
unsigned long get_number_of_users(); |
91 | 97 |
|
92 | 98 |
|
93 |
-/* |
|
99 |
+/*! \brief |
|
94 | 100 |
* Find a particular domain |
95 | 101 |
*/ |
96 | 102 |
int find_domain(str* _d, udomain_t** _p); |
... | ... |
@@ -22,13 +22,19 @@ |
22 | 22 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
23 | 23 |
*/ |
24 | 24 |
|
25 |
+/*! \file |
|
26 |
+ * \brief USRLOC - Hash table collision slot related functions |
|
27 |
+ * \ingroup usrloc |
|
28 |
+ */ |
|
29 |
+ |
|
30 |
+ |
|
25 | 31 |
|
26 | 32 |
#include "hslot.h" |
27 | 33 |
|
28 | 34 |
int ul_locks_no=4; |
29 | 35 |
gen_lock_set_t* ul_locks=0; |
30 | 36 |
|
31 |
-/* |
|
37 |
+/*! \brief |
|
32 | 38 |
* Initialize locks |
33 | 39 |
*/ |
34 | 40 |
int ul_init_locks(void) |
... | ... |
@@ -114,7 +120,7 @@ int init_slot(struct udomain* _d, hslot_t* _s, int n) |
114 | 120 |
} |
115 | 121 |
|
116 | 122 |
|
117 |
-/* |
|
123 |
+/*! \brief |
|
118 | 124 |
* Deinitialize given slot structure |
119 | 125 |
*/ |
120 | 126 |
void deinit_slot(hslot_t* _s) |
... | ... |
@@ -134,7 +140,7 @@ void deinit_slot(hslot_t* _s) |
134 | 140 |
} |
135 | 141 |
|
136 | 142 |
|
137 |
-/* |
|
143 |
+/*! \brief |
|
138 | 144 |
* Add an element to an slot's linked list |
139 | 145 |
*/ |
140 | 146 |
void slot_add(hslot_t* _s, struct urecord* _r) |
... | ... |
@@ -151,7 +157,7 @@ void slot_add(hslot_t* _s, struct urecord* _r) |
151 | 157 |
} |
152 | 158 |
|
153 | 159 |
|
154 |
-/* |
|
160 |
+/*! \brief |
|
155 | 161 |
* Remove an element from slot linked list |
156 | 162 |
*/ |
157 | 163 |
void slot_rem(hslot_t* _s, struct urecord* _r) |
... | ... |
@@ -22,6 +22,12 @@ |
22 | 22 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
23 | 23 |
*/ |
24 | 24 |
|
25 |
+/*! \file |
|
26 |
+ * \brief USRLOC - Hash table collision slot related functions |
|
27 |
+ * \ingroup usrloc |
|
28 |
+ */ |
|
29 |
+ |
|
30 |
+ |
|
25 | 31 |
|
26 | 32 |
#ifndef HSLOT_H |
27 | 33 |
#define HSLOT_H |
... | ... |
@@ -37,36 +43,36 @@ struct urecord; |
37 | 43 |
|
38 | 44 |
|
39 | 45 |
typedef struct hslot { |
40 |
- int n; /* Number of elements in the collision slot */ |
|
41 |
- struct urecord* first; /* First element in the list */ |
|
42 |
- struct urecord* last; /* Last element in the list */ |
|
43 |
- struct udomain* d; /* Domain we belong to */ |
|
46 |
+ int n; /*!< Number of elements in the collision slot */ |
|
47 |
+ struct urecord* first; /*!< First element in the list */ |
|
48 |
+ struct urecord* last; /*!< Last element in the list */ |
|
49 |
+ struct udomain* d; /*!< Domain we belong to */ |
|
44 | 50 |
#ifdef GEN_LOCK_T_PREFERED |
45 |
- gen_lock_t *lock; /* Lock for hash entry - fastlock */ |
|
51 |
+ gen_lock_t *lock; /*!< Lock for hash entry - fastlock */ |
|
46 | 52 |
#else |
47 |
- int lockidx; /* Lock index for hash entry - the rest*/ |
|
53 |
+ int lockidx; /*!< Lock index for hash entry - the rest*/ |
|
48 | 54 |
#endif |
49 | 55 |
} hslot_t; |
50 | 56 |
|
51 |
-/* |
|
57 |
+/*! \brief |
|
52 | 58 |
* Initialize slot structure |
53 | 59 |
*/ |
54 | 60 |
int init_slot(struct udomain* _d, hslot_t* _s, int n); |
55 | 61 |
|
56 | 62 |
|
57 |
-/* |
|
63 |
+/*! \brief |
|
58 | 64 |
* Deinitialize given slot structure |
59 | 65 |
*/ |
60 | 66 |
void deinit_slot(hslot_t* _s); |
61 | 67 |
|
62 | 68 |
|
63 |
-/* |
|
69 |
+/*! \brief |
|
64 | 70 |
* Add an element to slot linked list |
65 | 71 |
*/ |
66 | 72 |
void slot_add(hslot_t* _s, struct urecord* _r); |
67 | 73 |
|
68 | 74 |
|
69 |
-/* |
|
75 |
+/*! \brief |
|
70 | 76 |
* Remove an element from slot linked list |
71 | 77 |
*/ |
72 | 78 |
void slot_rem(hslot_t* _s, struct urecord* _r); |
... | ... |
@@ -28,7 +28,10 @@ |
28 | 28 |
* 2004-06-07 updated to the new DB api (andrei) |
29 | 29 |
*/ |
30 | 30 |
|
31 |
- |
|
31 |
+/*! \file |
|
32 |
+ * \brief USRLOC - Usrloc contact structure |
|
33 |
+ * \ingroup usrloc |
|
34 |
+ */ |
|
32 | 35 |
|
33 | 36 |
#include "ucontact.h" |
34 | 37 |
#include <string.h> /* memcpy */ |
... | ... |
@@ -44,11 +47,10 @@ |
44 | 47 |
#include "ucontact.h" |
45 | 48 |
|
46 | 49 |
|
47 |
-/* |
|
50 |
+/*! \brief |
|
48 | 51 |
* Create a new contact structure |
49 | 52 |
*/ |
50 |
-ucontact_t* new_ucontact(str* _dom, str* _aor, str* _contact, |
|
51 |
- ucontact_info_t* _ci) |
|
53 |
+ucontact_t* new_ucontact(str* _dom, str* _aor, str* _contact, ucontact_info_t* _ci) |
|
52 | 54 |
{ |
53 | 55 |
ucontact_t *c; |
54 | 56 |
|
... | ... |
@@ -96,7 +98,7 @@ error: |
96 | 98 |
|
97 | 99 |
|
98 | 100 |
|
99 |
-/* |
|
101 |
+/*! \brief |
|
100 | 102 |
* Free all memory associated with given contact structure |
101 | 103 |
*/ |
102 | 104 |
void free_ucontact(ucontact_t* _c) |
... | ... |
@@ -111,7 +113,7 @@ void free_ucontact(ucontact_t* _c) |
111 | 113 |
} |
112 | 114 |
|
113 | 115 |
|
114 |
-/* |
|
116 |
+/*! \brief |
|
115 | 117 |
* Print contact, for debugging purposes only |
116 | 118 |
*/ |
117 | 119 |
void print_ucontact(FILE* _f, ucontact_t* _c) |
... | ... |
@@ -164,7 +166,7 @@ void print_ucontact(FILE* _f, ucontact_t* _c) |
164 | 166 |
} |
165 | 167 |
|
166 | 168 |
|
167 |
-/* |
|
169 |
+/*! \brief |
|
168 | 170 |
* Update ucontact structure in memory |
169 | 171 |
*/ |
170 | 172 |
int mem_update_ucontact(ucontact_t* _c, ucontact_info_t* _ci) |
... | ... |
@@ -225,7 +227,7 @@ int mem_update_ucontact(ucontact_t* _c, ucontact_info_t* _ci) |
225 | 227 |
/* ================ State related functions =============== */ |
226 | 228 |
|
227 | 229 |
|
228 |
-/* |
|
230 |
+/*! \brief |
|
229 | 231 |
* Update state of the contact |
230 | 232 |
*/ |
231 | 233 |
void st_update_ucontact(ucontact_t* _c) |
... | ... |
@@ -259,10 +261,9 @@ void st_update_ucontact(ucontact_t* _c) |
259 | 261 |
} |
260 | 262 |
|
261 | 263 |
|
262 |
-/* |
|
264 |
+/*! \brief |
|
263 | 265 |
* Update state of the contact |
264 |
- * Returns 1 if the contact should be |
|
265 |
- * delete from memory immediately, |
|
266 |
+ * \return 1 if the contact should be deleted from memory immediately, |
|
266 | 267 |
* 0 otherwise |
267 | 268 |
*/ |
268 | 269 |
int st_delete_ucontact(ucontact_t* _c) |
... | ... |
@@ -301,10 +302,10 @@ int st_delete_ucontact(ucontact_t* _c) |
301 | 302 |
} |
302 | 303 |
|
303 | 304 |
|
304 |
-/* |
|
305 |
+/*! \brief |
|
305 | 306 |
* Called when the timer is about to delete |
306 |
- * an expired contact, this routine returns |
|
307 |
- * 1 if the contact should be removed from |
|
307 |
+ * an expired contact. |
|
308 |
+ * \return 1 if the contact should be removed from |
|
308 | 309 |
* the database and 0 otherwise |
309 | 310 |
*/ |
310 | 311 |
int st_expired_ucontact(ucontact_t* _c) |
... | ... |
@@ -331,7 +332,7 @@ int st_expired_ucontact(ucontact_t* _c) |
331 | 332 |
} |
332 | 333 |
|
333 | 334 |
|
334 |
-/* |
|
335 |
+/*! \brief |
|
335 | 336 |
* Called when the timer is about flushing the contact, |
336 | 337 |
* updates contact state and returns 1 if the contact |
337 | 338 |
* should be inserted, 2 if update and 0 otherwise |
... | ... |
@@ -368,7 +369,7 @@ int st_flush_ucontact(ucontact_t* _c) |
368 | 369 |
|
369 | 370 |
/* ============== Database related functions ================ */ |
370 | 371 |
|
371 |
-/* |
|
372 |
+/*! \brief |
|
372 | 373 |
* Insert contact into the database |
373 | 374 |
*/ |
374 | 375 |
int db_insert_ucontact(ucontact_t* _c) |
... | ... |
@@ -504,7 +505,7 @@ int db_insert_ucontact(ucontact_t* _c) |
504 | 505 |
} |
505 | 506 |
|
506 | 507 |
|
507 |
-/* |
|
508 |
+/*! \brief |
|
508 | 509 |
* Update contact in the database |
509 | 510 |
*/ |
510 | 511 |
int db_update_ucontact(ucontact_t* _c) |
... | ... |
@@ -633,7 +634,7 @@ int db_update_ucontact(ucontact_t* _c) |
633 | 634 |
} |
634 | 635 |
|
635 | 636 |
|
636 |
-/* |
|
637 |
+/*! \brief |
|
637 | 638 |
* Delete contact from the database |
638 | 639 |
*/ |
639 | 640 |
int db_delete_ucontact(ucontact_t* _c) |
... | ... |
@@ -749,7 +750,7 @@ static inline void update_contact_pos(struct urecord* _r, ucontact_t* _c) |
749 | 750 |
} |
750 | 751 |
|
751 | 752 |
|
752 |
-/* |
|
753 |
+/*! \brief |
|
753 | 754 |
* Update ucontact with new values |
754 | 755 |
*/ |
755 | 756 |
int update_ucontact(struct urecord* _r, ucontact_t* _c, ucontact_info_t* _ci) |
... | ... |
@@ -28,6 +28,11 @@ |
28 | 28 |
* instead of UDP package (bogdan) |
29 | 29 |
*/ |
30 | 30 |
|
31 |
+/*! \file |
|
32 |
+ * \brief USRLOC - Usrloc contact structure |
|
33 |
+ * \ingroup usrloc |
|
34 |
+ */ |
|
35 |
+ |
|
31 | 36 |
|
32 | 37 |
#ifndef UCONTACT_H |
33 | 38 |
#define UCONTACT_H |
... | ... |
@@ -40,42 +45,46 @@ |
40 | 45 |
|
41 | 46 |
|
42 | 47 |
|
48 |
+/*! \brief States for in-memory contacts in regards to contact storage handler (db, in-memory, ldap etc) */ |
|
43 | 49 |
typedef enum cstate { |
44 |
- CS_NEW, /* New contact - not flushed yet */ |
|
45 |
- CS_SYNC, /* Synchronized contact with the database */ |
|
46 |
- CS_DIRTY /* Update contact - not flushed yet */ |
|
50 |
+ CS_NEW, /*!< New contact - not flushed yet */ |
|
51 |
+ CS_SYNC, /*!< Synchronized contact with the database */ |
|
52 |
+ CS_DIRTY /*!< Update contact - not flushed yet */ |
|
47 | 53 |
} cstate_t; |
48 | 54 |
|
49 | 55 |
|
50 |
-/* |
|
56 |
+/*! \brief |
|
51 | 57 |
* Flags that can be associated with a Contact |
52 | 58 |
*/ |
53 | 59 |
typedef enum flags { |
54 |
- FL_NONE = 0, /* No flags set */ |
|
55 |
- FL_MEM = 1 << 0, /* Update memory only */ |
|
56 |
- FL_ALL = (int)0xFFFFFFFF /* All flags set */ |
|
60 |
+ FL_NONE = 0, /*!< No flags set */ |
|
61 |
+ FL_MEM = 1 << 0, /*!< Update memory only */ |
|
62 |
+ FL_ALL = (int)0xFFFFFFFF /*!< All flags set */ |
|
57 | 63 |
} flags_t; |
58 | 64 |
|
59 | 65 |
|
66 |
+/*! \brief |
|
67 |
+ * Main structure for handling of registered Contact: data |
|
68 |
+ */ |
|
60 | 69 |
typedef struct ucontact { |
61 |
- str* domain; /* Pointer to domain name (NULL terminated) */ |
|
62 |
- str* aor; /* Pointer to the AOR string in record structure*/ |
|
63 |
- str c; /* Contact address */ |
|
64 |
- str received; /* IP+port+protocol we recved the REGISTER from */ |
|
65 |
- str path; /* Path header */ |
|
66 |
- time_t expires; /* expires parameter */ |
|
67 |
- qvalue_t q; /* q parameter */ |
|
68 |
- str callid; /* Call-ID header field */ |
|
69 |
- int cseq; /* CSeq value */ |
|
70 |
- cstate_t state; /* State of the contact */ |
|
71 |
- unsigned int flags; /* Various flags (NAT, ping type, etc) */ |
|
72 |
- unsigned int cflags; /* custom contact flags (from script) */ |
|
73 |
- str user_agent; /* User-Agent header field */ |
|
74 |
- struct socket_info *sock; /* received soket */ |
|
75 |
- time_t last_modified; /* when the record was last modified */ |
|
76 |
- unsigned int methods; /* Supported methods */ |
|
77 |
- struct ucontact* next; /* Next contact in the linked list */ |
|
78 |
- struct ucontact* prev; /* Previous contact in the linked list */ |
|
70 |
+ str* domain; /*!< Pointer to domain name (NULL terminated) */ |
|
71 |
+ str* aor; /*!< Pointer to the AOR string in record structure*/ |
|
72 |
+ str c; /*!< Contact address */ |
|
73 |
+ str received; /*!< IP+port+protocol we received the REGISTER from */ |
|
74 |
+ str path; /*!< Path header */ |
|
75 |
+ time_t expires; /*!< Expires parameter */ |
|
76 |
+ qvalue_t q; /*!< q parameter */ |
|
77 |
+ str callid; /*!< Call-ID header field of registration */ |
|
78 |
+ int cseq; /*!< CSeq value */ |
|
79 |
+ cstate_t state; /*!< State of the contact (\ref cstate) */ |
|
80 |
+ unsigned int flags; /*!< Various flags (NAT, ping type, etc) */ |
|
81 |
+ unsigned int cflags; /*!< Custom contact flags (from script) */ |
|
82 |
+ str user_agent; /*!< User-Agent header field */ |
|
83 |
+ struct socket_info *sock; /*!< received socket */ |
|
84 |
+ time_t last_modified; /*!< When the record was last modified */ |
|
85 |
+ unsigned int methods; /*!< Supported methods */ |
|
86 |
+ struct ucontact* next; /*!< Next contact in the linked list */ |
|
87 |
+ struct ucontact* prev; /*!< Previous contact in the linked list */ |
|
79 | 88 |
} ucontact_t; |
80 | 89 |
|
81 | 90 |
typedef struct ucontact_info { |
... | ... |
@@ -93,7 +102,7 @@ typedef struct ucontact_info { |
93 | 102 |
time_t last_modified; |
94 | 103 |
} ucontact_info_t; |
95 | 104 |
|
96 |
-/* |
|
105 |
+/*! \brief |
|
97 | 106 |
* ancient time used for marking the contacts forced to expired |
98 | 107 |
*/ |
99 | 108 |
#define UL_EXPIRED_TIME 10 |
... | ... |
@@ -104,26 +113,26 @@ typedef struct ucontact_info { |
104 | 113 |
#define VALID_CONTACT(c, t) ((c->expires>t) || (c->expires==0)) |
105 | 114 |
|
106 | 115 |
|
107 |
-/* |
|
116 |
+/*! \brief |
|
108 | 117 |
* Create a new contact structure |
109 | 118 |
*/ |
110 | 119 |
ucontact_t* new_ucontact(str* _dom, str* _aor, str* _contact, |
111 | 120 |
ucontact_info_t* _ci); |
112 | 121 |
|
113 | 122 |
|
114 |
-/* |
|
123 |
+/*! \brief |
|
115 | 124 |
* Free all memory associated with given contact structure |
116 | 125 |
*/ |
117 | 126 |
void free_ucontact(ucontact_t* _c); |
118 | 127 |
|
119 | 128 |
|
120 |
-/* |
|
129 |
+/*! \brief |
|
121 | 130 |
* Print contact, for debugging purposes only |
122 | 131 |
*/ |
123 | 132 |
void print_ucontact(FILE* _f, ucontact_t* _c); |
124 | 133 |
|
125 | 134 |
|
126 |
-/* |
|
135 |
+/*! \brief |
|
127 | 136 |
* Update existing contact in memory with new values |
128 | 137 |
*/ |
129 | 138 |
int mem_update_ucontact(ucontact_t* _c, ucontact_info_t *_ci); |
... | ... |
@@ -132,14 +141,14 @@ int mem_update_ucontact(ucontact_t* _c, ucontact_info_t *_ci); |
132 | 141 |
/* ===== State transition functions - for write back cache scheme ======== */ |
133 | 142 |
|
134 | 143 |
|
135 |
-/* |
|
144 |
+/*! \brief |
|
136 | 145 |
* Update state of the contact if we |
137 | 146 |
* are using write-back scheme |
138 | 147 |
*/ |
139 | 148 |
void st_update_ucontact(ucontact_t* _c); |
140 | 149 |
|
141 | 150 |
|
142 |
-/* |
|
151 |
+/*! \brief |
|
143 | 152 |
* Update state of the contact if we |
144 | 153 |
* are using write-back scheme |
145 | 154 |
* Returns 1 if the contact should be |
... | ... |
@@ -149,7 +158,7 @@ void st_update_ucontact(ucontact_t* _c); |
149 | 158 |
int st_delete_ucontact(ucontact_t* _c); |
150 | 159 |
|
151 | 160 |
|
152 |
-/* |
|
161 |
+/*! \brief |
|
153 | 162 |
* Called when the timer is about to delete |
154 | 163 |
* an expired contact, this routine returns |
155 | 164 |
* 1 if the contact should be removed from |
... | ... |
@@ -158,7 +167,7 @@ int st_delete_ucontact(ucontact_t* _c); |
158 | 167 |
int st_expired_ucontact(ucontact_t* _c); |
159 | 168 |
|
160 | 169 |
|
161 |
-/* |
|
170 |
+/*! \brief |
|
162 | 171 |
* Called when the timer is about flushing the contact, |
163 | 172 |
* updates contact state and returns 1 if the contact |
164 | 173 |
* should be inserted, 2 if updated and 0 otherwise |
... | ... |
@@ -169,19 +178,19 @@ int st_flush_ucontact(ucontact_t* _c); |
169 | 178 |
/* ==== Database related functions ====== */ |
170 | 179 |
|
171 | 180 |
|
172 |
-/* |
|
181 |
+/*! \brief |
|
173 | 182 |
* Insert contact into the database |
174 | 183 |
*/ |
175 | 184 |
int db_insert_ucontact(ucontact_t* _c); |
176 | 185 |
|
177 | 186 |
|
178 |
-/* |
|
187 |
+/*! \brief |
|
179 | 188 |
* Update contact in the database |
180 | 189 |
*/ |
181 | 190 |
int db_update_ucontact(ucontact_t* _c); |
182 | 191 |
|
183 | 192 |
|
184 |
-/* |
|
193 |
+/*! \brief |
|
185 | 194 |
* Delete contact from the database |
186 | 195 |
*/ |
187 | 196 |
int db_delete_ucontact(ucontact_t* _c); |
... | ... |
@@ -191,7 +200,7 @@ int db_delete_ucontact(ucontact_t* _c); |
191 | 200 |
|
192 | 201 |
struct urecord; |
193 | 202 |
|
194 |
-/* |
|
203 |
+/*! \brief |
|
195 | 204 |
* Update ucontact with new values |
196 | 205 |
*/ |
197 | 206 |
typedef int (*update_ucontact_t)(struct urecord* _r, ucontact_t* _c, |
... | ... |
@@ -29,6 +29,11 @@ |
29 | 29 |
* |
30 | 30 |
*/ |
31 | 31 |
|
32 |
+/*! \file |
|
33 |
+ * \brief USRLOC - |
|
34 |
+ * \ingroup usrloc |
|
35 |
+ */ |
|
36 |
+ |
|
32 | 37 |
#include "udomain.h" |
33 | 38 |
#include <string.h> |
34 | 39 |
#include "../../parser/parse_methods.h" |
... | ... |
@@ -66,7 +71,7 @@ static char *build_stat_name( str* domain, char *var_name) |
66 | 71 |
#endif |
67 | 72 |
|
68 | 73 |
|
69 |
-/* |
|
74 |
+/*! \brief |
|
70 | 75 |
* Create a new domain structure |
71 | 76 |
* _n is pointer to str representing |
72 | 77 |
* name of the domain, the string is |
... | ... |
@@ -138,7 +143,7 @@ error0: |
138 | 143 |
} |
139 | 144 |
|
140 | 145 |
|
141 |
-/* |
|
146 |
+/*! \brief |
|
142 | 147 |
* Free all memory allocated for |
143 | 148 |
* the domain |
144 | 149 |
*/ |
... | ... |
@@ -158,8 +163,8 @@ void free_udomain(udomain_t* _d) |
158 | 163 |
} |
159 | 164 |
|
160 | 165 |
|
161 |
-/* |
|
162 |
- * Returns a statis dummy urecord for temporary usage |
|
166 |
+/*! \brief |
|
167 |
+ * Returns a static dummy urecord for temporary usage |
|
163 | 168 |
*/ |
164 | 169 |
static inline void get_static_urecord(udomain_t* _d, str* _aor, |
165 | 170 |
struct urecord** _r) |
... | ... |
@@ -173,7 +178,7 @@ static inline void get_static_urecord(udomain_t* _d, str* _aor, |
173 | 178 |
} |
174 | 179 |
|
175 | 180 |
|
176 |
-/* |
|
181 |
+/*! \brief |
|
177 | 182 |
* Just for debugging |
178 | 183 |
*/ |
179 | 184 |
void print_udomain(FILE* _f, udomain_t* _d) |
... | ... |
@@ -205,7 +210,7 @@ void print_udomain(FILE* _f, udomain_t* _d) |
205 | 210 |
} |
206 | 211 |
|
207 | 212 |
|
208 |
-/* |
|
213 |
+/*! \brief |
|
209 | 214 |
* expects 12 rows (contact, expirs, q, callid, cseq, flags, |
210 | 215 |
* ua, received, path, socket, methods, last_modified) |
211 | 216 |
*/ |
... | ... |
@@ -474,7 +479,7 @@ error: |
474 | 479 |
} |
475 | 480 |
|
476 | 481 |
|
477 |
-/* |
|
482 |
+/*! \brief |
|
478 | 483 |
* loads from DB all contacts for an AOR |
479 | 484 |
*/ |
480 | 485 |
urecord_t* db_load_urecord(db_con_t* _c, udomain_t* _d, str *_aor) |
... | ... |
@@ -611,7 +616,7 @@ int db_timer_udomain(udomain_t* _d) |
611 | 616 |
} |
612 | 617 |
|
613 | 618 |
|
614 |
-/* performs a dummy query just to see if DB is ok */ |
|
619 |
+/*! \brief performs a dummy query just to see if DB is ok */ |
|
615 | 620 |
int testdb_udomain(db_con_t* con, udomain_t* d) |
616 | 621 |
{ |
617 | 622 |
db_key_t key[1], col[1]; |
... | ... |
@@ -640,7 +645,7 @@ int testdb_udomain(db_con_t* con, udomain_t* d) |
640 | 645 |
} |
641 | 646 |
|
642 | 647 |
|
643 |
-/* |
|
648 |
+/*! \brief |
|
644 | 649 |
* Insert a new record into domain |
645 | 650 |
*/ |
646 | 651 |
int mem_insert_urecord(udomain_t* _d, str* _aor, struct urecord** _r) |
... | ... |
@@ -659,7 +664,7 @@ int mem_insert_urecord(udomain_t* _d, str* _aor, struct urecord** _r) |
659 | 664 |
} |
660 | 665 |
|
661 | 666 |
|
662 |
-/* |
|
667 |
+/*! \brief |
|
663 | 668 |
* Remove a record from domain |
664 | 669 |
*/ |
665 | 670 |
void mem_delete_urecord(udomain_t* _d, struct urecord* _r) |
... | ... |
@@ -703,7 +708,7 @@ int mem_timer_udomain(udomain_t* _d) |
703 | 708 |
} |
704 | 709 |
|
705 | 710 |
|
706 |
-/* |
|
711 |
+/*! \brief |
|
707 | 712 |
* Get lock |
708 | 713 |
*/ |
709 | 714 |
void lock_udomain(udomain_t* _d, str* _aor) |
... | ... |
@@ -722,7 +727,7 @@ void lock_udomain(udomain_t* _d, str* _aor) |
722 | 727 |
} |
723 | 728 |
|
724 | 729 |
|
725 |
-/* |
|
730 |
+/*! \brief |
|
726 | 731 |
* Release lock |
727 | 732 |
*/ |
728 | 733 |
void unlock_udomain(udomain_t* _d, str* _aor) |
... | ... |
@@ -739,7 +744,7 @@ void unlock_udomain(udomain_t* _d, str* _aor) |
739 | 744 |
} |
740 | 745 |
} |
741 | 746 |
|
742 |
-/* |
|
747 |
+/*! \brief |
|
743 | 748 |
* Get lock |
744 | 749 |
*/ |
745 | 750 |
void lock_ulslot(udomain_t* _d, int i) |
... | ... |
@@ -753,7 +758,7 @@ void lock_ulslot(udomain_t* _d, int i) |
753 | 758 |
} |
754 | 759 |
|
755 | 760 |
|
756 |
-/* |
|
761 |
+/*! \brief |
|
757 | 762 |
* Release lock |
758 | 763 |
*/ |
759 | 764 |
void unlock_ulslot(udomain_t* _d, int i) |
... | ... |
@@ -768,7 +773,7 @@ void unlock_ulslot(udomain_t* _d, int i) |
768 | 773 |
|
769 | 774 |
|
770 | 775 |
|
771 |
-/* |
|
776 |
+/*! \brief |
|
772 | 777 |
* Create and insert a new record |
773 | 778 |
*/ |
774 | 779 |
int insert_urecord(udomain_t* _d, str* _aor, struct urecord** _r) |
... | ... |
@@ -785,7 +790,7 @@ int insert_urecord(udomain_t* _d, str* _aor, struct urecord** _r) |
785 | 790 |
} |
786 | 791 |
|
787 | 792 |
|
788 |
-/* |
|
793 |
+/*! \brief |
|
789 | 794 |
* Obtain a urecord pointer if the urecord exists in domain |
790 | 795 |
*/ |
791 | 796 |
int get_urecord(udomain_t* _d, str* _aor, struct urecord** _r) |
... | ... |
@@ -821,7 +826,7 @@ int get_urecord(udomain_t* _d, str* _aor, struct urecord** _r) |
821 | 826 |
} |
822 | 827 |
|
823 | 828 |
|
824 |
-/* |
|
829 |
+/*! \brief |
|
825 | 830 |
* Delete a urecord from domain |
826 | 831 |
*/ |
827 | 832 |
int delete_urecord(udomain_t* _d, str* _aor, struct urecord* _r) |
... | ... |
@@ -28,6 +28,11 @@ |
28 | 28 |
*/ |
29 | 29 |
|
30 | 30 |
|
31 |
+/*! \file |
|
32 |
+ * \brief USRLOC - Usrloc domain structure |
|
33 |
+ * \ingroup usrloc |
|
34 |
+ */ |
|
35 |
+ |
|
31 | 36 |
#ifndef UDOMAIN_H |
32 | 37 |
#define UDOMAIN_H |
33 | 38 |
|
... | ... |
@@ -41,25 +46,25 @@ |
41 | 46 |
#include "hslot.h" |
42 | 47 |
|
43 | 48 |
|
44 |
-struct hslot; /* Hash table slot */ |
|
45 |
-struct urecord; /* Usrloc record */ |
|
49 |
+struct hslot; /*!< Hash table slot */ |
|
50 |
+struct urecord; /*!< Usrloc record */ |
|
46 | 51 |
|
47 | 52 |
|
48 |
-/* |
|
53 |
+/*! \brief |
|
49 | 54 |
* The structure represents a usrloc domain |
50 | 55 |
*/ |
51 | 56 |
typedef struct udomain { |
52 |
- str* name; /* Domain name (NULL terminated) */ |
|
53 |
- int size; /* Hash table size */ |
|
54 |
- struct hslot* table; /* Hash table - array of collision slots */ |
|
57 |
+ str* name; /*!< Domain name (NULL terminated) */ |
|
58 |
+ int size; /*!< Hash table size */ |
|
59 |
+ struct hslot* table; /*!< Hash table - array of collision slots */ |
|
55 | 60 |
/* statistics */ |
56 |
- stat_var *users; /* no of registered users */ |
|
57 |
- stat_var *contacts; /* no of registered contacts */ |
|
58 |
- stat_var *expires; /* no of expires */ |
|
61 |
+ stat_var *users; /*!< no of registered users */ |
|
62 |
+ stat_var *contacts; /*!< no of registered contacts */ |
|
63 |
+ stat_var *expires; /*!< no of expires */ |
|
59 | 64 |
} udomain_t; |
60 | 65 |
|
61 | 66 |
|
62 |
-/* |
|
67 |
+/*! \brief |
|
63 | 68 |
* Create a new domain structure |
64 | 69 |
* _n is pointer to str representing |
65 | 70 |
* name of the domain, the string is |
... | ... |
@@ -70,63 +75,63 @@ typedef struct udomain { |
70 | 75 |
int new_udomain(str* _n, int _s, udomain_t** _d); |
71 | 76 |
|
72 | 77 |
|
73 |
-/* |
|
78 |
+/*! \brief |
|
74 | 79 |
* Free all memory allocated for |
75 | 80 |
* the domain |
76 | 81 |
*/ |
77 | 82 |
void free_udomain(udomain_t* _d); |
78 | 83 |
|
79 | 84 |
|
80 |
-/* |
|
85 |
+/*! \brief |
|
81 | 86 |
* Just for debugging |
82 | 87 |
*/ |
83 | 88 |
void print_udomain(FILE* _f, udomain_t* _d); |
84 | 89 |
|
85 | 90 |
|
86 |
-/* |
|
91 |
+/*! \brief |
|
87 | 92 |
* Load data from a database |
88 | 93 |
*/ |
89 | 94 |
int preload_udomain(db_con_t* _c, udomain_t* _d); |
90 | 95 |
|
91 | 96 |
|
92 |
-/* |
|
97 |
+/*! \brief |
|
93 | 98 |
* Check the DB validity of a domain |
94 | 99 |
*/ |
95 | 100 |
int testdb_udomain(db_con_t* con, udomain_t* d); |
96 | 101 |
|
97 | 102 |
|
98 |
-/* |
|
103 |
+/*! \brief |
|
99 | 104 |
* Timer handler for given domain (db_only) |
100 | 105 |
*/ |
101 | 106 |
int db_timer_udomain(udomain_t* _d); |
102 | 107 |
|
103 | 108 |
|
104 |
-/* |
|
109 |
+/*! \brief |
|
105 | 110 |
* Timer handler for given domain |
106 | 111 |
*/ |
107 | 112 |
int mem_timer_udomain(udomain_t* _d); |
108 | 113 |
|
109 | 114 |
|
110 |
-/* |
|
115 |
+/*! \brief |
|
111 | 116 |
* Insert record into domain |
112 | 117 |
*/ |
113 | 118 |
int mem_insert_urecord(udomain_t* _d, str* _aor, struct urecord** _r); |
114 | 119 |
|
115 | 120 |
|
116 |
-/* |
|
121 |
+/*! \brief |
|
117 | 122 |
* Delete a record |
118 | 123 |
*/ |
119 | 124 |
void mem_delete_urecord(udomain_t* _d, struct urecord* _r); |
120 | 125 |
|
121 | 126 |
|
122 |
-/* |
|
127 |
+/*! \brief |
|
123 | 128 |
* Get lock |
124 | 129 |
*/ |
125 | 130 |
typedef void (*lock_udomain_t)(udomain_t* _d, str *_aor); |
126 | 131 |
void lock_udomain(udomain_t* _d, str *_aor); |
127 | 132 |
|
128 | 133 |
|
129 |
-/* |
|
134 |
+/*! \brief |
|
130 | 135 |
* Release lock |
131 | 136 |
*/ |
132 | 137 |
typedef void (*unlock_udomain_t)(udomain_t* _d, str *_aor); |
... | ... |
@@ -139,21 +144,21 @@ void unlock_ulslot(udomain_t* _d, int i); |
139 | 144 |
/* ===== module interface ======= */ |
140 | 145 |
|
141 | 146 |
|
142 |
-/* |
|
147 |
+/*! \brief |
|
143 | 148 |
* Create and insert a new record |
144 | 149 |
*/ |
145 | 150 |
typedef int (*insert_urecord_t)(udomain_t* _d, str* _aor, struct urecord** _r); |
146 | 151 |
int insert_urecord(udomain_t* _d, str* _aor, struct urecord** _r); |
147 | 152 |
|
148 | 153 |
|
149 |
-/* |
|
154 |
+/*! \brief |
|
150 | 155 |
* Obtain a urecord pointer if the urecord exists in domain |
151 | 156 |
*/ |
152 | 157 |
typedef int (*get_urecord_t)(udomain_t* _d, str* _a, struct urecord** _r); |
153 | 158 |
int get_urecord(udomain_t* _d, str* _aor, struct urecord** _r); |
154 | 159 |
|
155 | 160 |
|
156 |
-/* |
|
161 |
+/*! \brief |
|
157 | 162 |
* Delete a urecord from domain |
158 | 163 |
*/ |
159 | 164 |
typedef int (*delete_urecord_t)(udomain_t* _d, str* _a, struct urecord* _r); |
... | ... |
@@ -24,6 +24,10 @@ |
24 | 24 |
* 2004-03-16 created (bogdan) |
25 | 25 |
*/ |
26 | 26 |
|
27 |
+/*! \file |
|
28 |
+ * \brief USRLOC - Callback functions |
|
29 |
+ * \ingroup usrloc |
|
30 |
+ */ |
|
27 | 31 |
|
28 | 32 |
|
29 | 33 |
#include <stdlib.h> |
... | ... |
@@ -71,7 +75,8 @@ void destroy_ulcb_list(void) |
71 | 75 |
|
72 | 76 |
|
73 | 77 |
|
74 |
-/* register a callback function 'f' for 'types' mask of events; |
|
78 |
+/*! \brief |
|
79 |
+ register a callback function 'f' for 'types' mask of events; |
|
75 | 80 |
*/ |
76 | 81 |
int register_ulcb( int types, ul_cb f, void *param ) |
77 | 82 |
{ |
... | ... |
@@ -24,6 +24,10 @@ |
24 | 24 |
* 2004-03-16 created (bogdan) |
25 | 25 |
*/ |
26 | 26 |
|
27 |
+/*! \file |
|
28 |
+ * \brief USRLOC - Module callbacks |
|
29 |
+ * \ingroup usrloc |
|
30 |
+ */ |
|
27 | 31 |
|
28 | 32 |
#ifndef _UL_CALLBACKS_H |
29 | 33 |
#define _UL_CALLBACKS_H |
... | ... |
@@ -37,17 +41,17 @@ |
37 | 41 |
#define UL_CONTACT_EXPIRE (1<<3) |
38 | 42 |
#define ULCB_MAX ((1<<4)-1) |
39 | 43 |
|
40 |
-/* callback function prototype */ |
|
44 |
+/*! \brief callback function prototype */ |
|
41 | 45 |
typedef void (ul_cb) (ucontact_t *c, int type, void *param); |
42 |
-/* register callback function prototype */ |
|
46 |
+/*! \brief register callback function prototype */ |
|
43 | 47 |
typedef int (*register_ulcb_t)( int cb_types, ul_cb f, void *param); |
44 | 48 |
|
45 | 49 |
|
46 | 50 |
struct ul_callback { |
47 |
- int id; /* id of this callback - useless */ |
|
48 |
- int types; /* types of events that trigger the callback*/ |
|
49 |
- ul_cb* callback; /* callback function */ |
|
50 |
- void *param; /* param to be passed to callback function */ |
|
51 |
+ int id; /*!< id of this callback - useless */ |
|
52 |
+ int types; /*!< types of events that trigger the callback*/ |
|
53 |
+ ul_cb* callback; /*!< callback function */ |
|
54 |
+ void *param; /*!< param to be passed to callback function */ |
|
51 | 55 |
struct ul_callback* next; |
52 | 56 |
}; |
53 | 57 |
|
... | ... |
@@ -69,10 +73,10 @@ int init_ulcb_list(); |
69 | 73 |
void destroy_ulcb_list(); |
70 | 74 |
|
71 | 75 |
|
72 |
-/* register a callback for several types of events */ |
|
76 |
+/*! \brief register a callback for several types of events */ |
|
73 | 77 |
int register_ulcb( int types, ul_cb f, void *param ); |
74 | 78 |
|
75 |
-/* run all transaction callbacks for an event type */ |
|
79 |
+/*! \brief run all transaction callbacks for an event type */ |
|
76 | 80 |
static inline void run_ul_callbacks( int type , ucontact_t *c) |
77 | 81 |
{ |
78 | 82 |
struct ul_callback *cbp; |
... | ... |
@@ -27,6 +27,11 @@ |
27 | 27 |
* 2006-12-01 created (bogdan) |
28 | 28 |
*/ |
29 | 29 |
|
30 |
+/*! \file |
|
31 |
+ * \brief USRLOC - Usrloc MI functions |
|
32 |
+ * \ingroup usrloc |
|
33 |
+ */ |
|
34 |
+ |
|
30 | 35 |
#include <string.h> |
31 | 36 |
#include <stdio.h> |
32 | 37 |
#include "../../mi/mi.h" |
... | ... |
@@ -82,8 +87,7 @@ static inline int mi_fix_aor(str *aor) |
82 | 87 |
|
83 | 88 |
|
84 | 89 |
|
85 |
-static inline int mi_add_aor_node(struct mi_node *parent, urecord_t* r, |
|
86 |
- time_t t, int short_dump) |
|
90 |
+static inline int mi_add_aor_node(struct mi_node *parent, urecord_t* r, time_t t, int short_dump) |
|
87 | 91 |
{ |
88 | 92 |
struct mi_node *anode; |
89 | 93 |
struct mi_node *cnode; |
... | ... |
@@ -213,7 +217,7 @@ static inline int mi_add_aor_node(struct mi_node *parent, urecord_t* r, |
213 | 217 |
|
214 | 218 |
/*************************** MI functions *****************************/ |
215 | 219 |
|
216 |
-/* |
|
220 |
+/*! \brief |
|
217 | 221 |
* Expects 2 nodes: the table name and the AOR |
218 | 222 |
*/ |
219 | 223 |
struct mi_root* mi_usrloc_rm_aor(struct mi_root *cmd, void *param) |
... | ... |
@@ -247,7 +251,7 @@ struct mi_root* mi_usrloc_rm_aor(struct mi_root *cmd, void *param) |
247 | 251 |
} |
248 | 252 |
|
249 | 253 |
|
250 |
-/* |
|
254 |
+/*! \brief |
|
251 | 255 |
* Expects 3 nodes: the table name, the AOR and contact |
252 | 256 |
*/ |
253 | 257 |
struct mi_root* mi_usrloc_rm_contact(struct mi_root *cmd, void *param) |
... | ... |
@@ -404,7 +408,7 @@ struct mi_root* mi_usrloc_flush(struct mi_root *cmd, void *param) |
404 | 408 |
} |
405 | 409 |
|
406 | 410 |
|
407 |
-/* |
|
411 |
+/*! \brief |
|
408 | 412 |
* Expects 7 nodes: |
409 | 413 |
* table name, |
410 | 414 |
* AOR |
... | ... |
@@ -524,7 +528,7 @@ lock_error: |
524 | 528 |
} |
525 | 529 |
|
526 | 530 |
|
527 |
-/* |
|
531 |
+/*! \brief |
|
528 | 532 |
* Expects 2 nodes: the table name and the AOR |
529 | 533 |
*/ |
530 | 534 |
struct mi_root* mi_usrloc_show_contact(struct mi_root *cmd, void *param) |
... | ... |
@@ -33,6 +33,17 @@ |
33 | 33 |
* 2004-06-07 updated to the new DB api (andrei) |
34 | 34 |
*/ |
35 | 35 |
|
36 |
+/*! \file |
|
37 |
+ * \brief USRLOC - Usrloc module interface |
|
38 |
+ * \ingroup usrloc |
|
39 |
+ */ |
|
40 |
+ |
|
41 |
+/*! \defgroup usrloc User location module |
|
42 |
+ \brief The module keeps a user location table |
|
43 |
+ and provides access to the table to other modules. The module |
|
44 |
+ exports no functions that could be used directly from scripts. |
|
45 |
+ */ |
|
46 |
+ |
|
36 | 47 |
#include <stdio.h> |
37 | 48 |
#include "ul_mod.h" |
38 | 49 |
#include "../../sr_module.h" |
... | ... |
@@ -66,10 +77,10 @@ MODULE_VERSION |
66 | 77 |
#define METHODS_COL "methods" |
67 | 78 |
#define LAST_MOD_COL "last_modified" |
68 | 79 |
|
69 |
-static int mod_init(void); /* Module initialization function */ |
|
70 |
-static void destroy(void); /* Module destroy function */ |
|
71 |
-static void timer(unsigned int ticks, void* param); /* Timer handler */ |
|
72 |
-static int child_init(int rank); /* Per-child init function */ |
|
80 |
+static int mod_init(void); /*!< Module initialization function */ |
|
81 |
+static void destroy(void); /*!< Module destroy function */ |
|
82 |
+static void timer(unsigned int ticks, void* param); /*!< Timer handler */ |
|
83 |
+static int child_init(int rank); /*!< Per-child init function */ |
|
73 | 84 |
static int mi_child_init(void); |
74 | 85 |
|
75 | 86 |
extern int bind_usrloc(usrloc_api_t* api); |
... | ... |
@@ -78,50 +89,28 @@ extern int ul_locks_no; |
78 | 89 |
* Module parameters and their default values |
79 | 90 |
*/ |
80 | 91 |
|
81 |
-/* Name of column containing usernames */ |
|
82 |
-str user_col = str_init(USER_COL); |
|
83 |
-/* Name of column containing domains */ |
|
84 |
-str domain_col = str_init(DOMAIN_COL); |
|
85 |
-/* Name of column containing contact addresses */ |
|
86 |
-str contact_col = str_init(CONTACT_COL); |
|
87 |
-/* Name of column containing expires values */ |
|
88 |
-str expires_col = str_init(EXPIRES_COL); |
|
89 |
-/* Name of column containing q values */ |
|
90 |
-str q_col = str_init(Q_COL); |
|
91 |
-/* Name of column containing callid string */ |
|
92 |
-str callid_col = str_init(CALLID_COL); |
|
93 |
-/* Name of column containing cseq values */ |
|
94 |
-str cseq_col = str_init(CSEQ_COL); |
|
95 |
-/* Name of column containing internal flags */ |
|
96 |
-str flags_col = str_init(FLAGS_COL); |
|
97 |
-/* Name of column containing contact flags */ |
|
98 |
-str cflags_col = str_init(CFLAGS_COL); |
|
99 |
-/* Name of column containing user agent string */ |
|
100 |
-str user_agent_col = str_init(USER_AGENT_COL); |
|
101 |
-/* Name of column containing transport info of REGISTER */ |
|
102 |
-str received_col = str_init(RECEIVED_COL); |
|
103 |
-/* Name of column containing the Path header */ |
|
104 |
-str path_col = str_init(PATH_COL); |
|
105 |
-/* Name of column containing the received socket */ |
|
106 |
-str sock_col = str_init(SOCK_COL); |
|
107 |
-/* Name of column containing the supported methods */ |
|
108 |
-str methods_col = str_init(METHODS_COL); |
|
109 |
-/* Name of column containing the last modified date */ |
|
110 |
-str last_mod_col = str_init(LAST_MOD_COL); |
|
111 |
- |
|
112 |
-/* Database URL */ |
|
113 |
-str db_url = str_init(DEFAULT_DB_URL); |
|
114 |
-/* Timer interval in seconds */ |
|
115 |
-int timer_interval = 60; |
|
116 |
-/* Database sync scheme: 0-no db, 1-write through, 2-write back, 3-only db */ |
|
117 |
-int db_mode = 0; |
|
118 |
-/* Whether usrloc should use domain part of aor */ |
|
119 |
-int use_domain = 0; |
|
120 |
-/* By default do not enable timestamp ordering */ |
|
121 |
-int desc_time_order = 0; |
|
122 |
- |
|
123 |
-/* number of rows to fetch from result */ |
|
124 |
-int ul_fetch_rows = 2000; |
|
92 |
+str user_col = str_init(USER_COL); /*!< Name of column containing usernames */ |
|
93 |
+str domain_col = str_init(DOMAIN_COL); /*!< Name of column containing domains */ |
|
94 |
+str contact_col = str_init(CONTACT_COL); /*!< Name of column containing contact addresses */ |
|
95 |
+str expires_col = str_init(EXPIRES_COL); /*!< Name of column containing expires values */ |
|
96 |
+str q_col = str_init(Q_COL); /*!< Name of column containing q values */ |
|
97 |
+str callid_col = str_init(CALLID_COL); /*!< Name of column containing callid string */ |
|
98 |
+str cseq_col = str_init(CSEQ_COL); /*!< Name of column containing cseq values */ |
|
99 |
+str flags_col = str_init(FLAGS_COL); /*!< Name of column containing internal flags */ |
|
100 |
+str cflags_col = str_init(CFLAGS_COL); /*!< Name of column containing contact flags */ |
|
101 |
+str user_agent_col = str_init(USER_AGENT_COL); /*!< Name of column containing user agent string */ |
|
102 |
+str received_col = str_init(RECEIVED_COL); /*!< Name of column containing transport info of REGISTER */ |
|
103 |
+str path_col = str_init(PATH_COL); /*!< Name of column containing the Path header */ |
|
104 |
+str sock_col = str_init(SOCK_COL); /*!< Name of column containing the received socket */ |
|
105 |
+str methods_col = str_init(METHODS_COL); /*!< Name of column containing the supported methods */ |
|
106 |
+str last_mod_col = str_init(LAST_MOD_COL); /*!< Name of column containing the last modified date */ |
|
107 |
+str db_url = str_init(DEFAULT_DB_URL); /*!< Database URL */ |
|
108 |
+int timer_interval = 60; /*!< Timer interval in seconds */ |
|
109 |
+int db_mode = 0; /*!< Database sync scheme: 0-no db, 1-write through, 2-write back, 3-only db */ |
|
110 |
+int use_domain = 0; /*!< Whether usrloc should use domain part of aor */ |
|
111 |
+int desc_time_order = 0; /*!< By default do not enable timestamp ordering */ |
|
112 |
+ |
|
113 |
+int ul_fetch_rows = 2000; /*!< number of rows to fetch from result */ |
|
125 | 114 |
int ul_hash_size = 9; |
126 | 115 |
|
127 | 116 |
/* flag */ |
... | ... |
@@ -133,7 +122,7 @@ db_func_t ul_dbf; |
133 | 122 |
|
134 | 123 |
|
135 | 124 |
|
136 |
-/* |
|
125 |
+/*! \brief |
|
137 | 126 |
* Exported functions |
138 | 127 |
*/ |
139 | 128 |
static cmd_export_t cmds[] = { |
... | ... |
@@ -142,7 +131,7 @@ static cmd_export_t cmds[] = { |
142 | 131 |
}; |
143 | 132 |
|
144 | 133 |
|
145 |
-/* |
|
134 |
+/*! \brief |
|
146 | 135 |
* Exported parameters |
147 | 136 |
*/ |
148 | 137 |
static param_export_t params[] = { |
... | ... |
@@ -199,21 +188,21 @@ static mi_export_t mi_cmds[] = { |
199 | 188 |
|
200 | 189 |
struct module_exports exports = { |
201 | 190 |
"usrloc", |
202 |
- DEFAULT_DLFLAGS, /* dlopen flags */ |
|
203 |
- cmds, /* Exported functions */ |
|
204 |
- params, /* Export parameters */ |
|
205 |
- mod_stats, /* exported statistics */ |
|
206 |
- mi_cmds, /* exported MI functions */ |
|
207 |
- 0, /* exported pseudo-variables */ |
|
208 |
- 0, /* extra processes */ |
|
209 |
- mod_init, /* Module initialization function */ |
|
210 |
- 0, /* Response function */ |
|
211 |
- destroy, /* Destroy function */ |
|
212 |
- child_init /* Child initialization function */ |
|
191 |
+ DEFAULT_DLFLAGS, /*!< dlopen flags */ |
|
192 |
+ cmds, /*!< Exported functions */ |
|
193 |
+ params, /*!< Export parameters */ |
|
194 |
+ mod_stats, /*!< exported statistics */ |
|
195 |
+ mi_cmds, /*!< exported MI functions */ |
|
196 |
+ 0, /*!< exported pseudo-variables */ |
|
197 |
+ 0, /*!< extra processes */ |
|
198 |
+ mod_init, /*!< Module initialization function */ |
|
199 |
+ 0, /*!< Response function */ |
|
200 |
+ destroy, /*!< Destroy function */ |
|
201 |
+ child_init /*!< Child initialization function */ |
|
213 | 202 |
}; |
214 | 203 |
|
215 | 204 |
|
216 |
-/* |
|
205 |
+/*! \brief |
|
217 | 206 |
* Module initialization function |
218 | 207 |
*/ |
219 | 208 |
static int mod_init(void) |
... | ... |
@@ -365,7 +354,7 @@ static int mi_child_init(void) |
365 | 354 |
} |
366 | 355 |
|
367 | 356 |
|
368 |
-/* |
|
357 |
+/*! \brief |
|
369 | 358 |
* Module destroy function |
370 | 359 |
*/ |
371 | 360 |
static void destroy(void) |
... | ... |
@@ -387,7 +376,7 @@ static void destroy(void) |
387 | 376 |
} |
388 | 377 |
|
389 | 378 |
|
390 |
-/* |
|
379 |
+/*! \brief |
|
391 | 380 |
* Timer handler |
392 | 381 |
*/ |
393 | 382 |
static void timer(unsigned int ticks, void* param) |
... | ... |
@@ -28,6 +28,10 @@ |
28 | 28 |
* 2004-06-07 updated to the new DB api (andrei) |
29 | 29 |
*/ |
30 | 30 |
|
31 |
+/*! \file |
|
32 |
+ * \brief USRLOC - Usrloc record structure |
|
33 |
+ * \ingroup usrloc |
|
34 |
+ */ |
|
31 | 35 |
|
32 | 36 |
|
33 | 37 |
#include "urecord.h" |
... | ... |
@@ -45,7 +49,7 @@ int matching_mode = CONTACT_ONLY; |
45 | 49 |
|
46 | 50 |
int cseq_delay = 20; |
47 | 51 |
|
48 |
-/* |
|
52 |
+/*! \brief |
|
49 | 53 |
* Create and initialize new record structure |
50 | 54 |
*/ |
51 | 55 |
int new_urecord(str* _dom, str* _aor, urecord_t** _r) |
... | ... |
@@ -72,7 +76,7 @@ int new_urecord(str* _dom, str* _aor, urecord_t** _r) |
72 | 76 |
} |
73 | 77 |
|
74 | 78 |
|
75 |
-/* |
|
79 |
+/*! \brief |
|
76 | 80 |
* Free all memory used by the given structure |
77 | 81 |
* The structure must be removed from all linked |
78 | 82 |
* lists first |
... | ... |
@@ -95,7 +99,7 @@ void free_urecord(urecord_t* _r) |
95 | 99 |
} |
96 | 100 |
|
97 | 101 |
|
98 |
-/* |
|
102 |
+/*! \brief |
|
99 | 103 |
* Print a record |
100 | 104 |
*/ |
101 | 105 |
void print_urecord(FILE* _f, urecord_t* _r) |
... | ... |
@@ -120,7 +124,7 @@ void print_urecord(FILE* _f, urecord_t* _r) |
120 | 124 |
} |
121 | 125 |
|
122 | 126 |
|
123 |
-/* |
|
127 |
+/*! \brief |
|
124 | 128 |
* Add a new contact |
125 | 129 |
* Contacts are ordered by: 1) q |
126 | 130 |
* 2) descending modification time |
... | ... |
@@ -168,7 +172,7 @@ ucontact_t* mem_insert_ucontact(urecord_t* _r, str* _c, ucontact_info_t* _ci) |
168 | 172 |
} |
169 | 173 |
|
170 | 174 |
|
171 |
-/* |
|
175 |
+/*! \brief |
|
172 | 176 |
* Remove the contact from lists |
173 | 177 |
*/ |
174 | 178 |
void mem_remove_ucontact(urecord_t* _r, ucontact_t* _c) |
... | ... |
@@ -188,7 +192,7 @@ void mem_remove_ucontact(urecord_t* _r, ucontact_t* _c) |
188 | 192 |
|
189 | 193 |
|
190 | 194 |
|
191 |
-/* |
|
195 |
+/*! \brief |
|
192 | 196 |
* Remove contact from the list and delete |
193 | 197 |
*/ |
194 | 198 |
void mem_delete_ucontact(urecord_t* _r, ucontact_t* _c) |
... | ... |
@@ -199,7 +203,7 @@ void mem_delete_ucontact(urecord_t* _r, ucontact_t* _c) |
199 | 203 |
} |
200 | 204 |
|
201 | 205 |
|
202 |
-/* |
|
206 |
+/*! \brief |
|
203 | 207 |
* This timer routine is used when |
204 | 208 |
* db_mode is set to NO_DB |
205 | 209 |
*/ |
... | ... |
@@ -234,7 +238,7 @@ static inline int nodb_timer(urecord_t* _r) |
234 | 238 |
|
235 | 239 |
|
236 | 240 |
|
237 |
-/* |
|
241 |
+/*! \brief |
|
238 | 242 |
* This routine is used when db_mode is |
239 | 243 |
* set to WRITE_THROUGH |
240 | 244 |
*/ |
... | ... |
@@ -273,7 +277,7 @@ static inline int wt_timer(urecord_t* _r) |
273 | 277 |
|
274 | 278 |
|
275 | 279 |
|
276 |
-/* |
|
280 |
+/*! \brief |
|
277 | 281 |
* Write-back timer |
278 | 282 |
*/ |
279 | 283 |
static inline int wb_timer(urecord_t* _r) |
... | ... |
@@ -392,7 +396,7 @@ int db_delete_urecord(urecord_t* _r) |
392 | 396 |
} |
393 | 397 |
|
394 | 398 |
|
395 |
-/* |
|
399 |
+/*! \brief |
|
396 | 400 |
* Release urecord previously obtained |
397 | 401 |
* through get_urecord |
398 | 402 |
*/ |
... | ... |
@@ -406,7 +410,7 @@ void release_urecord(urecord_t* _r) |
406 | 410 |
} |
407 | 411 |
|
408 | 412 |
|
409 |
-/* |
|
413 |
+/*! \brief |
|
410 | 414 |
* Create and insert new contact |
411 | 415 |
* into urecord |
412 | 416 |
*/ |
... | ... |
@@ -434,7 +438,7 @@ int insert_ucontact(urecord_t* _r, str* _contact, ucontact_info_t* _ci, |
434 | 438 |
} |
435 | 439 |
|
436 | 440 |
|
437 |
-/* |
|
441 |
+/*! \brief |
|
438 | 442 |
* Delete ucontact from urecord |
439 | 443 |
*/ |
440 | 444 |
int delete_ucontact(urecord_t* _r, struct ucontact* _c) |
... | ... |
@@ -487,7 +491,7 @@ static inline struct ucontact* contact_callid_match( ucontact_t* ptr, |
487 | 491 |
} |
488 | 492 |
|
489 | 493 |
|
490 |
-/* |
|
494 |
+/*! \brief |
|
491 | 495 |
* Get pointer to ucontact with given contact |
492 | 496 |
* Returns: |
493 | 497 |
* 0 - found |
... | ... |
@@ -25,6 +25,11 @@ |
25 | 25 |
* --------- |
26 | 26 |
*/ |
27 | 27 |
|
28 |
+/*! \file |
|
29 |
+ * \brief USRLOC - Usrloc record structure |
|
30 |
+ * \ingroup usrloc |
|
31 |
+ */ |
|
32 |
+ |
|
28 | 33 |
|
29 | 34 |
#ifndef URECORD_H |
30 | 35 |
#define URECORD_H |
... | ... |
@@ -40,20 +45,20 @@ |
40 | 45 |
|
41 | 46 |
struct hslot; |
42 | 47 |
|
43 |
-/* |
|
48 |
+/*! \brief |
|
44 | 49 |
* Basic hash table element |
45 | 50 |
*/ |
46 | 51 |
typedef struct urecord { |
47 |
- str* domain; /* Pointer to domain we belong to |
|
52 |
+ str* domain; /*!< Pointer to domain we belong to |
|
48 | 53 |
* ( null terminated string) */ |
49 |
- str aor; /* Address of record */ |
|
50 |
- unsigned int aorhash; /* Hash over address of record */ |
|
51 |
- ucontact_t* contacts; /* One or more contact fields */ |
|
54 |
+ str aor; /*!< Address of record */ |
|
55 |
+ unsigned int aorhash; /*!< Hash over address of record */ |
|
56 |
+ ucontact_t* contacts; /*!< One or more contact fields */ |
|
52 | 57 |
|
53 |
- struct hslot* slot; /* Collision slot in the hash table |
|
58 |
+ struct hslot* slot; /*!< Collision slot in the hash table |
|
54 | 59 |
* array we belong to */ |
55 |
- struct urecord* prev; /* Next item in the hash entry */ |
|
56 |
- struct urecord* next; /* Previous item in the hash entry */ |
|
60 |
+ struct urecord* prev; /*!< Next item in the hash entry */ |
|
61 |
+ struct urecord* next; /*!< Previous item in the hash entry */ |
|
57 | 62 |
} urecord_t; |
58 | 63 |
|
59 | 64 |
|
... | ... |
@@ -22,6 +22,10 @@ |
22 | 22 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
23 | 23 |
*/ |
24 | 24 |
|
25 |
+/*! \file |
|
26 |
+ * \brief USRLOC - time related functions |
|
27 |
+ * \ingroup usrloc |
|
28 |
+ */ |
|
25 | 29 |
|
26 | 30 |
#ifndef UTIME_H |
27 | 31 |
#define UTIME_H |
... | ... |
@@ -32,7 +36,7 @@ |
32 | 36 |
extern time_t act_time; |
33 | 37 |
|
34 | 38 |
|
35 |
-/* |
|
39 |
+/*! \brief |
|
36 | 40 |
* Get actual time |
37 | 41 |
*/ |
38 | 42 |
void get_act_time(void); |