}\
} while (0)
-#define FR_TIME_DELTA_BOUND_CHECK(_name, _var, _op, _bound_sec, _bound_usec)\
+#define FR_TIME_DELTA_BOUND_CHECK(_name, _var, _op, _bound)\
do {\
- fr_time_delta_t _bound = ((fr_time_delta_t) _bound_sec) * NSEC + ((fr_time_delta_t) _bound_usec) * 1000;\
if (!(_var _op _bound)) { \
- WARN("Ignoring \"" _name " = %d.%.06d\", forcing to \"" _name " = %d.%06d\"",\
- (int)(_var / NSEC), ((int)(_var % NSEC)) / 1000,\
- (int)_bound_sec, (int)_bound_usec);\
+ WARN("Ignoring \"" _name " = %pV\", forcing to \"" _name " = %pV\"",\
+ fr_box_time_delta(_var),\
+ fr_box_time_delta(_bound));\
_var = _bound;\
}\
} while (0)
/*
* These timers are usually protocol specific.
*/
- FR_TIME_DELTA_BOUND_CHECK("idle_timeout", inst->io.idle_timeout, >=, 1, 0);
- FR_TIME_DELTA_BOUND_CHECK("idle_timeout", inst->io.idle_timeout, <=, 600, 0);
+ FR_TIME_DELTA_BOUND_CHECK("idle_timeout", inst->io.idle_timeout, >=, fr_time_delta_from_sec(1));
+ FR_TIME_DELTA_BOUND_CHECK("idle_timeout", inst->io.idle_timeout, <=, fr_time_delta_from_sec(600));
- FR_TIME_DELTA_BOUND_CHECK("nak_lifetime", inst->io.nak_lifetime, >=, 1, 0);
- FR_TIME_DELTA_BOUND_CHECK("nak_lifetime", inst->io.nak_lifetime, <=, 600, 0);
+ FR_TIME_DELTA_BOUND_CHECK("nak_lifetime", inst->io.nak_lifetime, >=, fr_time_delta_from_sec(1));
+ FR_TIME_DELTA_BOUND_CHECK("nak_lifetime", inst->io.nak_lifetime, <=, fr_time_delta_from_sec(600));
/*
* Tell the master handler about the main protocol instance.
/*
* These timers are usually protocol specific.
*/
- FR_TIME_DELTA_BOUND_CHECK("idle_timeout", inst->io.idle_timeout, >=, 1, 0);
- FR_TIME_DELTA_BOUND_CHECK("idle_timeout", inst->io.idle_timeout, <=, 600, 0);
+ FR_TIME_DELTA_BOUND_CHECK("idle_timeout", inst->io.idle_timeout, >=, fr_time_delta_from_sec(1));
+ FR_TIME_DELTA_BOUND_CHECK("idle_timeout", inst->io.idle_timeout, <=, fr_time_delta_from_sec(600));
- FR_TIME_DELTA_BOUND_CHECK("nak_lifetime", inst->io.nak_lifetime, >=, 1, 0);
- FR_TIME_DELTA_BOUND_CHECK("nak_lifetime", inst->io.nak_lifetime, <=, 600, 0);
+ FR_TIME_DELTA_BOUND_CHECK("nak_lifetime", inst->io.nak_lifetime, >=, fr_time_delta_from_sec(1));
+ FR_TIME_DELTA_BOUND_CHECK("nak_lifetime", inst->io.nak_lifetime, <=, fr_time_delta_from_sec(600));
/*
* Tell the master handler about the main protocol instance.
/*
* These timers are usually protocol specific.
*/
- FR_TIME_DELTA_BOUND_CHECK("idle_timeout", inst->io.idle_timeout, >=, 1, 0);
- FR_TIME_DELTA_BOUND_CHECK("idle_timeout", inst->io.idle_timeout, <=, 600, 0);
+ FR_TIME_DELTA_BOUND_CHECK("idle_timeout", inst->io.idle_timeout, >=, fr_time_delta_from_sec(1));
+ FR_TIME_DELTA_BOUND_CHECK("idle_timeout", inst->io.idle_timeout, <=, fr_time_delta_from_sec(600));
- FR_TIME_DELTA_BOUND_CHECK("nak_lifetime", inst->io.nak_lifetime, >=, 1, 0);
- FR_TIME_DELTA_BOUND_CHECK("nak_lifetime", inst->io.nak_lifetime, <=, 600, 0);
+ FR_TIME_DELTA_BOUND_CHECK("nak_lifetime", inst->io.nak_lifetime, >=, fr_time_delta_from_sec(1));
+ FR_TIME_DELTA_BOUND_CHECK("nak_lifetime", inst->io.nak_lifetime, <=, fr_time_delta_from_sec(600));
- FR_TIME_DELTA_BOUND_CHECK("cleanup_delay", inst->io.cleanup_delay, <=, 30, 0);
+ FR_TIME_DELTA_BOUND_CHECK("cleanup_delay", inst->io.cleanup_delay, <=, fr_time_delta_from_sec(30));
/*
* No Access-Request packets, then no cleanup delay.
/*
* These timers are usually protocol specific.
*/
- FR_TIME_DELTA_BOUND_CHECK("idle_timeout", inst->io.idle_timeout, >=, 1, 0);
- FR_TIME_DELTA_BOUND_CHECK("idle_timeout", inst->io.idle_timeout, <=, 600, 0);
+ FR_TIME_DELTA_BOUND_CHECK("idle_timeout", inst->io.idle_timeout, >=, fr_time_delta_from_sec(1));
+ FR_TIME_DELTA_BOUND_CHECK("idle_timeout", inst->io.idle_timeout, <=, fr_time_delta_from_sec(600));
- FR_TIME_DELTA_BOUND_CHECK("nak_lifetime", inst->io.nak_lifetime, >=, 1, 0);
- FR_TIME_DELTA_BOUND_CHECK("nak_lifetime", inst->io.nak_lifetime, <=, 600, 0);
+ FR_TIME_DELTA_BOUND_CHECK("nak_lifetime", inst->io.nak_lifetime, >=, fr_time_delta_from_sec(1));
+ FR_TIME_DELTA_BOUND_CHECK("nak_lifetime", inst->io.nak_lifetime, <=, fr_time_delta_from_sec(600));
/*
* Tell the master handler about the main protocol instance.
inst->name = cf_section_name2(conf);
if (!inst->name) inst->name = cf_section_name1(conf);
- FR_TIME_DELTA_BOUND_CHECK("connection.connect_timeout", inst->connection_timeout, >=, 1, 0);
- FR_TIME_DELTA_BOUND_CHECK("connection.connect_timeout", inst->connection_timeout, <=, 30, 0);
+ FR_TIME_DELTA_BOUND_CHECK("connection.connect_timeout", inst->connection_timeout, >=, fr_time_delta_from_sec(1));
+ FR_TIME_DELTA_BOUND_CHECK("connection.connect_timeout", inst->connection_timeout, <=, fr_time_delta_from_sec(30));
- FR_TIME_DELTA_BOUND_CHECK("connection.reconnect_delay", inst->reconnection_delay, >=, 5, 0);
- FR_TIME_DELTA_BOUND_CHECK("connection.reconnect_delay", inst->reconnection_delay, <=, 300, 0);
+ FR_TIME_DELTA_BOUND_CHECK("connection.reconnect_delay", inst->reconnection_delay, >=, fr_time_delta_from_sec(5));
+ FR_TIME_DELTA_BOUND_CHECK("connection.reconnect_delay", inst->reconnection_delay, <=, fr_time_delta_from_sec(300));
- FR_TIME_DELTA_BOUND_CHECK("connection.idle_timeout", inst->idle_timeout, >=, 5, 0);
- FR_TIME_DELTA_BOUND_CHECK("connection.idle_timeout", inst->idle_timeout, <=, 600, 0);
+ FR_TIME_DELTA_BOUND_CHECK("connection.idle_timeout", inst->idle_timeout, >=, fr_time_delta_from_sec(5));
+ FR_TIME_DELTA_BOUND_CHECK("connection.idle_timeout", inst->idle_timeout, <=, fr_time_delta_from_sec(600));
- FR_TIME_DELTA_BOUND_CHECK("connection.zombie_period", inst->zombie_period, >=, 1, 0);
- FR_TIME_DELTA_BOUND_CHECK("connection.zombie_period", inst->zombie_period, <=, 120, 0);
+ FR_TIME_DELTA_BOUND_CHECK("connection.zombie_period", inst->zombie_period, >=, fr_time_delta_from_sec(1));
+ FR_TIME_DELTA_BOUND_CHECK("connection.zombie_period", inst->zombie_period, <=, fr_time_delta_from_sec(120));
num_types = talloc_array_length(inst->types);
rad_assert(num_types > 0);