public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
	Mira Limbeck <m.limbeck@proxmox.com>
Subject: Re: [pve-devel] [PATCH conntrack-tool v2 1/5] initial commit
Date: Thu, 4 Feb 2021 09:07:30 +0100	[thread overview]
Message-ID: <8bc0c730-c3e9-1395-a6af-1f1934840192@proxmox.com> (raw)
In-Reply-To: <20210203142536.28480-1-m.limbeck@proxmox.com>

On 03.02.21 15:25, Mira Limbeck wrote:
> Dumping conntrack information and importing conntrack information works
> for IPv4 and IPv6. No filtering is supported for now. pve-conntrack-tool
> will always return both IPv4 and IPv6 conntracks together.
> 
> Conntracks are serialized as JSON and printed on STDOUT line by line
> with one line containing one conntrack. When inserting data is read
> from STDIN line by line and expected to be one JSON object per line
> representing the conntrack.
> 
> Currently some conntrack attributes are not supported. These are
> HELPER_INFO, CONNLABELS and CONNLABELS_MASK. The reason for this is that
> handling of variable length attributes does not seem to be correctly
> implemented in libnetfilter_conntrack. To fix this we would probably have
> to use libmnl directly.
> 
> Conntracks containing protonum 2 (IGMP) are ignored in the dump as
> they can't be inserted using libnetfilter_conntrack (conntrack-tools'
> conntrack also exhibits the same behavior).
> 
> Expectation support, which is necessary for FTP and other protocols, is
> not yet implemented.
> 
> Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
> ---
> v2:
>  - changed Conntracks to Socket
>  - reworked a lot of the code for less code duplication
>  - reduced usage of 'unsafe'
>  - added/changed things based on @Wobu's suggestions (off-list)
> 
>  Cargo.toml                 |  14 ++
>  src/main.rs                | 488 +++++++++++++++++++++++++++++++++++++
>  src/mnl.rs                 | 132 ++++++++++
>  src/netfilter_conntrack.rs | 168 +++++++++++++
>  4 files changed, 802 insertions(+)
>  create mode 100644 Cargo.toml
>  create mode 100644 src/main.rs
>  create mode 100644 src/mnl.rs
>  create mode 100644 src/netfilter_conntrack.rs
> 

I take a (very) quick look at it and the code itself seems quite sensible.

One higher level question though, would it makes sense do have the whole
plumbing and general socket interfacing in it's own library crate (or sub
workspace or something like that) and the binary here separate and as
plain user of that create.

That way we could additionally publish it on crates.io, could be helpful
form some people (even if conntrack/nl is certainly a bit of a niche).

What do you think about that?




  parent reply	other threads:[~2021-02-04  8:08 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-03 14:25 Mira Limbeck
2021-02-03 14:25 ` [pve-devel] [PATCH conntrack-tool v2 2/5] add packaging support Mira Limbeck
2021-02-04  7:08   ` Thomas Lamprecht
2021-02-04  9:55     ` Mira Limbeck
2021-02-03 14:25 ` [pve-devel] [PATCH conntrack-tool v2 3/5] add expectation support Mira Limbeck
2021-02-03 14:25 ` [pve-devel] [PATCH conntrack-tool v2 4/5] add additional bindings Mira Limbeck
2021-02-03 14:25 ` [pve-devel] [PATCH conntrack-tool v2 5/5] replace C callback with closures Mira Limbeck
2021-02-03 14:25 ` [pve-devel] [PATCH qemu-server v2] copy conntrack information on migration Mira Limbeck
2021-02-05  8:11   ` Fabian Ebner
2021-02-05  9:51     ` Mira Limbeck
2021-02-04  8:07 ` Thomas Lamprecht [this message]
2021-02-04 10:15   ` [pve-devel] [PATCH conntrack-tool v2 1/5] initial commit Mira Limbeck
2021-02-04 10:20     ` Thomas Lamprecht
2021-02-04 10:16 ` Mira Limbeck

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=8bc0c730-c3e9-1395-a6af-1f1934840192@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=m.limbeck@proxmox.com \
    --cc=pve-devel@lists.proxmox.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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal