UDP Broadcast Packet Forwarder

Click to download

This program listens for packets on a specified UDP broadcast. When a packet is received, it sends that packet to all interfaces on the local machine as though it originated from the original sender.

The primary purpose of this is to allow machines on the local network to reach processes which have been bound to a specific interface and as such do not receive broadcast packets.

One practical application is to run multiple Half-Life servers from the same machine, binding each process to a different interface (aliased or otherwise). By forwarding broadcast packets, the in-game Half-Life server browser can locate all running processes on the host.

 

INSTALL

make ; cp udp_broadcast_fw /some/where

 

USAGE

/some/where/udp_broadcast_fw udp-port

udp_broadcast_fw must be run as root in order to create the necessary raw socket

 

COMPATIBILITY

- I have tested this on Redhat 2.2.16 SMP; but it should work on all Linux 2.2.x systems.
- I have yet to try Linux 2.4.x; may require minor modifications
- FreeBSD compatibility seems unlikely given the somewhat system-specific nature of ioctl
- Other unices are somewhat irrelevant for this program's intended purpose

 

EXAMPLE

/some/where/udp_broadcast_fw 27015 # forward Half-Life broadcast packets

 

BUGS/CRITICISM/PATCHES/ETC

Web: http://www.serverquery.com/udp_broadcast_fw/
Email:

 

HISTORY

0.1.1 - 19 Feb 02
  • Moved fork() code to just before main loop; allows errors to appear

    0.1 - 18 Feb 02

  • Initial release

     

    LICENSE

    This code is made available under the GPL. Read COPYING for more info.

     

    This service may only be used from the AGN webservers