History

netfilter: nft_payload: add packet mangling support

Add support for mangling packet payload. Checksum for the specified base header is updated automatically if requested, however no updates for any kind of pseudo headers are supported, meaning no stateless NAT is supported. For checksum updates different checksumming methods can be specified. The currently supported methods are NONE for no checksum updates, and INET for internet type checksums.

Patrick McHardy committed 10 years ago

Commit 7ec3f7b1 parent a9ecfbe3 files · +155 −6Browse files

Showing the changes to include/uapi (1 of 3 files). Show all

Unified · Split

include/uapi/linux/netfilter/nf_tables.h+17−0
@@ -597,6 +597,17 @@ enum nft_payload_bases { · 596 unmodified lines
597597 NFT_PAYLOAD_TRANSPORT_HEADER,
598598 };
599599
600+/**
601+ * enum nft_payload_csum_types - nf_tables payload expression checksum types
602+ *
603+ * @NFT_PAYLOAD_CSUM_NONE: no checksumming
604+ * @NFT_PAYLOAD_CSUM_INET: internet checksum (RFC 791)
605+ */
606+enum nft_payload_csum_types {
607+ NFT_PAYLOAD_CSUM_NONE,
608+ NFT_PAYLOAD_CSUM_INET,
609+};
610+
600611 /**
601612 * enum nft_payload_attributes - nf_tables payload expression netlink attributes
602613 *
@@ -604,6 +615,9 @@ enum nft_payload_bases { · 1 unmodified line
604615 * @NFTA_PAYLOAD_BASE: payload base (NLA_U32: nft_payload_bases)
605616 * @NFTA_PAYLOAD_OFFSET: payload offset relative to base (NLA_U32)
606617 * @NFTA_PAYLOAD_LEN: payload length (NLA_U32)
618+ * @NFTA_PAYLOAD_SREG: source register to load data from (NLA_U32: nft_registers)
619+ * @NFTA_PAYLOAD_CSUM_TYPE: checksum type (NLA_U32)
620+ * @NFTA_PAYLOAD_CSUM_OFFSET: checksum offset relative to base (NLA_U32)
607621 */
608622 enum nft_payload_attributes {
609623 NFTA_PAYLOAD_UNSPEC,
@@ -611,6 +625,9 @@ enum nft_payload_attributes { · 1 unmodified line
611625 NFTA_PAYLOAD_BASE,
612626 NFTA_PAYLOAD_OFFSET,
613627 NFTA_PAYLOAD_LEN,
628+ NFTA_PAYLOAD_SREG,
629+ NFTA_PAYLOAD_CSUM_TYPE,
630+ NFTA_PAYLOAD_CSUM_OFFSET,
614631 __NFTA_PAYLOAD_MAX
615632 };
616633 #define NFTA_PAYLOAD_MAX (__NFTA_PAYLOAD_MAX - 1)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t