netfilter: ipset: Support comments for ipset entries in the core.
This adds the core support for having comments on ipset entries. The comments are stored as standard null-terminated strings in dynamically allocated memory after being passed to the kernel. As a result of this, code has been added to the generic destroy function to iterate all extensions and call that extension's destroy task if the set has that extension activated, and if such a task is defined. Signed-off-by: Oliver Smith <oliver@8.c.9.b.0.7.4.0.1.0.0.2.ip6.arpa> Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
This commit is contained in:

committed by
Jozsef Kadlecsik

parent
ea53ac5b63
commit
68b63f08d2
@@ -10,12 +10,14 @@
|
||||
#ifndef _UAPI_IP_SET_H
|
||||
#define _UAPI_IP_SET_H
|
||||
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
/* The protocol version */
|
||||
#define IPSET_PROTOCOL 6
|
||||
|
||||
/* The maximum permissible comment length we will accept over netlink */
|
||||
#define IPSET_MAX_COMMENT_SIZE 255
|
||||
|
||||
/* The max length of strings including NUL: set and type identifiers */
|
||||
#define IPSET_MAXNAMELEN 32
|
||||
|
||||
@@ -110,6 +112,7 @@ enum {
|
||||
IPSET_ATTR_IFACE,
|
||||
IPSET_ATTR_BYTES,
|
||||
IPSET_ATTR_PACKETS,
|
||||
IPSET_ATTR_COMMENT,
|
||||
__IPSET_ATTR_ADT_MAX,
|
||||
};
|
||||
#define IPSET_ATTR_ADT_MAX (__IPSET_ATTR_ADT_MAX - 1)
|
||||
@@ -140,6 +143,7 @@ enum ipset_errno {
|
||||
IPSET_ERR_IPADDR_IPV4,
|
||||
IPSET_ERR_IPADDR_IPV6,
|
||||
IPSET_ERR_COUNTER,
|
||||
IPSET_ERR_COMMENT,
|
||||
|
||||
/* Type specific error codes */
|
||||
IPSET_ERR_TYPE_SPECIFIC = 4352,
|
||||
@@ -176,6 +180,8 @@ enum ipset_cadt_flags {
|
||||
IPSET_FLAG_NOMATCH = (1 << IPSET_FLAG_BIT_NOMATCH),
|
||||
IPSET_FLAG_BIT_WITH_COUNTERS = 3,
|
||||
IPSET_FLAG_WITH_COUNTERS = (1 << IPSET_FLAG_BIT_WITH_COUNTERS),
|
||||
IPSET_FLAG_BIT_WITH_COMMENT = 4,
|
||||
IPSET_FLAG_WITH_COMMENT = (1 << IPSET_FLAG_BIT_WITH_COMMENT),
|
||||
IPSET_FLAG_CADT_MAX = 15,
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user