Skip to content

libnetfilter_conntrack: add connlabel support

Florian Westphal netfilter-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3api: add nfct_bitmask objectinclude/internal/bitops.h include/internal/object.h include/libnetfilter_conntrack/libnetfilter_conntrack.h +1 more+120 -00 replies
2/3api: add connlabel api and attributeinclude/internal/object.h include/internal/prototypes.h include/libnetfilter_conntrack/libnetfilter_conntrack.h +9 more+384 -01 reply
3/3examples: add connlabel dump/set/clear demo programsexamples/Makefile.am examples/nfct-mnl-dump-labels.c examples/nfct-mnl-set-label.c+283 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] libnetfilter_conntrack: add connlabel support

The following three patches add support for the planned connlabel extension to libnetfilter_conntrack.

I've tried to add Pablos feedback/ideas, thus:
- a new nfct_bitmask object is added, plus interfaces to test/set such bits
- 2nd patch adds functions to create/inspect a name <-> bit mapping table
- setting/retrieving the connlabels is done with the existing nfct_get/set_attr interface, so no new interface for that.

Caveats:
- I only wired CTA_LABELS up with the libmnl-based API
- I only made a very brief test of this code (using the example programs).

Please let me know if there are any remaining issues with the chosen approach.

summary of changes:

examples/Makefile.am                                       |   10 
examples/nfct-mnl-dump-labels.c                            |  103 +++++
examples/nfct-mnl-set-label.c                              |  170 +++++++++
include/internal/bitops.h                                  |    2 
include/internal/object.h                                  |   12 
include/internal/prototypes.h                              |    9 
include/libnetfilter_conntrack/libnetfilter_conntrack.h    |   20 +
include/libnetfilter_conntrack/linux_nfnetlink_conntrack.h |    1 
src/conntrack/Makefile.am                                  |    1 
src/conntrack/api.c                                        |  164 ++++++++
src/conntrack/build_mnl.c                                  |   12 
src/conntrack/getter.c                                     |    6 
src/conntrack/labels.c                                     |  239 +++++++++++++
src/conntrack/parse.c                                      |    1 
src/conntrack/parse_mnl.c                                  |   25 +
src/conntrack/setter.c                                     |   12 
16 files changed, 787 insertions(+)