// =======================================================================
// Broadcast to Unicast Translator
// Listens for global broadcasts and fowards them directly to a given IP.
// -----------------------------------------------------------------------
// Copyright (C) 2007 Matt Razza
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published
// by the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// as well as the GNU Lesser General Public License along with this
// program.  If not, see <http://www.gnu.org/licenses/>.
// =======================================================================

How to Use
==========
First you'll need to set all the required variables (see "Help with 'set'").
Once you've done that just run the "start" command.

Note: This is to be run on the Windows machine only. It will not function
correctly under WINE.

Some application specific settings are listed below:
----------------------------------------------------

Command and Conqure 3 (Windows + WINE Network Play)-
	port					8086
	self					Your NETWORK IP (Windows)
	target					Their NETWORK IP (WINE/Linux)
	packetSize				476

Command List
============

help					Shows this list
about					Shows app about
set						Allows you to set varibles (see below)
add						Allows you to add settings (see below)
del						Allows you to delete settings (see below)
ls						Lists something
start					Starts the system
stop					Stops the system
exec					Exicutes commands from a file (file as argument; IN SAME DIR)
close					Closes the program

Help with "set"
===============
You need to set a few variables before the program will be able to
function as expected. The following varibles are listed below:

set self <ip> - Enter your own IP you'll be sending the broadcasts from
	this is important so that you don't send anyone elses broadcasts; if
	not set the program will reflect any broadcasts as it's own

set port <port> - Set the port with which to both listen for, and sent
	the broadcast/unicasts on (if you want different ports see the next two) -
	THE PORT MUST BE SET (both listen and target; this command sets both)
	
set listenPort <port> - Set the port with which to listen from/send the data
	from
	
set targetPort <targetIP> <port> - Set the port with which to send the data to

set packetSize <number of bytes> - Set the expect packet size; if not set program will default to 1kB MAX size and use standard winsock detection

set sendOverlap <0/1 BOOL> - Set if you should send overlap packets (send the user his broadcasts back; default false (not sending them back))

Help with "add"
===============
You NEED to have at least 1 target:

add target <ip> - Enter the IP of a new target to add to the array

Help with "delete"
==================
del target <ip> - Removes an IP from the array

Help with "ls"
==============
ls target - Lists all added targets

What's to Come
==============
-UDP Packet Editing support; make it look like the unicast comes from the broadcast sender.