summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6a15196)
raw | patch | inline | side by side (parent: 6a15196)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sat, 2 May 2009 07:37:20 +0000 (09:37 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sat, 2 May 2009 07:37:20 +0000 (09:37 +0200) |
src/iptables.c | patch | blob | history |
diff --git a/src/iptables.c b/src/iptables.c
index c8542a5f78b2378a6a61842bf0ab34da9bb46e91..fb887da6ed28d4f01703ca3f93ffa7e7faba9fad 100644 (file)
--- a/src/iptables.c
+++ b/src/iptables.c
/*
Each table/chain combo that will be queried goes into this list
*/
+
+enum protocol_version_e
+{
+ IPV4,
+ IPV6
+};
+typedef enum protocol_version_e protocol_version_t;
+
#ifndef XT_TABLE_MAXNAMELEN
# define XT_TABLE_MAXNAMELEN 32
#endif
typedef struct {
- enum
- {
- IPV4,
- IPV6
- } ip_version;
+ protocol_version_t ip_version;
char table[XT_TABLE_MAXNAMELEN];
char chain[XT_TABLE_MAXNAMELEN];
union
static int iptables_config (const char *key, const char *value)
{
/* int ip_value; */
- enum { IPV4, IPV6 } ip_protocol;
+ protocol_version_t ip_version;
if (strcasecmp (key, "Chain") == 0)
- ip_protocol = IPV4;
+ ip_version = IPV4;
else if (strcasecmp (key, "Chain6") == 0)
- ip_protocol = IPV6;
+ ip_version = IPV6;
- if (( ip_protocol == IPV4 ) || ( ip_protocol == IPV6 ))
+ if (( ip_version == IPV4 ) || ( ip_version == IPV6 ))
{
ip_chain_t temp, *final, **list;
char *table;
*/
/* set IPv4 or IPv6 */
- temp.ip_version = ip_protocol;
+ temp.ip_version = ip_version;
/* Chain <table> <chain> [<comment|num> [name]] */
fields_num = strsplit (value_copy, fields, 4);