From bf1ae494ed67e9b44bc57c91d885218e2cf64cec Mon Sep 17 00:00:00 2001 From: Jozsef Kadlecsik Date: Tue, 7 Dec 2010 17:08:12 +0100 Subject: Remove command MODIFY Modifying a set can be performed by save/modify/restore/swap, without adding kernel part support. --- include/libipset/linux_ip_set.h | 37 ++++++++++++++++----------------- kernel/include/linux/netfilter/ip_set.h | 33 ++++++++++++++--------------- lib/PROTOCOL | 2 +- 3 files changed, 35 insertions(+), 37 deletions(-) diff --git a/include/libipset/linux_ip_set.h b/include/libipset/linux_ip_set.h index a122ee7..1fb7ea2 100644 --- a/include/libipset/linux_ip_set.h +++ b/include/libipset/linux_ip_set.h @@ -8,7 +8,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. + * published by the Free Software Foundation. */ /* The protocol version */ @@ -22,29 +22,28 @@ enum ipset_cmd { IPSET_CMD_NONE, IPSET_CMD_PROTOCOL, /* 1: Return protocol version */ IPSET_CMD_CREATE, /* 2: Create a new (empty) set */ - IPSET_CMD_MODIFY, /* 3: Modify an existing set */ - IPSET_CMD_DESTROY, /* 4: Destroy a (empty) set */ - IPSET_CMD_FLUSH, /* 5: Remove all elements from a set */ - IPSET_CMD_RENAME, /* 6: Rename a set */ - IPSET_CMD_SWAP, /* 7: Swap two sets */ - IPSET_CMD_LIST, /* 8: List sets */ - IPSET_CMD_SAVE, /* 9: Save sets */ - IPSET_CMD_ADD, /* 10: Add an element to a set */ - IPSET_CMD_DEL, /* 11: Delete an element from a set */ - IPSET_CMD_TEST, /* 12: Test an element in a set */ - IPSET_CMD_HEADER, /* 13: Get set header data only */ - IPSET_CMD_TYPE, /* 14: Get set type */ + IPSET_CMD_DESTROY, /* 3: Destroy a (empty) set */ + IPSET_CMD_FLUSH, /* 4: Remove all elements from a set */ + IPSET_CMD_RENAME, /* 5: Rename a set */ + IPSET_CMD_SWAP, /* 6: Swap two sets */ + IPSET_CMD_LIST, /* 7: List sets */ + IPSET_CMD_SAVE, /* 8: Save sets */ + IPSET_CMD_ADD, /* 9: Add an element to a set */ + IPSET_CMD_DEL, /* 10: Delete an element from a set */ + IPSET_CMD_TEST, /* 11: Test an element in a set */ + IPSET_CMD_HEADER, /* 12: Get set header data only */ + IPSET_CMD_TYPE, /* 13: Get set type */ IPSET_MSG_MAX, /* Netlink message commands */ /* Commands in userspace: */ - IPSET_CMD_RESTORE = IPSET_MSG_MAX, /* 15: Enter restore mode */ - IPSET_CMD_HELP, /* 16: Get help */ - IPSET_CMD_VERSION, /* 17: Get program version */ - IPSET_CMD_QUIT, /* 18: Quit from interactive mode */ + IPSET_CMD_RESTORE = IPSET_MSG_MAX, /* 14: Enter restore mode */ + IPSET_CMD_HELP, /* 15: Get help */ + IPSET_CMD_VERSION, /* 16: Get program version */ + IPSET_CMD_QUIT, /* 17: Quit from interactive mode */ IPSET_CMD_MAX, - IPSET_CMD_COMMIT = IPSET_CMD_MAX, /* 19: Commit buffered commands */ + IPSET_CMD_COMMIT = IPSET_CMD_MAX, /* 18: Commit buffered commands */ }; /* Attributes at command level */ @@ -93,7 +92,7 @@ enum { IPSET_ATTR_ELEMENTS, IPSET_ATTR_REFERENCES, IPSET_ATTR_MEMSIZE, - + __IPSET_ATTR_CREATE_MAX, }; #define IPSET_ATTR_CREATE_MAX (__IPSET_ATTR_CREATE_MAX - 1) diff --git a/kernel/include/linux/netfilter/ip_set.h b/kernel/include/linux/netfilter/ip_set.h index 07ff5a3..2d789d4 100644 --- a/kernel/include/linux/netfilter/ip_set.h +++ b/kernel/include/linux/netfilter/ip_set.h @@ -22,29 +22,28 @@ enum ipset_cmd { IPSET_CMD_NONE, IPSET_CMD_PROTOCOL, /* 1: Return protocol version */ IPSET_CMD_CREATE, /* 2: Create a new (empty) set */ - IPSET_CMD_MODIFY, /* 3: Modify an existing set */ - IPSET_CMD_DESTROY, /* 4: Destroy a (empty) set */ - IPSET_CMD_FLUSH, /* 5: Remove all elements from a set */ - IPSET_CMD_RENAME, /* 6: Rename a set */ - IPSET_CMD_SWAP, /* 7: Swap two sets */ - IPSET_CMD_LIST, /* 8: List sets */ - IPSET_CMD_SAVE, /* 9: Save sets */ - IPSET_CMD_ADD, /* 10: Add an element to a set */ - IPSET_CMD_DEL, /* 11: Delete an element from a set */ - IPSET_CMD_TEST, /* 12: Test an element in a set */ - IPSET_CMD_HEADER, /* 13: Get set header data only */ - IPSET_CMD_TYPE, /* 14: Get set type */ + IPSET_CMD_DESTROY, /* 3: Destroy a (empty) set */ + IPSET_CMD_FLUSH, /* 4: Remove all elements from a set */ + IPSET_CMD_RENAME, /* 5: Rename a set */ + IPSET_CMD_SWAP, /* 6: Swap two sets */ + IPSET_CMD_LIST, /* 7: List sets */ + IPSET_CMD_SAVE, /* 8: Save sets */ + IPSET_CMD_ADD, /* 9: Add an element to a set */ + IPSET_CMD_DEL, /* 10: Delete an element from a set */ + IPSET_CMD_TEST, /* 11: Test an element in a set */ + IPSET_CMD_HEADER, /* 12: Get set header data only */ + IPSET_CMD_TYPE, /* 13: Get set type */ IPSET_MSG_MAX, /* Netlink message commands */ /* Commands in userspace: */ - IPSET_CMD_RESTORE = IPSET_MSG_MAX, /* 15: Enter restore mode */ - IPSET_CMD_HELP, /* 16: Get help */ - IPSET_CMD_VERSION, /* 17: Get program version */ - IPSET_CMD_QUIT, /* 18: Quit from interactive mode */ + IPSET_CMD_RESTORE = IPSET_MSG_MAX, /* 14: Enter restore mode */ + IPSET_CMD_HELP, /* 15: Get help */ + IPSET_CMD_VERSION, /* 16: Get program version */ + IPSET_CMD_QUIT, /* 17: Quit from interactive mode */ IPSET_CMD_MAX, - IPSET_CMD_COMMIT = IPSET_CMD_MAX, /* 19: Commit buffered commands */ + IPSET_CMD_COMMIT = IPSET_CMD_MAX, /* 18: Commit buffered commands */ }; /* Attributes at command level */ diff --git a/lib/PROTOCOL b/lib/PROTOCOL index f48e87d..aa8fc64 100644 --- a/lib/PROTOCOL +++ b/lib/PROTOCOL @@ -4,7 +4,7 @@ req: msg: IPSET_CMD_PROTOCOL resp: attr: IPSET_ATTR_PROTOCOL (protocol max) IPSET_ATTR_PROTOCOL_MIN (protocol min, optional) -req: msg: IPSET_CMD_CREATE|MODIFY +req: msg: IPSET_CMD_CREATE attr: IPSET_ATTR_PROTOCOL IPSET_ATTR_SETNAME IPSET_ATTR_TYPENAME -- cgit v1.2.3