All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nft RFC] datatype: add time type parser and adapt output
Date: Thu, 16 Jan 2014 21:05:56 +0000	[thread overview]
Message-ID: <20140116210556.GA24079@macbook.localnet> (raw)
In-Reply-To: <1389906062-27409-1-git-send-email-pablo@netfilter.org>

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@netfilter.org>
> ---
> 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().

  reply	other threads:[~2014-01-16 21:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-16 21:01 [PATCH nft RFC] datatype: add time type parser and adapt output Pablo Neira Ayuso
2014-01-16 21:05 ` Patrick McHardy [this message]
2014-01-16 21:23   ` Patrick McHardy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140116210556.GA24079@macbook.localnet \
    --to=kaber@trash.net \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.