summaryrefslogtreecommitdiff
path: root/src/read_config_lex.l
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2008-11-25 23:34:48 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2008-11-25 23:34:48 +0100
commitb2edf895af82914ab09a842641a45b7a806e9b1e (patch)
tree2b2890418f2f39bd12587288411420e9a0b9b369 /src/read_config_lex.l
parent6262a4a7b7139fb5636228cb0f5a1e72f848d871 (diff)
downloadconntrack-tools-b2edf895af82914ab09a842641a45b7a806e9b1e.tar.gz
conntrack-tools-b2edf895af82914ab09a842641a45b7a806e9b1e.zip
filter: CIDR-based filtering support
This patch adds CIDR-based filtering support. The current implementation is O(n). This patch also introduces the vector data type which is used to store the IP address and the network mask. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/read_config_lex.l')
-rw-r--r--src/read_config_lex.l6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/read_config_lex.l b/src/read_config_lex.l
index cbb6ca8..67c95d3 100644
--- a/src/read_config_lex.l
+++ b/src/read_config_lex.l
@@ -36,14 +36,16 @@ is_on [o|O][n|N]
is_off [o|O][f|F][f|F]
integer [0-9]+
path \/[^\"\n ]*
+ip4_cidr \/[0-2]*[0-9]+
ip4_end [0-9]*[0-9]+
ip4_part [0-2]*{ip4_end}
-ip4 {ip4_part}\.{ip4_part}\.{ip4_part}\.{ip4_part}
+ip4 {ip4_part}\.{ip4_part}\.{ip4_part}\.{ip4_part}{ip4_cidr}?
hex_255 [0-9a-fA-F]{1,4}
+ip6_cidr \/[0-1]*[0-9]*[0-9]+
ip6_part {hex_255}":"?
ip6_form1 {ip6_part}{0,16}"::"{ip6_part}{0,16}
ip6_form2 ({hex_255}":"){16}{hex_255}
-ip6 {ip6_form1}|{ip6_form2}
+ip6 {ip6_form1}{ip6_cidr}?|{ip6_form2}{ip6_cidr}?
string [a-zA-Z][a-zA-Z0-9\.]*
persistent [P|p][E|e][R|r][S|s][I|i][S|s][T|t][E|e][N|n][T|T]
nack [N|n][A|a][C|c][K|k]