summaryrefslogtreecommitdiffstats
path: root/src/errcode.c
diff options
context:
space:
mode:
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2010-10-24 21:42:48 +0200
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2010-10-24 21:42:48 +0200
commit0d32c5c070f817229110f92d7b31df9a3e4eeec5 (patch)
tree5ee04a9e03de32d2029ad0d708811e382ca922d1 /src/errcode.c
parent62a3d29539aa109fed1c8a20d63ef95948b13842 (diff)
Fixes, cleanups, commentsv5.0-pre8
- More comments added to the code - ICMP and ICMPv6 support added to the hash:ip,port, hash:ip,port,ip and hash:ip,port,net types - hash:net and hash:ip,port,net types are reworked - hash:net,port type added - Wrong direction parameters fixed in hash:ip,port - Helps and manpage are updated - More tests added - Ugly macros are rewritten to functions in parse.c (Holger Eitzenberger) - resize related bug in hash types fixed (Holger Eitzenberger) - autoreconf patches by Jan Engelhardt applied - netlink patch minimalized: dumping can be initialized by a second parsing of the message (thanks to David and Patrick for the suggestion) - IPv4/IPv6 address attributes are introduced in order to fix the context (suggested by David)
Diffstat (limited to 'src/errcode.c')
-rw-r--r--src/errcode.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/errcode.c b/src/errcode.c
index ae0d8c8..313c500 100644
--- a/src/errcode.c
+++ b/src/errcode.c
@@ -32,7 +32,8 @@ static const struct ipset_errcode_table core_errcode_table[] = {
{ IPSET_ERR_FIND_TYPE, 0,
"Kernel error received: set type does not supported" },
{ IPSET_ERR_MAX_SETS, 0,
- "Kernel error received: maximal number of sets reached, cannot create more." },
+ "Kernel error received: maximal number of sets reached, "
+ "cannot create more." },
{ IPSET_ERR_INVALID_NETMASK, 0,
"The value of the netmask parameter is invalid" },
{ IPSET_ERR_INVALID_FAMILY, 0,
@@ -63,6 +64,10 @@ static const struct ipset_errcode_table core_errcode_table[] = {
"The value of the CIDR parameter of the IP address is invalid" },
{ IPSET_ERR_TIMEOUT, 0,
"Timeout cannot be used: set was created without timeout support" },
+ { IPSET_ERR_IPADDR_IPV4, 0,
+ "An IPv4 address is expected, but not received" },
+ { IPSET_ERR_IPADDR_IPV6, 0,
+ "An IPv6 address is expected, but not received" },
/* ADD specific error codes */
{ IPSET_ERR_EXIST, IPSET_CMD_ADD,
@@ -119,23 +124,25 @@ static const struct ipset_errcode_table list_errcode_table[] = {
{ IPSET_ERR_BEFORE, 0,
"No reference set specified." },
{ IPSET_ERR_NAMEREF, 0,
- "The set to which you referred with 'before' or 'after' does not exist." },
+ "The set to which you referred with 'before' or 'after' "
+ "does not exist." },
{ IPSET_ERR_LIST_FULL, 0,
"The set is full, more elements cannot be added." },
{ IPSET_ERR_REF_EXIST, 0,
- "The set to which you referred with 'before' or 'after' is not added to the set." },
+ "The set to which you referred with 'before' or 'after' "
+ "is not added to the set." },
{ },
};
#define MATCH_TYPENAME(a, b) STRNEQ(a, b, strlen(b))
/**
- * ipset_errcode - interpret an error code
+ * ipset_errcode - interpret a kernel error code
* @session: session structure
* @errcode: errcode
*
* Find the error code and print the appropriate
- * error message.
+ * error message into the error buffer.
*
* Returns -1.
*/
@@ -182,5 +189,6 @@ retry:
strerror(errcode));
else
return ipset_err(session,
- "Undecoded error %u received from kernel", errcode);
+ "Undecoded error %u received from kernel",
+ errcode);
}