Generate scheduled updates. Untested, but builds.
[trust_router.git] / common / tr_config.c
index 59fd409..6a3d4dc 100644 (file)
@@ -97,6 +97,7 @@ static TR_CFG_RC tr_cfg_parse_internal (TR_CFG *trc, json_t *jcfg) {
   json_t *jcfgpoll = NULL;
   json_t *jcfgsettle = NULL;
   json_t *jroutesweep = NULL;
+  json_t *jrouteupdate = NULL;
 
   if ((!trc) || (!jcfg))
     return TR_CFG_BAD_PARAMS;
@@ -172,6 +173,14 @@ static TR_CFG_RC tr_cfg_parse_internal (TR_CFG *trc, json_t *jcfg) {
        return TR_CFG_NOPARSE;
       }
     }
+    if (NULL != (jrouteupdate = json_object_get(jint, "route_update_interval"))) {
+      if (json_is_number(jrouteupdate)) {
+       trc->internal->route_update_interval = json_integer_value(jrouteupdate);
+      } else {
+       tr_debug("tr_cfg_parse_internal: Parsing error, route_update_interval is not a number.");
+       return TR_CFG_NOPARSE;
+      }
+    }
 
     if (NULL != (jlog = json_object_get(jint, "logging"))) {
       if (NULL != (jlogthres = json_object_get(jlog, "log_threshold"))) {