| 139 | |
| 140 | |
| 141 | int 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 | |
| 180 | static int child_init(int rank) |
nothing calls this directly
no test coverage detected