summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2011-03-18 17:24:50 +0100
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2011-03-18 17:24:50 +0100
commitf284b0d07b5d99e745312cbcc0fd95a6a4a7f5b4 (patch)
tree8dc08a86b3c9cc78456aaff8995db2f6f4fca9c6 /src
parent6b88433a9334f3f0fc44ee52867326ce20c4af15 (diff)
SCTP, UDPLITE support added
SCTP and UDPLITE port support added to the hash:*port* types.
Diffstat (limited to 'src')
-rw-r--r--src/ipset.827
-rw-r--r--src/ipset_hash_ipport.c6
-rw-r--r--src/ipset_hash_ipportip.c6
-rw-r--r--src/ipset_hash_ipportnet.c6
-rw-r--r--src/ipset_hash_netport.c5
5 files changed, 29 insertions, 21 deletions
diff --git a/src/ipset.8 b/src/ipset.8
index b9ca8a5..cad3296 100644
--- a/src/ipset.8
+++ b/src/ipset.8
@@ -330,6 +330,9 @@ Mandatory options to use when creating a \fBbitmap:port\fR type of set:
\fBrange\fP \fIfromport\fP\-\fItoport\fR
Create the set from the specified inclusive port range.
.PP
+The \fBset\fR match and \fBSET\fR target netfilter kernel modules interpret
+the stored numbers as TCP or UDP port numbers.
+.PP
Examples:
.IP
ipset create foo bitmap:port range 0\-1024
@@ -380,9 +383,9 @@ a range or a network:
.PP
Examples:
.IP
-ipset create foo hash:ip netmask 24
+ipset create foo hash:ip netmask 30
.IP
-ipset add foo 192.168.1.1\-192.168.1.2
+ipset add foo 192.168.1.0/24
.IP
ipset test foo 192.168.1.2
.SS hash:net
@@ -414,8 +417,10 @@ correct value.
The maximal number of elements which can be stored in the set, default 65536.
.PP
When adding/deleting/testing entries, if the cidr prefix parameter is not specified,
-then the host prefix value is assumed. When adding/deleting entries, overlapping
-elements are not checked.
+then the host prefix value is assumed. When adding/deleting entries, the exact
+element is added/deleted and overlapping elements are not checked by the kernel.
+When testing entries, if a host address is tested, then the kernel tries to match
+the host address in the networks added to the set and reports the result accordingly.
.PP
From the \fBset\fR netfilter match point of view the searching for a match
always starts from the smallest size of netblock (most specific
@@ -431,7 +436,7 @@ Examples:
.IP
ipset create foo hash:net
.IP
-ipset add foo 192.168.0/24
+ipset add foo 192.168.0.0/24
.IP
ipset add foo 10.1.0.0/16
.IP
@@ -481,8 +486,8 @@ TCP port or range of ports expressed in TCP portname identifiers from /etc/servi
\fIportnumber[\-portnumber]\fR
TCP port or range of ports expressed in TCP port numbers
.TP
-\fBtcp\fR|\fBudp\fR:\fIportname\fR|\fIportnumber\fR[\-\fIportname\fR|\fIportnumber\fR]
-TCP or UDP port or port range expressed in port name(s) or port number(s)
+\fBtcp\fR|\fBsctp\fR|\fBudp\fR|\fBudplite\fR:\fIportname\fR|\fIportnumber\fR[\-\fIportname\fR|\fIportnumber\fR]
+TCP, SCTP, UDP or UDPLITE port or port range expressed in port name(s) or port number(s)
.TP
\fBicmp\fR:\fIcodename\fR|\fItype\fR/\fIcode\fR
ICMP codename or type/code. The supported ICMP codename identifiers can always
@@ -508,7 +513,7 @@ ipset add foo 192.168.1.0/24,80\-82
.IP
ipset add foo 192.168.1.1,udp:53
.IP
-ipset add foo 192.168.1.1,ospf:0
+ipset add foo 192.168.1.1,vrrp:0
.IP
ipset test foo 192.168.1.1,80
.SS hash:net,port
@@ -547,8 +552,10 @@ part of the elements see the description at the
\fBhash:ip,port\fR set type.
.PP
When adding/deleting/testing entries, if the cidr prefix parameter is not specified,
-then the host prefix value is assumed. When adding/deleting entries, overlapping
-elements are not checked.
+then the host prefix value is assumed. When adding/deleting entries, the exact
+element is added/deleted and overlapping elements are not checked by the kernel.
+When testing entries, if a host address is tested, then the kernel tries to match
+the host address in the networks added to the set and reports the result accordingly.
.PP
From the \fBset\fR netfilter match point of view the searching for a match
always starts from the smallest size of netblock (most specific
diff --git a/src/ipset_hash_ipport.c b/src/ipset_hash_ipport.c
index 94bda07..3179805 100644
--- a/src/ipset_hash_ipport.c
+++ b/src/ipset_hash_ipport.c
@@ -82,13 +82,13 @@ static const char hash_ipport_usage[] =
" IP is a valid IPv4 or IPv6 address (or hostname).\n"
" Adding/deleting multiple elements in IP/CIDR or FROM-TO form\n"
" is supported for IPv4.\n"
-" Adding/deleting multiple elements with TCP/UDP port range\n"
-" is supported both for IPv4 and IPv6.\n";
+" Adding/deleting multiple elements with TCP/SCTP/UDP/UDPLITE\n"
+" port range is supported both for IPv4 and IPv6.\n";
struct ipset_type ipset_hash_ipport0 = {
.name = "hash:ip,port",
.alias = { "ipporthash", NULL },
- .revision = 0,
+ .revision = 1,
.family = AF_INET46,
.dimension = IPSET_DIM_TWO,
.elem = {
diff --git a/src/ipset_hash_ipportip.c b/src/ipset_hash_ipportip.c
index cb90152..944ee81 100644
--- a/src/ipset_hash_ipportip.c
+++ b/src/ipset_hash_ipportip.c
@@ -82,13 +82,13 @@ static const char hash_ipportip_usage[] =
" IP is a valid IPv4 or IPv6 address (or hostname).\n"
" Adding/deleting multiple elements in IP/CIDR or FROM-TO form\n"
" in the first IP component is supported for IPv4.\n"
-" Adding/deleting multiple elements with TCP/UDP port range\n"
-" is supported both for IPv4 and IPv6.\n";
+" Adding/deleting multiple elements with TCP/SCTP/UDP/UDPLITE\n"
+" port range is supported both for IPv4 and IPv6.\n";
struct ipset_type ipset_hash_ipportip0 = {
.name = "hash:ip,port,ip",
.alias = { "ipportiphash", NULL },
- .revision = 0,
+ .revision = 1,
.family = AF_INET46,
.dimension = IPSET_DIM_THREE,
.elem = {
diff --git a/src/ipset_hash_ipportnet.c b/src/ipset_hash_ipportnet.c
index ff3a8ec..bd94d12 100644
--- a/src/ipset_hash_ipportnet.c
+++ b/src/ipset_hash_ipportnet.c
@@ -83,13 +83,13 @@ static const char hash_ipportnet_usage[] =
" CIDR is a valid IPv4 or IPv6 CIDR prefix.\n"
" Adding/deleting multiple elements in IP/CIDR or FROM-TO form\n"
" in the first IP component is supported for IPv4.\n"
-" Adding/deleting multiple elements with TCP/UDP port range\n"
-" is supported both for IPv4 and IPv6.\n";
+" Adding/deleting multiple elements with TCP/SCTP/UDP/UDPLITE\n"
+" port range is supported both for IPv4 and IPv6.\n";
struct ipset_type ipset_hash_ipportnet0 = {
.name = "hash:ip,port,net",
.alias = { "ipportnethash", NULL },
- .revision = 0,
+ .revision = 1,
.family = AF_INET46,
.dimension = IPSET_DIM_THREE,
.elem = {
diff --git a/src/ipset_hash_netport.c b/src/ipset_hash_netport.c
index 843ef31..8ca77df 100644
--- a/src/ipset_hash_netport.c
+++ b/src/ipset_hash_netport.c
@@ -60,12 +60,13 @@ static const char hash_netport_usage[] =
"where depending on the INET family\n"
" IP is a valid IPv4 or IPv6 address (or hostname),\n"
" CIDR is a valid IPv4 or IPv6 CIDR prefix.\n"
-" Adding/deleting multiple elements with TCP/UDP port range supported.\n";
+" Adding/deleting multiple elements with TCP/SCTP/UDP/UDPLITE\n"
+" port range is supported both for IPv4 and IPv6.\n";
struct ipset_type ipset_hash_netport0 = {
.name = "hash:net,port",
.alias = { "netporthash", NULL },
- .revision = 0,
+ .revision = 1,
.family = AF_INET46,
.dimension = IPSET_DIM_TWO,
.elem = {