# HG changeset patch # User Luke Mewburn # Date 1582071222 -39600 # Node ID f260953c2c6c06f486113ff49d1a70f603a4082c # Parent b09f1b4c9fad2851b9e6d94d8efbe98fb605eb90 dict_dcca_3gpp: dump dict if conf if "dumpdict" Add debug code to log the vendor dictionary if the config file is the word "dumpdict". diff -r b09f1b4c9fad -r f260953c2c6c extensions/dict_dcca_3gpp/dict_dcca_3gpp.c --- a/extensions/dict_dcca_3gpp/dict_dcca_3gpp.c Wed Feb 19 10:26:29 2020 +1100 +++ b/extensions/dict_dcca_3gpp/dict_dcca_3gpp.c Wed Feb 19 11:13:42 2020 +1100 @@ -144,12 +144,14 @@ static int dict_dcca_3gpp_entry(char * conffile) { + struct dict_object * vendor = NULL; + /* Applications section */ { /* Create the vendors */ { struct dict_vendor_data vendor_data = { 10415, "3GPP" }; - CHECK_FCT(fd_dict_new(fd_g_config->cnf_dict, DICT_VENDOR, &vendor_data, NULL, NULL)); + CHECK_FCT(fd_dict_new(fd_g_config->cnf_dict, DICT_VENDOR, &vendor_data, NULL, &vendor)); } { struct dict_vendor_data vendor_data = { 5535, "3GPP2" }; @@ -10885,7 +10887,13 @@ }; PARSE_loc_rules(rules, rule_avp); } - + + if (conffile && (0 == strcmp(conffile, "dumpdict"))) { + char * tbuf = NULL; size_t tbuflen = 0; + LOG_D("dict_dcca_3gpp dictionary: %s", fd_dict_dump_object(&tbuf, &tbuflen, NULL, vendor)); + free(tbuf); + } + LOG_D( "Extension 'Dictionary definitions for DCCA 3GPP' initialized"); return 0; }