+
+ if (NULL != (jrouteconnect = json_object_get(jint, "trp_connect_interval"))) {
+ if (json_is_number(jrouteconnect)) {
+ trc->internal->trp_connect_interval = json_integer_value(jrouteconnect);
+ } else {
+ tr_debug("tr_cfg_parse_internal: Parsing error, trp_connect_interval is not a number.");
+ return TR_CFG_NOPARSE;
+ }
+ } else {
+ /* if not configured, use the default */
+ trc->internal->trp_connect_interval=TR_DEFAULT_TRP_CONNECT_INTERVAL;
+ }
+
+ if (NULL != (jroutesweep = json_object_get(jint, "trp_sweep_interval"))) {
+ if (json_is_number(jroutesweep)) {
+ trc->internal->trp_sweep_interval = json_integer_value(jroutesweep);
+ } else {
+ tr_debug("tr_cfg_parse_internal: Parsing error, trp_sweep_interval is not a number.");
+ return TR_CFG_NOPARSE;
+ }
+ } else {
+ /* if not configured, use the default */
+ trc->internal->trp_sweep_interval=TR_DEFAULT_TRP_SWEEP_INTERVAL;
+ }
+
+ if (NULL != (jrouteupdate = json_object_get(jint, "trp_update_interval"))) {
+ if (json_is_number(jrouteupdate)) {
+ trc->internal->trp_update_interval = json_integer_value(jrouteupdate);
+ } else {
+ tr_debug("tr_cfg_parse_internal: Parsing error, trp_update_interval is not a number.");
+ return TR_CFG_NOPARSE;
+ }
+ } else {
+ /* if not configured, use the default */
+ trc->internal->trp_update_interval=TR_DEFAULT_TRP_UPDATE_INTERVAL;
+ }
+
+ if (NULL != (jlog = json_object_get(jint, "logging"))) {
+ if (NULL != (jlogthres = json_object_get(jlog, "log_threshold"))) {
+ if (json_is_string(jlogthres)) {
+ trc->internal->log_threshold = str2sev(json_string_value(jlogthres));
+ } else {
+ tr_debug("tr_cfg_parse_internal: Parsing error, log_threshold is not a string.");
+ return TR_CFG_NOPARSE;
+ }
+ } else {
+ /* If not configured, use the default */
+ trc->internal->log_threshold = TR_DEFAULT_LOG_THRESHOLD;
+ }
+
+ if (NULL != (jconthres = json_object_get(jlog, "console_threshold"))) {
+ if (json_is_string(jconthres)) {
+ trc->internal->console_threshold = str2sev(json_string_value(jconthres));
+ } else {
+ tr_debug("tr_cfg_parse_internal: Parsing error, console_threshold is not a string.");
+ return TR_CFG_NOPARSE;
+ }
+ } else {
+ /* If not configured, use the default */
+ trc->internal->console_threshold = TR_DEFAULT_CONSOLE_THRESHOLD;
+ }
+ } else {
+ /* If not configured, use the default */
+ trc->internal->console_threshold = TR_DEFAULT_CONSOLE_THRESHOLD;
+ trc->internal->log_threshold = TR_DEFAULT_LOG_THRESHOLD;
+ }
+
+ tr_debug("tr_cfg_parse_internal: Internal config parsed.");
+ return TR_CFG_SUCCESS;