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

Function parse_conf_string

modules/aaa_diameter/app_opensips/app_opensips.c:681–723  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

679
680
681static int parse_conf_string(const char *confstring,
682 char **extra_avps_file, int *lib_mode)
683{
684 char *p;
685
686 *extra_avps_file = NULL;
687 *lib_mode = 0;
688
689 if (!confstring)
690 goto out;
691
692 p = strcasestr(confstring, "extra-avps-file");
693 if (p) {
694 p += strlen("extra-avps-file");
695 while (*p != '/' && *p != '\0')
696 p++;
697
698 if (*p != '/') {
699 fd_log_error("'extra-avps-file' requires an absolute file path\n");
700 } else {
701 char *e = p;
702 while (!isspace(*e) && *e != ';' && *e != '\0')
703 e++;
704 *extra_avps_file = malloc(e - p + 1);
705 memcpy(*extra_avps_file, p, e - p);
706 (*extra_avps_file)[e - p] = '\0';
707 }
708 }
709
710 p = strcasestr(confstring, "library-mode");
711 if (p) {
712 p += strlen("library-mode");
713 while (!isdigit(*p) && *p != ';' && *p != '\0')
714 p++;
715 if (isdigit(*p) && *p != '0')
716 *lib_mode = 1;
717 }
718
719out:
720 fd_log_debug("[INIT] extra-avps-file: %s", *extra_avps_file);
721 fd_log_debug("[INIT] library-mode: %d", *lib_mode);
722 return 0;
723}
724
725
726/* entry point: register handlers for Accounting and Digest Auth */

Callers 1

os_entryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected