Compare commits

...

8 Commits

Author SHA1 Message Date
Marcelo Roberto Jimenez
ce5ccd8edc Creation of the tag for release-1.6.6.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/tags/release-1.6.6@352 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-04-26 00:52:45 +00:00
Marcelo Roberto Jimenez
f0161c7274 Merge of trunk into branch 1.6.x.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/branches/branch-1.6.x@351 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-04-26 00:49:39 +00:00
Marcelo Roberto Jimenez
4b40e94b03 Merge of trunk into branch 1.6.x.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/branches/branch-1.6.x@339 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-03-25 10:21:08 +00:00
Marcelo Roberto Jimenez
1c9632dcc3 White spaces.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/branches/branch-1.6.x@329 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-03-05 03:55:33 +00:00
Marcelo Roberto Jimenez
cc0c2ffc50 Merge of trunk into branch-1.6.x.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/branches/branch-1.6.x@327 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-02-22 04:48:10 +00:00
Marcelo Roberto Jimenez
f812b124d7 Merge of trunk into branch-1.6.x.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/branches/branch-1.6.x@324 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-02-10 02:27:45 +00:00
Marcelo Roberto Jimenez
a785465222 Merge of trunk into branch-1.6.x.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/branches/branch-1.6.x@322 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-02-08 02:29:26 +00:00
Marcelo Roberto Jimenez
078f3f8faf Merge of trunk into branch 1.6.x.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/branches/branch-1.6.x@312 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-02-03 01:36:23 +00:00
61 changed files with 4436 additions and 555 deletions

135
ChangeLog
View File

@@ -1,3 +1,76 @@
*******************************************************************************
Version 1.6.6
*******************************************************************************
2008-04-24 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
* Added thread id's to the UpnpPrintf debug messages. Thanks to
Charles Nepveu for the idea.
2008-04-24 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
* SF Bug Tracker [ 1948586 ]
Uppercase U in in "xmlns:U" in Invoke Action causes seg. f.
Submitted By: Thomas Norheim - kjakan_no
Device no longer segfaults with the following malformed xml action:
<u:SetColor xmlns:U="urn:schemas-upnp-org:service:tvpicture:1">
<Color>2</Color>
</u:SetColor>
2008-04-23 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
* Use -O0 in debug builds so that variables do not get optimized out.
2008-04-10 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
* Apostolos Syropoulos changes for OpenSolaris x86.
2008-03-20 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
* Andre Sodermans (wienerschnitzel) patch for building libupnp under
windows systems with VC9.
2008-03-20 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
* Andre Sodermans (wienerschnitzel) patch for building libupnp under
windows systems with VC8.
2008-03-08 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
* Fixed a printf format problem on the upnp_tv_device.c from both
upnp/sample/tvdevie and upnp/sample/tvcombo directories. The variable
port was a short int instead of an unsigned short and it was beeing
print as a negative value.
2008-03-08 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
* SF Bug Tracker [ 1902668 ] Cannot compile on MSVC
Submitted By Luke Kim - nereusuj
Version 1.6.5 cannot be compiled because of some changes in 1.6.3.
MSVC does not support stdint.h, gettimeofday(), sys/param.h, const int
variables in array size and Windows does not define _WINDOWS_ but define
_WINDOWS.
* MSVC does not understand "const int"'s as declarators of array
dimensions, we must use #define'd constants.
* Use WIN32 instead of _WINDOWS_ or _WINDOWS.
2008-02-22 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
* No longer ignore "upnp:rootdevice" advertisement. Thanks to Bob Ciora.
2008-02-10 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
* Changed "sys_errlist[errno]", which is deprecated, by
"strerror_r()", which is thread safe.
2008-02-06 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
* Slightly improved error report by showing the sys_errlist string
corresponding to errno.
2008-02-06 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
* Got rid of two useless constants: UPNP_SOCKETERROR and
UPNP_INVALID_SOCKET. They both mean the same, that a network API
function has failed. -1 is the value to check, not an invented constant.
*******************************************************************************
Version 1.6.5
*******************************************************************************
2008-02-02 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
* Peter Hartley's fix for wrong sized variable beeing passed to
http_MakeMessage() on 64 bit architectures.
******************************************************************************* *******************************************************************************
Version 1.6.4 Version 1.6.4
******************************************************************************* *******************************************************************************
@@ -146,7 +219,7 @@ Version 1.6.1
handle accordingly. handle accordingly.
2007-08-05 Marcelo Jimenez <mroberto(at)users.sourceforge.net> 2007-08-05 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
* Merge of Mac OS X patch from St<53>phane Corth<74>sy (davelopper), * Merge of Mac OS X patch from St<53>phane Corth<74>sy (davelopper),
SF Bug Tracker [ 1686420 ] Modifications for MacOSX. SF Bug Tracker [ 1686420 ] Modifications for MacOSX.
Some of the proposed changes were already done by Rene Hexel's patch. Some of the proposed changes were already done by Rene Hexel's patch.
@@ -570,14 +643,14 @@ Version 1.4.0
FORK FROM DEAD libupnp FORK FROM DEAD libupnp
******************************************************************************* *******************************************************************************
2006-04-29 R<>mi Turboult <r3mi(at)users.sourceforge.net> 2006-04-29 R<>mi Turboult <r3mi(at)users.sourceforge.net>
* THANKS: new file with list of contributors * THANKS: new file with list of contributors
* upnp/src/gena/gena_device.c (respond_ok): add 'Content-Length: 0' * upnp/src/gena/gena_device.c (respond_ok): add 'Content-Length: 0'
in subscription response. Patch by Chaos (Bug # 1455367). in subscription response. Patch by Chaos (Bug # 1455367).
2006-04-08 R<>mi Turboult <r3mi(at)users.sourceforge.net> 2006-04-08 R<>mi Turboult <r3mi(at)users.sourceforge.net>
* upnp/doc/UPnP_Programming_Guide.pdf: replace this document with * upnp/doc/UPnP_Programming_Guide.pdf: replace this document with
the one in libupnp-doc-1.2.1 because current CVS version the one in libupnp-doc-1.2.1 because current CVS version
@@ -588,20 +661,20 @@ FORK FROM DEAD libupnp
* changes applied to several files to work under Sparc Solaris, temporarily * changes applied to several files to work under Sparc Solaris, temporarily
requiring a define SPARC_SOLARIS requiring a define SPARC_SOLARIS
2006-04-03 R<>mi Turboult <r3mi(at)users.sourceforge.net> 2006-04-03 R<>mi Turboult <r3mi(at)users.sourceforge.net>
* upnp/Makefile.am: install upnp samples in $(docdir)/examples * upnp/Makefile.am: install upnp samples in $(docdir)/examples
2006-03-28 R<>mi Turboult <r3mi(at)users.sourceforge.net> 2006-03-28 R<>mi Turboult <r3mi(at)users.sourceforge.net>
* configure.ac: add --with-docdir option to choose where documentation * configure.ac: add --with-docdir option to choose where documentation
is installed (or -without-docdir to not install the documentation) is installed (or -without-docdir to not install the documentation)
2006-03-27 R<>mi Turboult <r3mi(at)users.sourceforge.net> 2006-03-27 R<>mi Turboult <r3mi(at)users.sourceforge.net>
* ixml/test: add simple test suite for xml parser * ixml/test: add simple test suite for xml parser
2006-03-26 R<>mi Turboult <r3mi(at)users.sourceforge.net> 2006-03-26 R<>mi Turboult <r3mi(at)users.sourceforge.net>
* ixml/src/ixmlparser.c (Parser_processCDSect): fix bug which prevents * ixml/src/ixmlparser.c (Parser_processCDSect): fix bug which prevents
CDATA sections which contain a 0 (zero) to be parsed (instead the CDATA sections which contain a 0 (zero) to be parsed (instead the
@@ -612,18 +685,18 @@ FORK FROM DEAD libupnp
option, and move samples compilation from check_PROGRAMS to option, and move samples compilation from check_PROGRAMS to
noinst_PROGRAMS noinst_PROGRAMS
2006-03-25 R<>mi Turboult <r3mi(at)users.sourceforge.net> 2006-03-25 R<>mi Turboult <r3mi(at)users.sourceforge.net>
* upnp/src/genlib/miniserver/miniserver.c (get_miniserver_sockets): * upnp/src/genlib/miniserver/miniserver.c (get_miniserver_sockets):
fix bug if new socket created has fd 0 (can only occur when stdin fix bug if new socket created has fd 0 (can only occur when stdin
has been closed). Patch by Oskar Liljeblad 2004-07-02 : has been closed). Patch by Oskar Liljeblad 2004-07-02 :
http://sourceforge.net/mailarchive/message.php?msg_id=8870528 http://sourceforge.net/mailarchive/message.php?msg_id=8870528
2006-03-21 R<>mi Turboult <r3mi(at)users.sourceforge.net> 2006-03-21 R<>mi Turboult <r3mi(at)users.sourceforge.net>
* upnp/test/test_init.c: add some version checks and exit if failure * upnp/test/test_init.c: add some version checks and exit if failure
2006-03-05 R<>mi Turboult <r3mi(at)users.sourceforge.net> 2006-03-05 R<>mi Turboult <r3mi(at)users.sourceforge.net>
* libupnp version 1.3.1 * libupnp version 1.3.1
@@ -638,11 +711,11 @@ FORK FROM DEAD libupnp
dependencies between upnp and ixml / threadutil, so that programs dependencies between upnp and ixml / threadutil, so that programs
linking against upnp only still work. linking against upnp only still work.
2006-03-04 R<>mi Turboult <r3mi(at)users.sourceforge.net> 2006-03-04 R<>mi Turboult <r3mi(at)users.sourceforge.net>
* libupnp version 1.3.0 * libupnp version 1.3.0
2006-03-03 R<>mi Turboult <r3mi(at)users.sourceforge.net> 2006-03-03 R<>mi Turboult <r3mi(at)users.sourceforge.net>
* upnp/src/genlib/net/http/httpreadwrite.c (get_sdk_info): use * upnp/src/genlib/net/http/httpreadwrite.c (get_sdk_info): use
package version string from configure to set sdk info package version string from configure to set sdk info
@@ -650,7 +723,7 @@ FORK FROM DEAD libupnp
* upnp/Makefile.am: add sample/tvdevice/web/ files in EXTRA_DIST * upnp/Makefile.am: add sample/tvdevice/web/ files in EXTRA_DIST
+ do not distribute generated upnpconfig.h file. + do not distribute generated upnpconfig.h file.
2006-02-28 R<>mi Turboult <r3mi(at)users.sourceforge.net> 2006-02-28 R<>mi Turboult <r3mi(at)users.sourceforge.net>
* upnp/src/inc/config.h, configure.ac: use only new defines * upnp/src/inc/config.h, configure.ac: use only new defines
UPNP_HAVE_xx instead of INCLUDE_yyy_APIS and INTERNAL_WEB_SERVER UPNP_HAVE_xx instead of INCLUDE_yyy_APIS and INTERNAL_WEB_SERVER
@@ -659,7 +732,7 @@ FORK FROM DEAD libupnp
the librarie LDFLAGS in order to export only the symbols defined the librarie LDFLAGS in order to export only the symbols defined
in the API in the API
2006-02-27 R<>mi Turboult <r3mi(at)users.sourceforge.net> 2006-02-27 R<>mi Turboult <r3mi(at)users.sourceforge.net>
* configure.ac: add libtool versions for the 3 libraries * configure.ac: add libtool versions for the 3 libraries
@@ -667,7 +740,7 @@ FORK FROM DEAD libupnp
* threadutil/src/ThreadPool.c (SetSeed): add missing 'static' * threadutil/src/ThreadPool.c (SetSeed): add missing 'static'
2006-02-26 R<>mi Turboult <r3mi(at)users.sourceforge.net> 2006-02-26 R<>mi Turboult <r3mi(at)users.sourceforge.net>
* threadutil/inc/iasnprintf.h: add gcc __printf__ format attribute * threadutil/inc/iasnprintf.h: add gcc __printf__ format attribute
to "iasnprintf" to "iasnprintf"
@@ -688,11 +761,11 @@ FORK FROM DEAD libupnp
the configuration of the installed libraries (generates installed the configuration of the installed libraries (generates installed
file <upnp/upnpconfig.h>) file <upnp/upnpconfig.h>)
2006-02-22 R<>mi Turboult <r3mi(at)users.sourceforge.net> 2006-02-22 R<>mi Turboult <r3mi(at)users.sourceforge.net>
* upnp/ : add missing include of config.h in some .c files * upnp/ : add missing include of config.h in some .c files
2006-02-21 R<>mi Turboult <r3mi(at)users.sourceforge.net> 2006-02-21 R<>mi Turboult <r3mi(at)users.sourceforge.net>
* upnp/inc/upnp.h: move some definitions which should not be * upnp/inc/upnp.h: move some definitions which should not be
exported into "upnp/src/inc/util.h" exported into "upnp/src/inc/util.h"
@@ -700,12 +773,12 @@ FORK FROM DEAD libupnp
* import all modifications below from libupnp in djmount 0.51 * import all modifications below from libupnp in djmount 0.51
into official libupnp into official libupnp
2006-01-17 R<>mi Turboult <r3mi(at)users.sourceforge.net> 2006-01-17 R<>mi Turboult <r3mi(at)users.sourceforge.net>
* threadutil/Makefile.am (libthreadutil_la_SOURCES): remove extraneous * threadutil/Makefile.am (libthreadutil_la_SOURCES): remove extraneous
file file
2006-01-15 R<>mi Turboult <r3mi(at)users.sourceforge.net> 2006-01-15 R<>mi Turboult <r3mi(at)users.sourceforge.net>
* configure.ac: add checks for large-file support * configure.ac: add checks for large-file support
@@ -725,53 +798,53 @@ FORK FROM DEAD libupnp
* ixml/src/node.c (ixmlNode_getNodeType): fix compilation warning * ixml/src/node.c (ixmlNode_getNodeType): fix compilation warning
on const return type on const return type
2006-01-12 R<>mi Turboult <r3mi(at)users.sourceforge.net> 2006-01-12 R<>mi Turboult <r3mi(at)users.sourceforge.net>
* upnp/src/inc/readwrite.h : suppress unused C++ header file * upnp/src/inc/readwrite.h : suppress unused C++ header file
2006-01-11 R<>mi Turboult <r3mi(at)users.sourceforge.net> 2006-01-11 R<>mi Turboult <r3mi(at)users.sourceforge.net>
* upnp/inc/config.h, upnp/src/inc/upnpapi.h, * upnp/inc/config.h, upnp/src/inc/upnpapi.h,
upnp/src/inc/httpreadwrite.h: remove internal configuration variable upnp/src/inc/httpreadwrite.h: remove internal configuration variable
MINIMUM_DELAY (no clear purpose) MINIMUM_DELAY (no clear purpose)
2005-12-05 R<>mi Turboult <r3mi(at)users.sourceforge.net> 2005-12-05 R<>mi Turboult <r3mi(at)users.sourceforge.net>
* upnp/inc/upnp.h: re-declare obsolete method UpnpSetContentLength, * upnp/inc/upnp.h: re-declare obsolete method UpnpSetContentLength,
for binary compatibility with previous libupnp version. for binary compatibility with previous libupnp version.
* upnp/src/api/upnpapi.c: correct type of g_maxContentLength to size_t * upnp/src/api/upnpapi.c: correct type of g_maxContentLength to size_t
2005-11-01 R<>mi Turboult <r3mi(at)users.sourceforge.net> 2005-11-01 R<>mi Turboult <r3mi(at)users.sourceforge.net>
* autoconfiscate library : replace all makefiles by Makefile.am * autoconfiscate library : replace all makefiles by Makefile.am
for automake support, + preliminary autoconf support for automake support, + preliminary autoconf support
(generated config.h not yet used in source files) (generated config.h not yet used in source files)
2005-10-18 R<>mi Turboult <r3mi(at)users.sourceforge.net> 2005-10-18 R<>mi Turboult <r3mi(at)users.sourceforge.net>
* upnp/src/makefile: fix location of DEBUG STATIC libupnp library * upnp/src/makefile: fix location of DEBUG STATIC libupnp library
* upnp/sample/tvctrlpt/linux/Makefile, * upnp/sample/tvctrlpt/linux/Makefile,
upnp/sample/tvdevice/linux/Makefile: fix STATIC library support upnp/sample/tvdevice/linux/Makefile: fix STATIC library support
2005-10-16 R<>mi Turboult <r3mi(at)users.sourceforge.net> 2005-10-16 R<>mi Turboult <r3mi(at)users.sourceforge.net>
* threadutil/src/Makefile (clean): remove built library * threadutil/src/Makefile (clean): remove built library
2005-08-28 R<>mi Turboult <r3mi(at)users.sourceforge.net> 2005-08-28 R<>mi Turboult <r3mi(at)users.sourceforge.net>
* ixml/src/ixml.h, ixml/src/ixml.c (ixmlRelaxParser) : new function * ixml/src/ixml.h, ixml/src/ixml.c (ixmlRelaxParser) : new function
* ixml/src/ixmlparser.h, ixml/src/ixmlparser.c (Parser_setErrorChar) : * ixml/src/ixmlparser.h, ixml/src/ixmlparser.c (Parser_setErrorChar) :
new function new function
2005-08-02 R<>mi Turboult <r3mi(at)users.sourceforge.net> 2005-08-02 R<>mi Turboult <r3mi(at)users.sourceforge.net>
* ixml/src/Makefile: correct bug for static library being incorrectly * ixml/src/Makefile: correct bug for static library being incorrectly
stripped when building non-debug stripped when building non-debug
2005-06-09 R<>mi Turboult <r3mi(at)users.sourceforge.net> 2005-06-09 R<>mi Turboult <r3mi(at)users.sourceforge.net>
* ixml/src/element.c (ixmlElement_removeAttributeNode): * ixml/src/element.c (ixmlElement_removeAttributeNode):
remove some compilation warning remove some compilation warning
@@ -782,7 +855,7 @@ FORK FROM DEAD libupnp
* upnp/inc/upnptools.h, upnp/src/api/upnptools.c : * upnp/inc/upnptools.h, upnp/src/api/upnptools.c :
add missing const's in public API add missing const's in public API
2005-05-28 R<>mi Turboult <r3mi(at)users.sourceforge.net> 2005-05-28 R<>mi Turboult <r3mi(at)users.sourceforge.net>
* upnp/inc/config.h: suppress HTTP_READ_BYTES (unused) * upnp/inc/config.h: suppress HTTP_READ_BYTES (unused)
and replace by DEFAULT_SOAP_CONTENT_LENGTH (previously in upnpapi.h) and replace by DEFAULT_SOAP_CONTENT_LENGTH (previously in upnpapi.h)
@@ -803,7 +876,7 @@ FORK FROM DEAD libupnp
* upnp/src/genlib/net/http/httpreadwrite.c : corrected an incorrect * upnp/src/genlib/net/http/httpreadwrite.c : corrected an incorrect
sprintf format sprintf format
2005-05-27 R<>mi Turboult <r3mi(at)users.sourceforge.net> 2005-05-27 R<>mi Turboult <r3mi(at)users.sourceforge.net>
* upnp/makefile, upnp/src/makefile, * upnp/makefile, upnp/src/makefile,
ixml/Makefile, ixml/src/Makefile, ixml/Makefile, ixml/src/Makefile,
@@ -811,7 +884,7 @@ FORK FROM DEAD libupnp
implement STATIC library support (from patch at implement STATIC library support (from patch at
http://sourceforge.net/tracker/?group_id=7189&atid=307189 ) http://sourceforge.net/tracker/?group_id=7189&atid=307189 )
2005-05-26 R<>mi Turboult <r3mi(at)users.sourceforge.net> 2005-05-26 R<>mi Turboult <r3mi(at)users.sourceforge.net>
* upnp/src/api/upnpapi.c, upnp/src/soap/soap_device.c, * upnp/src/api/upnpapi.c, upnp/src/soap/soap_device.c,
upnp/src/soap/makefile : upnp/src/soap/makefile :

5
THANKS
View File

@@ -7,9 +7,12 @@ Here is a list of these people. Help us keep it complete and
exempt of errors. exempt of errors.
- Alex (afaucher) - Alex (afaucher)
- Andre Sodermans (wienerschnitzel)
- Apostolos Syropoulos
- Arno Willig - Arno Willig
- Bob Ciora - Bob Ciora
- Chaos - Chaos
- Charles Nepveu (cnepveu)
- Chris Pickel - Chris Pickel
- Craig Nelson - Craig Nelson
- David Maass - David Maass
@@ -30,7 +33,7 @@ exempt of errors.
- Keith Brindley - Keith Brindley
- Leuk_He - Leuk_He
- Loigu - Loigu
- Luke Kim - Luke Kim (nereusuj)
- Marcelo Roberto Jimenez (mroberto) - Marcelo Roberto Jimenez (mroberto)
- Markus Strobl - Markus Strobl
- Nektarios K. Papadopoulos (npapadop) - Nektarios K. Papadopoulos (npapadop)

222
build/msvc/stdint.h Normal file
View File

@@ -0,0 +1,222 @@
// ISO C9x compliant stdint.h for Microsoft Visual Studio
// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
//
// Copyright (c) 2006 Alexander Chemeris
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// 3. The name of the author may be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
///////////////////////////////////////////////////////////////////////////////
#ifndef _MSC_VER // [
#error "Use this header only with Microsoft Visual C++ compilers!"
#endif // _MSC_VER ]
#ifndef _MSC_STDINT_H_ // [
#define _MSC_STDINT_H_
#if _MSC_VER > 1000
#pragma once
#endif
#include <limits.h>
// For Visual Studio 6 in C++ mode wrap <wchar.h> include with 'extern "C++" {}'
// or compiler give many errors like this:
// error C2733: second C linkage of overloaded function 'wmemchr' not allowed
#if (_MSC_VER < 1300) && defined(__cplusplus)
extern "C++" {
#endif
# include <wchar.h>
#if (_MSC_VER < 1300) && defined(__cplusplus)
}
#endif
// 7.18.1 Integer types
// 7.18.1.1 Exact-width integer types
typedef __int8 int8_t;
typedef __int16 int16_t;
typedef __int32 int32_t;
typedef __int64 int64_t;
typedef unsigned __int8 uint8_t;
typedef unsigned __int16 uint16_t;
typedef unsigned __int32 uint32_t;
typedef unsigned __int64 uint64_t;
// 7.18.1.2 Minimum-width integer types
typedef int8_t int_least8_t;
typedef int16_t int_least16_t;
typedef int32_t int_least32_t;
typedef int64_t int_least64_t;
typedef uint8_t uint_least8_t;
typedef uint16_t uint_least16_t;
typedef uint32_t uint_least32_t;
typedef uint64_t uint_least64_t;
// 7.18.1.3 Fastest minimum-width integer types
typedef int8_t int_fast8_t;
typedef int16_t int_fast16_t;
typedef int32_t int_fast32_t;
typedef int64_t int_fast64_t;
typedef uint8_t uint_fast8_t;
typedef uint16_t uint_fast16_t;
typedef uint32_t uint_fast32_t;
typedef uint64_t uint_fast64_t;
// 7.18.1.4 Integer types capable of holding object pointers
#ifdef _WIN64 // [
typedef __int64 intptr_t;
typedef unsigned __int64 uintptr_t;
#else // _WIN64 ][
typedef int intptr_t;
typedef unsigned int uintptr_t;
#endif // _WIN64 ]
// 7.18.1.5 Greatest-width integer types
typedef int64_t intmax_t;
typedef uint64_t uintmax_t;
// 7.18.2 Limits of specified-width integer types
#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259
// 7.18.2.1 Limits of exact-width integer types
#define INT8_MIN ((int8_t)_I8_MIN)
#define INT8_MAX _I8_MAX
#define INT16_MIN ((int16_t)_I16_MIN)
#define INT16_MAX _I16_MAX
#define INT32_MIN ((int32_t)_I32_MIN)
#define INT32_MAX _I32_MAX
#define INT64_MIN ((int64_t)_I64_MIN)
#define INT64_MAX _I64_MAX
#define UINT8_MAX _UI8_MAX
#define UINT16_MAX _UI16_MAX
#define UINT32_MAX _UI32_MAX
#define UINT64_MAX _UI64_MAX
// 7.18.2.2 Limits of minimum-width integer types
#define INT_LEAST8_MIN INT8_MIN
#define INT_LEAST8_MAX INT8_MAX
#define INT_LEAST16_MIN INT16_MIN
#define INT_LEAST16_MAX INT16_MAX
#define INT_LEAST32_MIN INT32_MIN
#define INT_LEAST32_MAX INT32_MAX
#define INT_LEAST64_MIN INT64_MIN
#define INT_LEAST64_MAX INT64_MAX
#define UINT_LEAST8_MAX UINT8_MAX
#define UINT_LEAST16_MAX UINT16_MAX
#define UINT_LEAST32_MAX UINT32_MAX
#define UINT_LEAST64_MAX UINT64_MAX
// 7.18.2.3 Limits of fastest minimum-width integer types
#define INT_FAST8_MIN INT8_MIN
#define INT_FAST8_MAX INT8_MAX
#define INT_FAST16_MIN INT16_MIN
#define INT_FAST16_MAX INT16_MAX
#define INT_FAST32_MIN INT32_MIN
#define INT_FAST32_MAX INT32_MAX
#define INT_FAST64_MIN INT64_MIN
#define INT_FAST64_MAX INT64_MAX
#define UINT_FAST8_MAX UINT8_MAX
#define UINT_FAST16_MAX UINT16_MAX
#define UINT_FAST32_MAX UINT32_MAX
#define UINT_FAST64_MAX UINT64_MAX
// 7.18.2.4 Limits of integer types capable of holding object pointers
#ifdef _WIN64 // [
# define INTPTR_MIN INT64_MIN
# define INTPTR_MAX INT64_MAX
# define UINTPTR_MAX UINT64_MAX
#else // _WIN64 ][
# define INTPTR_MIN INT32_MIN
# define INTPTR_MAX INT32_MAX
# define UINTPTR_MAX UINT32_MAX
#endif // _WIN64 ]
// 7.18.2.5 Limits of greatest-width integer types
#define INTMAX_MIN INT64_MIN
#define INTMAX_MAX INT64_MAX
#define UINTMAX_MAX UINT64_MAX
// 7.18.3 Limits of other integer types
#ifdef _WIN64 // [
# define PTRDIFF_MIN _I64_MIN
# define PTRDIFF_MAX _I64_MAX
#else // _WIN64 ][
# define PTRDIFF_MIN _I32_MIN
# define PTRDIFF_MAX _I32_MAX
#endif // _WIN64 ]
#define SIG_ATOMIC_MIN INT_MIN
#define SIG_ATOMIC_MAX INT_MAX
#ifndef SIZE_MAX // [
# ifdef _WIN64 // [
# define SIZE_MAX _UI64_MAX
# else // _WIN64 ][
# define SIZE_MAX _UI32_MAX
# endif // _WIN64 ]
#endif // SIZE_MAX ]
// WCHAR_MIN and WCHAR_MAX are also defined in <wchar.h>
#ifndef WCHAR_MIN // [
# define WCHAR_MIN 0
#endif // WCHAR_MIN ]
#ifndef WCHAR_MAX // [
# define WCHAR_MAX _UI16_MAX
#endif // WCHAR_MAX ]
#define WINT_MIN 0
#define WINT_MAX _UI16_MAX
#endif // __STDC_LIMIT_MACROS ]
// 7.18.4 Limits of other integer types
#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260
// 7.18.4.1 Macros for minimum-width integer constants
#define INT8_C(val) val##i8
#define INT16_C(val) val##i16
#define INT32_C(val) val##i32
#define INT64_C(val) val##i64
#define UINT8_C(val) val##ui8
#define UINT16_C(val) val##ui16
#define UINT32_C(val) val##ui32
#define UINT64_C(val) val##ui64
// 7.18.4.2 Macros for greatest-width integer constants
#define INTMAX_C INT64_C
#define UINTMAX_C UINT64_C
#endif // __STDC_CONSTANT_MACROS ]
#endif // _MSC_STDINT_H_ ]

223
build/vc8/ixml.vcproj Normal file
View File

@@ -0,0 +1,223 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="ixml"
ProjectGUID="{AD489FAF-9CDD-411B-BFE9-1B9C6C16D427}"
RootNamespace="ixml"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\out.vc8.$(ConfigurationName)\$(ProjectName)"
IntermediateDirectory=".\out.vc8.$(ConfigurationName)\$(ProjectName)"
ConfigurationType="4"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\ixml\inc;..\..\ixml\src\inc"
PreprocessorDefinitions="WIN32;DEBUG"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
RuntimeLibrary="2"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\..\ixml\src\attr.c"
>
</File>
<File
RelativePath="..\..\ixml\src\document.c"
>
</File>
<File
RelativePath="..\..\ixml\src\element.c"
>
</File>
<File
RelativePath="..\..\ixml\src\ixml.c"
>
</File>
<File
RelativePath="..\..\ixml\src\ixmlmembuf.c"
>
</File>
<File
RelativePath="..\..\ixml\src\ixmlparser.c"
>
</File>
<File
RelativePath="..\..\ixml\src\namedNodeMap.c"
>
</File>
<File
RelativePath="..\..\ixml\src\node.c"
>
</File>
<File
RelativePath="..\..\ixml\src\nodeList.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\..\ixml\inc\ixml.h"
>
</File>
<File
RelativePath="..\..\ixml\src\inc\ixmlmembuf.h"
>
</File>
<File
RelativePath="..\..\ixml\src\inc\ixmlparser.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

65
build/vc8/libupnp.sln Normal file
View File

@@ -0,0 +1,65 @@

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libupnp", "libupnp.vcproj", "{6227F51A-1498-4C4A-B213-F6FDED605125}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "threadutil", "threadutil.vcproj", "{24884928-0501-4CF2-BC8A-180AFC23B2AF}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ixml", "ixml.vcproj", "{AD489FAF-9CDD-411B-BFE9-1B9C6C16D427}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tvdevice", "tvdevice.vcproj", "{F592B023-E1F3-4A1E-841E-662DEE497435}"
ProjectSection(ProjectDependencies) = postProject
{6227F51A-1498-4C4A-B213-F6FDED605125} = {6227F51A-1498-4C4A-B213-F6FDED605125}
{24884928-0501-4CF2-BC8A-180AFC23B2AF} = {24884928-0501-4CF2-BC8A-180AFC23B2AF}
{AD489FAF-9CDD-411B-BFE9-1B9C6C16D427} = {AD489FAF-9CDD-411B-BFE9-1B9C6C16D427}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tvctrlpt", "tvctrlpt.vcproj", "{BC1557D9-9E84-4BA5-861E-CB04D767FBDC}"
ProjectSection(ProjectDependencies) = postProject
{AD489FAF-9CDD-411B-BFE9-1B9C6C16D427} = {AD489FAF-9CDD-411B-BFE9-1B9C6C16D427}
{24884928-0501-4CF2-BC8A-180AFC23B2AF} = {24884928-0501-4CF2-BC8A-180AFC23B2AF}
{6227F51A-1498-4C4A-B213-F6FDED605125} = {6227F51A-1498-4C4A-B213-F6FDED605125}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tvcombo", "tvcombo.vcproj", "{B5D74697-F615-4DCB-AA8B-935F6372F01C}"
ProjectSection(ProjectDependencies) = postProject
{6227F51A-1498-4C4A-B213-F6FDED605125} = {6227F51A-1498-4C4A-B213-F6FDED605125}
{24884928-0501-4CF2-BC8A-180AFC23B2AF} = {24884928-0501-4CF2-BC8A-180AFC23B2AF}
{AD489FAF-9CDD-411B-BFE9-1B9C6C16D427} = {AD489FAF-9CDD-411B-BFE9-1B9C6C16D427}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{6227F51A-1498-4C4A-B213-F6FDED605125}.Debug|Win32.ActiveCfg = Debug|Win32
{6227F51A-1498-4C4A-B213-F6FDED605125}.Debug|Win32.Build.0 = Debug|Win32
{6227F51A-1498-4C4A-B213-F6FDED605125}.Release|Win32.ActiveCfg = Release|Win32
{6227F51A-1498-4C4A-B213-F6FDED605125}.Release|Win32.Build.0 = Release|Win32
{24884928-0501-4CF2-BC8A-180AFC23B2AF}.Debug|Win32.ActiveCfg = Debug|Win32
{24884928-0501-4CF2-BC8A-180AFC23B2AF}.Debug|Win32.Build.0 = Debug|Win32
{24884928-0501-4CF2-BC8A-180AFC23B2AF}.Release|Win32.ActiveCfg = Release|Win32
{24884928-0501-4CF2-BC8A-180AFC23B2AF}.Release|Win32.Build.0 = Release|Win32
{AD489FAF-9CDD-411B-BFE9-1B9C6C16D427}.Debug|Win32.ActiveCfg = Debug|Win32
{AD489FAF-9CDD-411B-BFE9-1B9C6C16D427}.Debug|Win32.Build.0 = Debug|Win32
{AD489FAF-9CDD-411B-BFE9-1B9C6C16D427}.Release|Win32.ActiveCfg = Release|Win32
{AD489FAF-9CDD-411B-BFE9-1B9C6C16D427}.Release|Win32.Build.0 = Release|Win32
{F592B023-E1F3-4A1E-841E-662DEE497435}.Debug|Win32.ActiveCfg = Debug|Win32
{F592B023-E1F3-4A1E-841E-662DEE497435}.Debug|Win32.Build.0 = Debug|Win32
{F592B023-E1F3-4A1E-841E-662DEE497435}.Release|Win32.ActiveCfg = Release|Win32
{F592B023-E1F3-4A1E-841E-662DEE497435}.Release|Win32.Build.0 = Release|Win32
{BC1557D9-9E84-4BA5-861E-CB04D767FBDC}.Debug|Win32.ActiveCfg = Debug|Win32
{BC1557D9-9E84-4BA5-861E-CB04D767FBDC}.Debug|Win32.Build.0 = Debug|Win32
{BC1557D9-9E84-4BA5-861E-CB04D767FBDC}.Release|Win32.ActiveCfg = Release|Win32
{BC1557D9-9E84-4BA5-861E-CB04D767FBDC}.Release|Win32.Build.0 = Release|Win32
{B5D74697-F615-4DCB-AA8B-935F6372F01C}.Debug|Win32.ActiveCfg = Debug|Win32
{B5D74697-F615-4DCB-AA8B-935F6372F01C}.Debug|Win32.Build.0 = Debug|Win32
{B5D74697-F615-4DCB-AA8B-935F6372F01C}.Release|Win32.ActiveCfg = Release|Win32
{B5D74697-F615-4DCB-AA8B-935F6372F01C}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

559
build/vc8/libupnp.vcproj Normal file
View File

@@ -0,0 +1,559 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="libupnp"
ProjectGUID="{6227F51A-1498-4C4A-B213-F6FDED605125}"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="true"
SuppressStartupBanner="true"
TargetEnvironment="1"
TypeLibraryName=".\Release/libupnp.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\pthreads\include,..\ixml\src\inc,..\ixml\inc,..\threadutil\inc,..\upnp\inc,..\upnp\src\inc,.\inc"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBUPNP_EXPORTS;PTW32_STATIC_LIB;UPNP_STATIC_LIB;UPNP_USE_MSVCPP"
StringPooling="true"
RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
PrecompiledHeaderFile=".\Release/libupnp.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="true"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1031"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="odbc32.lib odbccp32.lib ..\..\pthreads\lib\pthreadvc2.lib ws2_32.lib"
OutputFile=".\Release/libupnp.dll"
LinkIncremental="1"
SuppressStartupBanner="true"
ProgramDatabaseFile=".\Release/libupnp.pdb"
ImportLibrary=".\Release/libupnp.lib"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
SuppressStartupBanner="true"
OutputFile=".\Release/libupnp.bsc"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\out.vc8.$(ConfigurationName)\$(ProjectName)"
IntermediateDirectory=".\out.vc8.$(ConfigurationName)\$(ProjectName)"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="true"
SuppressStartupBanner="true"
TargetEnvironment="1"
TypeLibraryName=".\Debug/libupnp.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\pthreads\include;..\..\ixml\src\inc;..\..\ixml\inc;..\..\threadutil\inc;..\..\upnp\inc;..\..\upnp\src\inc;..\inc;..\msvc"
PreprocessorDefinitions="DEBUG;WIN32;_WINDOWS;_USRDLL;LIBUPNP_EXPORTS;UPNP_USE_MSVCPP"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
PrecompiledHeaderFile="$(OutDir)\libupnp.pch"
AssemblerListingLocation="$(OutDir)\"
ObjectFile="$(OutDir)\"
ProgramDataBaseFileName="$(OutDir)\"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1031"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="odbc32.lib odbccp32.lib ..\..\pthreads\lib\pthreadvc2.lib ws2_32.lib"
OutputFile="$(OutDir)\libupnp.dll"
LinkIncremental="2"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)\libupnp.pdb"
ImportLibrary="$(OutDir)\libupnp.lib"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
SuppressStartupBanner="true"
OutputFile="$(OutDir)\libupnp.bsc"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="sources"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
>
<File
RelativePath="..\..\ixml\src\attr.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\client_table\client_table.c"
>
</File>
<File
RelativePath="..\..\ixml\src\document.c"
>
</File>
<File
RelativePath="..\..\ixml\src\element.c"
>
</File>
<File
RelativePath="..\..\threadutil\src\FreeList.c"
>
</File>
<File
RelativePath="..\..\upnp\src\gena\gena_callback2.c"
>
</File>
<File
RelativePath="..\..\upnp\src\gena\gena_ctrlpt.c"
>
</File>
<File
RelativePath="..\..\upnp\src\gena\gena_device.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\net\http\httpparser.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\net\http\httpreadwrite.c"
>
</File>
<File
RelativePath="..\..\upnp\src\inet_pton.c"
>
</File>
<File
RelativePath="..\..\ixml\src\ixml.c"
>
</File>
<File
RelativePath="..\..\ixml\src\ixmlmembuf.c"
>
</File>
<File
RelativePath="..\..\ixml\src\ixmlparser.c"
>
</File>
<File
RelativePath="..\..\threadutil\src\LinkedList.c"
>
</File>
<File
RelativePath="..\..\upnp\src\uuid\md5.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\util\membuffer.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\miniserver\miniserver.c"
>
</File>
<File
RelativePath="..\..\ixml\src\namedNodeMap.c"
>
</File>
<File
RelativePath="..\..\ixml\src\node.c"
>
</File>
<File
RelativePath="..\..\ixml\src\nodeList.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\net\http\parsetools.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\service_table\service_table.c"
>
</File>
<File
RelativePath="..\..\upnp\src\soap\soap_common.c"
>
</File>
<File
RelativePath="..\..\upnp\src\soap\soap_ctrlpt.c"
>
</File>
<File
RelativePath="..\..\upnp\src\soap\soap_device.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\net\sock.c"
>
</File>
<File
RelativePath="..\..\upnp\src\ssdp\ssdp_ctrlpt.c"
>
</File>
<File
RelativePath="..\..\upnp\src\ssdp\ssdp_device.c"
>
</File>
<File
RelativePath="..\..\upnp\src\ssdp\ssdp_server.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\net\http\statcodes.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\util\strintmap.c"
>
</File>
<File
RelativePath="..\..\upnp\src\uuid\sysdep.c"
>
</File>
<File
RelativePath="..\..\threadutil\src\ThreadPool.c"
>
</File>
<File
RelativePath="..\..\threadutil\src\TimerThread.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\util\upnp_timeout.c"
>
</File>
<File
RelativePath="..\..\upnp\src\api\upnpapi.c"
>
</File>
<File
RelativePath="..\..\upnp\src\api\upnpdebug.c"
>
</File>
<File
RelativePath="..\..\upnp\src\api\upnptools.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\net\uri\uri.c"
>
</File>
<File
RelativePath="..\..\upnp\src\urlconfig\urlconfig.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\util\util.c"
>
</File>
<File
RelativePath="..\..\upnp\src\uuid\uuid.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\net\http\webserver.c"
>
</File>
<File
RelativePath="..\..\upnp\src\win_dll.c"
>
</File>
</Filter>
<Filter
Name="headers"
Filter="h;hpp;hxx;hm;inl"
>
<File
RelativePath="..\..\upnp\src\inc\client_table.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\config.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\gena.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\gena_ctrlpt.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\gena_device.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\global.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\gmtdate.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\http_client.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\httpparser.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\httpreadwrite.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\inet_pton.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\md5.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\membuffer.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\miniserver.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\netall.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\parsetools.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\server.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\service_table.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\soaplib.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\sock.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\ssdplib.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\statcodes.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\statuscodes.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\strintmap.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\sysdep.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\unixutil.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\upnp_timeout.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\upnpapi.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\upnpclosesocket.h"
>
</File>
<File
RelativePath="..\..\upnp\inc\upnpdebug.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\uri.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\urlconfig.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\util.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\utilall.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\uuid.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\webserver.h"
>
</File>
</Filter>
<Filter
Name="resources"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
>
</Filter>
<File
RelativePath="..\..\..\..\libupnp_win32.patch"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

213
build/vc8/threadutil.vcproj Normal file
View File

@@ -0,0 +1,213 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="threadutil"
ProjectGUID="{24884928-0501-4CF2-BC8A-180AFC23B2AF}"
RootNamespace="threadutil"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\out.vc8.$(ConfigurationName)\$(ProjectName)"
IntermediateDirectory=".\out.vc8.$(ConfigurationName)\$(ProjectName)"
ConfigurationType="4"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\threadutil\inc;..\..\upnp\inc;..\..\ixml\inc;..\..\pthreads\include"
PreprocessorDefinitions="WIN32;DEBUG"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
AdditionalDependencies="pthreadVC2.lib"
AdditionalLibraryDirectories="..\..\pthreads\lib"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
RuntimeLibrary="2"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\..\threadutil\src\FreeList.c"
>
</File>
<File
RelativePath="..\..\threadutil\src\LinkedList.c"
>
</File>
<File
RelativePath="..\..\threadutil\src\ThreadPool.c"
>
</File>
<File
RelativePath="..\..\threadutil\src\TimerThread.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\..\threadutil\inc\FreeList.h"
>
</File>
<File
RelativePath="..\..\threadutil\inc\ithread.h"
>
</File>
<File
RelativePath="..\..\threadutil\inc\LinkedList.h"
>
</File>
<File
RelativePath="..\..\threadutil\inc\ThreadPool.h"
>
</File>
<File
RelativePath="..\..\threadutil\inc\TimerThread.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

216
build/vc8/tvcombo.vcproj Normal file
View File

@@ -0,0 +1,216 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="tvcombo"
ProjectGUID="{B5D74697-F615-4DCB-AA8B-935F6372F01C}"
RootNamespace="tvcombo"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\out.vc8.$(ConfigurationName)\$(ProjectName)"
IntermediateDirectory=".\out.vc8.$(ConfigurationName)\$(ProjectName)"
ConfigurationType="1"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\upnp\inc;..\..\ixml\inc;..\..\upnp\sample\common;..\inc;..\..\threadutil\inc;..\..\pthreads\include;..\..\upnp\sample\tvcombo;..\..\upnp\sample\tvcombo\linux"
PreprocessorDefinitions="WIN32;DEBUG"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="..\..\pthreads\lib\pthreadVC2.lib ixml.lib threadutil.lib libupnp.lib"
AdditionalLibraryDirectories="&quot;$(OutDir)&quot;;&quot;out.vc8.$(ConfigurationName)\ixml&quot;;&quot;out.vc8.$(ConfigurationName)\threadutil&quot;;&quot;out.vc8.$(ConfigurationName)\libupnp&quot;"
GenerateDebugInformation="true"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
RuntimeLibrary="2"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\..\upnp\sample\common\sample_util.c"
>
</File>
<File
RelativePath="..\..\upnp\sample\tvcombo\linux\upnp_tv_combo_main.c"
>
</File>
<File
RelativePath="..\..\upnp\sample\tvcombo\upnp_tv_ctrlpt.c"
>
</File>
<File
RelativePath="..\..\upnp\sample\tvcombo\upnp_tv_device.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\..\upnp\sample\common\sample_util.h"
>
</File>
<File
RelativePath="..\..\upnp\sample\tvcombo\upnp_tv_ctrlpt.h"
>
</File>
<File
RelativePath="..\..\upnp\sample\tvcombo\upnp_tv_device.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

208
build/vc8/tvctrlpt.vcproj Normal file
View File

@@ -0,0 +1,208 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="tvctrlpt"
ProjectGUID="{BC1557D9-9E84-4BA5-861E-CB04D767FBDC}"
RootNamespace="tvctrlpt"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\out.vc8.$(ConfigurationName)\$(ProjectName)"
IntermediateDirectory=".\out.vc8.$(ConfigurationName)\$(ProjectName)"
ConfigurationType="1"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\upnp\inc;..\..\ixml\inc;..\..\upnp\sample\common;..\inc;..\..\threadutil\inc;..\..\pthreads\include;..\..\upnp\sample\tvctrlpt;..\..\upnp\sample\tvctrlpt\linux"
PreprocessorDefinitions="WIN32;DEBUG"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="..\..\pthreads\lib\pthreadVC2.lib ixml.lib threadutil.lib libupnp.lib"
AdditionalLibraryDirectories="&quot;$(OutDir)&quot;;&quot;out.vc8.$(ConfigurationName)\ixml&quot;;&quot;out.vc8.$(ConfigurationName)\threadutil&quot;;&quot;out.vc8.$(ConfigurationName)\libupnp&quot;"
GenerateDebugInformation="true"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
RuntimeLibrary="2"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\..\upnp\sample\common\sample_util.c"
>
</File>
<File
RelativePath="..\..\upnp\sample\tvctrlpt\upnp_tv_ctrlpt.c"
>
</File>
<File
RelativePath="..\..\upnp\sample\tvctrlpt\linux\upnp_tv_ctrlpt_main.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\..\upnp\sample\common\sample_util.h"
>
</File>
<File
RelativePath="..\..\upnp\sample\tvctrlpt\upnp_tv_ctrlpt.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

208
build/vc8/tvdevice.vcproj Normal file
View File

@@ -0,0 +1,208 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="tvdevice"
ProjectGUID="{F592B023-E1F3-4A1E-841E-662DEE497435}"
RootNamespace="tvdevice"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\out.vc8.$(ConfigurationName)\$(ProjectName)"
IntermediateDirectory=".\out.vc8.$(ConfigurationName)\$(ProjectName)"
ConfigurationType="1"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\upnp\inc;..\..\ixml\inc;..\..\upnp\sample\common;..\inc;..\..\threadutil\inc;..\..\pthreads\include;..\..\upnp\sample\tvdevice;..\..\upnp\sample\tvdevice\linux"
PreprocessorDefinitions="WIN32;DEBUG"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="..\..\pthreads\lib\pthreadVC2.lib ixml.lib threadutil.lib libupnp.lib"
AdditionalLibraryDirectories="&quot;$(OutDir)&quot;;&quot;out.vc8.$(ConfigurationName)\ixml&quot;;&quot;out.vc8.$(ConfigurationName)\threadutil&quot;;&quot;out.vc8.$(ConfigurationName)\libupnp&quot;"
GenerateDebugInformation="true"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
RuntimeLibrary="2"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\..\upnp\sample\common\sample_util.c"
>
</File>
<File
RelativePath="..\..\upnp\sample\tvdevice\upnp_tv_device.c"
>
</File>
<File
RelativePath="..\..\upnp\sample\tvdevice\linux\upnp_tv_device_main.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\..\upnp\sample\common\sample_util.h"
>
</File>
<File
RelativePath="..\..\upnp\sample\tvdevice\upnp_tv_device.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

222
build/vc9/ixml.vcproj Normal file
View File

@@ -0,0 +1,222 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="ixml"
ProjectGUID="{9C2C266D-35A3-465F-A297-0E21D54E5C89}"
RootNamespace="ixml"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\out.vc9.$(ConfigurationName)\$(ProjectName)"
IntermediateDirectory=".\out.vc9.$(ConfigurationName)\$(ProjectName)"
ConfigurationType="4"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\ixml\inc;..\..\ixml\src\inc"
PreprocessorDefinitions="DEBUG;WIN32"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\..\ixml\src\attr.c"
>
</File>
<File
RelativePath="..\..\ixml\src\document.c"
>
</File>
<File
RelativePath="..\..\ixml\src\element.c"
>
</File>
<File
RelativePath="..\..\ixml\src\ixml.c"
>
</File>
<File
RelativePath="..\..\ixml\src\ixmlmembuf.c"
>
</File>
<File
RelativePath="..\..\ixml\src\ixmlparser.c"
>
</File>
<File
RelativePath="..\..\ixml\src\namedNodeMap.c"
>
</File>
<File
RelativePath="..\..\ixml\src\node.c"
>
</File>
<File
RelativePath="..\..\ixml\src\nodeList.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\..\ixml\inc\ixml.h"
>
</File>
<File
RelativePath="..\..\ixml\src\inc\ixmlmembuf.h"
>
</File>
<File
RelativePath="..\..\ixml\src\inc\ixmlparser.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

69
build/vc9/libupnp.sln Normal file
View File

@@ -0,0 +1,69 @@

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual C++ Express 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libupnp", "libupnp.vcproj", "{6227F51A-1498-4C4A-B213-F6FDED605125}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ixml", "ixml.vcproj", "{9C2C266D-35A3-465F-A297-0E21D54E5C89}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "threadutil", "threadutil.vcproj", "{1D3EEF7A-D248-48C0-B6B5-ECA229FE4B3D}"
ProjectSection(ProjectDependencies) = postProject
{6227F51A-1498-4C4A-B213-F6FDED605125} = {6227F51A-1498-4C4A-B213-F6FDED605125}
{9C2C266D-35A3-465F-A297-0E21D54E5C89} = {9C2C266D-35A3-465F-A297-0E21D54E5C89}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tvctrlpt", "tvctrlpt.vcproj", "{8FB56F1C-E617-4B79-96AE-1FA499A3A9B5}"
ProjectSection(ProjectDependencies) = postProject
{6227F51A-1498-4C4A-B213-F6FDED605125} = {6227F51A-1498-4C4A-B213-F6FDED605125}
{9C2C266D-35A3-465F-A297-0E21D54E5C89} = {9C2C266D-35A3-465F-A297-0E21D54E5C89}
{1D3EEF7A-D248-48C0-B6B5-ECA229FE4B3D} = {1D3EEF7A-D248-48C0-B6B5-ECA229FE4B3D}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tvdevice", "tvdevice.vcproj", "{7FB5F4A6-74F9-471D-B358-BAA0AC1CCA0A}"
ProjectSection(ProjectDependencies) = postProject
{6227F51A-1498-4C4A-B213-F6FDED605125} = {6227F51A-1498-4C4A-B213-F6FDED605125}
{9C2C266D-35A3-465F-A297-0E21D54E5C89} = {9C2C266D-35A3-465F-A297-0E21D54E5C89}
{1D3EEF7A-D248-48C0-B6B5-ECA229FE4B3D} = {1D3EEF7A-D248-48C0-B6B5-ECA229FE4B3D}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tvcombo", "tvcombo.vcproj", "{6365804B-22C6-4D5E-91F3-0C052EB55B4F}"
ProjectSection(ProjectDependencies) = postProject
{6227F51A-1498-4C4A-B213-F6FDED605125} = {6227F51A-1498-4C4A-B213-F6FDED605125}
{9C2C266D-35A3-465F-A297-0E21D54E5C89} = {9C2C266D-35A3-465F-A297-0E21D54E5C89}
{1D3EEF7A-D248-48C0-B6B5-ECA229FE4B3D} = {1D3EEF7A-D248-48C0-B6B5-ECA229FE4B3D}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{6227F51A-1498-4C4A-B213-F6FDED605125}.Debug|Win32.ActiveCfg = Debug|Win32
{6227F51A-1498-4C4A-B213-F6FDED605125}.Debug|Win32.Build.0 = Debug|Win32
{6227F51A-1498-4C4A-B213-F6FDED605125}.Release|Win32.ActiveCfg = Release|Win32
{6227F51A-1498-4C4A-B213-F6FDED605125}.Release|Win32.Build.0 = Release|Win32
{9C2C266D-35A3-465F-A297-0E21D54E5C89}.Debug|Win32.ActiveCfg = Debug|Win32
{9C2C266D-35A3-465F-A297-0E21D54E5C89}.Debug|Win32.Build.0 = Debug|Win32
{9C2C266D-35A3-465F-A297-0E21D54E5C89}.Release|Win32.ActiveCfg = Release|Win32
{9C2C266D-35A3-465F-A297-0E21D54E5C89}.Release|Win32.Build.0 = Release|Win32
{1D3EEF7A-D248-48C0-B6B5-ECA229FE4B3D}.Debug|Win32.ActiveCfg = Debug|Win32
{1D3EEF7A-D248-48C0-B6B5-ECA229FE4B3D}.Debug|Win32.Build.0 = Debug|Win32
{1D3EEF7A-D248-48C0-B6B5-ECA229FE4B3D}.Release|Win32.ActiveCfg = Release|Win32
{1D3EEF7A-D248-48C0-B6B5-ECA229FE4B3D}.Release|Win32.Build.0 = Release|Win32
{8FB56F1C-E617-4B79-96AE-1FA499A3A9B5}.Debug|Win32.ActiveCfg = Debug|Win32
{8FB56F1C-E617-4B79-96AE-1FA499A3A9B5}.Debug|Win32.Build.0 = Debug|Win32
{8FB56F1C-E617-4B79-96AE-1FA499A3A9B5}.Release|Win32.ActiveCfg = Release|Win32
{8FB56F1C-E617-4B79-96AE-1FA499A3A9B5}.Release|Win32.Build.0 = Release|Win32
{7FB5F4A6-74F9-471D-B358-BAA0AC1CCA0A}.Debug|Win32.ActiveCfg = Debug|Win32
{7FB5F4A6-74F9-471D-B358-BAA0AC1CCA0A}.Debug|Win32.Build.0 = Debug|Win32
{7FB5F4A6-74F9-471D-B358-BAA0AC1CCA0A}.Release|Win32.ActiveCfg = Release|Win32
{7FB5F4A6-74F9-471D-B358-BAA0AC1CCA0A}.Release|Win32.Build.0 = Release|Win32
{6365804B-22C6-4D5E-91F3-0C052EB55B4F}.Debug|Win32.ActiveCfg = Debug|Win32
{6365804B-22C6-4D5E-91F3-0C052EB55B4F}.Debug|Win32.Build.0 = Debug|Win32
{6365804B-22C6-4D5E-91F3-0C052EB55B4F}.Release|Win32.ActiveCfg = Release|Win32
{6365804B-22C6-4D5E-91F3-0C052EB55B4F}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

558
build/vc9/libupnp.vcproj Normal file
View File

@@ -0,0 +1,558 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="libupnp"
ProjectGUID="{6227F51A-1498-4C4A-B213-F6FDED605125}"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="true"
SuppressStartupBanner="true"
TargetEnvironment="1"
TypeLibraryName=".\Release/libupnp.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\pthreads\include,..\ixml\src\inc,..\ixml\inc,..\threadutil\inc,..\upnp\inc,..\upnp\src\inc,.\inc"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBUPNP_EXPORTS;PTW32_STATIC_LIB;UPNP_STATIC_LIB;UPNP_USE_MSVCPP"
StringPooling="true"
RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
PrecompiledHeaderFile=".\Release/libupnp.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="true"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1031"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="odbc32.lib odbccp32.lib ..\..\pthreads\lib\pthreadvc2.lib ws2_32.lib"
OutputFile=".\Release/libupnp.dll"
LinkIncremental="1"
SuppressStartupBanner="true"
ProgramDatabaseFile=".\Release/libupnp.pdb"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
ImportLibrary=".\Release/libupnp.lib"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
SuppressStartupBanner="true"
OutputFile=".\Release/libupnp.bsc"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\out.vc9.$(ConfigurationName)\$(ProjectName)"
IntermediateDirectory=".\out.vc9.$(ConfigurationName)\$(ProjectName)"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="true"
SuppressStartupBanner="true"
TargetEnvironment="1"
TypeLibraryName=".\Debug/libupnp.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\pthreads\include;..\..\ixml\src\inc;..\..\ixml\inc;..\..\threadutil\inc;..\..\upnp\inc;..\..\upnp\src\inc;..\inc;..\msvc"
PreprocessorDefinitions="DEBUG;WIN32;_USRDLL;LIBUPNP_EXPORTS;UPNP_USE_MSVCPP"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
PrecompiledHeaderFile="$(OutDir)\libupnp.pch"
AssemblerListingLocation="$(OutDir)\"
ObjectFile="$(OutDir)\"
ProgramDataBaseFileName="$(OutDir)\"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1031"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="odbc32.lib odbccp32.lib ..\..\pthreads\lib\pthreadvc2.lib ws2_32.lib"
OutputFile="$(OutDir)\libupnp.dll"
LinkIncremental="2"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)\libupnp.pdb"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
ImportLibrary="$(OutDir)\libupnp.lib"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
SuppressStartupBanner="true"
OutputFile="$(OutDir)\libupnp.bsc"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="sources"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
>
<File
RelativePath="..\..\ixml\src\attr.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\client_table\client_table.c"
>
</File>
<File
RelativePath="..\..\ixml\src\document.c"
>
</File>
<File
RelativePath="..\..\ixml\src\element.c"
>
</File>
<File
RelativePath="..\..\threadutil\src\FreeList.c"
>
</File>
<File
RelativePath="..\..\upnp\src\gena\gena_callback2.c"
>
</File>
<File
RelativePath="..\..\upnp\src\gena\gena_ctrlpt.c"
>
</File>
<File
RelativePath="..\..\upnp\src\gena\gena_device.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\net\http\httpparser.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\net\http\httpreadwrite.c"
>
</File>
<File
RelativePath="..\..\upnp\src\inet_pton.c"
>
</File>
<File
RelativePath="..\..\ixml\src\ixml.c"
>
</File>
<File
RelativePath="..\..\ixml\src\ixmlmembuf.c"
>
</File>
<File
RelativePath="..\..\ixml\src\ixmlparser.c"
>
</File>
<File
RelativePath="..\..\threadutil\src\LinkedList.c"
>
</File>
<File
RelativePath="..\..\upnp\src\uuid\md5.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\util\membuffer.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\miniserver\miniserver.c"
>
</File>
<File
RelativePath="..\..\ixml\src\namedNodeMap.c"
>
</File>
<File
RelativePath="..\..\ixml\src\node.c"
>
</File>
<File
RelativePath="..\..\ixml\src\nodeList.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\net\http\parsetools.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\service_table\service_table.c"
>
</File>
<File
RelativePath="..\..\upnp\src\soap\soap_common.c"
>
</File>
<File
RelativePath="..\..\upnp\src\soap\soap_ctrlpt.c"
>
</File>
<File
RelativePath="..\..\upnp\src\soap\soap_device.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\net\sock.c"
>
</File>
<File
RelativePath="..\..\upnp\src\ssdp\ssdp_ctrlpt.c"
>
</File>
<File
RelativePath="..\..\upnp\src\ssdp\ssdp_device.c"
>
</File>
<File
RelativePath="..\..\upnp\src\ssdp\ssdp_server.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\net\http\statcodes.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\util\strintmap.c"
>
</File>
<File
RelativePath="..\..\upnp\src\uuid\sysdep.c"
>
</File>
<File
RelativePath="..\..\threadutil\src\ThreadPool.c"
>
</File>
<File
RelativePath="..\..\threadutil\src\TimerThread.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\util\upnp_timeout.c"
>
</File>
<File
RelativePath="..\..\upnp\src\api\upnpapi.c"
>
</File>
<File
RelativePath="..\..\upnp\src\api\upnpdebug.c"
>
</File>
<File
RelativePath="..\..\upnp\src\api\upnptools.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\net\uri\uri.c"
>
</File>
<File
RelativePath="..\..\upnp\src\urlconfig\urlconfig.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\util\util.c"
>
</File>
<File
RelativePath="..\..\upnp\src\uuid\uuid.c"
>
</File>
<File
RelativePath="..\..\upnp\src\genlib\net\http\webserver.c"
>
</File>
<File
RelativePath="..\..\upnp\src\win_dll.c"
>
</File>
</Filter>
<Filter
Name="headers"
Filter="h;hpp;hxx;hm;inl"
>
<File
RelativePath="..\..\upnp\src\inc\client_table.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\config.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\gena.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\gena_ctrlpt.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\gena_device.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\global.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\gmtdate.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\http_client.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\httpparser.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\httpreadwrite.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\inet_pton.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\md5.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\membuffer.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\miniserver.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\netall.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\parsetools.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\server.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\service_table.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\soaplib.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\sock.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\ssdplib.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\statcodes.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\statuscodes.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\strintmap.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\sysdep.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\unixutil.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\upnp_timeout.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\upnpapi.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\upnpclosesocket.h"
>
</File>
<File
RelativePath="..\..\upnp\inc\upnpdebug.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\uri.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\urlconfig.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\util.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\utilall.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\uuid.h"
>
</File>
<File
RelativePath="..\..\upnp\src\inc\webserver.h"
>
</File>
</Filter>
<Filter
Name="resources"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
>
</Filter>
<File
RelativePath="..\..\..\..\libupnp_win32.patch"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

212
build/vc9/threadutil.vcproj Normal file
View File

@@ -0,0 +1,212 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="threadutil"
ProjectGUID="{1D3EEF7A-D248-48C0-B6B5-ECA229FE4B3D}"
RootNamespace="threadutil"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\out.vc9.$(ConfigurationName)\$(ProjectName)"
IntermediateDirectory=".\out.vc9.$(ConfigurationName)\$(ProjectName)"
ConfigurationType="4"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\threadutil\inc;..\..\upnp\inc;..\..\ixml\inc;..\..\pthreads\include"
PreprocessorDefinitions="WIN32;DEBUG"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
AdditionalDependencies="pthreadVC2.lib"
AdditionalLibraryDirectories="..\..\pthreads\lib"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\..\threadutil\src\FreeList.c"
>
</File>
<File
RelativePath="..\..\threadutil\src\LinkedList.c"
>
</File>
<File
RelativePath="..\..\threadutil\src\ThreadPool.c"
>
</File>
<File
RelativePath="..\..\threadutil\src\TimerThread.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\..\threadutil\inc\FreeList.h"
>
</File>
<File
RelativePath="..\..\threadutil\inc\ithread.h"
>
</File>
<File
RelativePath="..\..\threadutil\inc\LinkedList.h"
>
</File>
<File
RelativePath="..\..\threadutil\inc\threadpool.h"
>
</File>
<File
RelativePath="..\..\threadutil\inc\TimerThread.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

212
build/vc9/tvcombo.vcproj Normal file
View File

@@ -0,0 +1,212 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="tvcombo"
ProjectGUID="{6365804B-22C6-4D5E-91F3-0C052EB55B4F}"
RootNamespace="tvcombo"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\out.vc9.$(ConfigurationName)\$(ProjectName)"
IntermediateDirectory=".\out.vc9.$(ConfigurationName)\$(ProjectName)"
ConfigurationType="1"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\upnp\inc;..\..\upnp\sample\common;..\..\upnp\sample;..\..\ixml\inc;..\..\pthreads\include;..\inc;..\..\threadutil\inc;..\..\upnp\sample\tvcombo"
PreprocessorDefinitions="DEBUG;WIN32"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="..\..\pthreads\lib\pthreadVC2.lib ixml.lib threadutil.lib libupnp.lib"
AdditionalLibraryDirectories="&quot;$(OutDir)&quot;;&quot;.\out.vc9.$(ConfigurationName)\ixml&quot;;&quot;.\out.vc9.$(ConfigurationName)\threadutil&quot;;&quot;.\out.vc9.$(ConfigurationName)\libupnp&quot;"
GenerateDebugInformation="true"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\..\upnp\sample\common\sample_util.c"
>
</File>
<File
RelativePath="..\..\upnp\sample\tvcombo\linux\upnp_tv_combo_main.c"
>
</File>
<File
RelativePath="..\..\upnp\sample\tvcombo\upnp_tv_ctrlpt.c"
>
</File>
<File
RelativePath="..\..\upnp\sample\tvcombo\upnp_tv_device.c"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\..\upnp\sample\common\sample_util.h"
>
</File>
<File
RelativePath="..\..\upnp\sample\tvcombo\upnp_tv_ctrlpt.h"
>
</File>
<File
RelativePath="..\..\upnp\sample\tvcombo\upnp_tv_device.h"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

204
build/vc9/tvctrlpt.vcproj Normal file
View File

@@ -0,0 +1,204 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="tvctrlpt"
ProjectGUID="{8FB56F1C-E617-4B79-96AE-1FA499A3A9B5}"
RootNamespace="sample"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\out.vc9.$(ConfigurationName)\$(ProjectName)"
IntermediateDirectory=".\out.vc9.$(ConfigurationName)\$(ProjectName)"
ConfigurationType="1"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\upnp\inc;..\..\upnp\sample\common;..\..\ixml\inc;..\inc;..\..\threadutil\inc;..\..\pthreads\include;..\..\upnp\sample\tvctrlpt\linux;..\..\upnp\sample\tvctrlpt"
PreprocessorDefinitions="WIN32;DEBUG"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="..\..\pthreads\lib\pthreadVC2.lib ixml.lib threadutil.lib libupnp.lib"
AdditionalLibraryDirectories="&quot;$(OutDir)&quot;;&quot;.\out.vc9.$(ConfigurationName)\ixml&quot;;&quot;.\out.vc9.$(ConfigurationName)\threadutil&quot;;&quot;.\out.vc9.$(ConfigurationName)\libupnp&quot;"
GenerateDebugInformation="true"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\..\upnp\sample\common\sample_util.c"
>
</File>
<File
RelativePath="..\..\upnp\sample\tvctrlpt\upnp_tv_ctrlpt.c"
>
</File>
<File
RelativePath="..\..\upnp\sample\tvctrlpt\linux\upnp_tv_ctrlpt_main.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\..\upnp\sample\common\sample_util.h"
>
</File>
<File
RelativePath="..\..\upnp\sample\tvctrlpt\upnp_tv_ctrlpt.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

204
build/vc9/tvdevice.vcproj Normal file
View File

@@ -0,0 +1,204 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="tvdevice"
ProjectGUID="{7FB5F4A6-74F9-471D-B358-BAA0AC1CCA0A}"
RootNamespace="tvdevice"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\out.vc9.$(ConfigurationName)\$(ProjectName)"
IntermediateDirectory=".\out.vc9.$(ConfigurationName)\$(ProjectName)"
ConfigurationType="1"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\upnp\inc;..\..\ixml\inc;..\..\upnp\sample\common;..\inc;..\..\threadutil\inc;..\..\pthreads\include;..\..\upnp\sample\tvdevice;..\..\upnp\sample\tvdevice\linux"
PreprocessorDefinitions="WIN32;DEBUG"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="..\..\pthreads\lib\pthreadVC2.lib ixml.lib threadutil.lib libupnp.lib"
AdditionalLibraryDirectories="&quot;$(OutDir)&quot;;&quot;.\out.vc9.$(ConfigurationName)\ixml&quot;;&quot;.\out.vc9.$(ConfigurationName)\threadutil&quot;;&quot;.\out.vc9.$(ConfigurationName)\libupnp&quot;"
GenerateDebugInformation="true"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\..\upnp\sample\common\sample_util.c"
>
</File>
<File
RelativePath="..\..\upnp\sample\tvdevice\upnp_tv_device.c"
>
</File>
<File
RelativePath="..\..\upnp\sample\tvdevice\linux\upnp_tv_device_main.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\..\upnp\sample\common\sample_util.h"
>
</File>
<File
RelativePath="..\..\upnp\sample\tvdevice\upnp_tv_device.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -4,12 +4,12 @@
# #
# Process this file with autoconf to produce a configure script. # Process this file with autoconf to produce a configure script.
# #
# (C) Copyright 2005-2007 R<>mi Turboult <r3mi@users.sourceforge.net> # (C) Copyright 2005-2007 R<>mi Turboult <r3mi@users.sourceforge.net>
# #
AC_PREREQ(2.60) AC_PREREQ(2.60)
AC_INIT([libupnp], [1.6.4], [mroberto@users.sourceforge.net]) AC_INIT([libupnp], [1.6.6], [mroberto@users.sourceforge.net])
dnl ############################################################################ dnl ############################################################################
dnl # *Independently* of the above libupnp package version, the libtool version dnl # *Independently* of the above libupnp package version, the libtool version
dnl # of the 3 libraries need to be updated whenever there is a change released: dnl # of the 3 libraries need to be updated whenever there is a change released:
@@ -120,9 +120,33 @@ dnl #AC_SUBST([LT_VERSION_THREADUTIL], [4:2:2])
dnl #AC_SUBST([LT_VERSION_UPNP], [3:3:0]) dnl #AC_SUBST([LT_VERSION_UPNP], [3:3:0])
dnl # dnl #
dnl ############################################################################ dnl ############################################################################
dnl # Release 1.6.5:
dnl # "current:revision:age"
dnl #
dnl # - Code has changed in upnp
dnl # revision: 3 -> 4
dnl #
dnl #AC_SUBST([LT_VERSION_IXML], [2:4:0])
dnl #AC_SUBST([LT_VERSION_THREADUTIL], [4:2:2])
dnl #AC_SUBST([LT_VERSION_UPNP], [3:4:0])
dnl #
dnl ############################################################################
dnl # Release 1.6.6:
dnl # "current:revision:age"
dnl #
dnl # - Code has changed in threadutil
dnl # revision: 2 -> 3
dnl # - Code has changed in upnp
dnl # revision: 4 -> 5
dnl #
dnl #AC_SUBST([LT_VERSION_IXML], [2:4:0])
dnl #AC_SUBST([LT_VERSION_THREADUTIL], [4:3:2])
dnl #AC_SUBST([LT_VERSION_UPNP], [3:5:0])
dnl #
dnl ############################################################################
AC_SUBST([LT_VERSION_IXML], [2:4:0]) AC_SUBST([LT_VERSION_IXML], [2:4:0])
AC_SUBST([LT_VERSION_THREADUTIL], [4:2:2]) AC_SUBST([LT_VERSION_THREADUTIL], [4:3:2])
AC_SUBST([LT_VERSION_UPNP], [3:3:0]) AC_SUBST([LT_VERSION_UPNP], [3:5:0])
dnl ############################################################################ dnl ############################################################################
dnl # Repeating the algorithm to place it closer to the modificatin place: dnl # Repeating the algorithm to place it closer to the modificatin place:
dnl # - library code modified: revision++ dnl # - library code modified: revision++
@@ -277,7 +301,9 @@ freebsd*)
echo "Using non-specific system compiler settings" echo "Using non-specific system compiler settings"
if test x"$enable_debug" = xyes; then if test x"$enable_debug" = xyes; then
# AC_PROG_CC already sets CFLAGS to "-g -O2" by default # AC_PROG_CC already sets CFLAGS to "-g -O2" by default
: #:
# Use -O0 in debug so that variables do not get optimized out
AX_CFLAGS_GCC_OPTION([-O0])
else else
# add optimise for size # add optimise for size
AX_CFLAGS_GCC_OPTION([-Os]) AX_CFLAGS_GCC_OPTION([-Os])

View File

@@ -268,7 +268,7 @@ ixmlDocument_createDocumentEx( OUT IXML_Document ** rtDoc )
* *
*=================================================================*/ *=================================================================*/
IXML_Document * IXML_Document *
ixmlDocument_createDocument( ) ixmlDocument_createDocument()
{ {
IXML_Document *doc = NULL; IXML_Document *doc = NULL;

View File

@@ -483,7 +483,7 @@ Parser_UTF8ToInt( IN const char *ss,
* *
*===============================================================================*/ *===============================================================================*/
static Parser * static Parser *
Parser_init( ) Parser_init()
{ {
Parser *newParser = NULL; Parser *newParser = NULL;
@@ -677,7 +677,7 @@ Parser_LoadDocument( OUT IXML_Document ** retDoc,
int rc = IXML_SUCCESS; int rc = IXML_SUCCESS;
Parser *xmlParser = NULL; Parser *xmlParser = NULL;
xmlParser = Parser_init( ); xmlParser = Parser_init();
if( xmlParser == NULL ) { if( xmlParser == NULL ) {
return IXML_INSUFFICIENT_MEMORY; return IXML_INSUFFICIENT_MEMORY;
} }

View File

@@ -261,7 +261,7 @@ ixmlNode_setLocalName( IN IXML_Node * nodeptr,
} }
/*================================================================ /*================================================================
* ixmlNode_getNodeNamespaceURI * ixmlNode_getNamespaceURI
* Returns the node namespaceURI * Returns the node namespaceURI
* External function. * External function.
* Returns: * Returns:

View File

@@ -1,4 +1,4 @@
Version: 1.6.4 Version: 1.6.6
Summary: Universal Plug and Play (UPnP) SDK Summary: Universal Plug and Play (UPnP) SDK
Name: libupnp Name: libupnp
Release: 1%{?dist} Release: 1%{?dist}

View File

@@ -12,7 +12,7 @@ dnl $2 = default value, shall be m4 constant, either [yes] or [no]
dnl $3 = help string (default value is appended) e.g. [compile debugging code] dnl $3 = help string (default value is appended) e.g. [compile debugging code]
dnl dnl
dnl @version $Id: rt_bool_arg_enable.m4,v 1.2 2006/02/18 14:35:09 r3mi Exp $ dnl @version $Id: rt_bool_arg_enable.m4,v 1.2 2006/02/18 14:35:09 r3mi Exp $
dnl @author R<>mi Turboult <r3mi@users.sourceforge.net> dnl @author R<>mi Turboult <r3mi@users.sourceforge.net>
dnl @license GPLWithACException dnl @license GPLWithACException
dnl dnl
dnl This file is free software, distributed under the terms of the GNU dnl This file is free software, distributed under the terms of the GNU

View File

@@ -2,7 +2,7 @@
# #
# "Makefile.am" for "libupnp/threadutil" # "Makefile.am" for "libupnp/threadutil"
# #
# (C) Copyright 2005 R<>mi Turboult <r3mi@users.sourceforge.net> # (C) Copyright 2005 R<>mi Turboult <r3mi@users.sourceforge.net>
# #
AM_CPPFLAGS = -I$(srcdir)/inc -I$(srcdir)/src/inc AM_CPPFLAGS = -I$(srcdir)/inc -I$(srcdir)/src/inc

View File

@@ -79,7 +79,20 @@ typedef enum priority {LOW_PRIORITY,
#endif #endif
#include "LinkedList.h" #include "LinkedList.h"
#include <sys/time.h> /* for gettimeofday() */
#ifdef WIN32
#include <time.h>
#include <winsock2.h>
struct timezone
{
int tz_minuteswest; /* minutes W of Greenwich */
int tz_dsttime; /* type of dst correction */
};
int gettimeofday(struct timeval *tv, struct timezone *tz);
#else /* WIN32 */
#include <sys/time.h> /* for gettimeofday() */
#endif
#include "FreeList.h" #include "FreeList.h"
#include "ithread.h" #include "ithread.h"

View File

@@ -715,7 +715,11 @@ typedef pthread_rwlock_t ithread_rwlock_t;
* 0 on success, Nonzero on failure. * 0 on success, Nonzero on failure.
* See man page for sleep (man 3 sleep) * See man page for sleep (man 3 sleep)
*****************************************************************************/ *****************************************************************************/
#ifndef WIN32
#define isleep sleep #define isleep sleep
#else
#define isleep(x) Sleep((x)*1000)
#endif
/**************************************************************************** /****************************************************************************
* Function: isleep * Function: isleep
@@ -730,7 +734,11 @@ typedef pthread_rwlock_t ithread_rwlock_t;
* 0 on success, Nonzero on failure. * 0 on success, Nonzero on failure.
* See man page for sleep (man 3 sleep) * See man page for sleep (man 3 sleep)
*****************************************************************************/ *****************************************************************************/
#ifndef WIN32
#define imillisleep(x) usleep(1000*x) #define imillisleep(x) usleep(1000*x)
#else
#define imillisleep Sleep
#endif
#ifdef WIN32 #ifdef WIN32
#ifndef UPNP_STATIC_LIB #ifndef UPNP_STATIC_LIB

View File

@@ -30,11 +30,13 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#include "LinkedList.h" #include "LinkedList.h"
#include <sys/param.h> #ifndef WIN32
#include <sys/param.h>
#endif
#if (defined(BSD) && BSD >= 199306) || defined(__OSX__) || defined(__APPLE__) #if (defined(BSD) && BSD >= 199306) || defined(__OSX__) || defined(__APPLE__)
#include <stdlib.h> #include <stdlib.h>
#else #else
#include <malloc.h> #include <malloc.h>
#endif #endif
#include <assert.h> #include <assert.h>
@@ -532,3 +534,4 @@ ListSize( LinkedList * list )
return list->size; return list->size;
} }

View File

@@ -391,7 +391,7 @@ static void SetSeed()
srand( ( unsigned int )t.tv_usec + (unsigned int)ithread_get_current_thread_id().p ); srand( ( unsigned int )t.tv_usec + (unsigned int)ithread_get_current_thread_id().p );
#elif defined(__FreeBSD__) || defined(__OSX__) || defined(__APPLE__) #elif defined(__FreeBSD__) || defined(__OSX__) || defined(__APPLE__)
srand( ( unsigned int )t.tv_usec + (unsigned int)ithread_get_current_thread_id() ); srand( ( unsigned int )t.tv_usec + (unsigned int)ithread_get_current_thread_id() );
#elif defined(__linux__) #elif defined(__linux__) || defined(__sun)
srand( ( unsigned int )t.tv_usec + ithread_get_current_thread_id() ); srand( ( unsigned int )t.tv_usec + ithread_get_current_thread_id() );
#else #else
{ {
@@ -1597,3 +1597,45 @@ int ThreadPoolGetStats( ThreadPool *tp, ThreadPoolStats *stats )
#endif /* STATS */ #endif /* STATS */
#ifdef WIN32
#if defined(_MSC_VER) || defined(_MSC_EXTENSIONS)
#define DELTA_EPOCH_IN_MICROSECS 11644473600000000Ui64
#else
#define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL
#endif
int gettimeofday(struct timeval *tv, struct timezone *tz)
{
FILETIME ft;
unsigned __int64 tmpres = 0;
static int tzflag;
if (NULL != tv)
{
GetSystemTimeAsFileTime(&ft);
tmpres |= ft.dwHighDateTime;
tmpres <<= 32;
tmpres |= ft.dwLowDateTime;
/*converting file time to unix epoch*/
tmpres /= 10; /*convert into microseconds*/
tmpres -= DELTA_EPOCH_IN_MICROSECS;
tv->tv_sec = (long)(tmpres / 1000000UL);
tv->tv_usec = (long)(tmpres % 1000000UL);
}
if (NULL != tz)
{
if (!tzflag)
{
_tzset();
tzflag++;
}
tz->tz_minuteswest = _timezone / 60;
tz->tz_dsttime = _daylight;
}
return 0;
}
#endif /* WIN32 */

View File

@@ -1,7 +1,7 @@
# #
# "Makefile.am" for "libupnp/upnp" # "Makefile.am" for "libupnp/upnp"
# #
# Copyright (C) 2005 R<>mi Turboult <r3mi@users.sourceforge.net> # Copyright (C) 2005 R<>mi Turboult <r3mi@users.sourceforge.net>
# #
SUBDIRS = doc . sample SUBDIRS = doc . sample

View File

@@ -47,7 +47,9 @@
#include <stdio.h> #include <stdio.h>
#include <sys/param.h> #ifndef WIN32
#include <sys/param.h>
#endif
#if (defined(BSD) && BSD >= 199306) #if (defined(BSD) && BSD >= 199306)
#include <time.h> #include <time.h>
#endif #endif
@@ -102,8 +104,6 @@
#define UpnpCloseSocket closesocket #define UpnpCloseSocket closesocket
#define fseeko fseek #define fseeko fseek
#endif #endif
#define UPNP_SOCKETERROR -1
#define UPNP_INVALID_SOCKET -1
#ifndef WIN32 #ifndef WIN32
#define SOCKET int #define SOCKET int
#endif #endif

View File

@@ -1,7 +1,7 @@
/******************************************************************************* /*******************************************************************************
* *
* Copyright (c) 2000-2003 Intel Corporation * Copyright (c) 2000-2003 Intel Corporation
* Copyright (c) 2006 R<>mi Turboult <r3mi@users.sourceforge.net> * Copyright (c) 2006 R<>mi Turboult <r3mi@users.sourceforge.net>
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without

View File

@@ -105,7 +105,7 @@ SampleUtil_RegisterUpdateFunction( state_update update_function )
* *
********************************************************************************/ ********************************************************************************/
int int
SampleUtil_Finish( ) SampleUtil_Finish()
{ {
ithread_mutex_destroy( &display_mutex ); ithread_mutex_destroy( &display_mutex );
gPrintFun = NULL; gPrintFun = NULL;

View File

@@ -34,24 +34,26 @@
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif /* __cplusplus */
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "upnptools.h"
#include "ithread.h" #include "ithread.h"
#include "ixml.h" #include "ixml.h"
#include "upnptools.h"
// mutex to control displaying of events
extern ithread_mutex_t display_mutex;
//mutex to control displaying of events
extern ithread_mutex_t display_mutex ;
typedef enum { typedef enum {
STATE_UPDATE = 0, STATE_UPDATE = 0,
DEVICE_ADDED =1, DEVICE_ADDED = 1,
DEVICE_REMOVED=2, DEVICE_REMOVED = 2,
GET_VAR_COMPLETE=3 GET_VAR_COMPLETE = 3
} eventType; } eventType;
@@ -68,7 +70,7 @@ typedef enum {
* node -- The DOM node from which to extract the value * node -- The DOM node from which to extract the value
* *
********************************************************************************/ ********************************************************************************/
char * SampleUtil_GetElementValue(IN IXML_Element *element); char *SampleUtil_GetElementValue(IN IXML_Element *element);
/******************************************************************************** /********************************************************************************
* SampleUtil_GetFirstServiceList * SampleUtil_GetFirstServiceList
@@ -85,7 +87,7 @@ char * SampleUtil_GetElementValue(IN IXML_Element *element);
* *
********************************************************************************/ ********************************************************************************/
IXML_NodeList *SampleUtil_GetFirstServiceList(IN IXML_Document * doc); IXML_NodeList *SampleUtil_GetFirstServiceList(IN IXML_Document *doc);
/******************************************************************************** /********************************************************************************
@@ -100,7 +102,7 @@ IXML_NodeList *SampleUtil_GetFirstServiceList(IN IXML_Document * doc);
* item -- The item to search for * item -- The item to search for
* *
********************************************************************************/ ********************************************************************************/
char * SampleUtil_GetFirstDocumentItem(IN IXML_Document *doc, IN const char *item); char *SampleUtil_GetFirstDocumentItem(IN IXML_Document *doc, IN const char *item);
@@ -116,7 +118,7 @@ char * SampleUtil_GetFirstDocumentItem(IN IXML_Document *doc, IN const char *ite
* item -- The item to search for * item -- The item to search for
* *
********************************************************************************/ ********************************************************************************/
char * SampleUtil_GetFirstElementItem(IN IXML_Element *element, IN const char *item); char *SampleUtil_GetFirstElementItem(IN IXML_Element *element, IN const char *item);
/******************************************************************************** /********************************************************************************
* SampleUtil_PrintEventType * SampleUtil_PrintEventType
@@ -162,9 +164,13 @@ int SampleUtil_PrintEvent(IN Upnp_EventType EventType,
* controlURL -- OUT -- The control URL for the service * controlURL -- OUT -- The control URL for the service
* *
********************************************************************************/ ********************************************************************************/
int SampleUtil_FindAndParseService (IN IXML_Document *DescDoc, IN char* location, int SampleUtil_FindAndParseService (
IN char *serviceType, OUT char **serviceId, IN IXML_Document *DescDoc,
OUT char **eventURL, OUT char **controlURL); IN char* location,
IN char *serviceType,
OUT char **serviceId,
OUT char **eventURL,
OUT char **controlURL);
/******************************************************************************** /********************************************************************************
@@ -196,8 +202,11 @@ extern print_string gPrintFun;
* const char * UDN * const char * UDN
* int newDevice * int newDevice
********************************************************************************/ ********************************************************************************/
typedef void (*state_update)( const char *varName, const char *varValue, const char *UDN, typedef void (*state_update)(
eventType type); const char *varName,
const char *varValue,
const char *UDN,
eventType type);
//global state update function used by smaple util //global state update function used by smaple util
extern state_update gStateUpdateFun; extern state_update gStateUpdateFun;
@@ -224,7 +233,7 @@ int SampleUtil_Initialize(print_string print_function);
* Parameters: * Parameters:
* *
********************************************************************************/ ********************************************************************************/
int SampleUtil_Finish(void); int SampleUtil_Finish();
/******************************************************************************** /********************************************************************************
* SampleUtil_Print * SampleUtil_Print
@@ -238,7 +247,7 @@ int SampleUtil_Finish(void);
* . . . - variable number of args. (see printf) * . . . - variable number of args. (see printf)
* *
********************************************************************************/ ********************************************************************************/
int SampleUtil_Print( char *fmt, ... ); int SampleUtil_Print(char *fmt, ...);
/******************************************************************************** /********************************************************************************
* SampleUtil_RegisterUpdateFunction * SampleUtil_RegisterUpdateFunction
@@ -248,7 +257,7 @@ int SampleUtil_Print( char *fmt, ... );
* Parameters: * Parameters:
* *
********************************************************************************/ ********************************************************************************/
int SampleUtil_RegisterUpdateFunction( state_update update_function ); int SampleUtil_RegisterUpdateFunction(state_update update_function);
/******************************************************************************** /********************************************************************************
* SampleUtil_StateUpdate * SampleUtil_StateUpdate
@@ -258,11 +267,22 @@ int SampleUtil_RegisterUpdateFunction( state_update update_function );
* Parameters: * Parameters:
* *
********************************************************************************/ ********************************************************************************/
void SampleUtil_StateUpdate( const char *varName, const char *varValue, const char *UDN, void SampleUtil_StateUpdate(
eventType type); const char *varName,
const char *varValue,
const char *UDN,
eventType type);
#ifdef __cplusplus #ifdef __cplusplus
}; };
#endif /* __cplusplus */
#ifdef WIN32
#define snprintf _snprintf
#define strcasecmp stricmp
#endif #endif
#endif /* UPNPSDK_UTIL_H */
#endif /* SAMPLE_UTIL_H */

View File

@@ -449,17 +449,17 @@ device_main( int argc, char **argv )
port = ( unsigned short )portTemp; port = ( unsigned short )portTemp;
return TvDeviceStart( return TvDeviceStart( ip_address, port, desc_doc_name, web_dir_path, linux_print );
ip_address, port, desc_doc_name, web_dir_path, linux_print );
} }
int int main( int argc, char **argv )
main( int argc, char **argv )
{ {
int rc; int rc;
ithread_t cmdloop_thread; ithread_t cmdloop_thread;
#ifndef WIN32
int sig; int sig;
sigset_t sigs_to_catch; sigset_t sigs_to_catch;
#endif
int code; int code;
device_main(argc, argv); device_main(argc, argv);
@@ -468,11 +468,10 @@ main( int argc, char **argv )
SampleUtil_Print( "Error starting UPnP TV Control Point" ); SampleUtil_Print( "Error starting UPnP TV Control Point" );
return rc; return rc;
} }
// start a command loop thread /* start a command loop thread */
code = code = ithread_create( &cmdloop_thread, NULL, TvCtrlPointCommandLoop, NULL );
ithread_create( &cmdloop_thread, NULL, TvCtrlPointCommandLoop,
NULL );
#ifndef WIN32
/* /*
Catch Ctrl-C and properly shutdown Catch Ctrl-C and properly shutdown
*/ */
@@ -480,7 +479,10 @@ main( int argc, char **argv )
sigaddset( &sigs_to_catch, SIGINT ); sigaddset( &sigs_to_catch, SIGINT );
sigwait( &sigs_to_catch, &sig ); sigwait( &sigs_to_catch, &sig );
SampleUtil_Print( "Shutting down on signal %d...", sig ); SampleUtil_Print( "Shutting down on signal %d...\n", sig );
#else
ithread_join(cmdloop_thread, NULL);
#endif
TvDeviceStop(); TvDeviceStop();
rc = TvCtrlPointStop(); rc = TvCtrlPointStop();

View File

@@ -224,7 +224,7 @@ TvCtrlPointRefresh( void )
{ {
int rc; int rc;
TvCtrlPointRemoveAll( ); TvCtrlPointRemoveAll();
/* /*
Search for all devices of type tvdevice version 1, Search for all devices of type tvdevice version 1,
@@ -539,7 +539,7 @@ TvCtrlPointGetDevice( int devnum,
* *
********************************************************************************/ ********************************************************************************/
int int
TvCtrlPointPrintList( ) TvCtrlPointPrintList()
{ {
struct TvDeviceNode *tmpdevnode; struct TvDeviceNode *tmpdevnode;
int i = 0; int i = 0;
@@ -1096,7 +1096,7 @@ TvCtrlPointCallbackEventHandler( Upnp_EventType EventType,
if( DescDoc ) if( DescDoc )
ixmlDocument_free( DescDoc ); ixmlDocument_free( DescDoc );
TvCtrlPointPrintList( ); TvCtrlPointPrintList();
break; break;
} }
@@ -1122,7 +1122,7 @@ TvCtrlPointCallbackEventHandler( Upnp_EventType EventType,
TvCtrlPointRemoveDevice( d_event->DeviceId ); TvCtrlPointRemoveDevice( d_event->DeviceId );
SampleUtil_Print( "After byebye:" ); SampleUtil_Print( "After byebye:" );
TvCtrlPointPrintList( ); TvCtrlPointPrintList();
break; break;
} }
@@ -1354,7 +1354,7 @@ TvCtrlPointStart( print_string printFunctionPtr,
{ {
ithread_t timer_thread; ithread_t timer_thread;
int rc; int rc;
short int port = 0; unsigned short port = 0;
char *ip_address = NULL; char *ip_address = NULL;
SampleUtil_Initialize( printFunctionPtr ); SampleUtil_Initialize( printFunctionPtr );
@@ -1362,34 +1362,42 @@ TvCtrlPointStart( print_string printFunctionPtr,
ithread_mutex_init( &DeviceListMutex, 0 ); ithread_mutex_init( &DeviceListMutex, 0 );
SampleUtil_Print( "Intializing UPnP with ipaddress=%s port=%d", SampleUtil_Print(
ip_address, port ); "Initializing UPnP Sdk with\n"
"\tipaddress = %s port = %u\n",
ip_address, port );
rc = UpnpInit( ip_address, port ); rc = UpnpInit( ip_address, port );
if( UPNP_E_SUCCESS != rc ) { if( UPNP_E_SUCCESS != rc ) {
SampleUtil_Print( "WinCEStart: UpnpInit() Error: %d", rc ); SampleUtil_Print( "WinCEStart: UpnpInit() Error: %d", rc );
//UpnpFinish( ); //UpnpFinish();
//return TV_ERROR; //return TV_ERROR;
} }
if( NULL == ip_address ) if( NULL == ip_address ) {
ip_address = UpnpGetServerIpAddress( ); ip_address = UpnpGetServerIpAddress();
if( 0 == port ) }
port = UpnpGetServerPort( ); if( 0 == port ) {
port = UpnpGetServerPort();
}
SampleUtil_Print( "UPnP Initialized (%s:%d)", ip_address, port ); SampleUtil_Print(
"UPnP Initialized\n"
"\tipaddress= %s port = %u\n",
ip_address, port );
SampleUtil_Print( "Registering Control Point" ); SampleUtil_Print( "Registering Control Point" );
rc = UpnpRegisterClient( TvCtrlPointCallbackEventHandler, rc = UpnpRegisterClient( TvCtrlPointCallbackEventHandler,
&ctrlpt_handle, &ctrlpt_handle ); &ctrlpt_handle, &ctrlpt_handle );
if( UPNP_E_SUCCESS != rc ) { if( UPNP_E_SUCCESS != rc ) {
SampleUtil_Print( "Error registering CP: %d", rc ); SampleUtil_Print( "Error registering CP: %d", rc );
UpnpFinish( ); UpnpFinish();
return TV_ERROR; return TV_ERROR;
} }
SampleUtil_Print( "Control Point Registered" ); SampleUtil_Print( "Control Point Registered" );
TvCtrlPointRefresh( ); TvCtrlPointRefresh();
// start a timer thread // start a timer thread
ithread_create( &timer_thread, NULL, TvCtrlPointTimerLoop, NULL ); ithread_create( &timer_thread, NULL, TvCtrlPointTimerLoop, NULL );
@@ -1400,10 +1408,10 @@ TvCtrlPointStart( print_string printFunctionPtr,
int int
TvCtrlPointStop( void ) TvCtrlPointStop( void )
{ {
TvCtrlPointRemoveAll( ); TvCtrlPointRemoveAll();
UpnpUnRegisterClient( ctrlpt_handle ); UpnpUnRegisterClient( ctrlpt_handle );
UpnpFinish( ); UpnpFinish();
SampleUtil_Finish( ); SampleUtil_Finish();
return TV_SUCCESS; return TV_SUCCESS;
} }

View File

@@ -39,7 +39,9 @@ extern "C" {
#include <stdio.h> #include <stdio.h>
#include "ithread.h" #include "ithread.h"
#ifndef WIN32
#include <unistd.h> #include <unistd.h>
#endif
#include <stdarg.h> #include <stdarg.h>
#include <stdlib.h> #include <stdlib.h>
#include <signal.h> #include <signal.h>

View File

@@ -1913,11 +1913,11 @@ TvDeviceCallbackEventHandler( Upnp_EventType EventType,
* *
*****************************************************************************/ *****************************************************************************/
int int
TvDeviceStop( ) TvDeviceStop()
{ {
UpnpUnRegisterRootDevice( device_handle ); UpnpUnRegisterRootDevice( device_handle );
UpnpFinish( ); UpnpFinish();
SampleUtil_Finish( ); SampleUtil_Finish();
ithread_mutex_destroy( &TVDevMutex ); ithread_mutex_destroy( &TVDevMutex );
return UPNP_E_SUCCESS; return UPNP_E_SUCCESS;
} }
@@ -1958,32 +1958,37 @@ TvDeviceStart( char *ip_address,
SampleUtil_Initialize( pfun ); SampleUtil_Initialize( pfun );
SampleUtil_Print SampleUtil_Print(
( "Initializing UPnP Sdk with \n \t ipaddress = %s port = %d\n", "Initializing UPnP Sdk with\n"
ip_address, port ); "\tipaddress = %s port = %u\n",
ip_address, port );
if( ( ret = UpnpInit( ip_address, port ) ) != UPNP_E_SUCCESS ) { if( ( ret = UpnpInit( ip_address, port ) ) != UPNP_E_SUCCESS ) {
SampleUtil_Print( "Error with UpnpInit -- %d\n", ret ); SampleUtil_Print( "Error with UpnpInit -- %d\n", ret );
UpnpFinish( ); UpnpFinish();
return ret; return ret;
} }
if( ip_address == NULL ) { if( ip_address == NULL ) {
ip_address = UpnpGetServerIpAddress( ); ip_address = UpnpGetServerIpAddress();
} }
if( port == 0 ) { if( port == 0 ) {
port = UpnpGetServerPort( ); port = UpnpGetServerPort();
} }
SampleUtil_Print( "UPnP Initialized\n \t ipaddress= %s port = %d\n", SampleUtil_Print(
ip_address, port ); "UPnP Initialized\n"
"\tipaddress= %s port = %u\n",
ip_address, port );
if( desc_doc_name == NULL ) if( desc_doc_name == NULL ) {
desc_doc_name = "tvcombodesc.xml"; desc_doc_name = "tvcombodesc.xml";
}
if( web_dir_path == NULL ) if( web_dir_path == NULL ) {
web_dir_path = DEFAULT_WEB_DIR; web_dir_path = DEFAULT_WEB_DIR;
}
snprintf( desc_doc_url, DESC_URL_SIZE, "http://%s:%d/%s", ip_address, snprintf( desc_doc_url, DESC_URL_SIZE, "http://%s:%d/%s", ip_address,
port, desc_doc_name ); port, desc_doc_name );
@@ -1995,37 +2000,39 @@ TvDeviceStart( char *ip_address,
SampleUtil_Print SampleUtil_Print
( "Error specifying webserver root directory -- %s: %d\n", ( "Error specifying webserver root directory -- %s: %d\n",
web_dir_path, ret ); web_dir_path, ret );
UpnpFinish( ); UpnpFinish();
return ret; return ret;
} }
SampleUtil_Print SampleUtil_Print(
( "Registering the RootDevice\n\t with desc_doc_url: %s\n", "Registering the RootDevice\n"
desc_doc_url ); "\t with desc_doc_url: %s\n",
desc_doc_url );
if( ( ret = UpnpRegisterRootDevice( desc_doc_url, if( ( ret = UpnpRegisterRootDevice( desc_doc_url,
TvDeviceCallbackEventHandler, TvDeviceCallbackEventHandler,
&device_handle, &device_handle ) ) &device_handle, &device_handle ) )
!= UPNP_E_SUCCESS ) { != UPNP_E_SUCCESS ) {
SampleUtil_Print( "Error registering the rootdevice : %d\n", ret ); SampleUtil_Print( "Error registering the rootdevice : %d\n", ret );
UpnpFinish( ); UpnpFinish();
return ret; return ret;
} else { } else {
SampleUtil_Print( "RootDevice Registered\n" ); SampleUtil_Print(
"RootDevice Registered\n"
SampleUtil_Print( "Initializing State Table\n" ); "Initializing State Table\n");
TvDeviceStateTableInit( desc_doc_url ); TvDeviceStateTableInit( desc_doc_url );
SampleUtil_Print( "State Table Initialized\n" ); SampleUtil_Print("State Table Initialized\n");
if( ( ret = if( ( ret =
UpnpSendAdvertisement( device_handle, default_advr_expire ) ) UpnpSendAdvertisement( device_handle, default_advr_expire ) )
!= UPNP_E_SUCCESS ) { != UPNP_E_SUCCESS ) {
SampleUtil_Print( "Error sending advertisements : %d\n", ret ); SampleUtil_Print( "Error sending advertisements : %d\n", ret );
UpnpFinish( ); UpnpFinish();
return ret; return ret;
} }
SampleUtil_Print( "Advertisements Sent\n" ); SampleUtil_Print("Advertisements Sent\n");
} }
return UPNP_E_SUCCESS; return UPNP_E_SUCCESS;
} }

View File

@@ -41,7 +41,9 @@ extern "C" {
#include "ithread.h" #include "ithread.h"
#include <stdlib.h> #include <stdlib.h>
#ifndef WIN32
#include <unistd.h> #include <unistd.h>
#endif
#include <string.h> #include <string.h>
#include "upnp.h" #include "upnp.h"
#include "sample_util.h" #include "sample_util.h"

View File

@@ -29,9 +29,12 @@
// //
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#include <stdio.h>
#include "sample_util.h" #include "sample_util.h"
#include "upnp_tv_ctrlpt.h" #include "upnp_tv_ctrlpt.h"
#include <stdio.h>
#include <string.h> #include <string.h>
/* /*
@@ -124,108 +127,72 @@ TvCtrlPointPrintLongHelp( void )
SampleUtil_Print( "* TV Control Point Help Info *" ); SampleUtil_Print( "* TV Control Point Help Info *" );
SampleUtil_Print( "******************************" ); SampleUtil_Print( "******************************" );
SampleUtil_Print( "" ); SampleUtil_Print( "" );
SampleUtil_Print SampleUtil_Print( "This sample control point application automatically searches" );
( "This sample control point application automatically searches" ); SampleUtil_Print( "for and subscribes to the services of television device emulator" );
SampleUtil_Print SampleUtil_Print( "devices, described in the tvdevicedesc.xml description document." );
( "for and subscribes to the services of television device emulator" );
SampleUtil_Print
( "devices, described in the tvdevicedesc.xml description document." );
SampleUtil_Print( "" ); SampleUtil_Print( "" );
SampleUtil_Print( "Commands:" ); SampleUtil_Print( "Commands:" );
SampleUtil_Print( " Help" ); SampleUtil_Print( " Help" );
SampleUtil_Print( " Print this help info." ); SampleUtil_Print( " Print this help info." );
SampleUtil_Print( " ListDev" ); SampleUtil_Print( " ListDev" );
SampleUtil_Print SampleUtil_Print( " Print the current list of TV Device Emulators that this" );
( " Print the current list of TV Device Emulators that this" ); SampleUtil_Print( " control point is aware of. Each device is preceded by a" );
SampleUtil_Print SampleUtil_Print( " device number which corresponds to the devnum argument of" );
( " control point is aware of. Each device is preceded by a" );
SampleUtil_Print
( " device number which corresponds to the devnum argument of" );
SampleUtil_Print( " commands listed below." ); SampleUtil_Print( " commands listed below." );
SampleUtil_Print( " Refresh" ); SampleUtil_Print( " Refresh" );
SampleUtil_Print SampleUtil_Print( " Delete all of the devices from the device list and issue new" );
( " Delete all of the devices from the device list and issue new" ); SampleUtil_Print( " search request to rebuild the list from scratch." );
SampleUtil_Print
( " search request to rebuild the list from scratch." );
SampleUtil_Print( " PrintDev <devnum>" ); SampleUtil_Print( " PrintDev <devnum>" );
SampleUtil_Print SampleUtil_Print( " Print the state table for the device <devnum>." );
( " Print the state table for the device <devnum>." ); SampleUtil_Print( " e.g., 'PrintDev 1' prints the state table for the first" );
SampleUtil_Print
( " e.g., 'PrintDev 1' prints the state table for the first" );
SampleUtil_Print( " device in the device list." ); SampleUtil_Print( " device in the device list." );
SampleUtil_Print( " PowerOn <devnum>" ); SampleUtil_Print( " PowerOn <devnum>" );
SampleUtil_Print SampleUtil_Print( " Sends the PowerOn action to the Control Service of" );
( " Sends the PowerOn action to the Control Service of" );
SampleUtil_Print( " device <devnum>." ); SampleUtil_Print( " device <devnum>." );
SampleUtil_Print( " PowerOff <devnum>" ); SampleUtil_Print( " PowerOff <devnum>" );
SampleUtil_Print SampleUtil_Print( " Sends the PowerOff action to the Control Service of" );
( " Sends the PowerOff action to the Control Service of" );
SampleUtil_Print( " device <devnum>." ); SampleUtil_Print( " device <devnum>." );
SampleUtil_Print( " SetChannel <devnum> <channel>" ); SampleUtil_Print( " SetChannel <devnum> <channel>" );
SampleUtil_Print SampleUtil_Print( " Sends the SetChannel action to the Control Service of" );
( " Sends the SetChannel action to the Control Service of" ); SampleUtil_Print( " device <devnum>, requesting the channel to be changed" );
SampleUtil_Print
( " device <devnum>, requesting the channel to be changed" );
SampleUtil_Print( " to <channel>." ); SampleUtil_Print( " to <channel>." );
SampleUtil_Print( " SetVolume <devnum> <volume>" ); SampleUtil_Print( " SetVolume <devnum> <volume>" );
SampleUtil_Print SampleUtil_Print( " Sends the SetVolume action to the Control Service of" );
( " Sends the SetVolume action to the Control Service of" ); SampleUtil_Print( " device <devnum>, requesting the volume to be changed" );
SampleUtil_Print
( " device <devnum>, requesting the volume to be changed" );
SampleUtil_Print( " to <volume>." ); SampleUtil_Print( " to <volume>." );
SampleUtil_Print( " SetColor <devnum> <color>" ); SampleUtil_Print( " SetColor <devnum> <color>" );
SampleUtil_Print SampleUtil_Print( " Sends the SetColor action to the Control Service of" );
( " Sends the SetColor action to the Control Service of" ); SampleUtil_Print( " device <devnum>, requesting the color to be changed" );
SampleUtil_Print
( " device <devnum>, requesting the color to be changed" );
SampleUtil_Print( " to <color>." ); SampleUtil_Print( " to <color>." );
SampleUtil_Print( " SetTint <devnum> <tint>" ); SampleUtil_Print( " SetTint <devnum> <tint>" );
SampleUtil_Print SampleUtil_Print( " Sends the SetTint action to the Control Service of" );
( " Sends the SetTint action to the Control Service of" ); SampleUtil_Print( " device <devnum>, requesting the tint to be changed" );
SampleUtil_Print
( " device <devnum>, requesting the tint to be changed" );
SampleUtil_Print( " to <tint>." ); SampleUtil_Print( " to <tint>." );
SampleUtil_Print( " SetContrast <devnum> <contrast>" ); SampleUtil_Print( " SetContrast <devnum> <contrast>" );
SampleUtil_Print SampleUtil_Print( " Sends the SetContrast action to the Control Service of" );
( " Sends the SetContrast action to the Control Service of" ); SampleUtil_Print( " device <devnum>, requesting the contrast to be changed" );
SampleUtil_Print
( " device <devnum>, requesting the contrast to be changed" );
SampleUtil_Print( " to <contrast>." ); SampleUtil_Print( " to <contrast>." );
SampleUtil_Print( " SetBrightness <devnum> <brightness>" ); SampleUtil_Print( " SetBrightness <devnum> <brightness>" );
SampleUtil_Print SampleUtil_Print( " Sends the SetBrightness action to the Control Service of" );
( " Sends the SetBrightness action to the Control Service of" ); SampleUtil_Print( " device <devnum>, requesting the brightness to be changed" );
SampleUtil_Print
( " device <devnum>, requesting the brightness to be changed" );
SampleUtil_Print( " to <brightness>." ); SampleUtil_Print( " to <brightness>." );
SampleUtil_Print( " CtrlAction <devnum> <action>" ); SampleUtil_Print( " CtrlAction <devnum> <action>" );
SampleUtil_Print SampleUtil_Print( " Sends an action request specified by the string <action>" );
( " Sends an action request specified by the string <action>" ); SampleUtil_Print( " to the Control Service of device <devnum>. This command" );
SampleUtil_Print SampleUtil_Print( " only works for actions that have no arguments." );
( " to the Control Service of device <devnum>. This command" ); SampleUtil_Print( " (e.g., \"CtrlAction 1 IncreaseChannel\")" );
SampleUtil_Print
( " only works for actions that have no arguments." );
SampleUtil_Print
( " (e.g., \"CtrlAction 1 IncreaseChannel\")" );
SampleUtil_Print( " PictAction <devnum> <action>" ); SampleUtil_Print( " PictAction <devnum> <action>" );
SampleUtil_Print SampleUtil_Print( " Sends an action request specified by the string <action>" );
( " Sends an action request specified by the string <action>" ); SampleUtil_Print( " to the Picture Service of device <devnum>. This command" );
SampleUtil_Print SampleUtil_Print( " only works for actions that have no arguments." );
( " to the Picture Service of device <devnum>. This command" ); SampleUtil_Print( " (e.g., \"PictAction 1 DecreaseContrast\")" );
SampleUtil_Print
( " only works for actions that have no arguments." );
SampleUtil_Print
( " (e.g., \"PictAction 1 DecreaseContrast\")" );
SampleUtil_Print( " CtrlGetVar <devnum> <varname>" ); SampleUtil_Print( " CtrlGetVar <devnum> <varname>" );
SampleUtil_Print SampleUtil_Print( " Requests the value of a variable specified by the string <varname>" );
( " Requests the value of a variable specified by the string <varname>" ); SampleUtil_Print( " from the Control Service of device <devnum>." );
SampleUtil_Print
( " from the Control Service of device <devnum>." );
SampleUtil_Print( " (e.g., \"CtrlGetVar 1 Volume\")" ); SampleUtil_Print( " (e.g., \"CtrlGetVar 1 Volume\")" );
SampleUtil_Print( " PictGetVar <devnum> <action>" ); SampleUtil_Print( " PictGetVar <devnum> <action>" );
SampleUtil_Print SampleUtil_Print( " Requests the value of a variable specified by the string <varname>" );
( " Requests the value of a variable specified by the string <varname>" ); SampleUtil_Print( " from the Picture Service of device <devnum>." );
SampleUtil_Print
( " from the Picture Service of device <devnum>." );
SampleUtil_Print( " (e.g., \"PictGetVar 1 Tint\")" ); SampleUtil_Print( " (e.g., \"PictGetVar 1 Tint\")" );
SampleUtil_Print( " Exit" ); SampleUtil_Print( " Exit" );
SampleUtil_Print( " Exits the control point application." ); SampleUtil_Print( " Exits the control point application." );
@@ -242,7 +209,7 @@ TvCtrlPointPrintLongHelp( void )
* *
********************************************************************************/ ********************************************************************************/
void void
TvCtrlPointPrintCommands( ) TvCtrlPointPrintCommands()
{ {
int i; int i;
int numofcmds = sizeof( cmdloop_cmdlist ) / sizeof( cmdloop_commands ); int numofcmds = sizeof( cmdloop_cmdlist ) / sizeof( cmdloop_commands );
@@ -321,11 +288,11 @@ TvCtrlPointProcessCommand( char *cmdline )
switch ( cmdnum ) { switch ( cmdnum ) {
case PRTHELP: case PRTHELP:
TvCtrlPointPrintShortHelp( ); TvCtrlPointPrintShortHelp();
break; break;
case PRTFULLHELP: case PRTFULLHELP:
TvCtrlPointPrintLongHelp( ); TvCtrlPointPrintLongHelp();
break; break;
case POWON: case POWON:
@@ -411,15 +378,15 @@ TvCtrlPointProcessCommand( char *cmdline )
break; break;
case LSTDEV: case LSTDEV:
TvCtrlPointPrintList( ); TvCtrlPointPrintList();
break; break;
case REFRESH: case REFRESH:
TvCtrlPointRefresh( ); TvCtrlPointRefresh();
break; break;
case EXITCMD: case EXITCMD:
rc = TvCtrlPointStop( ); rc = TvCtrlPointStop();
exit( rc ); exit( rc );
break; break;
@@ -440,20 +407,23 @@ main( int argc,
{ {
int rc; int rc;
ithread_t cmdloop_thread; ithread_t cmdloop_thread;
#ifndef WIN32
int sig; int sig;
sigset_t sigs_to_catch; sigset_t sigs_to_catch;
#endif
int code; int code;
rc = TvCtrlPointStart( linux_print, NULL ); rc = TvCtrlPointStart( linux_print, NULL );
if( rc != TV_SUCCESS ) { if( rc != TV_SUCCESS ) {
SampleUtil_Print( "Error starting UPnP TV Control Point" ); SampleUtil_Print( "Error starting UPnP TV Control Point" );
exit( rc ); return rc;
} }
// start a command loop thread // start a command loop thread
code = code =
ithread_create( &cmdloop_thread, NULL, TvCtrlPointCommandLoop, ithread_create( &cmdloop_thread, NULL, TvCtrlPointCommandLoop,
NULL ); NULL );
#ifndef WIN32
/* /*
Catch Ctrl-C and properly shutdown Catch Ctrl-C and properly shutdown
*/ */
@@ -462,6 +432,10 @@ main( int argc,
sigwait( &sigs_to_catch, &sig ); sigwait( &sigs_to_catch, &sig );
SampleUtil_Print( "Shutting down on signal %d...", sig ); SampleUtil_Print( "Shutting down on signal %d...", sig );
rc = TvCtrlPointStop( ); #else
exit( rc ); ithread_join(cmdloop_thread, NULL);
#endif
rc = TvCtrlPointStop();
return rc;
} }

View File

@@ -224,7 +224,7 @@ TvCtrlPointRefresh( void )
{ {
int rc; int rc;
TvCtrlPointRemoveAll( ); TvCtrlPointRemoveAll();
/* /*
Search for all devices of type tvdevice version 1, Search for all devices of type tvdevice version 1,
@@ -539,7 +539,7 @@ TvCtrlPointGetDevice( int devnum,
* *
********************************************************************************/ ********************************************************************************/
int int
TvCtrlPointPrintList( ) TvCtrlPointPrintList()
{ {
struct TvDeviceNode *tmpdevnode; struct TvDeviceNode *tmpdevnode;
int i = 0; int i = 0;
@@ -1096,7 +1096,7 @@ TvCtrlPointCallbackEventHandler( Upnp_EventType EventType,
if( DescDoc ) if( DescDoc )
ixmlDocument_free( DescDoc ); ixmlDocument_free( DescDoc );
TvCtrlPointPrintList( ); TvCtrlPointPrintList();
break; break;
} }
@@ -1122,7 +1122,7 @@ TvCtrlPointCallbackEventHandler( Upnp_EventType EventType,
TvCtrlPointRemoveDevice( d_event->DeviceId ); TvCtrlPointRemoveDevice( d_event->DeviceId );
SampleUtil_Print( "After byebye:" ); SampleUtil_Print( "After byebye:" );
TvCtrlPointPrintList( ); TvCtrlPointPrintList();
break; break;
} }
@@ -1354,7 +1354,7 @@ TvCtrlPointStart( print_string printFunctionPtr,
{ {
ithread_t timer_thread; ithread_t timer_thread;
int rc; int rc;
short int port = 0; unsigned short port = 0;
char *ip_address = NULL; char *ip_address = NULL;
SampleUtil_Initialize( printFunctionPtr ); SampleUtil_Initialize( printFunctionPtr );
@@ -1362,34 +1362,42 @@ TvCtrlPointStart( print_string printFunctionPtr,
ithread_mutex_init( &DeviceListMutex, 0 ); ithread_mutex_init( &DeviceListMutex, 0 );
SampleUtil_Print( "Initializing UPnP with ipaddress=%s port=%d", SampleUtil_Print(
ip_address, port ); "Initializing UPnP Sdk with\n"
"\tipaddress = %s port = %u\n",
ip_address, port );
rc = UpnpInit( ip_address, port ); rc = UpnpInit( ip_address, port );
if( UPNP_E_SUCCESS != rc ) { if( UPNP_E_SUCCESS != rc ) {
SampleUtil_Print( "WinCEStart: UpnpInit() Error: %d", rc ); SampleUtil_Print( "WinCEStart: UpnpInit() Error: %d", rc );
UpnpFinish( ); UpnpFinish();
return TV_ERROR; return TV_ERROR;
} }
if( NULL == ip_address ) if( NULL == ip_address ) {
ip_address = UpnpGetServerIpAddress( ); ip_address = UpnpGetServerIpAddress();
if( 0 == port ) }
port = UpnpGetServerPort( ); if( 0 == port ) {
port = UpnpGetServerPort();
}
SampleUtil_Print( "UPnP Initialized (%s:%d)", ip_address, port ); SampleUtil_Print(
"UPnP Initialized\n"
"\tipaddress= %s port = %u\n",
ip_address, port );
SampleUtil_Print( "Registering Control Point" ); SampleUtil_Print( "Registering Control Point" );
rc = UpnpRegisterClient( TvCtrlPointCallbackEventHandler, rc = UpnpRegisterClient( TvCtrlPointCallbackEventHandler,
&ctrlpt_handle, &ctrlpt_handle ); &ctrlpt_handle, &ctrlpt_handle );
if( UPNP_E_SUCCESS != rc ) { if( UPNP_E_SUCCESS != rc ) {
SampleUtil_Print( "Error registering CP: %d", rc ); SampleUtil_Print( "Error registering CP: %d", rc );
UpnpFinish( ); UpnpFinish();
return TV_ERROR; return TV_ERROR;
} }
SampleUtil_Print( "Control Point Registered" ); SampleUtil_Print( "Control Point Registered" );
TvCtrlPointRefresh( ); TvCtrlPointRefresh();
// start a timer thread // start a timer thread
ithread_create( &timer_thread, NULL, TvCtrlPointTimerLoop, NULL ); ithread_create( &timer_thread, NULL, TvCtrlPointTimerLoop, NULL );
@@ -1400,10 +1408,10 @@ TvCtrlPointStart( print_string printFunctionPtr,
int int
TvCtrlPointStop( void ) TvCtrlPointStop( void )
{ {
TvCtrlPointRemoveAll( ); TvCtrlPointRemoveAll();
UpnpUnRegisterClient( ctrlpt_handle ); UpnpUnRegisterClient( ctrlpt_handle );
UpnpFinish( ); UpnpFinish();
SampleUtil_Finish( ); SampleUtil_Finish();
return TV_SUCCESS; return TV_SUCCESS;
} }

View File

@@ -39,7 +39,9 @@ extern "C" {
#include <stdio.h> #include <stdio.h>
#include "ithread.h" #include "ithread.h"
#ifndef WIN32
#include <unistd.h> #include <unistd.h>
#endif
#include <stdarg.h> #include <stdarg.h>
#include <stdlib.h> #include <stdlib.h>
#include <signal.h> #include <signal.h>

View File

@@ -29,10 +29,14 @@
// //
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#include <stdio.h>
#include "sample_util.h" #include "sample_util.h"
#include "upnp_tv_device.h" #include "upnp_tv_device.h"
#include <stdio.h>
/****************************************************************************** /******************************************************************************
* linux_print * linux_print
* *
@@ -82,7 +86,7 @@ TvDeviceCommandLoop( void *args )
if( strcasecmp( cmd, "exit" ) == 0 ) { if( strcasecmp( cmd, "exit" ) == 0 ) {
SampleUtil_Print( "Shutting down...\n" ); SampleUtil_Print( "Shutting down...\n" );
TvDeviceStop( ); TvDeviceStop();
exit( 0 ); exit( 0 );
} else { } else {
SampleUtil_Print( "\n Unknown command: %s\n\n", cmd ); SampleUtil_Print( "\n Unknown command: %s\n\n", cmd );
@@ -117,26 +121,26 @@ TvDeviceCommandLoop( void *args )
* *
* *
*****************************************************************************/ *****************************************************************************/
int int main( IN int argc, IN char **argv )
main( IN int argc,
IN char **argv )
{ {
unsigned int portTemp = 0; unsigned int portTemp = 0;
char *ip_address = NULL, char *ip_address = NULL,
*desc_doc_name = NULL, *desc_doc_name = NULL,
*web_dir_path = NULL; *web_dir_path = NULL;
int rc;
ithread_t cmdloop_thread; ithread_t cmdloop_thread;
int code; #ifndef WIN32
unsigned int port = 0;
int sig; int sig;
sigset_t sigs_to_catch; sigset_t sigs_to_catch;
#endif
int code;
unsigned int port = 0;
int i = 0; int i = 0;
SampleUtil_Initialize( linux_print ); SampleUtil_Initialize( linux_print );
//Parse options // Parse options
for( i = 1; i < argc; i++ ) { for( i = 1; i < argc; i++ ) {
if( strcmp( argv[i], "-ip" ) == 0 ) { if( strcmp( argv[i], "-ip" ) == 0 ) {
ip_address = argv[++i]; ip_address = argv[++i];
@@ -163,21 +167,18 @@ main( IN int argc,
( "\tweb_dir_path: Filesystem path where web files " ( "\tweb_dir_path: Filesystem path where web files "
"related to the device are stored\n" ); "related to the device are stored\n" );
SampleUtil_Print( "\t\te.g.: /upnp/sample/tvdevice/web\n" ); SampleUtil_Print( "\t\te.g.: /upnp/sample/tvdevice/web\n" );
exit( 1 ); return 1;
} }
} }
port = ( unsigned short )portTemp; port = ( unsigned short )portTemp;
TvDeviceStart( ip_address, port, desc_doc_name, web_dir_path, TvDeviceStart( ip_address, port, desc_doc_name, web_dir_path, linux_print );
linux_print );
/* /* start a command loop thread */
start a command loop thread code = ithread_create( &cmdloop_thread, NULL, TvDeviceCommandLoop, NULL );
*/
code = ithread_create( &cmdloop_thread, NULL, TvDeviceCommandLoop,
NULL );
#ifndef WIN32
/* /*
Catch Ctrl-C and properly shutdown Catch Ctrl-C and properly shutdown
*/ */
@@ -186,6 +187,11 @@ main( IN int argc,
sigwait( &sigs_to_catch, &sig ); sigwait( &sigs_to_catch, &sig );
SampleUtil_Print( "Shutting down on signal %d...\n", sig ); SampleUtil_Print( "Shutting down on signal %d...\n", sig );
TvDeviceStop( ); #else
exit( 0 ); ithread_join(cmdloop_thread, NULL);
#endif
rc = TvDeviceStop();
return rc;
} }

View File

@@ -1915,11 +1915,11 @@ TvDeviceCallbackEventHandler( Upnp_EventType EventType,
* *
*****************************************************************************/ *****************************************************************************/
int int
TvDeviceStop( ) TvDeviceStop()
{ {
UpnpUnRegisterRootDevice( device_handle ); UpnpUnRegisterRootDevice( device_handle );
UpnpFinish( ); UpnpFinish();
SampleUtil_Finish( ); SampleUtil_Finish();
ithread_mutex_destroy( &TVDevMutex ); ithread_mutex_destroy( &TVDevMutex );
return UPNP_E_SUCCESS; return UPNP_E_SUCCESS;
} }
@@ -1960,30 +1960,35 @@ TvDeviceStart( char *ip_address,
SampleUtil_Initialize( pfun ); SampleUtil_Initialize( pfun );
SampleUtil_Print SampleUtil_Print(
( "Initializing UPnP Sdk with \n \t ipaddress = %s port = %d\n", "Initializing UPnP Sdk with\n"
ip_address, port ); "\tipaddress = %s port = %u\n",
ip_address, port );
if( ( ret = UpnpInit( ip_address, port ) ) != UPNP_E_SUCCESS ) { if( ( ret = UpnpInit( ip_address, port ) ) != UPNP_E_SUCCESS ) {
SampleUtil_Print( "Error with UpnpInit -- %d\n", ret ); SampleUtil_Print( "Error with UpnpInit -- %d\n", ret );
UpnpFinish( ); UpnpFinish();
return ret; return ret;
} }
if( ip_address == NULL ) { if( ip_address == NULL ) {
ip_address = UpnpGetServerIpAddress( ); ip_address = UpnpGetServerIpAddress();
} }
port = UpnpGetServerPort( ); port = UpnpGetServerPort();
SampleUtil_Print( "UPnP Initialized\n \t ipaddress= %s port = %d\n", SampleUtil_Print(
ip_address, port ); "UPnP Initialized\n"
"\tipaddress= %s port = %u\n",
ip_address, port );
if( desc_doc_name == NULL ) if( desc_doc_name == NULL ) {
desc_doc_name = "tvdevicedesc.xml"; desc_doc_name = "tvdevicedesc.xml";
}
if( web_dir_path == NULL ) if( web_dir_path == NULL ) {
web_dir_path = DEFAULT_WEB_DIR; web_dir_path = DEFAULT_WEB_DIR;
}
snprintf( desc_doc_url, DESC_URL_SIZE, "http://%s:%d/%s", ip_address, snprintf( desc_doc_url, DESC_URL_SIZE, "http://%s:%d/%s", ip_address,
port, desc_doc_name ); port, desc_doc_name );
@@ -1995,37 +2000,39 @@ TvDeviceStart( char *ip_address,
SampleUtil_Print SampleUtil_Print
( "Error specifying webserver root directory -- %s: %d\n", ( "Error specifying webserver root directory -- %s: %d\n",
web_dir_path, ret ); web_dir_path, ret );
UpnpFinish( ); UpnpFinish();
return ret; return ret;
} }
SampleUtil_Print SampleUtil_Print(
( "Registering the RootDevice\n\t with desc_doc_url: %s\n", "Registering the RootDevice\n"
desc_doc_url ); "\t with desc_doc_url: %s\n",
desc_doc_url );
if( ( ret = UpnpRegisterRootDevice( desc_doc_url, if( ( ret = UpnpRegisterRootDevice( desc_doc_url,
TvDeviceCallbackEventHandler, TvDeviceCallbackEventHandler,
&device_handle, &device_handle ) ) &device_handle, &device_handle ) )
!= UPNP_E_SUCCESS ) { != UPNP_E_SUCCESS ) {
SampleUtil_Print( "Error registering the rootdevice : %d\n", ret ); SampleUtil_Print( "Error registering the rootdevice : %d\n", ret );
UpnpFinish( ); UpnpFinish();
return ret; return ret;
} else { } else {
SampleUtil_Print( "RootDevice Registered\n" ); SampleUtil_Print(
"RootDevice Registered\n"
SampleUtil_Print( "Initializing State Table\n" ); "Initializing State Table\n");
TvDeviceStateTableInit( desc_doc_url ); TvDeviceStateTableInit( desc_doc_url );
SampleUtil_Print( "State Table Initialized\n" ); SampleUtil_Print("State Table Initialized\n");
if( ( ret = if( ( ret =
UpnpSendAdvertisement( device_handle, default_advr_expire ) ) UpnpSendAdvertisement( device_handle, default_advr_expire ) )
!= UPNP_E_SUCCESS ) { != UPNP_E_SUCCESS ) {
SampleUtil_Print( "Error sending advertisements : %d\n", ret ); SampleUtil_Print( "Error sending advertisements : %d\n", ret );
UpnpFinish( ); UpnpFinish();
return ret; return ret;
} }
SampleUtil_Print( "Advertisements Sent\n" ); SampleUtil_Print("Advertisements Sent\n");
} }
return UPNP_E_SUCCESS; return UPNP_E_SUCCESS;
} }

View File

@@ -41,7 +41,9 @@ extern "C" {
#include "ithread.h" #include "ithread.h"
#include <stdlib.h> #include <stdlib.h>
#ifndef WIN32
#include <unistd.h> #include <unistd.h>
#endif
#include <string.h> #include <string.h>
#include "upnp.h" #include "upnp.h"
#include "sample_util.h" #include "sample_util.h"

View File

@@ -31,54 +31,61 @@
#include "config.h" #include "config.h"
#include <sys/stat.h>
#include <assert.h> #include <assert.h>
#include <signal.h> #include <signal.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <sys/stat.h>
#ifndef WIN32 #ifndef WIN32
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include <net/if.h>
#ifndef SPARC_SOLARIS #include <netinet/in.h>
// #include <linux/if.h>
#include <net/if.h>
#else
#include <fcntl.h>
#include <net/if.h>
#include <sys/sockio.h>
#endif
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/param.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/utsname.h> #include <sys/utsname.h>
#include <unistd.h> #include <unistd.h>
#include <sys/param.h>
#if (defined(BSD) && BSD >= 199306) #if defined(_sun)
#include <sys/sockio.h>
#include <fcntl.h>
#elif defined(BSD) && BSD >= 199306
#include <ifaddrs.h> #include <ifaddrs.h>
#endif #endif
#endif #endif /* WIN32 */
#include "upnpapi.h" #include "upnpapi.h"
#include "httpreadwrite.h" #include "httpreadwrite.h"
#include "membuffer.h"
#include "ssdplib.h" #include "ssdplib.h"
#include "soaplib.h" #include "soaplib.h"
#include "ThreadPool.h" #include "ThreadPool.h"
#include "membuffer.h"
#include "httpreadwrite.h"
// Needed for GENA // Needed for GENA
#include "gena.h" #include "gena.h"
#include "service_table.h"
#include "miniserver.h" #include "miniserver.h"
#include "service_table.h"
#ifdef INTERNAL_WEB_SERVER #ifdef INTERNAL_WEB_SERVER
#include "webserver.h" #include "webserver.h"
#include "urlconfig.h" #include "urlconfig.h"
#endif // INTERNAL_WEB_SERVER #endif // INTERNAL_WEB_SERVER
//
virtualDirList *pVirtualDirList; virtualDirList *pVirtualDirList;
// Mutex to synchronize the subscription handling at the client side // Mutex to synchronize the subscription handling at the client side
@@ -206,7 +213,7 @@ int UpnpInit( IN const char *HostIP,
return UPNP_E_INIT_FAILED; return UPNP_E_INIT_FAILED;
} }
UpnpPrintf( UPNP_INFO, API, __FILE__, __LINE__, "Inside UpnpInit \n" ); UpnpPrintf( UPNP_INFO, API, __FILE__, __LINE__, "Inside UpnpInit\n" );
// initialize mutex // initialize mutex
#ifdef __CYGWIN__ #ifdef __CYGWIN__
/* On Cygwin, pthread_mutex_init() fails without this memset. */ /* On Cygwin, pthread_mutex_init() fails without this memset. */
@@ -313,7 +320,7 @@ int UpnpInit( IN const char *HostIP,
"Host Ip: %s Host Port: %d\n", LOCAL_HOST, "Host Ip: %s Host Port: %d\n", LOCAL_HOST,
LOCAL_PORT ); LOCAL_PORT );
UpnpPrintf( UPNP_INFO, API, __FILE__, __LINE__, "Exiting UpnpInit \n" ); UpnpPrintf( UPNP_INFO, API, __FILE__, __LINE__, "Exiting UpnpInit\n" );
return UPNP_E_SUCCESS; return UPNP_E_SUCCESS;
@@ -330,7 +337,7 @@ PrintThreadPoolStats(
ThreadPoolStats stats; ThreadPoolStats stats;
ThreadPoolGetStats(tp, &stats); ThreadPoolGetStats(tp, &stats);
UpnpPrintf(UPNP_INFO, API, DbgFileName, DbgLineNo, UpnpPrintf(UPNP_INFO, API, DbgFileName, DbgLineNo,
"%s \n" "%s\n"
"High Jobs pending: %d\n" "High Jobs pending: %d\n"
"Med Jobs Pending: %d\n" "Med Jobs Pending: %d\n"
"Low Jobs Pending: %d\n" "Low Jobs Pending: %d\n"

View File

@@ -310,17 +310,30 @@ void UpnpDisplayFileAndLine(
IN const char *DbgFileName, IN const char *DbgFileName,
IN int DbgLineNo) IN int DbgLineNo)
{ {
int starlength = 66; #define NLINES 2
const char *lines[2]; #define MAX_LINE_SIZE 512
char FileAndLine[500]; #define NUMBER_OF_STARS 80
lines[0] = "DEBUG"; const char *lines[NLINES];
if (DbgFileName) { char buf[NLINES][MAX_LINE_SIZE];
sprintf(FileAndLine, int i;
"FILE: %s, LINE: %d",
DbgFileName, DbgLineNo); /* Initialize the pointer array */
lines[1] = FileAndLine; for (i = 0; i < NLINES; i++) {
lines[i] = buf[i];
} }
UpnpDisplayBanner(fd, lines, 2, starlength);
/* Put the debug lines in the buffer */
sprintf(buf[0], "DEBUG - THREAD ID: 0x%lX",
(unsigned long int)ithread_self());
if (DbgFileName) {
sprintf(buf[1],
"FILE: %s, LINE: %d",
DbgFileName,
DbgLineNo);
}
/* Show the lines centered */
UpnpDisplayBanner(fd, lines, NLINES, NUMBER_OF_STARS);
fflush(fd); fflush(fd);
} }
#endif #endif

View File

@@ -35,6 +35,7 @@
************************************************************************/ ************************************************************************/
#include "config.h" #include "config.h"
#ifndef WIN32 #ifndef WIN32
#include <arpa/inet.h> #include <arpa/inet.h>
#include <netinet/in.h> #include <netinet/in.h>
@@ -48,6 +49,7 @@
typedef int socklen_t; typedef int socklen_t;
#define EAFNOSUPPORT 97 #define EAFNOSUPPORT 97
#endif /* WIN32 */ #endif /* WIN32 */
#include "unixutil.h" #include "unixutil.h"
#include "ithread.h" #include "ithread.h"
@@ -65,7 +67,6 @@
#include "ThreadPool.h" #include "ThreadPool.h"
#include "httpreadwrite.h" #include "httpreadwrite.h"
#include "statcodes.h" #include "statcodes.h"
#include "upnp.h"
#include "upnpapi.h" #include "upnpapi.h"
#define APPLICATION_LISTENING_PORT 49152 #define APPLICATION_LISTENING_PORT 49152
@@ -376,8 +377,9 @@ schedule_request_job( IN int connfd,
* Return: void * Return: void
************************************************************************/ ************************************************************************/
static void static void
RunMiniServer( MiniServerSockArray * miniSock ) RunMiniServer( MiniServerSockArray *miniSock )
{ {
char errorBuffer[ERROR_BUFFER_LEN];
struct sockaddr_in clientAddr; struct sockaddr_in clientAddr;
socklen_t clientLen; socklen_t clientLen;
SOCKET connectHnd; SOCKET connectHnd;
@@ -393,6 +395,7 @@ RunMiniServer( MiniServerSockArray * miniSock )
unsigned int maxMiniSock; unsigned int maxMiniSock;
int byteReceived; int byteReceived;
char requestBuf[256]; char requestBuf[256];
int ret = 0;
maxMiniSock = max( miniServSock, miniServStopSock) ; maxMiniSock = max( miniServSock, miniServStopSock) ;
maxMiniSock = max( maxMiniSock, (SOCKET)(ssdpSock) ); maxMiniSock = max( maxMiniSock, (SOCKET)(ssdpSock) );
@@ -414,10 +417,11 @@ RunMiniServer( MiniServerSockArray * miniSock )
FD_SET( ssdpReqSock, &rdSet ); FD_SET( ssdpReqSock, &rdSet );
#endif #endif
if( select( maxMiniSock, &rdSet, NULL, &expSet, NULL ) == ret = select( maxMiniSock, &rdSet, NULL, &expSet, NULL );
UPNP_SOCKETERROR ) { if ( ret == -1 ) {
strerror_r(errno, errorBuffer, ERROR_BUFFER_LEN);
UpnpPrintf( UPNP_CRITICAL, SSDP, __FILE__, __LINE__, UpnpPrintf( UPNP_CRITICAL, SSDP, __FILE__, __LINE__,
"Error in select call!\n" ); "Error in select(): %s\n", errorBuffer );
/* Avoid 100% CPU in case of repeated error in select() */ /* Avoid 100% CPU in case of repeated error in select() */
isleep( 1 ); isleep( 1 );
continue; continue;
@@ -426,9 +430,10 @@ RunMiniServer( MiniServerSockArray * miniSock )
clientLen = sizeof( struct sockaddr_in ); clientLen = sizeof( struct sockaddr_in );
connectHnd = accept( miniServSock, connectHnd = accept( miniServSock,
( struct sockaddr * )&clientAddr, &clientLen ); ( struct sockaddr * )&clientAddr, &clientLen );
if( connectHnd == UPNP_INVALID_SOCKET ) { if( connectHnd == -1 ) {
strerror_r(errno, errorBuffer, ERROR_BUFFER_LEN);
UpnpPrintf( UPNP_INFO, MSERV, __FILE__, __LINE__, UpnpPrintf( UPNP_INFO, MSERV, __FILE__, __LINE__,
"miniserver: Error in accepting connection\n" ); "miniserver: Error in accept(): %s\n", errorBuffer );
continue; continue;
} }
schedule_request_job( connectHnd, &clientAddr ); schedule_request_job( connectHnd, &clientAddr );
@@ -444,8 +449,7 @@ RunMiniServer( MiniServerSockArray * miniSock )
} }
if( FD_ISSET( miniServStopSock, &rdSet ) ) { if( FD_ISSET( miniServStopSock, &rdSet ) ) {
clientLen = sizeof( struct sockaddr_in ); clientLen = sizeof( struct sockaddr_in );
memset( ( char * )&clientAddr, 0, memset( (char *)&clientAddr, 0, sizeof (struct sockaddr_in) );
sizeof( struct sockaddr_in ) );
byteReceived = byteReceived =
recvfrom( miniServStopSock, requestBuf, 25, 0, recvfrom( miniServStopSock, requestBuf, 25, 0,
( struct sockaddr * )&clientAddr, ( struct sockaddr * )&clientAddr,
@@ -453,7 +457,7 @@ RunMiniServer( MiniServerSockArray * miniSock )
if( byteReceived > 0 ) { if( byteReceived > 0 ) {
requestBuf[byteReceived] = '\0'; requestBuf[byteReceived] = '\0';
UpnpPrintf( UPNP_INFO, MSERV, __FILE__, __LINE__, UpnpPrintf( UPNP_INFO, MSERV, __FILE__, __LINE__,
"Received response !!! %s From host %s \n", "Received response: %s From host %s \n",
requestBuf, inet_ntoa( clientAddr.sin_addr ) ); requestBuf, inet_ntoa( clientAddr.sin_addr ) );
UpnpPrintf( UPNP_PACKET, MSERV, __FILE__, __LINE__, UpnpPrintf( UPNP_PACKET, MSERV, __FILE__, __LINE__,
"Received multicast packet: \n %s\n", "Received multicast packet: \n %s\n",
@@ -544,6 +548,7 @@ int
get_miniserver_sockets( MiniServerSockArray * out, get_miniserver_sockets( MiniServerSockArray * out,
unsigned short listen_port ) unsigned short listen_port )
{ {
char errorBuffer[ERROR_BUFFER_LEN];
struct sockaddr_in serverAddr; struct sockaddr_in serverAddr;
int listenfd; int listenfd;
int success; int success;
@@ -552,9 +557,10 @@ get_miniserver_sockets( MiniServerSockArray * out,
int sockError = UPNP_E_SUCCESS; int sockError = UPNP_E_SUCCESS;
int errCode = 0; int errCode = 0;
int miniServerStopSock; int miniServerStopSock;
int ret = 0;
listenfd = socket( AF_INET, SOCK_STREAM, 0 ); listenfd = socket( AF_INET, SOCK_STREAM, 0 );
if( listenfd < 0 ) { if ( listenfd == -1 ) {
return UPNP_E_OUTOF_SOCKET; // error creating socket return UPNP_E_OUTOF_SOCKET; // error creating socket
} }
// As per the IANA specifications for the use of ports by applications // As per the IANA specifications for the use of ports by applications
@@ -571,51 +577,51 @@ get_miniserver_sockets( MiniServerSockArray * out,
// Keeping the re-use address code as an optional behaviour that can be // Keeping the re-use address code as an optional behaviour that can be
// turned on if necessary. // turned on if necessary.
// TURN ON the reuseaddr_on option to use the option. // TURN ON the reuseaddr_on option to use the option.
if( reuseaddr_on ) { if ( reuseaddr_on ) {
//THIS IS ALLOWS US TO BIND AGAIN IMMEDIATELY // THIS IS ALLOWS US TO BIND AGAIN IMMEDIATELY
//AFTER OUR SERVER HAS BEEN CLOSED // AFTER OUR SERVER HAS BEEN CLOSED
//THIS MAY CAUSE TCP TO BECOME LESS RELIABLE // THIS MAY CAUSE TCP TO BECOME LESS RELIABLE
//HOWEVER IT HAS BEEN SUGESTED FOR TCP SERVERS // HOWEVER IT HAS BEEN SUGESTED FOR TCP SERVERS
UpnpPrintf( UPNP_INFO, MSERV, __FILE__, __LINE__, UpnpPrintf( UPNP_INFO, MSERV, __FILE__, __LINE__,
"mserv start: resuseaddr set\n" ); "mserv start: resuseaddr set\n" );
sockError = setsockopt( listenfd, SOL_SOCKET, SO_REUSEADDR, sockError = setsockopt( listenfd, SOL_SOCKET, SO_REUSEADDR,
( const char * )&reuseaddr_on, sizeof( int )); (const char *)&reuseaddr_on, sizeof (int) );
if( sockError == UPNP_SOCKETERROR ) { if ( sockError == -1 ) {
shutdown( listenfd, SD_BOTH ); shutdown( listenfd, SD_BOTH );
UpnpCloseSocket( listenfd ); UpnpCloseSocket( listenfd );
return UPNP_E_SOCKET_BIND; return UPNP_E_SOCKET_BIND;
} }
sockError = bind( listenfd, sockError = bind( listenfd, (struct sockaddr *)&serverAddr,
( struct sockaddr * )&serverAddr, sizeof (struct sockaddr_in) );
sizeof( struct sockaddr_in )
);
} else { } else {
do { do {
serverAddr.sin_port = htons( listen_port++ ); serverAddr.sin_port = htons( listen_port++ );
sockError = bind( listenfd, sockError = bind( listenfd, (struct sockaddr *)&serverAddr,
( struct sockaddr * )&serverAddr, sizeof (struct sockaddr_in) );
sizeof( struct sockaddr_in ) if ( sockError == -1 ) {
);
if( sockError == UPNP_SOCKETERROR ) {
#ifdef WIN32 #ifdef WIN32
errCode = WSAGetLastError(); errCode = WSAGetLastError();
#else #else
errCode = errno; errCode = errno;
#endif #endif
if( errno == EADDRINUSE ) if( errno == EADDRINUSE ) {
errCode = 1; errCode = 1;
}
} else } else
errCode = 0; errCode = 0;
} while( errCode != 0 ); } while ( errCode != 0 );
} }
if( sockError == UPNP_SOCKETERROR ) { if ( sockError == -1 ) {
perror( "mserv start: bind failed" ); strerror_r(errno, errorBuffer, ERROR_BUFFER_LEN);
UpnpPrintf( UPNP_INFO, MSERV, __FILE__, __LINE__,
"mserv start: Error in bind(): %s\n", errorBuffer );
shutdown( listenfd, SD_BOTH ); shutdown( listenfd, SD_BOTH );
UpnpCloseSocket( listenfd ); UpnpCloseSocket( listenfd );
return UPNP_E_SOCKET_BIND; // bind failed return UPNP_E_SOCKET_BIND; // bind failed
} }
@@ -623,28 +629,34 @@ get_miniserver_sockets( MiniServerSockArray * out,
"mserv start: bind success\n" ); "mserv start: bind success\n" );
success = listen( listenfd, SOMAXCONN ); success = listen( listenfd, SOMAXCONN );
if( success == UPNP_SOCKETERROR ) { if ( success == -1 ) {
strerror_r(errno, errorBuffer, ERROR_BUFFER_LEN);
UpnpPrintf( UPNP_INFO, MSERV, __FILE__, __LINE__,
"mserv start: Error in listen(): %s\n", errorBuffer );
shutdown( listenfd, SD_BOTH ); shutdown( listenfd, SD_BOTH );
UpnpCloseSocket( listenfd ); UpnpCloseSocket( listenfd );
return UPNP_E_LISTEN; // listen failed
return UPNP_E_LISTEN;
} }
actual_port = get_port( listenfd ); actual_port = get_port( listenfd );
if( actual_port <= 0 ) { if( actual_port <= 0 ) {
shutdown( listenfd, SD_BOTH ); shutdown( listenfd, SD_BOTH );
UpnpCloseSocket( listenfd ); UpnpCloseSocket( listenfd );
return UPNP_E_INTERNAL_ERROR; return UPNP_E_INTERNAL_ERROR;
} }
out->miniServerPort = actual_port; out->miniServerPort = actual_port;
if( ( miniServerStopSock = socket( AF_INET, SOCK_DGRAM, 0 ) ) == miniServerStopSock = socket( AF_INET, SOCK_DGRAM, 0 );
UPNP_INVALID_SOCKET ) { if ( miniServerStopSock == -1 ) {
UpnpPrintf( UPNP_CRITICAL, strerror_r(errno, errorBuffer, ERROR_BUFFER_LEN);
MSERV, __FILE__, __LINE__, UpnpPrintf( UPNP_CRITICAL, MSERV, __FILE__, __LINE__,
"Error in socket operation !!!\n" ); "Error in socket(): %s\n", errorBuffer );
shutdown( listenfd, SD_BOTH ); shutdown( listenfd, SD_BOTH );
UpnpCloseSocket( listenfd ); UpnpCloseSocket( listenfd );
return UPNP_E_OUTOF_SOCKET; return UPNP_E_OUTOF_SOCKET;
} }
@@ -652,10 +664,9 @@ get_miniserver_sockets( MiniServerSockArray * out,
memset( ( char * )&serverAddr, 0, sizeof( struct sockaddr_in ) ); memset( ( char * )&serverAddr, 0, sizeof( struct sockaddr_in ) );
serverAddr.sin_family = AF_INET; serverAddr.sin_family = AF_INET;
serverAddr.sin_addr.s_addr = inet_addr( "127.0.0.1" ); serverAddr.sin_addr.s_addr = inet_addr( "127.0.0.1" );
ret = bind( miniServerStopSock, (struct sockaddr *)&serverAddr,
if( bind( miniServerStopSock, ( struct sockaddr * )&serverAddr, sizeof (serverAddr) );
sizeof( serverAddr ) ) == UPNP_SOCKETERROR ) { if ( ret == -1 ) {
UpnpPrintf( UPNP_CRITICAL, UpnpPrintf( UPNP_CRITICAL,
MSERV, __FILE__, __LINE__, MSERV, __FILE__, __LINE__,
"Error in binding localhost!!!\n" ); "Error in binding localhost!!!\n" );
@@ -663,25 +674,25 @@ get_miniserver_sockets( MiniServerSockArray * out,
UpnpCloseSocket( listenfd ); UpnpCloseSocket( listenfd );
shutdown( miniServerStopSock, SD_BOTH ); shutdown( miniServerStopSock, SD_BOTH );
UpnpCloseSocket( miniServerStopSock ); UpnpCloseSocket( miniServerStopSock );
return UPNP_E_SOCKET_BIND; return UPNP_E_SOCKET_BIND;
} }
miniStopSockPort = get_port( miniServerStopSock ); miniStopSockPort = get_port( miniServerStopSock );
if( miniStopSockPort <= 0 ) { if ( miniStopSockPort <= 0 ) {
shutdown( miniServerStopSock, SD_BOTH ); shutdown( miniServerStopSock, SD_BOTH );
UpnpCloseSocket( miniServerStopSock ); UpnpCloseSocket( miniServerStopSock );
shutdown( listenfd, SD_BOTH ); shutdown( listenfd, SD_BOTH );
UpnpCloseSocket( listenfd ); UpnpCloseSocket( listenfd );
return UPNP_E_INTERNAL_ERROR; return UPNP_E_INTERNAL_ERROR;
} }
out->stopPort = miniStopSockPort; out->stopPort = miniStopSockPort;
out->miniServerSock = listenfd; out->miniServerSock = listenfd;
out->miniServerStopSock = miniServerStopSock; out->miniServerStopSock = miniServerStopSock;
return UPNP_E_SUCCESS; return UPNP_E_SUCCESS;
} }
/************************************************************************ /************************************************************************
@@ -718,18 +729,19 @@ StartMiniServer( unsigned short listen_port )
return UPNP_E_INTERNAL_ERROR; // miniserver running return UPNP_E_INTERNAL_ERROR; // miniserver running
} }
miniSocket = miniSocket = (MiniServerSockArray *) malloc( sizeof (MiniServerSockArray) );
( MiniServerSockArray * ) malloc( sizeof( MiniServerSockArray ) ); if( miniSocket == NULL ) {
if( miniSocket == NULL )
return UPNP_E_OUTOF_MEMORY; return UPNP_E_OUTOF_MEMORY;
}
if( ( success = get_miniserver_sockets( miniSocket, listen_port ) ) success = get_miniserver_sockets( miniSocket, listen_port );
!= UPNP_E_SUCCESS ) { if( success != UPNP_E_SUCCESS ) {
free( miniSocket ); free( miniSocket );
return success; return success;
} }
if( ( success = get_ssdp_sockets( miniSocket ) ) != UPNP_E_SUCCESS ) { success = get_ssdp_sockets( miniSocket );
if( success != UPNP_E_SUCCESS ) {
shutdown( miniSocket->miniServerSock, SD_BOTH ); shutdown( miniSocket->miniServerSock, SD_BOTH );
UpnpCloseSocket( miniSocket->miniServerSock ); UpnpCloseSocket( miniSocket->miniServerSock );
shutdown( miniSocket->miniServerStopSock, SD_BOTH ); shutdown( miniSocket->miniServerStopSock, SD_BOTH );
@@ -739,15 +751,12 @@ StartMiniServer( unsigned short listen_port )
return success; return success;
} }
TPJobInit( &job, ( start_routine ) RunMiniServer, TPJobInit( &job, (start_routine)RunMiniServer, (void *)miniSocket );
( void * )miniSocket );
TPJobSetPriority( &job, MED_PRIORITY ); TPJobSetPriority( &job, MED_PRIORITY );
TPJobSetFreeFunction( &job, ( free_routine ) free ); TPJobSetFreeFunction( &job, ( free_routine ) free );
success = ThreadPoolAddPersistent( &gMiniServerThreadPool, &job, NULL ); success = ThreadPoolAddPersistent( &gMiniServerThreadPool, &job, NULL );
if ( success < 0 ) {
if( success < 0 ) {
shutdown( miniSocket->miniServerSock, SD_BOTH ); shutdown( miniSocket->miniServerSock, SD_BOTH );
UpnpCloseSocket( miniSocket->miniServerSock ); UpnpCloseSocket( miniSocket->miniServerSock );
shutdown( miniSocket->miniServerStopSock, SD_BOTH ); shutdown( miniSocket->miniServerStopSock, SD_BOTH );
@@ -763,13 +772,13 @@ StartMiniServer( unsigned short listen_port )
} }
// wait for miniserver to start // wait for miniserver to start
count = 0; count = 0;
while( gMServState != MSERV_RUNNING && count < max_count ) { while ( gMServState != MSERV_RUNNING && count < max_count ) {
usleep( 50 * 1000 ); // 0.05s usleep( 50 * 1000 ); // 0.05s
count++; count++;
} }
// taking too long to start that thread // taking too long to start that thread
if( count >= max_count ) { if ( count >= max_count ) {
shutdown( miniSocket->miniServerSock, SD_BOTH ); shutdown( miniSocket->miniServerSock, SD_BOTH );
UpnpCloseSocket( miniSocket->miniServerSock ); UpnpCloseSocket( miniSocket->miniServerSock );
shutdown( miniSocket->miniServerStopSock, SD_BOTH ); shutdown( miniSocket->miniServerStopSock, SD_BOTH );
@@ -801,9 +810,9 @@ StartMiniServer( unsigned short listen_port )
* Always returns 0 * Always returns 0
************************************************************************/ ************************************************************************/
int int
StopMiniServer( void ) StopMiniServer()
{ {
char errorBuffer[ERROR_BUFFER_LEN];
int socklen = sizeof( struct sockaddr_in ); int socklen = sizeof( struct sockaddr_in );
int sock; int sock;
struct sockaddr_in ssdpAddr; struct sockaddr_in ssdpAddr;
@@ -817,9 +826,10 @@ StopMiniServer( void )
} }
sock = socket( AF_INET, SOCK_DGRAM, 0 ); sock = socket( AF_INET, SOCK_DGRAM, 0 );
if( sock == UPNP_INVALID_SOCKET ) { if ( sock == -1 ) {
strerror_r(errno, errorBuffer, ERROR_BUFFER_LEN);
UpnpPrintf( UPNP_INFO, SSDP, __FILE__, __LINE__, UpnpPrintf( UPNP_INFO, SSDP, __FILE__, __LINE__,
"SSDP_SERVER:StopSSDPServer: Error in socket operation !!!\n" ); "SSDP_SERVER: StopSSDPServer: Error in socket() %s\n", errorBuffer );
return 0; return 0;
} }
@@ -827,15 +837,16 @@ StopMiniServer( void )
ssdpAddr.sin_family = AF_INET; ssdpAddr.sin_family = AF_INET;
ssdpAddr.sin_addr.s_addr = inet_addr( "127.0.0.1" ); ssdpAddr.sin_addr.s_addr = inet_addr( "127.0.0.1" );
ssdpAddr.sin_port = htons( miniStopSockPort ); ssdpAddr.sin_port = htons( miniStopSockPort );
sendto( sock, buf, bufLen, 0, ( struct sockaddr * )&ssdpAddr, sendto( sock, buf, bufLen, 0, (struct sockaddr *)&ssdpAddr, socklen );
socklen );
usleep( 1000 ); usleep( 1000 );
if( gMServState == MSERV_IDLE ) if( gMServState == MSERV_IDLE ) {
break; break;
}
isleep( 1 ); isleep( 1 );
} }
shutdown( sock, SD_BOTH ); shutdown( sock, SD_BOTH );
UpnpCloseSocket( sock ); UpnpCloseSocket( sock );
return 0; return 0;
} }

View File

@@ -395,8 +395,13 @@ scanner_get_str( IN scanner_t * scanner )
* *
* Note : * Note :
************************************************************************/ ************************************************************************/
#ifndef WIN32
#warning The only use of the function 'scanner_pushback()' in the code is commented out. #warning The only use of the function 'scanner_pushback()' in the code is commented out.
#warning 'scanner_pushback()' is a candidate for removal. #warning 'scanner_pushback()' is a candidate for removal.
#else
#pragma message ("The only use of the function 'scanner_pushback()' in the code is commented out.")
#pragma message ("'scanner_pushback()' is a candidate for removal.")
#endif
static UPNP_INLINE void static UPNP_INLINE void
scanner_pushback( INOUT scanner_t * scanner, scanner_pushback( INOUT scanner_t * scanner,
IN size_t pushback_bytes ) IN size_t pushback_bytes )
@@ -965,8 +970,13 @@ read_until_crlf( INOUT scanner_t * scanner,
* PARSE_FAILURE * PARSE_FAILURE
* PARSE_INCOMPLETE * PARSE_INCOMPLETE
************************************************************************/ ************************************************************************/
#ifndef WIN32
#warning There are currently no uses of the function 'skip_to_end_of_header()' in the code. #warning There are currently no uses of the function 'skip_to_end_of_header()' in the code.
#warning 'skip_to_end_of_header()' is a candidate for removal. #warning 'skip_to_end_of_header()' is a candidate for removal.
#else
#pragma message("There are currently no uses of the function 'skip_to_end_of_header()' in the code.")
#pragma message("'skip_to_end_of_header()' is a candidate for removal.")
#endif
static UPNP_INLINE int static UPNP_INLINE int
skip_to_end_of_header( INOUT scanner_t * scanner ) skip_to_end_of_header( INOUT scanner_t * scanner )
{ {

View File

@@ -71,8 +71,16 @@
#include "webserver.h" #include "webserver.h"
/*
* Please, do not change these to const int while MSVC cannot understand
* const int in array dimensions.
*/
/*
const int CHUNK_HEADER_SIZE = 10; const int CHUNK_HEADER_SIZE = 10;
const int CHUNK_TAIL_SIZE = 10; const int CHUNK_TAIL_SIZE = 10;
*/
#define CHUNK_HEADER_SIZE 10
#define CHUNK_TAIL_SIZE 10
/************************************************************************ /************************************************************************

View File

@@ -176,7 +176,7 @@ http_get_code_text( int statusCode )
int table_num; int table_num;
if( !gInitialized ) { if( !gInitialized ) {
init_tables( ); init_tables();
} }
if( statusCode < 100 && statusCode >= 600 ) { if( statusCode < 100 && statusCode >= 600 ) {

View File

@@ -38,11 +38,9 @@
#include <assert.h> #include <assert.h>
#include <fcntl.h> #include <fcntl.h>
#ifndef UPNP_USE_BCBPP #ifndef UPNP_USE_BCBPP
#ifndef UPNP_USE_MSVCPP
#include <inttypes.h> #include <inttypes.h>
#include <stdint.h> #include <stdint.h>
#endif #endif
#endif
#include "util.h" #include "util.h"
#include "strintmap.h" #include "strintmap.h"
#include "membuffer.h" #include "membuffer.h"
@@ -536,9 +534,9 @@ web_server_init( void )
int ret_code; int ret_code;
if( bWebServerState == WEB_SERVER_DISABLED ) { if( bWebServerState == WEB_SERVER_DISABLED ) {
media_list_init( ); // decode media list media_list_init(); // decode media list
membuffer_init( &gDocumentRootDir ); membuffer_init( &gDocumentRootDir );
glob_alias_init( ); glob_alias_init();
pVirtualDirList = NULL; pVirtualDirList = NULL;

View File

@@ -32,6 +32,7 @@
#ifndef INTERNAL_CONFIG_H #ifndef INTERNAL_CONFIG_H
#define INTERNAL_CONFIG_H #define INTERNAL_CONFIG_H
#include "autoconfig.h" #include "autoconfig.h"

View File

@@ -36,12 +36,8 @@
#include "upnp.h" #include "upnp.h"
#include "client_table.h" #include "client_table.h"
//#include "../ssdp/ssdplib.h" //#include "../ssdp/ssdplib.h"
#define MAX_INTERFACES 256 #define MAX_INTERFACES 256
#define DEFAULT_INTERFACE 1 #define DEFAULT_INTERFACE 1

View File

@@ -31,19 +31,22 @@
#ifndef UTIL_H #ifndef UTIL_H
#define UTIL_H #define UTIL_H
#include "upnp.h" #include "upnp.h"
// usually used to specify direction of parameters in functions // usually used to specify direction of parameters in functions
#ifndef IN #ifndef IN
#define IN #define IN
#endif #endif
#ifndef OUT #ifndef OUT
#define OUT #define OUT
#endif #endif
#ifndef INOUT #ifndef INOUT
#define INOUT #define INOUT
#endif #endif
@@ -52,23 +55,18 @@
#define EVENT_TERMINATE -3 #define EVENT_TERMINATE -3
#ifndef WIN32
#define max(a, b) (((a)>(b))? (a):(b))
#define min(a, b) (((a)<(b))? (a):(b))
#endif
// boolean type in C // boolean type in C
typedef char xboolean; typedef char xboolean;
#ifndef TRUE #ifndef TRUE
#define TRUE 1 #define TRUE 1
#endif #endif
#ifndef FALSE #ifndef FALSE
#define FALSE 0 #define FALSE 0
#endif #endif
/////////////////////////// ///////////////////////////
// funcs // funcs
@@ -76,58 +74,62 @@ typedef char xboolean;
extern "C" { extern "C" {
#endif #endif
/************************************************************************
* Function: logerror
*
* Parameters:
* IN const char *fmt; format string
*
* Description: Log an error message.
*
* Return: void
************************************************************************/
void log_error( IN const char *fmt, ... ); void log_error( IN const char *fmt, ... );
/************************************************************************ /************************************************************************
* Function : linecopy * Function: linecopy
* *
* Parameters : * Parameters:
* OUT char dest[LINE_SIZE] ; output buffer * OUT char dest[LINE_SIZE]; output buffer
* IN const char* src ; input buffer * IN const char *src; input buffer
* *
* Description : Copy no of bytes spcified by the LINE_SIZE constant, * Description: Copy no of bytes spcified by the LINE_SIZE constant,
* from the source buffer. Null terminate the destination buffer * from the source buffer. Null terminate the destination buffer.
* *
* Return : void ; * Return: void
* ************************************************************************/
* Note :
************************************************************************/
void linecopy( OUT char dest[LINE_SIZE], IN const char* src ); void linecopy( OUT char dest[LINE_SIZE], IN const char* src );
/************************************************************************ /************************************************************************
* Function : namecopy * Function: namecopy
* *
* Parameters : * Parameters:
* OUT char dest[NAME_SIZE] ; output buffer * OUT char dest[NAME_SIZE]; output buffer
* IN const char* src ; input buffer * IN const char *src; input buffer
* *
* Description : Copy no of bytes spcified by the NAME_SIZE constant, * Description: Copy no of bytes spcified by the NAME_SIZE constant,
* from the source buffer. Null terminate the destination buffer * from the source buffer. Null terminate the destination buffer
* *
* Return : void ; * Return: void
* ************************************************************************/
* Note :
************************************************************************/
void namecopy( OUT char dest[NAME_SIZE], IN const char* src ); void namecopy( OUT char dest[NAME_SIZE], IN const char* src );
/************************************************************************ /************************************************************************
* Function : linecopylen * Function: linecopylen
* *
* Parameters : * Parameters:
* OUT char dest[LINE_SIZE] ; output buffer * OUT char dest[LINE_SIZE]; output buffer
* IN const char* src ; input buffer * IN const char *src; input buffer
* IN size_t srclen ; bytes to be copied. * IN size_t srclen; bytes to be copied.
* *
* Description : Determine if the srclen passed in paramter is less than * Description : Determine if the srclen passed in paramter is less than
* the permitted LINE_SIZE. If it is use the passed parameter, if not * the permitted LINE_SIZE. If it is use the passed parameter, if not
* use the permitted LINE_SIZE as the length parameter * use the permitted LINE_SIZE as the length parameter
* Copy no of bytes spcified by the LINE_SIZE constant, * Copy no of bytes spcified by the LINE_SIZE constant,
* from the source buffer. Null terminate the destination buffer * from the source buffer. Null terminate the destination buffer
* *
* Return : void ; * Return: void
* ************************************************************************/
* Note :
************************************************************************/
void linecopylen( OUT char dest[LINE_SIZE], IN const char* src, IN size_t srclen ); void linecopylen( OUT char dest[LINE_SIZE], IN const char* src, IN size_t srclen );
@@ -135,6 +137,9 @@ void linecopylen( OUT char dest[LINE_SIZE], IN const char* src, IN size_t srclen
} // extern C } // extern C
#endif #endif
/* Size of the errorBuffer variable, passed to the strerror_r() function */
#define ERROR_BUFFER_LEN 256
////////////////////////////////// //////////////////////////////////
// C specific // C specific
#ifndef __cplusplus #ifndef __cplusplus
@@ -148,16 +153,21 @@ void linecopylen( OUT char dest[LINE_SIZE], IN const char* src, IN size_t srclen
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#endif #endif
#define EADDRINUSE WSAEADDRINUSE #define EADDRINUSE WSAEADDRINUSE
#define strcasecmp stricmp #define strcasecmp stricmp
#define strncasecmp strnicmp #define strncasecmp strnicmp
#define sleep(a) Sleep((a)*1000) #define sleep(a) Sleep((a)*1000)
#define usleep(a) Sleep((a)/1000) #define usleep(a) Sleep((a)/1000)
#endif
#define strerror_r(a,b,c) (strerror_s((b),(c),(a)))
#else
#define max(a, b) (((a)>(b))? (a):(b))
#define min(a, b) (((a)<(b))? (a):(b))
#endif /* WIN32 */
#endif // __cplusplus #endif // __cplusplus
#endif /* GENLIB_UTIL_UTIL_H */ #endif /* UTIL_H */

View File

@@ -443,9 +443,9 @@ check_soap_body( IN IXML_Document * doc,
if( actionNode ) { if( actionNode ) {
ns = ixmlNode_getNamespaceURI( actionNode ); ns = ixmlNode_getNamespaceURI( actionNode );
name = ixmlNode_getLocalName( actionNode ); name = ixmlNode_getLocalName( actionNode );
if (name && ns &&
if( ( !strcmp( actionName, name ) ) !strcmp( actionName, name ) &&
&& ( !strcmp( urn, ns ) ) ) { !strcmp( urn, ns ) ) {
ret_code = UPNP_E_SUCCESS; ret_code = UPNP_E_SUCCESS;
} }
} }
@@ -607,7 +607,7 @@ get_device_info( IN http_message_t * request,
save_char = control_url[request->uri.pathquery.size]; save_char = control_url[request->uri.pathquery.size];
((char *)control_url)[request->uri.pathquery.size] = '\0'; ((char *)control_url)[request->uri.pathquery.size] = '\0';
HandleLock( ); HandleLock();
if( GetDeviceHandleInfo( &device_hnd, &device_info ) != HND_DEVICE ) { if( GetDeviceHandleInfo( &device_hnd, &device_info ) != HND_DEVICE ) {
goto error_handler; goto error_handler;
@@ -663,7 +663,7 @@ get_device_info( IN http_message_t * request,
error_handler: error_handler:
((char *)control_url)[request->uri.pathquery.size] = save_char; // restore ((char *)control_url)[request->uri.pathquery.size] = save_char; // restore
HandleUnlock( ); HandleUnlock();
return ret_code; return ret_code;
} }

View File

@@ -46,12 +46,10 @@
#include "unixutil.h" #include "unixutil.h"
#ifdef WIN32 #ifdef WIN32
#include <ws2tcpip.h> #include <ws2tcpip.h>
#include <winsock2.h> #include <winsock2.h>
#ifndef imillisleep #include <string.h>
#define imillisleep Sleep #endif /* WIN32 */
#endif
#endif
/************************************************************************ /************************************************************************
@@ -365,8 +363,13 @@ ssdp_handle_ctrlpt_msg( IN http_message_t * hmsg,
* Returns: void * Returns: void
* *
***************************************************************************/ ***************************************************************************/
#ifndef WIN32
#warning There are currently no uses of the function 'process_reply()' in the code. #warning There are currently no uses of the function 'process_reply()' in the code.
#warning 'process_reply()' is a candidate for removal. #warning 'process_reply()' is a candidate for removal.
#else
#pragma message("There are currently no uses of the function 'process_reply()' in the code.")
#pragma message("'process_reply()' is a candidate for removal.")
#endif
static UPNP_INLINE void static UPNP_INLINE void
process_reply( IN char *request_buf, process_reply( IN char *request_buf,
IN int buf_len, IN int buf_len,
@@ -514,8 +517,10 @@ SearchByTarget( IN int Mx,
IN char *St, IN char *St,
IN void *Cookie ) IN void *Cookie )
{ {
char errorBuffer[ERROR_BUFFER_LEN];
int socklen = sizeof( struct sockaddr_in ); int socklen = sizeof( struct sockaddr_in );
int *id = NULL; int *id = NULL;
int ret = 0;
char *ReqBuf; char *ReqBuf;
struct sockaddr_in destAddr; struct sockaddr_in destAddr;
fd_set wrSet; fd_set wrSet;
@@ -534,9 +539,10 @@ SearchByTarget( IN int Mx,
return UPNP_E_INVALID_PARAM; return UPNP_E_INVALID_PARAM;
} }
ReqBuf = ( char * )malloc( BUFSIZE ); ReqBuf = (char *)malloc( BUFSIZE );
if( ReqBuf == NULL ) if( ReqBuf == NULL ) {
return UPNP_E_OUTOF_MEMORY; return UPNP_E_OUTOF_MEMORY;
}
UpnpPrintf(UPNP_INFO, SSDP, __FILE__, __LINE__, ">>> SSDP SEND >>>\n"); UpnpPrintf(UPNP_INFO, SSDP, __FILE__, __LINE__, ">>> SSDP SEND >>>\n");
@@ -558,7 +564,7 @@ SearchByTarget( IN int Mx,
FD_ZERO( &wrSet ); FD_ZERO( &wrSet );
FD_SET( gSsdpReqSocket, &wrSet ); FD_SET( gSsdpReqSocket, &wrSet );
//add search criteria to list // add search criteria to list
HandleLock(); HandleLock();
if( GetClientHandleInfo( &handle, &ctrlpt_info ) != HND_CLIENT ) { if( GetClientHandleInfo( &handle, &ctrlpt_info ) != HND_CLIENT ) {
HandleUnlock(); HandleUnlock();
@@ -576,7 +582,7 @@ SearchByTarget( IN int Mx,
TPJobSetPriority( &job, MED_PRIORITY ); TPJobSetPriority( &job, MED_PRIORITY );
TPJobSetFreeFunction( &job, ( free_routine ) free ); TPJobSetFreeFunction( &job, ( free_routine ) free );
//Schdule a timeout event to remove search Arg // Schedule a timeout event to remove search Arg
TimerThreadSchedule( &gTimerThread, timeTillRead, TimerThreadSchedule( &gTimerThread, timeTillRead,
REL_SEC, &job, SHORT_TERM, id ); REL_SEC, &job, SHORT_TERM, id );
newArg->timeoutEventId = ( *id ); newArg->timeoutEventId = ( *id );
@@ -584,37 +590,25 @@ SearchByTarget( IN int Mx,
ListAddTail( &ctrlpt_info->SsdpSearchList, newArg ); ListAddTail( &ctrlpt_info->SsdpSearchList, newArg );
HandleUnlock(); HandleUnlock();
setsockopt( gSsdpReqSocket, IPPROTO_IP, IP_MULTICAST_IF, ret = setsockopt( gSsdpReqSocket, IPPROTO_IP, IP_MULTICAST_IF,
( char * )&addr, sizeof( addr ) ); (char *)&addr, sizeof (addr) );
if( select( gSsdpReqSocket + 1, NULL, &wrSet, NULL, NULL ) ret = select( gSsdpReqSocket + 1, NULL, &wrSet, NULL, NULL );
== UPNP_SOCKETERROR ) { if( ret == -1 ) {
if( errno == EBADF ) { strerror_r(errno, errorBuffer, ERROR_BUFFER_LEN);
UpnpPrintf( UPNP_INFO, SSDP, __FILE__, __LINE__, UpnpPrintf( UPNP_INFO, SSDP, __FILE__, __LINE__,
"SSDP_LIB :RequestHandler:An invalid file descriptor" "SSDP_LIB: Error in select(): %s\n",
" was givenin one of the sets. \n" ); errorBuffer );
} else if( errno == EINTR ) {
UpnpPrintf( UPNP_INFO, SSDP, __FILE__, __LINE__,
"SSDP_LIB :RequestHandler: A non blocked "
"signal was caught. \n" );
} else if( errno == EINVAL ) {
UpnpPrintf( UPNP_INFO, SSDP, __FILE__, __LINE__,
"SSDP_LIB :RequestHandler: n is negative. \n" );
} else if( errno == ENOMEM ) {
UpnpPrintf( UPNP_INFO, SSDP, __FILE__, __LINE__,
"SSDP_LIB : RequestHandler:select was unable to "
"allocate memory for internal tables.\n" );
}
shutdown( gSsdpReqSocket, SD_BOTH ); shutdown( gSsdpReqSocket, SD_BOTH );
UpnpCloseSocket( gSsdpReqSocket ); UpnpCloseSocket( gSsdpReqSocket );
free( ReqBuf ); free( ReqBuf );
return UPNP_E_INTERNAL_ERROR; return UPNP_E_INTERNAL_ERROR;
} else if( FD_ISSET( gSsdpReqSocket, &wrSet ) ) { } else if( FD_ISSET( gSsdpReqSocket, &wrSet ) ) {
int NumCopy = 0; int NumCopy = 0;
while( NumCopy < NUM_SSDP_COPY ) { while( NumCopy < NUM_SSDP_COPY ) {
sendto( gSsdpReqSocket, ReqBuf, strlen( ReqBuf ), 0, sendto( gSsdpReqSocket, ReqBuf, strlen( ReqBuf ), 0,
( struct sockaddr * )&destAddr, socklen ); (struct sockaddr *)&destAddr, socklen );
NumCopy++; NumCopy++;
imillisleep( SSDP_PAUSE ); imillisleep( SSDP_PAUSE );
} }
@@ -626,3 +620,4 @@ SearchByTarget( IN int Mx,
#endif // EXCLUDE_SSDP #endif // EXCLUDE_SSDP
#endif // INCLUDE_CLIENT_APIS #endif // INCLUDE_CLIENT_APIS

View File

@@ -30,10 +30,14 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#include "config.h" #include "config.h"
#ifdef INCLUDE_DEVICE_APIS #ifdef INCLUDE_DEVICE_APIS
#if EXCLUDE_SSDP == 0 #if EXCLUDE_SSDP == 0
#include <assert.h> #include <assert.h>
#include <stdio.h> #include <stdio.h>
#include <string.h>
#include "ssdplib.h" #include "ssdplib.h"
#include "upnpapi.h" #include "upnpapi.h"
#include "ThreadPool.h" #include "ThreadPool.h"
@@ -45,7 +49,7 @@
#ifdef WIN32 #ifdef WIN32
#include <ws2tcpip.h> #include <ws2tcpip.h>
#include <winsock2.h> #include <winsock2.h>
#endif #endif /* WIN32 */
#define MSGTYPE_SHUTDOWN 0 #define MSGTYPE_SHUTDOWN 0
#define MSGTYPE_ADVERTISEMENT 1 #define MSGTYPE_ADVERTISEMENT 1
@@ -213,26 +217,28 @@ NewRequestHandler( IN struct sockaddr_in *DestAddr,
IN int NumPacket, IN int NumPacket,
IN char **RqPacket ) IN char **RqPacket )
{ {
int ReplySock, char errorBuffer[ERROR_BUFFER_LEN];
socklen = sizeof( struct sockaddr_in ); int ReplySock;
int NumCopy, int socklen = sizeof( struct sockaddr_in );
Index; int NumCopy;
int Index;
unsigned long replyAddr = inet_addr( LOCAL_HOST ); unsigned long replyAddr = inet_addr( LOCAL_HOST );
int ttl = 4; //a/c to UPNP Spec int ttl = 4; // a/c to UPNP Spec
ReplySock = socket( AF_INET, SOCK_DGRAM, 0 ); ReplySock = socket( AF_INET, SOCK_DGRAM, 0 );
if( ReplySock == UPNP_INVALID_SOCKET ) { if ( ReplySock == -1 ) {
strerror_r(errno, errorBuffer, ERROR_BUFFER_LEN);
UpnpPrintf( UPNP_INFO, SSDP, __FILE__, __LINE__, UpnpPrintf( UPNP_INFO, SSDP, __FILE__, __LINE__,
"SSDP_LIB: New Request Handler:" "SSDP_LIB: New Request Handler:"
"Error in socket operation !!!\n" ); "Error in socket(): %s\n", errorBuffer );
return UPNP_E_OUTOF_SOCKET; return UPNP_E_OUTOF_SOCKET;
} }
setsockopt( ReplySock, IPPROTO_IP, IP_MULTICAST_IF, setsockopt( ReplySock, IPPROTO_IP, IP_MULTICAST_IF,
( char * )&replyAddr, sizeof( replyAddr ) ); (char *)&replyAddr, sizeof (replyAddr) );
setsockopt( ReplySock, IPPROTO_IP, IP_MULTICAST_TTL, setsockopt( ReplySock, IPPROTO_IP, IP_MULTICAST_TTL,
( char * )&ttl, sizeof( int ) ); (char *)&ttl, sizeof (int) );
for( Index = 0; Index < NumPacket; Index++ ) { for( Index = 0; Index < NumPacket; Index++ ) {
int rc; int rc;
@@ -262,6 +268,7 @@ NewRequestHandler( IN struct sockaddr_in *DestAddr,
shutdown( ReplySock, SD_BOTH ); shutdown( ReplySock, SD_BOTH );
UpnpCloseSocket( ReplySock ); UpnpCloseSocket( ReplySock );
return UPNP_E_SUCCESS; return UPNP_E_SUCCESS;
} }
@@ -334,8 +341,8 @@ CreateServicePacket( IN int msg_type,
ret_code = http_MakeMessage( ret_code = http_MakeMessage(
&buf, 1, 1, &buf, 1, 1,
"Q" "sssdc" "sdc" "ssc" "ssc" "ssc" "S" "Xc" "sscc", "Q" "sssdc" "sdc" "ssc" "ssc" "ssc" "S" "Xc" "sscc",
HTTPMETHOD_NOTIFY, "*", HTTPMETHOD_NOTIFY, "*", (size_t)1,
1, "HOST: ", SSDP_IP, ":", SSDP_PORT, "HOST: ", SSDP_IP, ":", SSDP_PORT,
"CACHE-CONTROL: max-age=", duration, "CACHE-CONTROL: max-age=", duration,
"LOCATION: ", location, "LOCATION: ", location,
"NT: ", nt, "NT: ", nt,

View File

@@ -43,6 +43,7 @@
#include "httpreadwrite.h" #include "httpreadwrite.h"
#ifdef WIN32 #ifdef WIN32
#include <string.h>
#include <winsock2.h> #include <winsock2.h>
#include <ws2tcpip.h> #include <ws2tcpip.h>
#include "unixutil.h" #include "unixutil.h"
@@ -442,20 +443,18 @@ Make_Socket_NoBlocking( int sock )
* Returns: int * Returns: int
* 0 if successful else -1 * 0 if successful else -1
***************************************************************************/ ***************************************************************************/
int int unique_service_name(IN char *cmd, IN SsdpEvent *Evt)
unique_service_name( IN char *cmd,
IN SsdpEvent * Evt )
{ {
char *TempPtr, char TempBuf[COMMAND_LEN];
TempBuf[COMMAND_LEN], char *TempPtr = NULL;
*Ptr, char *Ptr = NULL;
*ptr1, char *ptr1 = NULL;
*ptr2, char *ptr2 = NULL;
*ptr3; char *ptr3 = NULL;
int CommandFound = 0; int CommandFound = 0;
int length = 0;
if( ( TempPtr = strstr( cmd, "uuid:schemas" ) ) != NULL ) { if( ( TempPtr = strstr( cmd, "uuid:schemas" ) ) != NULL ) {
ptr1 = strstr( cmd, ":device" ); ptr1 = strstr( cmd, ":device" );
if( ptr1 != NULL ) { if( ptr1 != NULL ) {
ptr2 = strstr( ptr1 + 1, ":" ); ptr2 = strstr( ptr1 + 1, ":" );
@@ -487,7 +486,6 @@ unique_service_name( IN char *cmd,
} }
if( ( TempPtr = strstr( cmd, "uuid" ) ) != NULL ) { if( ( TempPtr = strstr( cmd, "uuid" ) ) != NULL ) {
//printf("cmd = %s\n",cmd);
if( ( Ptr = strstr( cmd, "::" ) ) != NULL ) { if( ( Ptr = strstr( cmd, "::" ) ) != NULL ) {
strncpy( Evt->UDN, TempPtr, Ptr - TempPtr ); strncpy( Evt->UDN, TempPtr, Ptr - TempPtr );
Evt->UDN[Ptr - TempPtr] = '\0'; Evt->UDN[Ptr - TempPtr] = '\0';
@@ -499,7 +497,6 @@ unique_service_name( IN char *cmd,
if( strstr( cmd, "urn:" ) != NULL if( strstr( cmd, "urn:" ) != NULL
&& strstr( cmd, ":service:" ) != NULL ) { && strstr( cmd, ":service:" ) != NULL ) {
if( ( TempPtr = strstr( cmd, "urn" ) ) != NULL ) { if( ( TempPtr = strstr( cmd, "urn" ) ) != NULL ) {
strcpy( Evt->ServiceType, TempPtr ); strcpy( Evt->ServiceType, TempPtr );
CommandFound = 1; CommandFound = 1;
@@ -514,8 +511,17 @@ unique_service_name( IN char *cmd,
} }
} }
if( CommandFound == 0 ) { if( ( TempPtr = strstr( cmd, "::upnp:rootdevice" ) ) != NULL ) {
/* Everything before "::upnp::rootdevice" is the UDN. */
if( TempPtr != cmd ) {
length = TempPtr - cmd;
strncpy(Evt->UDN, cmd, length);
Evt->UDN[length] = 0;
CommandFound = 1;
}
}
if( CommandFound == 0 ) {
return -1; return -1;
} }
@@ -856,33 +862,38 @@ readFromSSDPSocket( SOCKET socket )
int int
get_ssdp_sockets( MiniServerSockArray * out ) get_ssdp_sockets( MiniServerSockArray * out )
{ {
char errorBuffer[ERROR_BUFFER_LEN];
int onOff = 1; int onOff = 1;
u_char ttl = 4; u_char ttl = 4;
struct ip_mreq ssdpMcastAddr; struct ip_mreq ssdpMcastAddr;
struct sockaddr_in ssdpAddr; struct sockaddr_in ssdpAddr;
int option = 1; int option = 1;
int ret = 0;
struct in_addr addr; struct in_addr addr;
SOCKET ssdpSock; SOCKET ssdpSock;
#if INCLUDE_CLIENT_APIS #if INCLUDE_CLIENT_APIS
SOCKET ssdpReqSock; SOCKET ssdpReqSock;
if( ( ssdpReqSock = socket( AF_INET, SOCK_DGRAM, 0 ) ) == UPNP_INVALID_SOCKET ) { ssdpReqSock = socket( AF_INET, SOCK_DGRAM, 0 );
UpnpPrintf( UPNP_CRITICAL, if ( ssdpReqSock == -1 ) {
SSDP, __FILE__, __LINE__, strerror_r(errno, errorBuffer, ERROR_BUFFER_LEN);
"Error in socket operation !!!\n" ); UpnpPrintf( UPNP_CRITICAL, SSDP, __FILE__, __LINE__,
"Error in socket(): %s\n", errorBuffer );
return UPNP_E_OUTOF_SOCKET; return UPNP_E_OUTOF_SOCKET;
} }
setsockopt( ssdpReqSock, IPPROTO_IP, IP_MULTICAST_TTL, &ttl, sizeof( ttl ) ); ret = setsockopt( ssdpReqSock, IPPROTO_IP, IP_MULTICAST_TTL,
&ttl, sizeof (ttl) );
// just do it, regardless if fails or not. // just do it, regardless if fails or not.
Make_Socket_NoBlocking( ssdpReqSock ); Make_Socket_NoBlocking( ssdpReqSock );
gSsdpReqSocket = ssdpReqSock; gSsdpReqSocket = ssdpReqSock;
#endif /* INCLUDE_CLIENT_APIS */ #endif /* INCLUDE_CLIENT_APIS */
if( ( ssdpSock = socket( AF_INET, SOCK_DGRAM, 0 ) ) == UPNP_INVALID_SOCKET ) { ssdpSock = socket( AF_INET, SOCK_DGRAM, 0 );
UpnpPrintf( UPNP_CRITICAL, if ( ssdpSock == -1 ) {
SSDP, __FILE__, __LINE__, strerror_r(errno, errorBuffer, ERROR_BUFFER_LEN);
"Error in socket operation !!!\n" ); UpnpPrintf( UPNP_CRITICAL, SSDP, __FILE__, __LINE__,
"Error in socket(): %s\n", errorBuffer );
CLIENTONLY( shutdown( ssdpReqSock, SD_BOTH ); ) CLIENTONLY( shutdown( ssdpReqSock, SD_BOTH ); )
CLIENTONLY( UpnpCloseSocket( ssdpReqSock ); ) CLIENTONLY( UpnpCloseSocket( ssdpReqSock ); )
@@ -890,11 +901,12 @@ get_ssdp_sockets( MiniServerSockArray * out )
} }
onOff = 1; onOff = 1;
if( setsockopt( ssdpSock, SOL_SOCKET, SO_REUSEADDR, ret = setsockopt( ssdpSock, SOL_SOCKET, SO_REUSEADDR,
( char * )&onOff, sizeof( onOff ) ) != 0 ) { (char *)&onOff, sizeof(onOff) );
UpnpPrintf( UPNP_CRITICAL, if ( ret == -1) {
SSDP, __FILE__, __LINE__, strerror_r(errno, errorBuffer, ERROR_BUFFER_LEN);
"Error in set reuse addr !!!\n" ); UpnpPrintf( UPNP_CRITICAL, SSDP, __FILE__, __LINE__,
"Error in setsockopt() SO_REUSEADDR: %s\n", errorBuffer );
CLIENTONLY( shutdown( ssdpReqSock, SD_BOTH ); ) CLIENTONLY( shutdown( ssdpReqSock, SD_BOTH ); )
CLIENTONLY( UpnpCloseSocket( ssdpReqSock ); ) CLIENTONLY( UpnpCloseSocket( ssdpReqSock ); )
shutdown( ssdpSock, SD_BOTH ); shutdown( ssdpSock, SD_BOTH );
@@ -904,11 +916,12 @@ get_ssdp_sockets( MiniServerSockArray * out )
} }
#if defined(__FreeBSD__) || defined(__OSX__) || defined(__APPLE__) #if defined(__FreeBSD__) || defined(__OSX__) || defined(__APPLE__)
if( setsockopt( ssdpSock, SOL_SOCKET, SO_REUSEPORT, ret = setsockopt( ssdpSock, SOL_SOCKET, SO_REUSEPORT,
( char * )&onOff, sizeof( onOff ) ) != 0 ) { (char *)&onOff, sizeof (onOff) );
UpnpPrintf( UPNP_CRITICAL, if ( ret == -1 ) {
SSDP, __FILE__, __LINE__, strerror_r(errno, errorBuffer, ERROR_BUFFER_LEN);
"Error in set reuse port !!!\n" ); UpnpPrintf( UPNP_CRITICAL, SSDP, __FILE__, __LINE__,
"Error in setsockopt() SO_REUSEPORT: %s\n", errorBuffer );
CLIENTONLY( shutdown( ssdpReqSock, SD_BOTH ); ) CLIENTONLY( shutdown( ssdpReqSock, SD_BOTH ); )
CLIENTONLY( UpnpCloseSocket( ssdpReqSock ); ) CLIENTONLY( UpnpCloseSocket( ssdpReqSock ); )
shutdown( ssdpSock, SD_BOTH ); shutdown( ssdpSock, SD_BOTH );
@@ -918,16 +931,17 @@ get_ssdp_sockets( MiniServerSockArray * out )
} }
#endif /* __FreeBSD__ */ #endif /* __FreeBSD__ */
memset( ( void * )&ssdpAddr, 0, sizeof( struct sockaddr_in ) ); memset( (void *)&ssdpAddr, 0, sizeof( struct sockaddr_in ) );
ssdpAddr.sin_family = AF_INET; ssdpAddr.sin_family = AF_INET;
// ssdpAddr.sin_addr.s_addr = inet_addr(LOCAL_HOST); // ssdpAddr.sin_addr.s_addr = inet_addr(LOCAL_HOST);
ssdpAddr.sin_addr.s_addr = htonl( INADDR_ANY ); ssdpAddr.sin_addr.s_addr = htonl( INADDR_ANY );
ssdpAddr.sin_port = htons( SSDP_PORT ); ssdpAddr.sin_port = htons( SSDP_PORT );
if( bind( ssdpSock, ( struct sockaddr * )&ssdpAddr, ret = bind( ssdpSock, (struct sockaddr *)&ssdpAddr, sizeof (ssdpAddr) );
sizeof( ssdpAddr ) ) != 0 ) { if ( ret == -1 ) {
UpnpPrintf( UPNP_CRITICAL, strerror_r(errno, errorBuffer, ERROR_BUFFER_LEN);
SSDP, __FILE__, __LINE__, UpnpPrintf( UPNP_CRITICAL, SSDP, __FILE__, __LINE__,
"Error in binding !!!\n" ); "Error in bind(), addr=0x%08X, port=%d: %s\n",
INADDR_ANY, SSDP_PORT, errorBuffer );
shutdown( ssdpSock, SD_BOTH ); shutdown( ssdpSock, SD_BOTH );
UpnpCloseSocket( ssdpSock ); UpnpCloseSocket( ssdpSock );
CLIENTONLY( shutdown( ssdpReqSock, SD_BOTH ); ) CLIENTONLY( shutdown( ssdpReqSock, SD_BOTH ); )
@@ -936,14 +950,16 @@ get_ssdp_sockets( MiniServerSockArray * out )
return UPNP_E_SOCKET_BIND; return UPNP_E_SOCKET_BIND;
} }
memset( ( void * )&ssdpMcastAddr, 0, sizeof( struct ip_mreq ) ); memset( (void *)&ssdpMcastAddr, 0, sizeof (struct ip_mreq) );
ssdpMcastAddr.imr_interface.s_addr = inet_addr( LOCAL_HOST ); ssdpMcastAddr.imr_interface.s_addr = inet_addr( LOCAL_HOST );
ssdpMcastAddr.imr_multiaddr.s_addr = inet_addr( SSDP_IP ); ssdpMcastAddr.imr_multiaddr.s_addr = inet_addr( SSDP_IP );
if( setsockopt( ssdpSock, IPPROTO_IP, IP_ADD_MEMBERSHIP, ret = setsockopt( ssdpSock, IPPROTO_IP, IP_ADD_MEMBERSHIP,
( char * )&ssdpMcastAddr, sizeof( struct ip_mreq ) ) != 0 ) { (char *)&ssdpMcastAddr, sizeof (struct ip_mreq) );
UpnpPrintf( UPNP_CRITICAL, if ( ret == -1 ) {
SSDP, __FILE__, __LINE__, strerror_r(errno, errorBuffer, ERROR_BUFFER_LEN);
"Error in joining" " multicast group !!!\n" ); UpnpPrintf( UPNP_CRITICAL, SSDP, __FILE__, __LINE__,
"Error in setsockopt() IP_ADD_MEMBERSHIP (join multicast group): %s\n",
errorBuffer );
shutdown( ssdpSock, SD_BOTH ); shutdown( ssdpSock, SD_BOTH );
CLIENTONLY( shutdown( ssdpReqSock, SD_BOTH ); ) CLIENTONLY( shutdown( ssdpReqSock, SD_BOTH ); )
UpnpCloseSocket( ssdpSock ); UpnpCloseSocket( ssdpSock );
@@ -953,23 +969,29 @@ get_ssdp_sockets( MiniServerSockArray * out )
} }
/* Set multicast interface. */ /* Set multicast interface. */
memset( ( void * )&addr, 0, sizeof( struct in_addr )); memset( (void *)&addr, 0, sizeof (struct in_addr) );
addr.s_addr = inet_addr(LOCAL_HOST); addr.s_addr = inet_addr(LOCAL_HOST);
if ( setsockopt(ssdpSock, IPPROTO_IP, IP_MULTICAST_IF, ret = setsockopt(ssdpSock, IPPROTO_IP, IP_MULTICAST_IF,
(char *)&addr, sizeof addr) != 0) { (char *)&addr, sizeof addr);
if ( ret == -1 ) {
strerror_r(errno, errorBuffer, ERROR_BUFFER_LEN);
UpnpPrintf( UPNP_INFO, SSDP, __FILE__, __LINE__, UpnpPrintf( UPNP_INFO, SSDP, __FILE__, __LINE__,
"Couldn't set multicast interface.\n" ); "Error in setsockopt() IP_MULTICAST_IF (set multicast interface): %s\n",
errorBuffer );
/* This is probably not a critical error, so let's continue. */ /* This is probably not a critical error, so let's continue. */
} }
/* result is not checked becuase it will fail in WinMe and Win9x. */ /* result is not checked becuase it will fail in WinMe and Win9x. */
setsockopt( ssdpSock, IPPROTO_IP, ret = setsockopt( ssdpSock, IPPROTO_IP,
IP_MULTICAST_TTL, &ttl, sizeof( ttl ) ); IP_MULTICAST_TTL, &ttl, sizeof (ttl) );
if( setsockopt( ssdpSock, SOL_SOCKET, SO_BROADCAST,
(char *)&option, sizeof(option) ) != 0) { ret = setsockopt( ssdpSock, SOL_SOCKET, SO_BROADCAST,
UpnpPrintf( UPNP_CRITICAL, (char *)&option, sizeof (option) );
SSDP, __FILE__, __LINE__, if( ret == -1) {
"Error in setting broadcast !!!\n" ); strerror_r(errno, errorBuffer, ERROR_BUFFER_LEN);
UpnpPrintf( UPNP_CRITICAL, SSDP, __FILE__, __LINE__,
"Error in setsockopt() SO_BROADCAST (set broadcast): %s\n",
errorBuffer );
shutdown( ssdpSock, SD_BOTH ); shutdown( ssdpSock, SD_BOTH );
CLIENTONLY( shutdown( ssdpReqSock, SD_BOTH ); ) CLIENTONLY( shutdown( ssdpReqSock, SD_BOTH ); )
UpnpCloseSocket( ssdpSock ); UpnpCloseSocket( ssdpSock );

View File

@@ -18,11 +18,11 @@
*/ */
#include "config.h" #include "config.h"
#ifndef WIN32 #ifdef WIN32
#include <unistd.h> #include <winsock2.h>
#else #else /* WIN32 */
#include <winsock2.h> #include <unistd.h>
#endif #endif /* WIN32 */
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
#include "sysdep.h" #include "sysdep.h"
@@ -56,7 +56,7 @@ get_ieee_node_identifier(uuid_node_t *node)
less than 100ns. less than 100ns.
*/ */
#ifdef _WINDOWS_ #ifdef WIN32
void void
get_system_time( uuid_time_t * uuid_time ) get_system_time( uuid_time_t * uuid_time )
@@ -119,7 +119,7 @@ get_random_info(char seed[16])
MD5Final(seed, &c); MD5Final(seed, &c);
}; };
#else /* _WINDOWS_ */ #else /* WIN32 */
/*-----------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------*/
void void
@@ -163,5 +163,5 @@ get_random_info(char seed[16])
MD5Final(seed, &c); MD5Final(seed, &c);
}; };
#endif /* _WINDOWS_ */ #endif /* WIN32 */

View File

@@ -282,7 +282,7 @@ true_random( void )
inited = 1; inited = 1;
}; };
return ( rand( ) ); return ( rand() );
} }
/*-----------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------*/

View File

@@ -1,7 +1,7 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// //
// Copyright (c) 2006 R<>mi Turboult <r3mi@users.sourceforge.net> // Copyright (c) 2006 R<>mi Turboult <r3mi@users.sourceforge.net>
// All rights reserved. // All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without