Changeset 1387:d70f5f6cb306 in freeDiameter for extensions/rt_ereg/rtereg_conf.y
- Timestamp:
- Oct 15, 2019, 11:25:47 PM (5 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/rt_ereg/rtereg_conf.y
r1342 r1387 62 62 int ret; 63 63 64 TRACE_ENTRY("%p", conffile); 65 66 TRACE_DEBUG (FULL, "Parsing configuration file: %s...", conffile); 64 LOG_D("[rt_ereg] parsing configuration file '%s'", conffile); 67 65 68 66 rtereg_confin = fopen(conffile, "r"); … … 70 68 ret = errno; 71 69 fd_log_debug("Unable to open extension configuration file %s for reading: %s", conffile, strerror(ret)); 72 TRACE_DEBUG (INFO, "rt_ereg:error occurred, message logged -- configuration file.");70 LOG_E("[rt_ereg] error occurred, message logged -- configuration file."); 73 71 return ret; 74 72 } … … 80 78 81 79 if (rtereg_conf[rtereg_conf_size-1].finished == 0) { 82 TRACE_DEBUG(INFO, "rt_ereg:configuration invalid, AVP ended without OCTETSTRING AVP");80 LOG_E("[rt_ereg] configuration invalid, AVP ended without OCTETSTRING AVP"); 83 81 return EINVAL; 84 82 } 85 83 86 84 if (ret != 0) { 87 TRACE_DEBUG(INFO, "rt_ereg:unable to parse the configuration file.");85 LOG_E("[rt_ereg] unable to parse the configuration file."); 88 86 return EINVAL; 89 87 } else { … … 92 90 sum += rtereg_conf[i].rules_nb; 93 91 } 94 TRACE_DEBUG(FULL,"[rt-ereg] Added %d rules successfully.", sum);92 LOG_D("[rt-ereg] Added %d rules successfully.", sum); 95 93 } 96 94 … … 105 103 if (rtereg_conf[rtereg_conf_size-1].finished) { 106 104 if ((ret = realloc(rtereg_conf, sizeof(*rtereg_conf)*(rtereg_conf_size+1))) == NULL) { 107 TRACE_DEBUG(INFO, "rt_ereg:realloc failed");105 LOG_E("[rt_ereg] realloc failed"); 108 106 return -1; 109 107 } … … 111 109 rtereg_conf = ret; 112 110 memset(&rtereg_conf[rtereg_conf_size-1], 0, sizeof(*rtereg_conf)); 113 TRACE_DEBUG(INFO, "rt_ereg:New AVP group found starting with %s", name);111 LOG_D("[rt_ereg] New AVP group found starting with %s", name); 114 112 } 115 113 level = rtereg_conf[rtereg_conf_size-1].level + 1; 116 114 117 115 if ((ret = realloc(rtereg_conf[rtereg_conf_size-1].avps, sizeof(*rtereg_conf[rtereg_conf_size-1].avps)*level)) == NULL) { 118 TRACE_DEBUG(INFO, "rt_ereg:realloc failed");116 LOG_E("[rt_ereg] realloc failed"); 119 117 return -1; 120 118 } … … 123 121 CHECK_FCT_DO( fd_dict_search ( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME_ALL_VENDORS, name, &rtereg_conf[rtereg_conf_size-1].avps[level-1], ENOENT ), 124 122 { 125 TRACE_DEBUG(INFO, "rt_ereg:Unable to find '%s' AVP in the loaded dictionaries.", name);123 LOG_E("[rt_ereg] Unable to find '%s' AVP in the loaded dictionaries.", name); 126 124 return -1; 127 125 } ); … … 134 132 rtereg_conf[rtereg_conf_size-1].finished = 1; 135 133 } else if (data.avp_basetype != AVP_TYPE_GROUPED) { 136 TRACE_DEBUG(INFO, "rt_ereg:'%s' AVP is not an OCTETSTRING nor GROUPED AVP (%d).", name, data.avp_basetype);134 LOG_E("[rt_ereg] '%s' AVP is not an OCTETSTRING nor GROUPED AVP (%d).", name, data.avp_basetype); 137 135 return -1; 138 136 } … … 148 146 void yyerror (YYLTYPE *ploc, char * conffile, char const *s) 149 147 { 150 TRACE_DEBUG(INFO, "rt_ereg:error in configuration parsing");148 LOG_E("[rt_ereg] error in configuration parsing"); 151 149 152 150 if (ploc->first_line != ploc->last_line) … … 223 221 224 222 /* Error while compiling the regex */ 225 TRACE_DEBUG(INFO, "rt_ereg:error while compiling the regular expression '%s':", new->pattern);223 LOG_E("[rt_ereg] error while compiling the regular expression '%s':", new->pattern); 226 224 227 225 /* Get the error message size */ … … 233 231 /* Get the error message content */ 234 232 regerror(err, &new->preg, buf, bl); 235 TRACE_DEBUG(INFO,"\t%s", buf);233 LOG_E("\t%s", buf); 236 234 237 235 /* Free the buffer, return the error */
Note: See TracChangeset
for help on using the changeset viewer.