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
597 NFT_PAYLOAD_TRANSPORT_HEADER,597 NFT_PAYLOAD_TRANSPORT_HEADER,
598};598};
599 599
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 */
606enum nft_payload_csum_types {
607 NFT_PAYLOAD_CSUM_NONE,
608 NFT_PAYLOAD_CSUM_INET,
609};
610
600/**611/**
601 * enum nft_payload_attributes - nf_tables payload expression netlink attributes612 * enum nft_payload_attributes - nf_tables payload expression netlink attributes
602 *613 *
@@ -604,6 +615,9 @@ enum nft_payload_bases { · 1 unmodified line
604 * @NFTA_PAYLOAD_BASE: payload base (NLA_U32: nft_payload_bases)615 * @NFTA_PAYLOAD_BASE: payload base (NLA_U32: nft_payload_bases)
605 * @NFTA_PAYLOAD_OFFSET: payload offset relative to base (NLA_U32)616 * @NFTA_PAYLOAD_OFFSET: payload offset relative to base (NLA_U32)
606 * @NFTA_PAYLOAD_LEN: payload length (NLA_U32)617 * @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)
607 */621 */
608enum nft_payload_attributes {622enum nft_payload_attributes {
609 NFTA_PAYLOAD_UNSPEC,623 NFTA_PAYLOAD_UNSPEC,
@@ -611,6 +625,9 @@ enum nft_payload_attributes { · 1 unmodified line
611 NFTA_PAYLOAD_BASE,625 NFTA_PAYLOAD_BASE,
612 NFTA_PAYLOAD_OFFSET,626 NFTA_PAYLOAD_OFFSET,
613 NFTA_PAYLOAD_LEN,627 NFTA_PAYLOAD_LEN,
628 NFTA_PAYLOAD_SREG,
629 NFTA_PAYLOAD_CSUM_TYPE,
630 NFTA_PAYLOAD_CSUM_OFFSET,
614 __NFTA_PAYLOAD_MAX631 __NFTA_PAYLOAD_MAX
615};632};
616#define NFTA_PAYLOAD_MAX (__NFTA_PAYLOAD_MAX - 1)633#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