MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / dm_init_peer

Function dm_init_peer

modules/aaa_diameter/dm_peer.c:45–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43
44
45int dm_init_peer(void)
46{
47 struct {
48 struct list_head queue;
49 pthread_cond_t cond;
50 pthread_mutex_t mutex;
51 } *wrap;
52
53 wrap = shm_malloc(sizeof *wrap);
54 if (!wrap) {
55 LM_ERR("oom\n");
56 return -1;
57 }
58
59 msg_send_queue = &wrap->queue;
60 INIT_LIST_HEAD(msg_send_queue);
61
62 msg_send_lk = &wrap->mutex;
63 msg_send_cond = &wrap->cond;
64
65 init_mutex_cond(msg_send_lk, msg_send_cond);
66
67 INIT_LIST_HEAD(&dm_unreplied_req);
68 lock_init(&dm_unreplied_req_lk);
69 return 0;
70}
71
72
73static inline int dm_add_session(struct msg *msg, struct dict_object *model)

Callers 1

mod_initFunction · 0.85

Calls 4

shm_mallocFunction · 0.85
INIT_LIST_HEADFunction · 0.85
lock_initFunction · 0.85
init_mutex_condFunction · 0.70

Tested by

no test coverage detected