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

Function mod_init

modules/aaa_diameter/aaa_diameter.c:141–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

139
140
141int mod_init(void)
142{
143 LM_DBG("initializing module...\n");
144
145 if (dm_check_config() != 0) {
146 LM_ERR("bad modparam configuration\n");
147 return -1;
148 }
149
150 /* perform only a minimal amount of library initialization, just so modules
151 * can look up Diameter AVPs through the API, but without neither changing
152 * the internal library state nor forking any threads yet! */
153 if (dm_init_minimal() != 0) {
154 LM_ERR("failed to init freeDiameter global dictionary\n");
155 return -1;
156 }
157
158 if (dm_init_evi() != 0) {
159 LM_ERR("failed to init the Diameter event\n");
160 return -1;
161 }
162
163 if (dm_init_peer() != 0) {
164 LM_ERR("failed to init the local Diameter peer\n");
165 return -1;
166 }
167
168 if (dm_aaa_url.s) {
169 dm_aaa_url.len = strlen(dm_aaa_url.s);
170 if (!dm_init_prot(&dm_aaa_url)) {
171 LM_ERR("failed to init Diameter AAA connection\n");
172 return -1;
173 }
174 }
175
176 return 0;
177}
178
179
180static int child_init(int rank)

Callers

nothing calls this directly

Calls 5

dm_check_configFunction · 0.85
dm_init_minimalFunction · 0.85
dm_init_eviFunction · 0.85
dm_init_peerFunction · 0.85
dm_init_protFunction · 0.85

Tested by

no test coverage detected