All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [libnftables PATCH] parsing: add interface to parse from file
Date: Thu, 2 Jan 2014 14:52:42 +0100	[thread overview]
Message-ID: <20140102135242.GA5101@localhost> (raw)
In-Reply-To: <20140102132103.23299.58753.stgit@nfdev.cica.es>

On Thu, Jan 02, 2014 at 02:21:03PM +0100, Arturo Borrero Gonzalez wrote:
> This patch adds API interfaces to parse nft objects from a given filename.
> 
> I found this useful in `nft', where I'm trying to parse XML/JSON from a file.
> 
> Examples will be updated in a separated patch.
> 
> Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
> ---
>  include/libnftables/chain.h   |    1 +
>  include/libnftables/rule.h    |    1 +
>  include/libnftables/ruleset.h |    1 +
>  include/libnftables/set.h     |    2 ++
>  include/libnftables/table.h   |    1 +
>  src/chain.c                   |   15 +++++++++++++++
>  src/internal.h                |    8 +++++++-
>  src/libnftables.map           |    6 ++++++
>  src/rule.c                    |   14 ++++++++++++++
>  src/ruleset.c                 |   14 ++++++++++++++
>  src/set.c                     |   14 ++++++++++++++
>  src/set_elem.c                |   14 ++++++++++++++
>  src/table.c                   |   14 ++++++++++++++
>  src/utils.c                   |   34 ++++++++++++++++++++++++++++++++++
>  14 files changed, 138 insertions(+), 1 deletion(-)
> 
> diff --git a/include/libnftables/chain.h b/include/libnftables/chain.h
> index 8b4eab9..619088f 100644
> --- a/include/libnftables/chain.h
> +++ b/include/libnftables/chain.h
> @@ -52,6 +52,7 @@ struct nlmsghdr;
>  void nft_chain_nlmsg_build_payload(struct nlmsghdr *nlh, const struct nft_chain *t);
>  
>  int nft_chain_parse(struct nft_chain *c, enum nft_parse_type type, const char *data);
> +int nft_chain_fparse(struct nft_chain *c, enum nft_parse_type type, const char *filename);

Please, rework this to pass a file descriptor instead so it's
consistent with _fprintf API and we can use it with pipes as well.
Thanks.

  reply	other threads:[~2014-01-02 13:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-02 13:21 [libnftables PATCH] parsing: add interface to parse from file Arturo Borrero Gonzalez
2014-01-02 13:52 ` Pablo Neira Ayuso [this message]
2014-01-02 18:47   ` Arturo Borrero Gonzalez
2014-01-02 19:21     ` Pablo Neira Ayuso

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=20140102135242.GA5101@localhost \
    --to=pablo@netfilter.org \
    --cc=arturo.borrero.glez@gmail.com \
    --cc=netfilter-devel@vger.kernel.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.