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

Function parse_config_string

modules/aaa_diameter/dm_impl.c:1576–1616  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1574
1575
1576static int parse_config_string(const char *cfgstr,
1577 char **cfg_filename, char **extra_avps_file)
1578{
1579 csv_record *items, *it;
1580 int have_conf = 0;
1581
1582 items = __parse_csv_record(_str(cfgstr), 0, ';');
1583 for (it = items; it; it = it->next) {
1584 str dup;
1585
1586 if (!have_conf) {
1587 if (pkg_nt_str_dup(&dup, &it->s) != 0) {
1588 LM_ERR("oom\n");
1589 return -1;
1590 }
1591
1592 *cfg_filename = dup.s;
1593 have_conf = 1;
1594 } else {
1595 csv_record *kv;
1596
1597 kv = __parse_csv_record(&it->s, 0, ':');
1598 if (str_casematch(&kv->s, const_str("extra-avps-file"))) {
1599 if (pkg_nt_str_dup(&dup, &kv->next->s) != 0) {
1600 LM_ERR("oom\n");
1601 return -1;
1602 }
1603
1604 *extra_avps_file = dup.s;
1605 }
1606
1607 free_csv_record(kv);
1608 }
1609 }
1610
1611 LM_DBG("freeDiameter cfg file: '%s'\n", *cfg_filename);
1612 LM_DBG("freeDiameter extra-avps-file: '%s'\n", *extra_avps_file);
1613
1614 free_csv_record(items);
1615 return 0;
1616}
1617
1618
1619aaa_conn *dm_init_prot(str *aaa_url)

Callers 1

dm_init_protFunction · 0.85

Calls 4

__parse_csv_recordFunction · 0.85
_strClass · 0.85
free_csv_recordFunction · 0.85
pkg_nt_str_dupFunction · 0.50

Tested by

no test coverage detected