History

netfilter: nf_tables: add range expression

Inverse ranges != [a,b] are not currently possible because rules are composites of && operations, and we need to express this: data < a || data > b This patch adds a new range expression. Positive ranges can be already through two cmp expressions: cmp(sreg, data, >=) cmp(sreg, data, <=) This new range expression provides an alternative way to express this.

Pablo Neira Ayuso committed 10 years ago

Commit 0f3cd9b1 parent 7a682575 files · +178 −2Browse files

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

Unified · Split

include/uapi/linux/netfilter/nf_tables.h+29−0
@@ -546,6 +546,35 @@ enum nft_cmp_attributes { · 545 unmodified lines
546546 };
547547 #define NFTA_CMP_MAX (__NFTA_CMP_MAX - 1)
548548
549+/**
550+ * enum nft_range_ops - nf_tables range operator
551+ *
552+ * @NFT_RANGE_EQ: equal
553+ * @NFT_RANGE_NEQ: not equal
554+ */
555+enum nft_range_ops {
556+ NFT_RANGE_EQ,
557+ NFT_RANGE_NEQ,
558+};
559+
560+/**
561+ * enum nft_range_attributes - nf_tables range expression netlink attributes
562+ *
563+ * @NFTA_RANGE_SREG: source register of data to compare (NLA_U32: nft_registers)
564+ * @NFTA_RANGE_OP: cmp operation (NLA_U32: nft_cmp_ops)
565+ * @NFTA_RANGE_FROM_DATA: data range from (NLA_NESTED: nft_data_attributes)
566+ * @NFTA_RANGE_TO_DATA: data range to (NLA_NESTED: nft_data_attributes)
567+ */
568+enum nft_range_attributes {
569+ NFTA_RANGE_UNSPEC,
570+ NFTA_RANGE_SREG,
571+ NFTA_RANGE_OP,
572+ NFTA_RANGE_FROM_DATA,
573+ NFTA_RANGE_TO_DATA,
574+ __NFTA_RANGE_MAX
575+};
576+#define NFTA_RANGE_MAX (__NFTA_RANGE_MAX - 1)
577+
549578 enum nft_lookup_flags {
550579 NFT_LOOKUP_F_INV = (1 << 0),
551580 };

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