netfilter-devel.vger.kernel.org archive mirror
 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 2/2] Basic support for printing nft_data_reg in XML format.
Date: Tue, 2 Apr 2013 21:32:29 +0200	[thread overview]
Message-ID: <20130402193229.GA16053@localhost> (raw)
In-Reply-To: <CAOkSjBjM57H+XAX7h5YFOPcfF_Hj3H_vfnMpBg6tnQVTee1CKA@mail.gmail.com>

On Tue, Apr 02, 2013 at 07:18:39PM +0200, Arturo Borrero Gonzalez wrote:
> 2013/4/2 Pablo Neira Ayuso <pablo@netfilter.org>:
> > I think we need something similar to:
> >
> > int nft_parse_data(union nft_data_reg *data, struct nlattr *attr, int *type);
> >
> > We should pass a 'type' that indicates:
> >
> >         DATA_VALUE,
> >         DATA_VERDICT,
> >         DATA_CHAIN,
> >
> > So you know if you have print what the data_reg contains.
> >
> 
> If cmp and bitwise are going to always have DATA_VALUE, and imm
> depending on what was set, I think we could do:
> 
> int nft_data_reg_snprintf(char *buf, union data_reg *data, int type, ...)
> switch(type)
> return nft_data_reg_snprintf_'type'(buf, data, ...)

where 'type' can be: value, verdict or chain.

> And the same applies when parsing XML.

Exactly.

  reply	other threads:[~2013-04-02 19:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-29 15:34 [libnftables PATCH 0/2] Arturo Borrero
2013-03-29 15:34 ` [libnftables PATCH 1/2] Fix a typo in src/expr/match Arturo Borrero
2013-03-29 15:34 ` [libnftables PATCH 2/2] Basic support for printing nft_data_reg in XML format Arturo Borrero
2013-04-02 11:41   ` Pablo Neira Ayuso
2013-04-02 17:18     ` Arturo Borrero Gonzalez
2013-04-02 19:32       ` Pablo Neira Ayuso [this message]
2013-04-03 12:38         ` Arturo Borrero Gonzalez
2013-04-04 12:33           ` 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=20130402193229.GA16053@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).