On Thu, Jan 16, 2014 at 10:01:02PM +0100, Pablo Neira Ayuso wrote: > This patch allows to specify a string to indicate the time, eg. > > nft add rule filter output ct expiration \"1d2h3m4s\" counter > > Signed-off-by: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx> > --- > An alternative to this patch is to use seconds as input/output, that only > needs a smaller patch to fix time_type_print(). I think this is a much more natural way to specify relative times. > include/utils.h | 4 ++ > src/datatype.c | 133 ++++++++++++++++++++++++++++++++++++++++++++++++------- > 2 files changed, 121 insertions(+), 16 deletions(-) > > diff --git a/include/utils.h b/include/utils.h > index 854986f..f23f8e6 100644 > --- a/include/utils.h > +++ b/include/utils.h > @@ -62,6 +62,10 @@ > (void) (&_max1 == &_max2); \ > _max1 > _max2 ? _max1 : _max2; }) > > +#ifndef ARRAY_SIZE > +#define ARRAY_SIZE(a) (int)(sizeof(a)/sizeof((a)[0])) > +#endif We have array_size(). -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html