Skip to contentSkip to conversation

Multiple IPs on iptables/ip6tables command line

DISCUSSION [email protected] 2 participants 2 messages Apr 13, 2009 netfilter

lore
Share & tools
lore
#0 lore raw

Sorry about the corrupt patch. Here's a second try, hopefully without spurious line breaks.

Michael

---
 include/xtables.h.in |    5 ++
 ip6tables.c          |   49 +++++++++-----
 iptables.c           |   42 +++++++++----
 xtables.c            |  177 ++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 243 insertions(+), 30 deletions(-)
include/xtables.h.in +5 -0
index a399f90..a2b5f31 100644
@@ -211,6 +211,7 @@ extern void xtables_init(void);
 extern void xtables_set_nfproto(uint8_t);
 extern void *xtables_calloc(size_t, size_t);
 extern void *xtables_malloc(size_t);
+extern void *xtables_realloc(void*, size_t);
 
 extern int xtables_insmod(const char *, const char *, bool);
 extern int xtables_load_ko(const char *, bool);
@@ -256,6 +257,8 @@ extern struct in_addr *xtables_numeric_to_ipaddr(const char *);
 extern struct in_addr *xtables_numeric_to_ipmask(const char *);
 extern void xtables_ipparse_any(const char *, struct in_addr **,
 	struct in_addr *, unsigned int *);
+extern void xtables_ipparse_multiple(const char *name, struct in_addr **addrpp,
+	struct in_addr **maskpp, unsigned int *naddrs);
 
 extern struct in6_addr *xtables_numeric_to_ip6addr(const char *);
 extern const char *xtables_ip6addr_to_numeric(const struct in6_addr *);
@@ -263,6 +266,8 @@ extern const char *xtables_ip6addr_to_anyname(const struct in6_addr *);
 extern const char *xtables_ip6mask_to_numeric(const struct in6_addr *);
 extern void xtables_ip6parse_any(const char *, struct in6_addr **,
 	struct in6_addr *, unsigned int *);
+extern void xtables_ip6parse_multiple(const char *name, struct in6_addr **addrpp,
+	struct in6_addr **maskpp, unsigned int *naddrs);
 
 /**
  * Print the specified value to standard output, quoting dangerous
ip6tables.c +31 -18

151 lines not on this page · raw message

iptables.c +30 -12

143 lines not on this page · raw message

xtables.c +177 -0

195 lines not on this page · raw message

Signature · 1 line
1.5.6.3
#1 lore raw
Quoted 2 lines · On Monday 2009-04-13 19:26, [email protected] wrote:

Sorry about the corrupt patch. Here's a second try, hopefully without spurious line breaks.

First thing - it works. Needs manpage update, sorev update, style, etc. I'll fix that.