Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: "Blažej Krajňák" <blazej.krajnak@gmail.com>
Cc: netfilter@vger.kernel.org
Subject: Re: ulogd packet based logging with CT info
Date: Thu, 19 Aug 2021 19:03:30 +0200	[thread overview]
Message-ID: <20210819170330.GA7011@salvia> (raw)
In-Reply-To: <CAMEa=f=Or70aNKCiw6=SRG0wQxbdG51HhP6jBZsbKhUcTqaNqA@mail.gmail.com>

On Thu, Aug 19, 2021 at 04:05:41PM +0200, Blažej Krajňák wrote:
> št 19. 8. 2021 o 12:16 Pablo Neira Ayuso <pablo@netfilter.org> napísal(a):
> >
> > Better to stick to use nflog_nlmsg_parser(), my suggestion is:
> >
> > #1 msg_cb() provides struct nfgenmsg *nfmsg, you could retrieve the nlmsg
> >    from there since the nlmsghdr comes before nfgenmsg:
> >
> >         struct nlmsghdr *nlh;
> >
> >         nlh = (struct nlmsghdr *)((void *)nfg - sizeof(*nlh));
> >
> >         err = nflog_nlmsg_parse(nlh, attrs);
> >         if (err < 0)
> >                 ... error path
> >
> > #2 once you have access to attrs[NFULA_CT], from there on:
> >
> >         struct nf_conntrack *ct;
> >
> >         ct = nfct_new();
> >         if (!ct)
> >                 ... error path
> >
> >         err = nfct_nlmsg_parse(nlh, ct);
> >         if (err < 0)
> >                 ... error path
> >
> > Then, you get the pointer to conntrack object.
> 
> Great, your suggestions perfectly work. Thank you.
> Little later I will post complete code to everyone.

Thanks.

> Could it be useful to prepare patch to add this to ulogd2?

I think so, yes.

> As new input plugin or as a upgrade to inppkt_UFLOG?

Better if you integrate it into the existing plugin.

Please, go ahead post it for review, it might just need a few
iterations before it gets merged into master.

Thanks.

  reply	other threads:[~2021-08-19 17:03 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-15 14:23 ulogd packet based logging with CT info Blažej Krajňák
2021-08-15 14:31 ` Pablo Neira Ayuso
2021-08-15 16:23   ` Blažej Krajňák
2021-08-17 14:42     ` Blažej Krajňák
2021-08-17 15:05       ` Fatih USTA
2021-08-17 15:06         ` Blažej Krajňák
2021-08-18  7:22       ` Pablo Neira Ayuso
2021-08-18 10:06         ` Blažej Krajňák
2021-08-18 11:52           ` Pablo Neira Ayuso
2021-08-18 20:06             ` Blažej Krajňák
2021-08-19 10:16               ` Pablo Neira Ayuso
2021-08-19 14:05                 ` Blažej Krajňák
2021-08-19 17:03                   ` Pablo Neira Ayuso [this message]
     [not found]                     ` <CAMEa=f=wHTwJX6CjgOROcStTgDo-TdU6jb2xtpmNi=coHuPboA@mail.gmail.com>
2021-08-21 13:03                       ` Blažej Krajňák
2021-08-21 16:21                         ` Blažej Krajňák
2021-09-02 22:28                     ` Ken-ichirou MATSUZAWA

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=20210819170330.GA7011@salvia \
    --to=pablo@netfilter.org \
    --cc=blazej.krajnak@gmail.com \
    --cc=netfilter@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