static void bfd_idletx_handler(vector_t *strvec) { bfd_t *bfd; unsigned value; assert(strvec); assert(bfd_data); bfd = LIST_TAIL_DATA(bfd_data->bfd); assert(bfd); if (!read_unsigned_strvec(strvec, 1, &value,BFD_IDLETX_MIN, BFD_IDLETX_MAX, false)) report_config_error(CONFIG_GENERAL_ERROR, "Configuration error: BFD instance %s" " idle_tx value %s is not valid (must be in range" " [%u-%u]), ignoring", bfd->iname, FMT_STR_VSLOT(strvec, 1), BFD_IDLETX_MIN, BFD_IDLETX_MAX); else bfd->local_idle_tx_intv = value * 1000U; if (value > BFD_IDLETX_MAX_SENSIBLE) log_message(LOG_INFO, "Configuration warning: BFD instance %s" " idle_tx value %u is larger than max sensible (%u)", bfd->iname, value, BFD_IDLETX_MAX_SENSIBLE); }
static void smtpto_handler(vector_t *strvec) { unsigned timeout; /* The min value should be 1, but allow 0 to maintain backward compatibility * with pre v2.0.7 */ if (!read_unsigned_strvec(strvec, 1, &timeout, 0, UINT_MAX / TIMER_HZ, true)) { report_config_error(CONFIG_GENERAL_ERROR, "smtp_connect_timeout '%s' must be in [0, %d] - ignoring", FMT_STR_VSLOT(strvec, 1), UINT_MAX / TIMER_HZ); return; } if (timeout == 0) { report_config_error(CONFIG_GENERAL_ERROR, "smtp_conect_timeout must be greater than 0, setting to 1"); timeout = 1; } global_data->smtp_connection_to = timeout * TIMER_HZ; }
static void bfd_multiplier_handler(vector_t *strvec) { bfd_t *bfd; unsigned value; assert(strvec); assert(bfd_data); bfd = LIST_TAIL_DATA(bfd_data->bfd); assert(bfd); if (!read_unsigned_strvec(strvec, 1, &value, BFD_MULTIPLIER_MIN, BFD_MULTIPLIER_MAX, false)) report_config_error(CONFIG_GENERAL_ERROR, "Configuration error: BFD instance %s" " multiplier value %s not valid (must be in range" " [%u-%u]), ignoring", bfd->iname, FMT_STR_VSLOT(strvec, 1), BFD_MULTIPLIER_MIN, BFD_MULTIPLIER_MAX); else bfd->local_detect_mult = value; }