diff -r 64165e101f08 -r d42d557c7a5a stun/stun.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stun/stun.patch Fri Jan 09 00:45:56 2009 +0100 @@ -0,0 +1,85 @@ +Index: client.cxx +--- client.cxx.orig 2005-08-14 02:43:10 +0200 ++++ client.cxx 2005-11-16 10:28:17 +0100 +@@ -178,13 +178,13 @@ + retval[nic] = 0x02; + break; + case StunTypeDependentFilter: +- cout << "Independedt Mapping, Address Dependendent Filter"; ++ cout << "Independedt Mapping, Address Dependent Filter"; + if ( presPort ) cout << ", preserves ports"; else cout << ", random port"; + if ( hairpin ) cout << ", will hairpin"; else cout << ", no hairpin"; + retval[nic] = 0x04; + break; + case StunTypePortDependedFilter: +- cout << "Indepndent Mapping, Port Dependent Filter"; ++ cout << "Independent Mapping, Port Dependent Filter"; + if ( presPort ) cout << ", preserves ports"; else cout << ", random port"; + if ( hairpin ) cout << ", will hairpin"; else cout << ", no hairpin"; + retval[nic] = 0x06; +Index: server.cxx +--- server.cxx.orig 2005-08-13 22:19:29 +0200 ++++ server.cxx 2005-11-16 10:33:51 +0100 +@@ -23,7 +23,7 @@ + usage() + { + cerr << "Usage: " << endl +- << " ./server [-v] [-h] [-h IP_Address] [-a IP_Address] [-p port] [-o port] [-m mediaport]" << endl ++ << " ./server [-v] [-h] [-h IP_Address] [-a IP_Address] [-p port] [-o port] [-b] [-m mediaport] [-P pidfile]" << endl + << " " << endl + << " If the IP addresses of your NIC are 10.0.1.150 and 10.0.1.151, run this program with" << endl + << " ./server -v -h 10.0.1.150 -a 10.0.1.151" << endl +@@ -32,7 +32,7 @@ + << " -a sets the secondary IP" << endl + << " -p sets the primary port and defaults to 3478" << endl + << " -o sets the secondary port and defaults to 3479" << endl +- << " -b makes the program run in the backgroud" << endl ++ << " -b makes the program run in the background" << endl + << " -m sets up a STERN server starting at port m" << endl + << " -v runs in verbose mode" << endl + // in makefile too +@@ -55,6 +55,7 @@ + StunAddress4 altAddr; + bool verbose=false; + bool background=false; ++ char *myPidFile = 0; + + myAddr.addr = 0; + altAddr.addr = 0; +@@ -135,6 +136,16 @@ + } + myMediaPort = UInt16(strtol( argv[arg], NULL, 10)); + } ++ else if ( !strcmp( argv[arg] , "-P" ) ) ++ { ++ arg++; ++ if ( argc <= arg ) ++ { ++ usage(); ++ exit(-1); ++ } ++ myPidFile = argv[arg]; ++ } + else + { + usage(); +@@ -213,6 +224,19 @@ + + if (pid == 0) //child or not using background + { ++ /* write a daemon pidfile */ ++ if (myPidFile) { ++ pid_t pid; ++ FILE *fp; ++ pid = getpid(); ++ if ((fp = fopen(myPidFile, "w")) == NULL) { ++ fprintf(stderr, "stund: Can't write pidfile '%s'", myPidFile); ++ exit(1); ++ } ++ fprintf(fp, "%ld\n", (long)pid); ++ fclose(fp); ++ } ++ + StunServerInfo info; + bool ok = stunInitServer(info, myAddr, altAddr, myMediaPort, verbose); +