aboutsummaryrefslogtreecommitdiffstats
path: root/net/linuxigd/files
diff options
context:
space:
mode:
authorclive <clive@FreeBSD.org>2002-08-04 15:37:39 +0800
committerclive <clive@FreeBSD.org>2002-08-04 15:37:39 +0800
commit6e1e61b49ebcd5550a2a33f74949ae9fb013ccf3 (patch)
treebcb9ca8fd0dfae86038446b7a1e16e23d7411753 /net/linuxigd/files
parent984dd4b6d58c7e44ceed576c9693ab7cefe1bdc3 (diff)
downloadfreebsd-ports-gnome-6e1e61b49ebcd5550a2a33f74949ae9fb013ccf3.tar.gz
freebsd-ports-gnome-6e1e61b49ebcd5550a2a33f74949ae9fb013ccf3.tar.zst
freebsd-ports-gnome-6e1e61b49ebcd5550a2a33f74949ae9fb013ccf3.zip
New port: linuxigd, Linux UPnP Internet Gateway Device.
This project is a deamon 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. PR: ports/41295 Submitted by: Yen-Ming Lee <leeym@utopia.leeym.com> Submitter sponsored by: Miss WeiWei.
Diffstat (limited to 'net/linuxigd/files')
-rw-r--r--net/linuxigd/files/linuxigd.sh.sample25
-rw-r--r--net/linuxigd/files/patch-Makefile22
-rw-r--r--net/linuxigd/files/patch-gateway.cpp18
-rw-r--r--net/linuxigd/files/patch-gateway.h11
-rw-r--r--net/linuxigd/files/patch-ipcon.cpp12
-rw-r--r--net/linuxigd/files/patch-pmlist.cpp45
6 files changed, 133 insertions, 0 deletions
diff --git a/net/linuxigd/files/linuxigd.sh.sample b/net/linuxigd/files/linuxigd.sh.sample
new file mode 100644
index 000000000000..280bb66cf6ac
--- /dev/null
+++ b/net/linuxigd/files/linuxigd.sh.sample
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+EXT_IF=fxp0 # external interface
+INT_IF=fxp1 # internal interface
+
+if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
+ echo "$0: Cannot determine the PREFIX" >&2
+ exit 1
+fi
+
+case "$1" in
+start)
+ if [ -x ${PREFIX}/bin/upnpd ]; then
+ ${PREFIX}/bin/upnpd ${EXT_IF} ${INT_IF} && echo -n ' upnpd'
+ fi
+ ;;
+stop)
+ killall upnpd && echo -n ' upnpd'
+ ;;
+*)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
+
+exit 0
diff --git a/net/linuxigd/files/patch-Makefile b/net/linuxigd/files/patch-Makefile
new file mode 100644
index 000000000000..d2297bebb078
--- /dev/null
+++ b/net/linuxigd/files/patch-Makefile
@@ -0,0 +1,22 @@
+--- Makefile.orig Thu May 2 23:53:12 2002
++++ Makefile Sat Aug 3 22:10:53 2002
+@@ -1,6 +1,6 @@
+ CC=g++
+-INCLUDES= -I/usr/include/upnp
+-LIBS= -lpthread /usr/lib/libupnp.so
++INCLUDES= -I$(PREFIX)/include
++LIBS= $(PTHREAD_LIBS) $(PREFIX)/lib/libupnp.so
+
+
+ ifeq ($(DEBUG),1)
+@@ -26,7 +26,7 @@
+ rm -f *.o $(APPS)
+
+ install: upnpd
+- @install -d /etc/linuxigd
+- @install etc/* /etc/linuxigd
+- @install upnpd /usr/bin
++ @install -d $(PREFIX)/etc/linuxigd
++ @$(BSD_INSTALL_DATA) etc/* $(PREFIX)/etc/linuxigd
++ @$(BSD_INSTALL_PROGRAM) upnpd $(PREFIX)/bin
+
diff --git a/net/linuxigd/files/patch-gateway.cpp b/net/linuxigd/files/patch-gateway.cpp
new file mode 100644
index 000000000000..ce5f1109014d
--- /dev/null
+++ b/net/linuxigd/files/patch-gateway.cpp
@@ -0,0 +1,18 @@
+--- gateway.cpp.orig Sat May 18 05:11:23 2002
++++ gateway.cpp Sat Aug 3 22:10:54 2002
+@@ -49,6 +49,7 @@
+
+ // The global GATE object
+ Gate gate;
++char *ExtIf;
+
+ // Callback Function wrapper. This is needed because ISO forbids a pointer to a bound
+ // member function. This corrects the issue.
+@@ -140,6 +141,7 @@
+ UpnpFinish();
+ exit(1);
+ }
++ ExtIf = argv[1];
+ gate.m_ipcon = new IPCon(argv[1]);
+ syslog(LOG_DEBUG, "Registering the root device\n");
+ if ((ret = UpnpRegisterRootDevice(desc_doc_url, GateDeviceCallbackEventHandler,
diff --git a/net/linuxigd/files/patch-gateway.h b/net/linuxigd/files/patch-gateway.h
new file mode 100644
index 000000000000..eccea7967c0d
--- /dev/null
+++ b/net/linuxigd/files/patch-gateway.h
@@ -0,0 +1,11 @@
+--- gateway.h.orig Fri May 3 00:14:57 2002
++++ gateway.h Sat Aug 3 22:10:54 2002
+@@ -28,7 +28,7 @@
+
+ #define INIT_PORT 2869
+ #define INIT_DESC_DOC "gatedesc"
+-#define INIT_CONF_DIR "/etc/linuxigd/"
++#define INIT_CONF_DIR "%%PREFIX%%/etc/linuxigd/"
+
+ #define GATE_SERVICE_SERVCOUNT 3
+ #define GATE_SERVICE_OSINFO 0
diff --git a/net/linuxigd/files/patch-ipcon.cpp b/net/linuxigd/files/patch-ipcon.cpp
new file mode 100644
index 000000000000..1a0fd8d5da31
--- /dev/null
+++ b/net/linuxigd/files/patch-ipcon.cpp
@@ -0,0 +1,12 @@
+--- ipcon.cpp.orig Wed May 15 23:48:24 2002
++++ ipcon.cpp Sat Aug 3 22:10:54 2002
+@@ -25,7 +25,8 @@
+ #include <stdio.h>
+ #include <unistd.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/files/patch-pmlist.cpp b/net/linuxigd/files/patch-pmlist.cpp
new file mode 100644
index 000000000000..b0301c18f168
--- /dev/null
+++ b/net/linuxigd/files/patch-pmlist.cpp
@@ -0,0 +1,45 @@
+--- pmlist.cpp.orig Fri May 3 00:16:28 2002
++++ pmlist.cpp Sat Aug 3 22:11:41 2002
+@@ -30,6 +30,9 @@
+ #include <stdlib.h>
+ #include <unistd.h>
+ #include <iostream.h>
++
++extern char *ExtIf;
++
+ PortMapList::PortMapList()
+ {
+
+@@ -190,9 +193,12 @@
+ else
+ strcpy (prt, "udp");
+
+- sprintf(command,"/usr/sbin/iptables -t nat -A PREROUTING -p %s -d %s --dport %d -j DNAT --to %s:%d", prt, ExtIP, ExtPort, IntIP, IntPort);
+-
+- system(command);
++ FILE *ipnat = popen("/sbin/ipnat -f -", "w");
++ if (ipnat == NULL)
++ return 0;
++ sprintf(command, "rdr %s %s/32 port %d -> %s port %d %s", ExtIf, ExtIP, ExtPort, IntIP, IntPort, prt);
++ fprintf(ipnat, command);
++ pclose(ipnat);
+
+ ret=1;
+ return (ret);
+@@ -234,9 +240,13 @@
+ else
+ strcpy (prt, "udp");
+
+- sprintf(command, "/usr/sbin/iptables -t nat -D PREROUTING -p %s -d %s --dport %d -j DNAT --to %s:%d", prt, ExtIP, ExtPort, IntIP, IntPort);
+-
+- system(command);
++ FILE *ipnat = popen("/sbin/ipnat -rf -", "w");
++ if (ipnat == NULL)
++ return 0;
++ sprintf(command, "rdr %s %s/32 port %d -> %s port %d %s", ExtIf, ExtIP, ExtPort, IntIP, IntPort, prt);
++ fprintf(ipnat, command);
++ pclose(ipnat);
++
+ ret = 1;
+
+ return (ret);