Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
* @flags: bitmask of option flags, see %XTOPT_*
* @ptroff: offset into private structure for member
* @size: size of the item pointed to by @ptroff; this is a safeguard
+ * @min: lowest allowed value (for singular integral types)
+ * @max: highest allowed value (for singular integral types)
*/
struct xt_option_entry {
const char *name;
unsigned int id, excl, also, flags;
unsigned int ptroff;
size_t size;
+ unsigned int min, max;
};
/**
unsigned int lmin = 0, lmax = UINT32_MAX;
unsigned int value;
+ if (cb->entry->min != 0)
+ lmin = cb->entry->min;
+ if (cb->entry->max != 0)
+ lmax = cb->entry->max;
+
if (!xtables_strtoui(cb->arg, NULL, &value, lmin, lmax))
xt_params->exit_err(PARAMETER_PROBLEM,
"%s: bad value for option \"--%s\", "