diff options
Diffstat (limited to 'net/linuxigd')
-rw-r--r-- | net/linuxigd/Makefile | 27 | ||||
-rw-r--r-- | net/linuxigd/distinfo | 2 | ||||
-rw-r--r-- | net/linuxigd/files/linuxigd.in | 28 | ||||
-rw-r--r-- | net/linuxigd/files/patch-Makefile | 50 | ||||
-rw-r--r-- | net/linuxigd/files/patch-config.c | 133 | ||||
-rw-r--r-- | net/linuxigd/files/patch-etc__upnpd.conf | 58 | ||||
-rw-r--r-- | net/linuxigd/files/patch-gatedevice.c | 8 | ||||
-rw-r--r-- | net/linuxigd/files/patch-globals.h | 49 | ||||
-rw-r--r-- | net/linuxigd/files/patch-main.c | 58 | ||||
-rw-r--r-- | net/linuxigd/files/patch-pmlist.c | 148 | ||||
-rw-r--r-- | net/linuxigd/files/patch-util.c | 12 | ||||
-rw-r--r-- | net/linuxigd/pkg-descr | 6 | ||||
-rw-r--r-- | net/linuxigd/pkg-plist | 7 |
13 files changed, 0 insertions, 586 deletions
diff --git a/net/linuxigd/Makefile b/net/linuxigd/Makefile deleted file mode 100644 index 996a118b0212..000000000000 --- a/net/linuxigd/Makefile +++ /dev/null @@ -1,27 +0,0 @@ -# Created by: Yen-Ming Lee <leeym@leeym.com> -# $FreeBSD$ - -PORTNAME= linuxigd -PORTVERSION= 1.0 -PORTREVISION= 10 -CATEGORIES= net -MASTER_SITES= SF/linux-igd/linux-igd/${PORTNAME}-${PORTVERSION} - -MAINTAINER= ports@FreeBSD.org -COMMENT= Linux UPnP Internet Gateway Device - -DEPRECATED= Abandonware; use net/miniupnpd instead -EXPIRATION_DATE= 2019-05-08 - -LIB_DEPENDS= libupnp.so:devel/upnp - -USE_RC_SUBR= linuxigd -USES= gmake - -post-extract: - @${RM} ${WRKSRC}/iptc.? - -post-patch: - @${FIND} ${WRKSRC} -type f | ${XARGS} ${REINPLACE_CMD} -e "s|%%PREFIX%%|${PREFIX}|g" - -.include <bsd.port.mk> diff --git a/net/linuxigd/distinfo b/net/linuxigd/distinfo deleted file mode 100644 index f05b60c17ee2..000000000000 --- a/net/linuxigd/distinfo +++ /dev/null @@ -1,2 +0,0 @@ -SHA256 (linuxigd-1.0.tar.gz) = f6335273fd6bfad7fb32e94e36461e8b74f9523e7994bad8be9fac29bee9f4cd -SIZE (linuxigd-1.0.tar.gz) = 35396 diff --git a/net/linuxigd/files/linuxigd.in b/net/linuxigd/files/linuxigd.in deleted file mode 100644 index e9821a6b176a..000000000000 --- a/net/linuxigd/files/linuxigd.in +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh - -# PROVIDE: linuxigd -# REQUIRE: NETWORKING SERVERS -# KEYWORD: shutdown - -# -# Add the following lines to /etc/rc.conf to enable linuxigd: -# -# linuxigd_enable="YES" -# - -. /etc/rc.subr - -name=linuxigd -rcvar=linuxigd_enable - -load_rc_config $name - -command=%%PREFIX%%/sbin/upnpd -required_files="%%PREFIX%%/etc/linuxigd/gatedesc.xml %%PREFIX%%/etc/upnpd.conf" - -: ${linuxigd_enable="NO"} -: ${linuxigd_extif="fxp0"} -: ${linuxigd_intif="fxp1"} -: ${command_args="${linuxigd_extif} ${linuxigd_intif}"} - -run_rc_command "$1" diff --git a/net/linuxigd/files/patch-Makefile b/net/linuxigd/files/patch-Makefile deleted file mode 100644 index 8a60d51b9b7d..000000000000 --- a/net/linuxigd/files/patch-Makefile +++ /dev/null @@ -1,50 +0,0 @@ ---- Makefile.orig 2006-05-24 06:16:36.000000000 +0800 -+++ Makefile 2014-06-09 23:38:21.146264899 +0800 -@@ -1,25 +1,11 @@ --PREFIX=/usr --LIBUPNP_PREFIX=/usr --#LIBIPTC_PREFIX=/usr -+LIBUPNP_PREFIX=$(LOCALBASE) - --CC=gcc - INCLUDES= -I$(LIBUPNP_PREFIX)/include -I../include --LIBS= -lpthread -lupnp -lixml -lthreadutil -L$(LIBUPNP_PREFIX)/lib -L../libs -+LIBS= -lpthread -lupnp -lixml -lthreadutil -L$(LIBUPNP_PREFIX)/lib -L../libs - FILES= main.o gatedevice.o pmlist.o util.o config.o - - CFLAGS += -Wall -g -O2 - --ifdef HAVE_LIBIPTC --ifdef LIBIPTC_PREFIX --LIBS += -L$(LIBIPTC_PREFIX)/lib --INCLUDES += -I$(LIBIPTC_PREFIX)/include --endif -- --LIBS += -liptc --INCLUDES += -DHAVE_LIBIPTC --FILES += iptc.o --endif -- - all: upnpd - - upnpd: $(FILES) -@@ -33,11 +19,11 @@ clean: - rm -f *.o upnpd - - install: upnpd -- install -d /etc/linuxigd -- install etc/gatedesc.xml /etc/linuxigd -- install etc/gateconnSCPD.xml /etc/linuxigd -- install etc/gateicfgSCPD.xml /etc/linuxigd -- install etc/dummy.xml /etc/linuxigd -- install upnpd $(PREFIX)/sbin -- install upnpd.8 $(PREFIX)/share/man/man8 -- if [ ! -f /etc/upnpd.conf ]; then install etc/upnpd.conf /etc; fi -+ install -d $(DESTDIR)$(PREFIX)/etc/linuxigd -+ $(BSD_INSTALL_DATA) etc/gatedesc.xml $(DESTDIR)$(PREFIX)/etc/linuxigd -+ $(BSD_INSTALL_DATA) etc/gateconnSCPD.xml $(DESTDIR)$(PREFIX)/etc/linuxigd -+ $(BSD_INSTALL_DATA) etc/gateicfgSCPD.xml $(DESTDIR)$(PREFIX)/etc/linuxigd -+ $(BSD_INSTALL_DATA) etc/dummy.xml $(DESTDIR)$(PREFIX)/etc/linuxigd -+ $(BSD_INSTALL_PROGRAM) upnpd $(DESTDIR)$(PREFIX)/sbin -+ $(BSD_INSTALL_DATA) upnpd.8 $(DESTDIR)$(PREFIX)/man/man8 -+ $(BSD_INSTALL_DATA) etc/upnpd.conf $(DESTDIR)$(PREFIX)/etc/upnpd.conf.sample diff --git a/net/linuxigd/files/patch-config.c b/net/linuxigd/files/patch-config.c deleted file mode 100644 index a95bf31313ed..000000000000 --- a/net/linuxigd/files/patch-config.c +++ /dev/null @@ -1,133 +0,0 @@ ---- config.c.orig Sat Jun 16 20:37:40 2007 -+++ config.c Sat Jun 16 20:39:05 2007 -@@ -43,6 +43,12 @@ - return 0; - } - -+size_t strnlen(const char *s, size_t maxlen) -+{ -+ int len = strlen(s); -+ return (len < maxlen) ? len : maxlen; -+} -+ - int parseConfigFile(globals_p vars) - { - FILE *conf_file; -@@ -50,11 +56,8 @@ - - regex_t re_comment; - regex_t re_empty_row; -- regex_t re_iptables_location; -+ regex_t re_ipnat_location; - regex_t re_debug_mode; -- regex_t re_insert_forward_rules_yes; -- regex_t re_forward_chain_name; -- regex_t re_prerouting_chain_name; - regex_t re_upstream_bitrate; - regex_t re_downstream_bitrate; - regex_t re_duration; -@@ -63,10 +66,7 @@ - - // Make sure all vars are 0 or \0 terminated - vars->debug = 0; -- vars->forwardRules = 0; -- strcpy(vars->iptables,""); -- strcpy(vars->forwardChainName,""); -- strcpy(vars->preroutingChainName,""); -+ strcpy(vars->ipnat,""); - strcpy(vars->upstreamBitrate,""); - strcpy(vars->downstreamBitrate,""); - vars->duration = DEFAULT_DURATION; -@@ -78,14 +78,11 @@ - regcomp(&re_empty_row,"^[[:blank:]]*\r?\n$",REG_EXTENDED); - - // Regexps to match configuration file settings -- regcomp(&re_iptables_location,"iptables_location[[:blank:]]*=[[:blank:]]*\"([^\"]+)\"",REG_EXTENDED); -+ regcomp(&re_ipnat_location,"ipnat_location[[:blank:]]*=[[:blank:]]*\"([^\"]+)\"",REG_EXTENDED); - regcomp(&re_debug_mode,"debug_mode[[:blank:]]*=[[:blank:]]*([[:digit:]])",REG_EXTENDED); -- regcomp(&re_insert_forward_rules_yes,"insert_forward_rules[[:blank:]]*=[[:blank:]]*yes",REG_ICASE); -- regcomp(&re_forward_chain_name,"forward_chain_name[[:blank:]]*=[[:blank:]]*([[:alpha:]_-]+)",REG_EXTENDED); -- regcomp(&re_prerouting_chain_name,"prerouting_chain_name[[:blank:]]*=[[:blank:]]([[:alpha:]_-]+)",REG_EXTENDED); - regcomp(&re_upstream_bitrate,"upstream_bitrate[[:blank:]]*=[[:blank:]]*([[:digit:]]+)",REG_EXTENDED); - regcomp(&re_downstream_bitrate,"downstream_bitrate[[:blank:]]*=[[:blank:]]*([[:digit:]]+)",REG_EXTENDED); -- regcomp(&re_duration,"duration[[:blank:]]*=[[:blank:]]*(@?)([[:digit:]]+|[[:digit:]]+{2}:[[:digit:]]+{2})",REG_EXTENDED); -+ regcomp(&re_duration,"duration[[:blank:]]*=[[:blank:]]*(@?)([[:digit:]]+|[[:digit:]]{2}:[[:digit:]]{2})",REG_EXTENDED); - regcomp(&re_desc_doc,"description_document_name[[:blank:]]*=[[:blank:]]*([[:alpha:].]{1,20})",REG_EXTENDED); - regcomp(&re_xml_path,"xml_document_path[[:blank:]]*=[[:blank:]]*([[:alpha:]_/.]{1,50})",REG_EXTENDED); - -@@ -99,21 +96,10 @@ - if ( (0 != regexec(&re_comment,line,0,NULL,0) ) && - (0 != regexec(&re_empty_row,line,0,NULL,0)) ) - { -- // Chec if iptables_location -- if (regexec(&re_iptables_location,line,NMATCH,submatch,0) == 0) -- { -- getConfigOptionArgument(vars->iptables, PATH_LEN, line, submatch); -- } -- -- // Check is insert_forward_rules -- else if (regexec(&re_insert_forward_rules_yes,line,0,NULL,0) == 0) -- { -- vars->forwardRules = 1; -- } -- // Check forward_chain_name -- else if (regexec(&re_forward_chain_name,line,NMATCH,submatch,0) == 0) -+ // Chec if ipnat_location -+ if (regexec(&re_ipnat_location,line,NMATCH,submatch,0) == 0) - { -- getConfigOptionArgument(vars->forwardChainName, CHAIN_NAME_LEN, line, submatch); -+ getConfigOptionArgument(vars->ipnat, PATH_LEN, line, submatch); - } - else if (regexec(&re_debug_mode,line,NMATCH,submatch,0) == 0) - { -@@ -121,10 +107,6 @@ - getConfigOptionArgument(tmp,sizeof(tmp),line,submatch); - vars->debug = atoi(tmp); - } -- else if (regexec(&re_prerouting_chain_name,line,NMATCH,submatch,0) == 0) -- { -- getConfigOptionArgument(vars->preroutingChainName, CHAIN_NAME_LEN, line, submatch); -- } - else if (regexec(&re_upstream_bitrate,line,NMATCH,submatch,0) == 0) - { - getConfigOptionArgument(vars->upstreamBitrate, BITRATE_LEN, line, submatch); -@@ -156,27 +138,13 @@ - } - regfree(&re_comment); - regfree(&re_empty_row); -- regfree(&re_iptables_location); -+ regfree(&re_ipnat_location); - regfree(&re_debug_mode); -- regfree(&re_insert_forward_rules_yes); -- regfree(&re_forward_chain_name); -- regfree(&re_prerouting_chain_name); - regfree(&re_upstream_bitrate); - regfree(&re_downstream_bitrate); - regfree(&re_duration); - regfree(&re_desc_doc); - regfree(&re_xml_path); -- // Set default values for options not found in config file -- if (strnlen(vars->forwardChainName, CHAIN_NAME_LEN) == 0) -- { -- // No forward chain name was set in conf file, set it to default -- snprintf(vars->forwardChainName, CHAIN_NAME_LEN, IPTABLES_DEFAULT_FORWARD_CHAIN); -- } -- if (strnlen(vars->preroutingChainName, CHAIN_NAME_LEN) == 0) -- { -- // No prerouting chain name was set in conf file, set it to default -- snprintf(vars->preroutingChainName, CHAIN_NAME_LEN, IPTABLES_DEFAULT_PREROUTING_CHAIN); -- } - if (strnlen(vars->upstreamBitrate, BITRATE_LEN) == 0) - { - // No upstream_bitrate was found in the conf file, set it to default -@@ -195,8 +163,8 @@ - { - snprintf(vars->xmlPath, PATH_LEN, XML_PATH_DEFAULT); - } -- if (strnlen(vars->iptables, PATH_LEN) == 0) { -- // Can't find the iptables executable, return -1 to -+ if (strnlen(vars->ipnat, PATH_LEN) == 0) { -+ // Can't find the ipnat executable, return -1 to - // indicate en error - return -1; - } diff --git a/net/linuxigd/files/patch-etc__upnpd.conf b/net/linuxigd/files/patch-etc__upnpd.conf deleted file mode 100644 index c398a5fd4e5e..000000000000 --- a/net/linuxigd/files/patch-etc__upnpd.conf +++ /dev/null @@ -1,58 +0,0 @@ ---- etc/upnpd.conf.orig Thu Aug 17 02:19:30 2006 -+++ etc/upnpd.conf Sat Jun 16 19:57:09 2007 -@@ -2,10 +2,10 @@ - # /etc/sysconfig/upnpd - - # --# The full path and name of the iptables executable, -+# The full path and name of the ipnat executable, - # (enclosed in quotes). - # --iptables_location = "/sbin/iptables" -+ipnat_location = "/sbin/ipnat" - - # - # Daemon debug level. Messages are logged via syslog to debug. -@@ -17,29 +17,6 @@ - debug_mode = 2 - - # --# Should the daemon insert rules in the forward chain --# This is necessary if your firewall has a drop or reject --# policy in your forward chain. --# allowed values: yes,no --# default = no --insert_forward_rules = yes -- --# --# The name of the chain to put the forward rules in. --# This directive is only activ if "insert_forward_rules = yes" --# above. --# allowed values: a-z, A-Z, _, - --# default = FORWARD --# --forward_chain_name = FORWARD -- --# --# The name of the chain to put prerouting rules in. --# allowed values: a-z, A-Z, _, - --# default = PREROUTING --prerouting_chain_name = PREROUTING -- --# - # The internet line upstream bit rate reported from - # the daemon. Value in bits per second - # default = 0 -@@ -67,9 +44,9 @@ - - # The path to the xml documents - # Do not include the trailing "/" --# default = /etc/linuxigd -+# default = %%PREFIX%%/etc/linuxigd - # WARNING! The make install does put the xml files --# in /etc/linuxigd, if you change this variable -+# in %%PREFIX%%/etc/linuxigd, if you change this variable - # you have to make sure the xml docs are in the - # right place --xml_document_path = /etc/linuxigd -+xml_document_path = %%PREFIX%%/etc/linuxigd diff --git a/net/linuxigd/files/patch-gatedevice.c b/net/linuxigd/files/patch-gatedevice.c deleted file mode 100644 index 19a82fb2c00c..000000000000 --- a/net/linuxigd/files/patch-gatedevice.c +++ /dev/null @@ -1,8 +0,0 @@ ---- gatedevice.c.orig 2010-11-26 17:54:07.000000000 +0300 -+++ gatedevice.c 2010-11-26 17:55:02.000000000 +0300 -@@ -1,3 +1,5 @@ -+#include <stdio.h> -+#include <string.h> - #include <syslog.h> - #include <stdlib.h> - #include <upnp/ixml.h> diff --git a/net/linuxigd/files/patch-globals.h b/net/linuxigd/files/patch-globals.h deleted file mode 100644 index 030810467979..000000000000 --- a/net/linuxigd/files/patch-globals.h +++ /dev/null @@ -1,49 +0,0 @@ ---- globals.h.orig Mon Nov 13 01:14:11 2006 -+++ globals.h Sat Jun 16 19:53:23 2007 -@@ -1,6 +1,7 @@ - #ifndef _GLOBALS_H_ - #define _GLOBALS_H_ - -+#include <sys/socket.h> - #include <net/if.h> - - #define CHAIN_NAME_LEN 32 -@@ -17,17 +18,15 @@ - char extInterfaceName[IFNAMSIZ]; // The name of the external interface, picked up from the - // command line - char intInterfaceName[IFNAMSIZ]; // The name of the internal interface, picked from command line -+ char extIpAddress[16]; -+ char intIpAddress[16]; - -- // All vars below are read from /etc/upnpd.conf in main.c -+ // All vars below are read from %%PREFIX%%/etc/upnpd.conf in main.c - int debug; // 1 - print debug messages to syslog - // 0 - no debug messages -- char iptables[PATH_LEN]; // The full name and path of the iptables executable, used in pmlist.c -+ char ipnat[PATH_LEN]; // The full name and path of the ipnat executable, used in pmlist.c - char upstreamBitrate[BITRATE_LEN]; // The upstream bitrate reported by the daemon - char downstreamBitrate[BITRATE_LEN]; // The downstream bitrate reported by the daemon -- char forwardChainName[CHAIN_NAME_LEN]; // The name of the iptables chain to put FORWARD rules in -- char preroutingChainName[CHAIN_NAME_LEN]; // The name of the chain to put PREROUTING rules in -- int forwardRules; // 1 - forward rules are inserted -- // 0 - no forward rules inserted - long int duration; // 0 - no duration - // >0 - duration in seconds - // <0 - expiration time -@@ -38,14 +37,12 @@ - typedef struct GLOBALS* globals_p; - extern struct GLOBALS g_vars; - --#define CONF_FILE "/etc/upnpd.conf" -+#define CONF_FILE "%%PREFIX%%/etc/upnpd.conf" - #define MAX_CONFIG_LINE 256 --#define IPTABLES_DEFAULT_FORWARD_CHAIN "FORWARD" --#define IPTABLES_DEFAULT_PREROUTING_CHAIN "PREROUTING" - #define DEFAULT_DURATION 0 - #define DEFAULT_UPSTREAM_BITRATE "0" - #define DEFAULT_DOWNSTREAM_BITRATE "0" - #define DESC_DOC_DEFAULT "gatedesc.xml" --#define XML_PATH_DEFAULT "/etc/linuxigd" -+#define XML_PATH_DEFAULT "%%PREFIX%%/etc/linuxigd" - - #endif // _GLOBALS_H_ diff --git a/net/linuxigd/files/patch-main.c b/net/linuxigd/files/patch-main.c deleted file mode 100644 index a02f447903ed..000000000000 --- a/net/linuxigd/files/patch-main.c +++ /dev/null @@ -1,58 +0,0 @@ ---- main.c.orig 2010-11-26 17:45:26.000000000 +0300 -+++ main.c 2010-11-26 17:47:46.000000000 +0300 -@@ -1,13 +1,16 @@ - #include <stdio.h> - #include <stdlib.h> -+#include <string.h> - #include <unistd.h> - #include <syslog.h> -+#include <pthread.h> - #include <signal.h> - #include <sys/types.h> - #include <unistd.h> - #include <sys/stat.h> - #include <sys/resource.h> - #include <time.h> -+#include <sys/socket.h> - #include <net/if.h> - #include <upnp/upnp.h> - #include "globals.h" -@@ -22,7 +25,6 @@ - int main (int argc, char** argv) - { - char descDocUrl[7+15+1+5+1+sizeof(g_vars.descDocName)+1]; // http://ipaddr:port/docName<null> -- char intIpAddress[16]; // Server internal ip address - sigset_t sigsToCatch; - int ret, signum, arg = 1, foreground = 0; - -@@ -46,11 +48,17 @@ - strncpy(g_vars.intInterfaceName, argv[arg++], IFNAMSIZ); - - // Get the internal ip address to start the daemon on -- if (GetIpAddressStr(intIpAddress, g_vars.intInterfaceName) == 0) { -+ if (GetIpAddressStr(g_vars.intIpAddress, g_vars.intInterfaceName) == 0) { - fprintf(stderr, "Invalid internal interface name '%s'\n", g_vars.intInterfaceName); - exit(EXIT_FAILURE); - } - -+ // Get the external ip address to start the daemon on -+ if (GetIpAddressStr(g_vars.extIpAddress, g_vars.extInterfaceName) == 0) { -+ fprintf(stderr, "Invalid external interface name '%s'\n", g_vars.extInterfaceName); -+ exit(EXIT_FAILURE); -+ } -+ - if (!foreground) { - struct rlimit resourceLimit = { 0, 0 }; - pid_t pid, sid; -@@ -114,9 +122,9 @@ - - // Initialize UPnP SDK on the internal Interface - trace(3, "Initializing UPnP SDK ... "); -- if ( (ret = UpnpInit(intIpAddress,0) ) != UPNP_E_SUCCESS) -+ if ( (ret = UpnpInit(g_vars.intIpAddress,0) ) != UPNP_E_SUCCESS) - { -- syslog (LOG_ERR, "Error Initializing UPnP SDK on IP %s ",intIpAddress); -+ syslog (LOG_ERR, "Error Initializing UPnP SDK on IP %s ",g_vars.intIpAddress); - syslog (LOG_ERR, " UpnpInit returned %d", ret); - UpnpFinish(); - exit(1); diff --git a/net/linuxigd/files/patch-pmlist.c b/net/linuxigd/files/patch-pmlist.c deleted file mode 100644 index 8a61b70c33d9..000000000000 --- a/net/linuxigd/files/patch-pmlist.c +++ /dev/null @@ -1,148 +0,0 @@ ---- pmlist.c.orig 2010-11-26 17:45:26.000000000 +0300 -+++ pmlist.c 2010-11-26 17:49:30.000000000 +0300 -@@ -1,3 +1,5 @@ -+#include <stdio.h> -+#include <string.h> - #include <stdlib.h> - #include <sys/wait.h> - #include <unistd.h> -@@ -8,10 +10,6 @@ - #include "gatedevice.h" - #include "util.h" - --#if HAVE_LIBIPTC --#include "iptc.h" --#endif -- - struct portMap* pmlist_NewNode(int enabled, long int duration, char *remoteHost, - char *externalPort, char *internalPort, - char *protocol, char *internalClient, char *desc) -@@ -233,55 +231,18 @@ - { - if (enabled) - { --#if HAVE_LIBIPTC -- char *buffer = malloc(strlen(internalClient) + strlen(internalPort) + 2); -- if (buffer == NULL) { -- fprintf(stderr, "failed to malloc memory\n"); -- return 0; -- } -- -- strcpy(buffer, internalClient); -- strcat(buffer, ":"); -- strcat(buffer, internalPort); -- -- if (g_vars.forwardRules) -- iptc_add_rule("filter", g_vars.forwardChainName, protocol, NULL, NULL, NULL, internalClient, NULL, internalPort, "ACCEPT", NULL, FALSE); -- -- iptc_add_rule("nat", g_vars.preroutingChainName, protocol, g_vars.extInterfaceName, NULL, NULL, NULL, NULL, externalPort, "DNAT", buffer, TRUE); -- free(buffer); --#else - char command[COMMAND_LEN]; -- int status; - -- { -- char dest[DEST_LEN]; -- char *args[] = {"iptables", "-t", "nat", "-I", g_vars.preroutingChainName, "-i", g_vars.extInterfaceName, "-p", protocol, "--dport", externalPort, "-j", "DNAT", "--to", dest, NULL}; -- -- snprintf(dest, DEST_LEN, "%s:%s", internalClient, internalPort); -- snprintf(command, COMMAND_LEN, "%s -t nat -I %s -i %s -p %s --dport %s -j DNAT --to %s:%s", g_vars.iptables, g_vars.preroutingChainName, g_vars.extInterfaceName, protocol, externalPort, internalClient, internalPort); -- trace(3, "%s", command); -- if (!fork()) { -- int rc = execv(g_vars.iptables, args); -- exit(rc); -- } else { -- wait(&status); -- } -- } -- -- if (g_vars.forwardRules) -- { -- char *args[] = {"iptables", "-A", g_vars.forwardChainName, "-p", protocol, "-d", internalClient, "--dport", internalPort, "-j", "ACCEPT", NULL}; -- -- snprintf(command, COMMAND_LEN, "%s -A %s -p %s -d %s --dport %s -j ACCEPT", g_vars.iptables,g_vars.forwardChainName, protocol, internalClient, internalPort); -- trace(3, "%s", command); -- if (!fork()) { -- int rc = execv(g_vars.iptables, args); -- exit(rc); -- } else { -- wait(&status); -- } -- } --#endif -+ FILE *ipnat = popen("/sbin/ipnat -f -", "w"); -+ sprintf(command, "rdr %s %s/32 port %s -> %s port %s %s\n", -+ g_vars.extInterfaceName, g_vars.extIpAddress, externalPort, internalClient, internalPort, protocol); -+ trace(3, "%s", command); -+ fprintf(ipnat, command); -+ sprintf(command, "rdr lo0 %s/32 port %s -> %s port %s %s\n", -+ g_vars.extIpAddress, externalPort, internalClient, internalPort, protocol); -+ trace(3, "%s", command); -+ fprintf(ipnat, command); -+ pclose(ipnat); - } - return 1; - } -@@ -290,52 +251,18 @@ - { - if (enabled) - { --#if HAVE_LIBIPTC -- char *buffer = malloc(strlen(internalClient) + strlen(internalPort) + 2); -- strcpy(buffer, internalClient); -- strcat(buffer, ":"); -- strcat(buffer, internalPort); -- -- if (g_vars.forwardRules) -- iptc_delete_rule("filter", g_vars.forwardChainName, protocol, NULL, NULL, NULL, internalClient, NULL, internalPort, "ACCEPT", NULL); -- -- iptc_delete_rule("nat", g_vars.preroutingChainName, protocol, g_vars.extInterfaceName, NULL, NULL, NULL, NULL, externalPort, "DNAT", buffer); -- free(buffer); --#else - char command[COMMAND_LEN]; -- int status; - -- { -- char dest[DEST_LEN]; -- char *args[] = {"iptables", "-t", "nat", "-D", g_vars.preroutingChainName, "-i", g_vars.extInterfaceName, "-p", protocol, "--dport", externalPort, "-j", "DNAT", "--to", dest, NULL}; -- -- snprintf(dest, DEST_LEN, "%s:%s", internalClient, internalPort); -- snprintf(command, COMMAND_LEN, "%s -t nat -D %s -i %s -p %s --dport %s -j DNAT --to %s:%s", -- g_vars.iptables, g_vars.preroutingChainName, g_vars.extInterfaceName, protocol, externalPort, internalClient, internalPort); -- trace(3, "%s", command); -- -- if (!fork()) { -- int rc = execv(g_vars.iptables, args); -- exit(rc); -- } else { -- wait(&status); -- } -- } -- -- if (g_vars.forwardRules) -- { -- char *args[] = {"iptables", "-D", g_vars.forwardChainName, "-p", protocol, "-d", internalClient, "--dport", internalPort, "-j", "ACCEPT", NULL}; -- -- snprintf(command, COMMAND_LEN, "%s -D %s -p %s -d %s --dport %s -j ACCEPT", g_vars.iptables, g_vars.forwardChainName, protocol, internalClient, internalPort); -- trace(3, "%s", command); -- if (!fork()) { -- int rc = execv(g_vars.iptables, args); -- exit(rc); -- } else { -- wait(&status); -- } -- } --#endif -+ FILE *ipnat = popen("/sbin/ipnat -rf -", "w"); -+ sprintf(command, "rdr %s %s/32 port %s -> %s port %s %s\n", -+ g_vars.extInterfaceName, g_vars.extIpAddress, externalPort, internalClient, internalPort, protocol); -+ trace(3, "%s", command); -+ fprintf(ipnat, command); -+ sprintf(command, "rdr lo0 %s/32 port %s -> %s port %s %s\n", -+ g_vars.extIpAddress, externalPort, internalClient, internalPort, protocol); -+ trace(3, "%s", command); -+ fprintf(ipnat, command); -+ pclose(ipnat); - } - return 1; - } diff --git a/net/linuxigd/files/patch-util.c b/net/linuxigd/files/patch-util.c deleted file mode 100644 index 0c5f4aa5e319..000000000000 --- a/net/linuxigd/files/patch-util.c +++ /dev/null @@ -1,12 +0,0 @@ ---- util.c.orig Sat Jun 16 09:29:31 2007 -+++ util.c Sat Jun 16 09:29:38 2007 -@@ -3,7 +3,8 @@ - #include <stdarg.h> - #include <syslog.h> - #include <arpa/inet.h> --#include <linux/sockios.h> -+#include <sys/sockio.h> -+#include <sys/socket.h> - #include <net/if.h> - #include <netinet/in.h> - #include <sys/ioctl.h> diff --git a/net/linuxigd/pkg-descr b/net/linuxigd/pkg-descr deleted file mode 100644 index 603dda2ea962..000000000000 --- a/net/linuxigd/pkg-descr +++ /dev/null @@ -1,6 +0,0 @@ -This project is a daemon that emulates Microsoft's Internet Connection -Service (ICS). It implements the UPnP Internet Gateway Device specification -(IGD) and allows UPnP aware clients, such as MSN Messenger to work properly -from behind a NAT firewall. - -WWW: http://linux-igd.sourceforge.net/ diff --git a/net/linuxigd/pkg-plist b/net/linuxigd/pkg-plist deleted file mode 100644 index 54a78b35c560..000000000000 --- a/net/linuxigd/pkg-plist +++ /dev/null @@ -1,7 +0,0 @@ -etc/linuxigd/dummy.xml -etc/linuxigd/gateconnSCPD.xml -etc/linuxigd/gatedesc.xml -etc/linuxigd/gateicfgSCPD.xml -@sample etc/upnpd.conf.sample -man/man8/upnpd.8.gz -sbin/upnpd |