Skip to content

Commit f830837

Browse files
Jozsef Kadlecsikkaber
Jozsef Kadlecsik
authored andcommitted
netfilter: ipset: list:set set type support
The module implements the list:set type support in two flavours: without and with timeout. The sets has two sides: for the userspace, they store the names of other (non list:set type of) sets: one can add, delete and test set names. For the kernel, it forms an ordered union of the member sets: the members sets are tried in order when elements are added, deleted and tested and the process stops at the first success. Signed-off-by: Jozsef Kadlecsik <[email protected]> Signed-off-by: Patrick McHardy <[email protected]>
1 parent 21f4502 commit f830837

File tree

4 files changed

+624
-0
lines changed

4 files changed

+624
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#ifndef __IP_SET_LIST_H
2+
#define __IP_SET_LIST_H
3+
4+
/* List type specific error codes */
5+
enum {
6+
/* Set name to be added/deleted/tested does not exist. */
7+
IPSET_ERR_NAME = IPSET_ERR_TYPE_SPECIFIC,
8+
/* list:set type is not permitted to add */
9+
IPSET_ERR_LOOP,
10+
/* Missing reference set */
11+
IPSET_ERR_BEFORE,
12+
/* Reference set does not exist */
13+
IPSET_ERR_NAMEREF,
14+
/* Set is full */
15+
IPSET_ERR_LIST_FULL,
16+
/* Reference set is not added to the set */
17+
IPSET_ERR_REF_EXIST,
18+
};
19+
20+
#ifdef __KERNEL__
21+
22+
#define IP_SET_LIST_DEFAULT_SIZE 8
23+
#define IP_SET_LIST_MIN_SIZE 4
24+
25+
#endif /* __KERNEL__ */
26+
27+
#endif /* __IP_SET_LIST_H */

net/netfilter/ipset/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,14 @@ config IP_SET_HASH_NETPORT
108108

109109
To compile it as a module, choose M here. If unsure, say N.
110110

111+
config IP_SET_LIST_SET
112+
tristate "list:set set support"
113+
depends on IP_SET
114+
help
115+
This option adds the list:set set type support. In this
116+
kind of set one can store the name of other sets and it forms
117+
an ordered union of the member sets.
118+
119+
To compile it as a module, choose M here. If unsure, say N.
120+
111121
endif # IP_SET

net/netfilter/ipset/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ obj-$(CONFIG_IP_SET_HASH_IPPORTIP) += ip_set_hash_ipportip.o
1919
obj-$(CONFIG_IP_SET_HASH_IPPORTNET) += ip_set_hash_ipportnet.o
2020
obj-$(CONFIG_IP_SET_HASH_NET) += ip_set_hash_net.o
2121
obj-$(CONFIG_IP_SET_HASH_NETPORT) += ip_set_hash_netport.o
22+
23+
# list types
24+
obj-$(CONFIG_IP_SET_LIST_SET) += ip_set_list_set.o

0 commit comments

Comments
 (0)