netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Shivani Bhardwaj <shivanib134@gmail.com>
Cc: Netfilter Development Mailing list <netfilter-devel@vger.kernel.org>
Subject: Re: [PATCH v2] doc: Complete the documentation of statements
Date: Thu, 12 May 2016 13:05:21 +0200	[thread overview]
Message-ID: <20160512110521.GA1262@salvia> (raw)
In-Reply-To: <CAKHNQQFkpzx2r0v87JL55RhMsmmPt-BfVCmP=_ugOy=nZ_QysA@mail.gmail.com>

On Thu, May 12, 2016 at 04:21:06PM +0530, Shivani Bhardwaj wrote:
> On Thu, May 12, 2016 at 3:14 PM, Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> > On Thu, May 12, 2016 at 01:38:45PM +0530, Shivani Bhardwaj wrote:
> >> +                     <para>
> >> +                             &#13;&#10;The nflog statement provides logging of matching packets. When this statement is set for a rule, the Linux kernel will pass the packet to the loaded logging backend to log the packet. This is used in combination with nfnetlink_log as logging backend, which will multicast the packet through a netlink socket to the specified multicast group. One or more userspace processes may subscribe to the group to receive the packets. Like log statement, this is a non-terminating statement, i.e. rule traversal continues at the next rule. It is necessary to mention the group [default 0] to consider logging with nflog.
> >
> > We don't have a nflog statement, actually this is integrated into
> > 'log' itself. So if you indique the group, then it is assumed that you
> > want to use logging through nflog.
> >
> Yes, I'm sorry for the mistake.

No problem.

[...]
> >>                       <title>Meta statement</title>
> >>                       <para>
> >> +                             A meta statement sets the value of a meta expression.
> >> +                             The existing meta fields are: length,
> >> nfproto, l4proto, protocol, priority, mark, iif, iifname, iiftype,
> >> oif, oifname, oiftype, skuid, skgid, nftrace, rtclassid, ibriport,
> >> obriport, pkttype, cpu, iifgroup, oifgroup, cgroup.
> >
> > We actually support a bunch of this, have a look at:
> > net/netfilter/nft_meta.c so you know which ones we support ;)
> >
> Should I be adding the ones like prandom, secmark too? nft_meta.c
> shows it but nftables doesn't seem to have an entry in the parser.
> Please let me know.

void nft_meta_set_eval(const struct nft_expr *expr,
                       struct nft_regs *regs,
                       const struct nft_pktinfo *pkt)
{
        const struct nft_meta *meta = nft_expr_priv(expr);
        struct sk_buff *skb = pkt->skb;
        u32 value = regs->data[meta->sreg];

        switch (meta->key) {
        case NFT_META_MARK:
                [...]
                break;
        case NFT_META_PRIORITY:
                [...]
                break;
        case NFT_META_PKTTYPE:
                [...]
                break;
        case NFT_META_NFTRACE:
                [...]
        default:
                WARN_ON(1);
        }
}

We support mark, priority, pkttype and nftrace for meta statements at
this stage.

Note that you indicated what we support for meta expressions (what we
used to call 'matches' in iptables) that is the long list of things
you placed above.

  reply	other threads:[~2016-05-12 11:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-12  8:08 [PATCH v2] doc: Complete the documentation of statements Shivani Bhardwaj
2016-05-12  9:44 ` Pablo Neira Ayuso
2016-05-12 10:51   ` Shivani Bhardwaj
2016-05-12 11:05     ` Pablo Neira Ayuso [this message]
2016-05-12 11:07       ` Shivani Bhardwaj

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=20160512110521.GA1262@salvia \
    --to=pablo@netfilter.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=shivanib134@gmail.com \
    /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).