74 lines
2.0 KiB
Diff
74 lines
2.0 KiB
Diff
|
diff -urN linuxigd-1.0/iptc.c linuxigd-1.0.new/iptc.c
|
||
|
--- linuxigd-1.0/iptc.c 2006-09-11 17:55:48.000000000 +0200
|
||
|
+++ linuxigd-1.0.new/iptc.c 2007-06-02 12:24:34.000000000 +0200
|
||
|
@@ -22,9 +22,9 @@
|
||
|
struct ipt_entry_match *get_udp_match(const char *sports, const char *dports, unsigned int *nfcache);
|
||
|
struct ipt_entry_target *get_dnat_target(const char *input, unsigned int *nfcache);
|
||
|
|
||
|
-static u_int16_t parse_port(const char *port);
|
||
|
-static void parse_ports(const char *portstring, u_int16_t *ports);
|
||
|
-static int service_to_port(const char *name);
|
||
|
+static u_int16_t igd_parse_port(const char *port);
|
||
|
+void parse_ports(const char *portstring, u_int16_t *ports);
|
||
|
+static int igd_service_to_port(const char *name);
|
||
|
|
||
|
static void parse_range(const char *input, struct ip_nat_range *range);
|
||
|
static struct ipt_natinfo *append_range(struct ipt_natinfo *info, const struct ip_nat_range *range);
|
||
|
@@ -336,13 +336,12 @@
|
||
|
}
|
||
|
|
||
|
/* Copied and modified from libipt_tcp.c and libipt_udp.c */
|
||
|
-
|
||
|
static u_int16_t
|
||
|
-parse_port(const char *port)
|
||
|
+igd_parse_port(const char *port)
|
||
|
{
|
||
|
unsigned int portnum;
|
||
|
|
||
|
- if ((portnum = service_to_port(port)) != -1) {
|
||
|
+ if ((portnum = igd_service_to_port(port)) != -1) {
|
||
|
return (u_int16_t)portnum;
|
||
|
}
|
||
|
else {
|
||
|
@@ -350,7 +349,7 @@
|
||
|
}
|
||
|
}
|
||
|
|
||
|
-static void
|
||
|
+void
|
||
|
parse_ports(const char *portstring, u_int16_t *ports)
|
||
|
{
|
||
|
char *buffer;
|
||
|
@@ -358,19 +357,18 @@
|
||
|
|
||
|
buffer = strdup(portstring);
|
||
|
if ((cp = strchr(buffer, ':')) == NULL)
|
||
|
- ports[0] = ports[1] = parse_port(buffer);
|
||
|
+ ports[0] = ports[1] = igd_parse_port(buffer);
|
||
|
else {
|
||
|
*cp = '\0';
|
||
|
cp++;
|
||
|
|
||
|
- ports[0] = buffer[0] ? parse_port(buffer) : 0;
|
||
|
- ports[1] = cp[0] ? parse_port(cp) : 0xFFFF;
|
||
|
+ ports[0] = buffer[0] ? igd_parse_port(buffer) : 0;
|
||
|
+ ports[1] = cp[0] ? igd_parse_port(cp) : 0xFFFF;
|
||
|
}
|
||
|
free(buffer);
|
||
|
}
|
||
|
-
|
||
|
static int
|
||
|
-service_to_port(const char *name)
|
||
|
+igd_service_to_port(const char *name)
|
||
|
{
|
||
|
struct servent *service;
|
||
|
|
||
|
@@ -382,7 +380,6 @@
|
||
|
|
||
|
|
||
|
|
||
|
-
|
||
|
/* Copied and modified from libipt_DNAT.c */
|
||
|
|
||
|
static void
|