Mercurial > hg > freeDiameter
changeset 1426:f260953c2c6c
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".
author | Luke Mewburn <luke@mewburn.net> |
---|---|
date | Wed, 19 Feb 2020 11:13:42 +1100 |
parents | b09f1b4c9fad |
children | 122ac4e03b57 |
files | extensions/dict_dcca_3gpp/dict_dcca_3gpp.c |
diffstat | 1 files changed, 10 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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; }