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

Function rad_init_prot

modules/aaa_radius/rad.c:99–125  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

97 the Radius configuration file.
98 */
99aaa_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/*

Callers

nothing calls this directly

Calls 1

aaa_parse_urlFunction · 0.85

Tested by

no test coverage detected