Radius implementation for the init_prot callback For Radius, initialization consists of: - the url is parsed and a configuration structure is obtained - the rest field from the configuration structure is, for the radius module, a string for the path of the radius configuration file - obtain the connection handle - initialize the dictionary For Radius, the aaa_conn is actually the rc_handl
| 97 | the Radius configuration file. |
| 98 | */ |
| 99 | aaa_conn* rad_init_prot(str* aaa_url) { |
| 100 | |
| 101 | rc_handle *rh; |
| 102 | aaa_prot_config cfg; |
| 103 | |
| 104 | if (!aaa_url) { |
| 105 | LM_ERR("null aaa url \n"); |
| 106 | return NULL; |
| 107 | } |
| 108 | |
| 109 | if (aaa_parse_url(aaa_url, &cfg)) { |
| 110 | LM_ERR("aaa parse url error\n"); |
| 111 | return NULL; |
| 112 | } |
| 113 | |
| 114 | if (!(rh = rc_read_config((char*)(cfg.rest)))) { |
| 115 | LM_ERR("failed to open radius config file: %s\n", (char*)(cfg.rest)); |
| 116 | return NULL; |
| 117 | } |
| 118 | |
| 119 | if (rc_read_dictionary(rh, rc_conf_str(rh, "dictionary"))) { |
| 120 | LM_ERR("failed to read radius dictionary\n"); |
| 121 | return NULL; |
| 122 | } |
| 123 | |
| 124 | return rh; |
| 125 | } |
| 126 | |
| 127 | |
| 128 | /* |
nothing calls this directly
no test coverage detected