
Summary:
 upnp-test.c is a first attempt at a slimmed-down UPnP implementation that
 does not require a full featured XML parser or extra libraries.  It is our 
 goal to be light-weight, and eventually get accepted into the main Gaim 
 source tree.

 One option was to use libupnp (http://sourceforge.net/projects/upnp/) which
 was developed originally by Intel.  It appears to need C++ to get the XML
 parsers, but would be a good solution if we wanted to have an optional
 dependancy.  There is also the linux-igd project, which builds upon the
 libupnp infrastructure.

 Much of the work done for this UPnP implementation was based off the
 documentation from Zac Bowling. (http://www.polystimulus.com/UPnP_Support.eml)
 Thanks Zac!

Usage:
 upnp-test

Example Output:
tcarlson@zappa:~/prog/upnp-gaim$ ./upnp-test
sent 92 bytes to 239.255.255.250:1900
sent 92 bytes to 239.255.255.250:1900
upnp_listen: Recieved 250 bytes from 192.168.0.1:1900
upnp_listen: Recieved 268 bytes from 192.168.0.1:1900
upnp_listen: Recieved 322 bytes from 192.168.0.1:1900
upnp_listen: Recieved 322 bytes from 192.168.0.1:1900
upnp_listen: Recieved 322 bytes from 192.168.0.1:1900
upnp_listen: Recieved 322 bytes from 192.168.0.1:1900
upnp_listen: Recieved 322 bytes from 192.168.0.1:1900
upnp_listen: Recieved 322 bytes from 192.168.0.1:1900
upnp_listen: Recieved 322 bytes from 192.168.0.1:1900
upnp_listen: Recieved 322 bytes from 192.168.0.1:1900
find_igd_loc: for schemas-upnp-org:service:WANIPConnection:1 found http://192.168.0.1:5678/igd.xml.
parse_xml: Found it: [/WANIPConnection]
request_add_server: found host: [192.168.0.1]
request_add_server: found port: [5678]
new_body(len=598):
<s:Envelope
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:AddPortMapping
xmlns:u="urn:schemas-upnp-org:service:WANIPConnection:1">
<NewRemoteHost></NewRemoteHost>
<NewExternalPort>65000</NewExternalPort>
<NewProtocol>UDP</NewProtocol>
<NewInternalPort>65000</NewInternalPort>
<NewInternalClient>192.168.0.250</NewInternalClient>
<NewEnabled>1</NewEnabled>
<NewPortMappingDescription>(test)</NewPortMappingDescription>
<NewLeaseDuration>0</NewLeaseDuration>
</u:AddPortMapping>
</s:Body>
<s:Envelope>

head data (len=197):
POST /WANIPConnection HTTP/1.1
HOST: 192.168.0.1:5678
CONTENT-LENGTH: 598
CONTENT-TYPE: text/xml; chatset="utf-8"
SOAPACTION: "urn:schemas-upnp-org:service:WANIPConnection:1#AddPortMapping"

response data:
HTTP/1.1 200 OK
CONNECTION: CLOSE
CONTENT-LENGTH:331
CONTENT-TYPE:text/xml
DATE: Thu, 19 May 2005 02:57:12 GMT
SERVER: Embedded UPnP/1.0

<?xml version="1.0"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><m:AddPortMappingResponse xmlns:m="urn:schemas-upnp-org:service:WANIPConnection:1"></m:AddPortMappingResponse></SOAP-ENV:Body> </SOAP-ENV:Envelope>

