summaryrefslogtreecommitdiff
path: root/package/udp-broadcast-relay
diff options
context:
space:
mode:
Diffstat (limited to 'package/udp-broadcast-relay')
-rw-r--r--package/udp-broadcast-relay/Config.in12
-rw-r--r--package/udp-broadcast-relay/Makefile26
-rw-r--r--package/udp-broadcast-relay/ipkg/udp-broadcast-relay.control4
-rw-r--r--package/udp-broadcast-relay/patches/patch-main_c32
4 files changed, 74 insertions, 0 deletions
diff --git a/package/udp-broadcast-relay/Config.in b/package/udp-broadcast-relay/Config.in
new file mode 100644
index 000000000..9a729f14f
--- /dev/null
+++ b/package/udp-broadcast-relay/Config.in
@@ -0,0 +1,12 @@
+config ADK_PACKAGE_UDP_BROADCAST_RELAY
+ prompt "udp-broadcast-relay............... listens for packets on a specified UDP broadcast port."
+ tristate
+ default n
+ help
+ This program listens for packets on a specified UDP broadcast port. When a packet is received, it sends that packet to all specified interfaces but the one it came from as though it originated from the original sender.
+
+ The primary purpose of this is to allow games on machines on separated local networks (Ethernet, WLAN) that use udp broadcasts to find each other to do so.
+
+ It also works on ppp links, so you can log in from windows boxes (e.g. using pptp) and play LAN-based games together. Currently, you have to care about upcoming or downgoing interfaces yourself.
+
+ http://www.joachim-breitner.de/udp-broadcast-relay/
diff --git a/package/udp-broadcast-relay/Makefile b/package/udp-broadcast-relay/Makefile
new file mode 100644
index 000000000..75befbd9f
--- /dev/null
+++ b/package/udp-broadcast-relay/Makefile
@@ -0,0 +1,26 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= udp-broadcast-relay
+PKG_VERSION:= 0.3
+PKG_RELEASE:= 1
+PKG_MD5SUM:= a32f983b7063d6ac670e6b22be9b9d24
+
+MASTER_SITES:= http://www.joachim-breitner.de/udp-broadcast-relay/files/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,UDP_BROADCAST_RELAY,udp-broadcast-relay,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+do-build:
+ ${TARGET_CC} ${WRKBUILD}/main.c -o ${WRKBUILD}/${PKG_NAME}
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_UDP_BROADCAST_RELAY}/usr/sbin
+ ${INSTALL_BIN} ${WRKBUILD}/${PKG_NAME} ${IDIR_UDP_BROADCAST_RELAY}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/udp-broadcast-relay/ipkg/udp-broadcast-relay.control b/package/udp-broadcast-relay/ipkg/udp-broadcast-relay.control
new file mode 100644
index 000000000..f83247ac7
--- /dev/null
+++ b/package/udp-broadcast-relay/ipkg/udp-broadcast-relay.control
@@ -0,0 +1,4 @@
+Package: udp-broadcast-relay
+Priority: optional
+Section: net
+Description: This program listens for packets on a specified UDP broadcast port. When a packet is received, it sends that packet to all specified interfaces but the one it came from as though it originated from the original sender.
diff --git a/package/udp-broadcast-relay/patches/patch-main_c b/package/udp-broadcast-relay/patches/patch-main_c
new file mode 100644
index 000000000..f57fb0409
--- /dev/null
+++ b/package/udp-broadcast-relay/patches/patch-main_c
@@ -0,0 +1,32 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- udp-broadcast-relay-0.3.orig/main.c 2003-09-28 16:43:32.000000000 +0200
++++ udp-broadcast-relay-0.3/main.c 2008-10-15 16:04:02.000000000 +0200
+@@ -220,8 +220,8 @@ main(int argc,char **argv)
+ }
+
+ /* Save the address for later use */
+- bcopy( (struct sockaddr_in *)&reqbuf.ifr_addr,
+- &ifs[maxifs].dstaddr,
++ memcpy( &ifs[maxifs].dstaddr,
++ (struct sockaddr_in *)&reqbuf.ifr_addr,
+ sizeof(struct sockaddr_in) );
+
+ DPRINT("%s: %i / %s\n",
+@@ -349,7 +349,7 @@ main(int argc,char **argv)
+ DPRINT("From:\t\t%s:%d\n",inet_ntoa(rcv_addr.sin_addr),rcv_addr.sin_port);
+
+ /* copy sender's details into our datagram as the source addr */
+- bcopy(&(rcv_addr.sin_addr.s_addr),(gram+12),4);
++ memcpy((gram+12),&(rcv_addr.sin_addr.s_addr),4);
+ *(u_short*)(gram+20)=(u_short)rcv_addr.sin_port;
+
+ /* set the length of the packet */
+@@ -362,7 +362,7 @@ main(int argc,char **argv)
+ if (ifs[x].ifindex == rcv_ifindex) continue; /* no bounces, please */
+
+ /* Set destination addr ip - port is set already*/
+- bcopy(&(ifs[x].dstaddr.sin_addr.s_addr),(gram+16),4);
++ memcpy((gram+16),&(ifs[x].dstaddr.sin_addr.s_addr),4);
+
+ DPRINT ("Sent to %s:%d on interface %i\n",
+ inet_ntoa(ifs[x].dstaddr.sin_addr), /* dst ip */