Header file reordering and sanity. White space patch.

git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@384 119443c7-1b9e-41f8-b6fc-b9c35fce742c
This commit is contained in:
Marcelo Roberto Jimenez 2008-05-23 21:55:04 +00:00
parent 98e2b2b3af
commit 35db3e9bba
46 changed files with 1134 additions and 948 deletions

View File

@ -1,6 +1,8 @@
#include "autoconfig.h" #include "autoconfig.h"
#include "ixmldebug.h" #include "ixmldebug.h"

View File

@ -37,14 +37,18 @@ extern "C" {
#include <pthread.h> #include <pthread.h>
#ifndef WIN32 #ifdef WIN32
/* Do not #include <unistd.h> */
#else
#include <unistd.h> #include <unistd.h>
#endif #endif
#ifdef __FreeBSD__ #ifdef __FreeBSD__
#define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE #define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE
#endif #endif
#ifdef PTHREAD_MUTEX_RECURSIVE #ifdef PTHREAD_MUTEX_RECURSIVE
/* This system has SuS2-compliant mutex attributes. /* This system has SuS2-compliant mutex attributes.
* E.g. on Cygwin, where we don't have the old nonportable (NP) symbols * E.g. on Cygwin, where we don't have the old nonportable (NP) symbols
@ -715,10 +719,10 @@ 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 #ifdef WIN32
#define isleep sleep #define isleep(x) Sleep((x)*1000)
#else #else
#define isleep(x) Sleep((x)*1000) #define isleep sleep
#endif #endif
/**************************************************************************** /****************************************************************************
@ -734,12 +738,13 @@ 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 #ifdef WIN32
#define imillisleep(x) usleep(1000*x) #define imillisleep Sleep
#else #else
#define imillisleep Sleep #define imillisleep(x) usleep(1000*x)
#endif #endif
#ifdef WIN32 #ifdef WIN32
#ifndef UPNP_STATIC_LIB #ifndef UPNP_STATIC_LIB
#ifdef LIBUPNP_EXPORTS #ifdef LIBUPNP_EXPORTS

View File

@ -1,45 +1,55 @@
/////////////////////////////////////////////////////////////////////////// /**************************************************************************
// *
// Copyright (c) 2000-2003 Intel Corporation * Copyright (c) 2000-2003 Intel Corporation
// 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
// modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
// *
// * Redistributions of source code must retain the above copyright notice, * - Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice, * - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution. * and/or other materials provided with the distribution.
// * Neither name of Intel Corporation nor the names of its contributors * - Neither name of Intel Corporation nor the names of its contributors
// may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
// without specific prior written permission. * without specific prior written permission.
// *
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// *
/////////////////////////////////////////////////////////////////////////// **************************************************************************/
#include "LinkedList.h" #include "LinkedList.h"
#ifndef WIN32
#ifdef WIN32
/* Do not #include <sys/param.h> */
#else
#include <sys/param.h> #include <sys/param.h>
#endif #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>
static int static int
freeListNode( ListNode * node, freeListNode( ListNode * node,
LinkedList * list ) LinkedList * list )

View File

@ -15,7 +15,7 @@ typedef struct s_UpnpActionComplete UpnpActionComplete;
#include "UpnpString.h" #include "UpnpString.h"
#include "ixml.h" // for IXML_Document #include "ixml.h" /* for IXML_Document */
/** Constructor */ /** Constructor */

View File

@ -13,15 +13,17 @@ extern "C" {
typedef struct s_UpnpActionRequest UpnpActionRequest; typedef struct s_UpnpActionRequest UpnpActionRequest;
#include "ixml.h" // for IXML_Document #include "ixml.h" /* for IXML_Document */
#include "UpnpString.h" #include "UpnpString.h"
#ifndef WIN32
#include <netinet/in.h> // for sockaddr_storage #ifdef WIN32
#include <ws2tcpip.h>
#else #else
#include <ws2tcpip.h> #include <netinet/in.h> /* for sockaddr_storage */
#endif #endif
/** Constructor */ /** Constructor */
UpnpActionRequest *UpnpActionRequest_new(); UpnpActionRequest *UpnpActionRequest_new();

View File

@ -15,10 +15,11 @@ typedef struct s_UpnpDiscovery UpnpDiscovery;
#include "UpnpString.h" #include "UpnpString.h"
#ifndef WIN32
#include <netinet/in.h> // for sockaddr_storage #ifdef WIN32
#include <ws2tcpip.h>
#else #else
#include <ws2tcpip.h> #include <netinet/in.h> /* for sockaddr_storage */
#endif #endif

View File

@ -13,7 +13,7 @@ extern "C" {
typedef struct s_UpnpEvent UpnpEvent; typedef struct s_UpnpEvent UpnpEvent;
#include "ixml.h" // for IXML_Document #include "ixml.h" /* for IXML_Document */
#include "UpnpString.h" #include "UpnpString.h"

View File

@ -13,11 +13,11 @@ extern "C" {
typedef struct s_UpnpFileInfo UpnpFileInfo; typedef struct s_UpnpFileInfo UpnpFileInfo;
#include "ixml.h" // for DOMString #include "ixml.h" /* for DOMString */
#include <sys/types.h> // for off_t #include <sys/types.h> /* for off_t */
#include <time.h> // for time_t #include <time.h> /* for time_t */
/** Constructor */ /** Constructor */

View File

@ -17,7 +17,7 @@ typedef struct s_UpnpStateVarComplete UpnpStateVarComplete;
#include "UpnpString.h" #include "UpnpString.h"
#include "ixml.h" // for DOMString #include "ixml.h" /* for DOMString */
/** Constructor */ /** Constructor */

View File

@ -17,15 +17,16 @@ typedef struct s_UpnpStateVarRequest UpnpStateVarRequest;
#include "UpnpString.h" #include "UpnpString.h"
#include "ixml.h" // for DOMString #include "ixml.h" /* for DOMString */
#ifndef WIN32 #ifdef WIN32
#include <netinet/in.h> // for sockaddr_storage #include <ws2tcpip.h>
#else #else
#include <ws2tcpip.h> #include <netinet/in.h> /* for sockaddr_storage */
#endif #endif
/** Constructor */ /** Constructor */
UpnpStateVarRequest *UpnpStateVarRequest_new(); UpnpStateVarRequest *UpnpStateVarRequest_new();

View File

@ -51,17 +51,23 @@
#endif #endif
#include "ixml.h"
#include "upnpconfig.h"
#include <stdio.h> #include <stdio.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
#include "ixml.h" #ifdef WIN32
#include "upnpconfig.h" /* Do not #include <sys/param.h> */
#else
#include <sys/param.h>
#endif
#ifdef WIN32 #ifdef WIN32
@ -84,11 +90,13 @@
#define PRId64 "I64d" #define PRId64 "I64d"
#define PRIzu "lu" #define PRIzu "lu"
#endif /* UPNP_USE_MSVCPP */ #endif /* UPNP_USE_MSVCPP */
#ifdef UPNP_USE_BCBPP #ifdef UPNP_USE_BCBPP
/* define some things Borland Builder doesn't know */ /* define some things Borland Builder doesn't know */
#define UPNP_INLINE inline #define UPNP_INLINE inline
typedef __int64 int64_t; typedef __int64 int64_t;
#warning The Borland C compiler is probably broken on PRId64, please someone provide a proper fix here #warning The Borland C compiler is probably broken on PRId64, please someone provide a proper fix here
#define PRId64 "I64d" #define PRId64 "I64d"
#define PRIzu "zu" #define PRIzu "zu"
#endif /* UPNP_USE_BCBPP */ #endif /* UPNP_USE_BCBPP */
@ -107,24 +115,27 @@
/*#define inline*/ /*#define inline*/
#ifndef WIN32 #ifdef WIN32
#define UpnpCloseSocket close
#else
#define UpnpCloseSocket closesocket #define UpnpCloseSocket closesocket
#define fseeko fseek #define fseeko fseek
#else
#define UpnpCloseSocket close
#endif #endif
#ifndef WIN32
#ifdef WIN32
#else
#define SOCKET int #define SOCKET int
#define INVALID_SOCKET (SOCKET)(~0) #define INVALID_SOCKET (SOCKET)(~0)
#endif #endif
#ifndef WIN32 #ifdef WIN32
#include <netinet/in.h>
#else
#include <Ws2tcpip.h> #include <Ws2tcpip.h>
#include <iphlpapi.h> #include <iphlpapi.h>
#include <time.h> #include <time.h>
#else
#include <netinet/in.h>
#endif #endif

View File

@ -7,12 +7,12 @@
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
* *
* * Redistributions of source code must retain the above copyright notice, * - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, * - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution. * and/or other materials provided with the distribution.
* * Neither name of Intel Corporation nor the names of its contributors * - Neither name of Intel Corporation nor the names of its contributors
* may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
* without specific prior written permission. * without specific prior written permission.
* *

View File

@ -130,7 +130,8 @@ TvCtrlPointPrintLongHelp( void )
SampleUtil_Print( "" ); SampleUtil_Print( "" );
SampleUtil_Print( "This sample control point application automatically searches" ); SampleUtil_Print( "This sample control point application automatically searches" );
SampleUtil_Print( "for and subscribes to the services of television device emulator" ); SampleUtil_Print( "for and subscribes to the services of television device emulator" );
SampleUtil_Print( "devices. While registers a tv device itself." ); SampleUtil_Print( "devices, described in the tvdevicedesc.xml description document." );
SampleUtil_Print( "It also registers itself as a tv device." );
SampleUtil_Print( "" ); SampleUtil_Print( "" );
SampleUtil_Print( "Commands:" ); SampleUtil_Print( "Commands:" );
SampleUtil_Print( " Help" ); SampleUtil_Print( " Help" );
@ -456,7 +457,8 @@ int main( int argc, char **argv )
{ {
int rc; int rc;
ithread_t cmdloop_thread; ithread_t cmdloop_thread;
#ifndef WIN32 #ifdef WIN32
#else
int sig; int sig;
sigset_t sigs_to_catch; sigset_t sigs_to_catch;
#endif #endif
@ -471,7 +473,9 @@ int main( int argc, char **argv )
/* start a command loop thread */ /* start a command loop thread */
code = ithread_create( &cmdloop_thread, NULL, TvCtrlPointCommandLoop, NULL ); code = ithread_create( &cmdloop_thread, NULL, TvCtrlPointCommandLoop, NULL );
#ifndef WIN32 #ifdef WIN32
ithread_join(cmdloop_thread, NULL);
#else
/* /*
Catch Ctrl-C and properly shutdown Catch Ctrl-C and properly shutdown
*/ */
@ -480,12 +484,8 @@ int main( int argc, char **argv )
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 );
#else
ithread_join(cmdloop_thread, NULL);
#endif #endif
TvDeviceStop(); TvDeviceStop();
rc = TvCtrlPointStop(); rc = TvCtrlPointStop();
return rc; return rc;
} }

View File

@ -1,55 +1,65 @@
/////////////////////////////////////////////////////////////////////////// /**************************************************************************
// *
// Copyright (c) 2000-2003 Intel Corporation * Copyright (c) 2000-2003 Intel Corporation
// 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
// modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
// *
// * Redistributions of source code must retain the above copyright notice, * - Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice, * - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution. * and/or other materials provided with the distribution.
// * Neither name of Intel Corporation nor the names of its contributors * - Neither name of Intel Corporation nor the names of its contributors
// may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
// without specific prior written permission. * without specific prior written permission.
// *
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// *
/////////////////////////////////////////////////////////////////////////// **************************************************************************/
#ifndef UPNP_TV_CTRLPT_H #ifndef UPNP_TV_CTRLPT_H
#define UPNP_TV_CTRLPT_H #define UPNP_TV_CTRLPT_H
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include <stdio.h>
#include "sample_util.h"
#include "ithread.h" #include "ithread.h"
#ifndef WIN32
#include <unistd.h>
#endif
#include <stdarg.h>
#include <stdlib.h>
#include <signal.h>
#include <string.h>
#include "upnp.h" #include "upnp.h"
#include "upnptools.h" #include "upnptools.h"
#include "sample_util.h"
#include <signal.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef WIN32
/* Do not #include <unistd.h> */
#else
#include <unistd.h>
#endif
#define TV_SERVICE_SERVCOUNT 2 #define TV_SERVICE_SERVCOUNT 2
#define TV_SERVICE_CONTROL 0 #define TV_SERVICE_CONTROL 0
@ -68,12 +78,12 @@ extern "C" {
#define TV_MAX_VAL_LEN 5 #define TV_MAX_VAL_LEN 5
#define TV_SUCCESS 0 #define TV_SUCCESS 0
#define TV_ERROR (-1) #define TV_ERROR (-1)
#define TV_WARNING 1 #define TV_WARNING 1
/* This should be the maximum VARCOUNT from above */ /* This should be the maximum VARCOUNT from above */
#define TV_MAXVARS TV_PICTURE_VARCOUNT #define TV_MAXVARS TV_PICTURE_VARCOUNT
extern char TvDeviceType[]; extern char TvDeviceType[];
extern char *TvServiceType[]; extern char *TvServiceType[];

View File

@ -1,53 +1,66 @@
/////////////////////////////////////////////////////////////////////////// /**************************************************************************
// *
// Copyright (c) 2000-2003 Intel Corporation * Copyright (c) 2000-2003 Intel Corporation
// 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
// modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
// *
// * Redistributions of source code must retain the above copyright notice, * - Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice, * - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution. * and/or other materials provided with the distribution.
// * Neither name of Intel Corporation nor the names of its contributors * - Neither name of Intel Corporation nor the names of its contributors
// may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
// without specific prior written permission. * without specific prior written permission.
// *
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// *
/////////////////////////////////////////////////////////////////////////// **************************************************************************/
#ifndef UPNP_TV_DEVICE_H #ifndef UPNP_TV_DEVICE_H
#define UPNP_TV_DEVICE_H #define UPNP_TV_DEVICE_H
#include <stdio.h> #include <stdio.h>
#include <signal.h> #include <signal.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include "ithread.h"
#include <stdlib.h>
#ifndef WIN32
#include <unistd.h>
#endif
#include <string.h>
#include "upnp.h"
#include "sample_util.h" #include "sample_util.h"
#include "ithread.h"
#include "upnp.h"
#include <stdlib.h>
#include <string.h>
#ifdef WIN32
/* Do not #include <unistd.h> */
#else
#include <unistd.h>
#endif
//Color constants //Color constants
#define MAX_COLOR 10 #define MAX_COLOR 10
#define MIN_COLOR 1 #define MIN_COLOR 1

View File

@ -1,33 +1,33 @@
/////////////////////////////////////////////////////////////////////////// /**************************************************************************
// *
// Copyright (c) 2000-2003 Intel Corporation * Copyright (c) 2000-2003 Intel Corporation
// 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
// modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
// *
// * Redistributions of source code must retain the above copyright notice, * - Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice, * - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution. * and/or other materials provided with the distribution.
// * Neither name of Intel Corporation nor the names of its contributors * - Neither name of Intel Corporation nor the names of its contributors
// may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
// without specific prior written permission. * without specific prior written permission.
// *
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// *
/////////////////////////////////////////////////////////////////////////// **************************************************************************/
#include "sample_util.h" #include "sample_util.h"
@ -407,7 +407,8 @@ main( int argc,
{ {
int rc; int rc;
ithread_t cmdloop_thread; ithread_t cmdloop_thread;
#ifndef WIN32 #ifdef WIN32
#else
int sig; int sig;
sigset_t sigs_to_catch; sigset_t sigs_to_catch;
#endif #endif
@ -418,12 +419,12 @@ main( int argc,
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 #ifdef WIN32
ithread_join(cmdloop_thread, NULL);
#else
/* /*
Catch Ctrl-C and properly shutdown Catch Ctrl-C and properly shutdown
*/ */
@ -431,11 +432,10 @@ main( int argc,
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 #endif
rc = TvCtrlPointStop(); rc = TvCtrlPointStop();
return rc; return rc;
} }

View File

@ -1,55 +1,65 @@
/////////////////////////////////////////////////////////////////////////// /**************************************************************************
// *
// Copyright (c) 2000-2003 Intel Corporation * Copyright (c) 2000-2003 Intel Corporation
// 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
// modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
// *
// * Redistributions of source code must retain the above copyright notice, * - Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice, * - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution. * and/or other materials provided with the distribution.
// * Neither name of Intel Corporation nor the names of its contributors * - Neither name of Intel Corporation nor the names of its contributors
// may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
// without specific prior written permission. * without specific prior written permission.
// *
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// *
/////////////////////////////////////////////////////////////////////////// **************************************************************************/
#ifndef UPNP_TV_CTRLPT_H #ifndef UPNP_TV_CTRLPT_H
#define UPNP_TV_CTRLPT_H #define UPNP_TV_CTRLPT_H
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include <stdio.h>
#include "sample_util.h"
#include "ithread.h" #include "ithread.h"
#ifndef WIN32
#include <unistd.h>
#endif
#include <stdarg.h>
#include <stdlib.h>
#include <signal.h>
#include <string.h>
#include "upnp.h" #include "upnp.h"
#include "upnptools.h" #include "upnptools.h"
#include "sample_util.h"
#include <signal.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef WIN32
/* Do not #include <unistd.h> */
#else
#include <unistd.h>
#endif
#define TV_SERVICE_SERVCOUNT 2 #define TV_SERVICE_SERVCOUNT 2
#define TV_SERVICE_CONTROL 0 #define TV_SERVICE_CONTROL 0
@ -68,12 +78,12 @@ extern "C" {
#define TV_MAX_VAL_LEN 5 #define TV_MAX_VAL_LEN 5
#define TV_SUCCESS 0 #define TV_SUCCESS 0
#define TV_ERROR (-1) #define TV_ERROR (-1)
#define TV_WARNING 1 #define TV_WARNING 1
/* This should be the maximum VARCOUNT from above */ /* This should be the maximum VARCOUNT from above */
#define TV_MAXVARS TV_PICTURE_VARCOUNT #define TV_MAXVARS TV_PICTURE_VARCOUNT
extern char TvDeviceType[]; extern char TvDeviceType[];
extern char *TvServiceType[]; extern char *TvServiceType[];

View File

@ -1,33 +1,33 @@
/////////////////////////////////////////////////////////////////////////// /**************************************************************************
// *
// Copyright (c) 2000-2003 Intel Corporation * Copyright (c) 2000-2003 Intel Corporation
// 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
// modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
// *
// * Redistributions of source code must retain the above copyright notice, * - Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice, * - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution. * and/or other materials provided with the distribution.
// * Neither name of Intel Corporation nor the names of its contributors * - Neither name of Intel Corporation nor the names of its contributors
// may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
// without specific prior written permission. * without specific prior written permission.
// *
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// *
/////////////////////////////////////////////////////////////////////////// **************************************************************************/
#include "sample_util.h" #include "sample_util.h"
@ -130,7 +130,8 @@ int main( IN int argc, IN char **argv )
*web_dir_path = NULL; *web_dir_path = NULL;
int rc; int rc;
ithread_t cmdloop_thread; ithread_t cmdloop_thread;
#ifndef WIN32 #ifdef WIN32
#else
int sig; int sig;
sigset_t sigs_to_catch; sigset_t sigs_to_catch;
#endif #endif
@ -178,7 +179,9 @@ int main( IN int argc, IN char **argv )
/* 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 #ifdef WIN32
ithread_join(cmdloop_thread, NULL);
#else
/* /*
Catch Ctrl-C and properly shutdown Catch Ctrl-C and properly shutdown
*/ */
@ -187,8 +190,6 @@ int main( IN int argc, IN char **argv )
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 );
#else
ithread_join(cmdloop_thread, NULL);
#endif #endif
rc = TvDeviceStop(); rc = TvDeviceStop();

View File

@ -1,53 +1,66 @@
/////////////////////////////////////////////////////////////////////////// /**************************************************************************
// *
// Copyright (c) 2000-2003 Intel Corporation * Copyright (c) 2000-2003 Intel Corporation
// 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
// modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
// *
// * Redistributions of source code must retain the above copyright notice, * - Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice, * - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution. * and/or other materials provided with the distribution.
// * Neither name of Intel Corporation nor the names of its contributors * - Neither name of Intel Corporation nor the names of its contributors
// may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
// without specific prior written permission. * without specific prior written permission.
// *
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// *
/////////////////////////////////////////////////////////////////////////// **************************************************************************/
#ifndef UPNP_TV_DEVICE_H #ifndef UPNP_TV_DEVICE_H
#define UPNP_TV_DEVICE_H #define UPNP_TV_DEVICE_H
#include <stdio.h> #include <stdio.h>
#include <signal.h> #include <signal.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include "ithread.h"
#include <stdlib.h>
#ifndef WIN32
#include <unistd.h>
#endif
#include <string.h>
#include "upnp.h"
#include "sample_util.h" #include "sample_util.h"
#include "ithread.h"
#include "upnp.h"
#include <stdlib.h>
#include <string.h>
#ifdef WIN32
/* Do not #include <unistd.h> */
#else
#include <unistd.h>
#endif
//Color constants //Color constants
#define MAX_COLOR 10 #define MAX_COLOR 10
#define MIN_COLOR 1 #define MIN_COLOR 1

View File

@ -6,8 +6,8 @@
#include "ActionComplete.h" #include "ActionComplete.h"
#include <stdlib.h> // for calloc(), free() #include <stdlib.h> /* for calloc(), free() */
#include <string.h> // for strlen(), strdup() #include <string.h> /* for strlen(), strdup() */
struct SUpnpActionComplete struct SUpnpActionComplete

View File

@ -6,8 +6,8 @@
#include "ActionRequest.h" #include "ActionRequest.h"
#include <stdlib.h> // for calloc(), free() #include <stdlib.h> /* for calloc(), free() */
#include <string.h> // for memset(), strlen(), strdup() #include <string.h> /* for memset(), strlen(), strdup() */
struct SUpnpActionRequest struct SUpnpActionRequest

View File

@ -6,8 +6,8 @@
#include "Discovery.h" #include "Discovery.h"
#include <stdlib.h> // for calloc(), free() #include <stdlib.h> /* for calloc(), free() */
#include <string.h> // for memset() #include <string.h> /* for memset() */
struct SUpnpDiscovery struct SUpnpDiscovery

View File

@ -6,7 +6,7 @@
#include "Event.h" #include "Event.h"
#include <stdlib.h> // for calloc(), free() #include <stdlib.h> /* for calloc(), free() */
struct SUpnpEvent struct SUpnpEvent

View File

@ -6,7 +6,7 @@
#include "EventSubscribe.h" #include "EventSubscribe.h"
#include <stdlib.h> // for calloc(), free() #include <stdlib.h> /* for calloc(), free() */
struct SEventSubscribe struct SEventSubscribe

View File

@ -6,8 +6,8 @@
#include "FileInfo.h" #include "FileInfo.h"
#include <stdlib.h> // for calloc(), free() #include <stdlib.h> /* for calloc(), free() */
#include <string.h> // for strlen(), strdup() #include <string.h> /* for strlen(), strdup() */
struct SUpnpFileInfo struct SUpnpFileInfo

View File

@ -6,8 +6,8 @@
#include "StateVarComplete.h" #include "StateVarComplete.h"
#include <stdlib.h> // for calloc(), free() #include <stdlib.h> /* for calloc(), free() */
#include <string.h> // for strlen(), strdup() #include <string.h> /* for strlen(), strdup() */
struct SUpnpStateVarComplete struct SUpnpStateVarComplete

View File

@ -6,8 +6,8 @@
#include "StateVarRequest.h" #include "StateVarRequest.h"
#include <stdlib.h> // for calloc(), free() #include <stdlib.h> /* for calloc(), free() */
#include <string.h> // for memset(), strlen(), strdup() #include <string.h> /* for memset(), strlen(), strdup() */
struct SUpnpStateVarRequest struct SUpnpStateVarRequest

View File

@ -6,8 +6,8 @@
#include "SubscriptionRequest.h" #include "SubscriptionRequest.h"
#include <stdlib.h> // for calloc(), free() #include <stdlib.h> /* for calloc(), free() */
#include <string.h> // for memset(), strlen(), strdup() #include <string.h> /* for memset(), strlen(), strdup() */
struct SUpnpSubscriptionRequest struct SUpnpSubscriptionRequest

View File

@ -6,8 +6,8 @@
#include "UpnpString.h" #include "UpnpString.h"
#include <stdlib.h> // for calloc(), free() #include <stdlib.h> /* for calloc(), free() */
#include <string.h> // for strlen(), strdup() #include <string.h> /* for strlen(), strdup() */
/*! /*!

View File

@ -1,33 +1,33 @@
/////////////////////////////////////////////////////////////////////////// /**************************************************************************
// *
// Copyright (c) 2000-2003 Intel Corporation * Copyright (c) 2000-2003 Intel Corporation
// 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
// modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
// *
// * Redistributions of source code must retain the above copyright notice, * - Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice, * - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution. * and/or other materials provided with the distribution.
// * Neither name of Intel Corporation nor the names of its contributors * - Neither name of Intel Corporation nor the names of its contributors
// may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
// without specific prior written permission. * without specific prior written permission.
// *
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// *
/////////////////////////////////////////////////////////////////////////// **************************************************************************/
#include "config.h" #include "config.h"
@ -42,7 +42,9 @@
#include <string.h> #include <string.h>
#ifndef WIN32 #ifdef WIN32
/* Do not include these files */
#else
#include <arpa/inet.h> #include <arpa/inet.h>
#include <net/if.h> #include <net/if.h>
#include <netinet/in.h> #include <netinet/in.h>
@ -62,7 +64,7 @@
#elif defined(BSD) && BSD >= 199306 #elif defined(BSD) && BSD >= 199306
#include <ifaddrs.h> #include <ifaddrs.h>
#endif #endif
#endif /* WIN32 */ #endif
#include "upnpapi.h" #include "upnpapi.h"

View File

@ -1,33 +1,33 @@
/////////////////////////////////////////////////////////////////////////// /**************************************************************************
// *
// Copyright (c) 2000-2003 Intel Corporation * Copyright (c) 2000-2003 Intel Corporation
// 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
// modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
// *
// * Redistributions of source code must retain the above copyright notice, * - Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice, * - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution. * and/or other materials provided with the distribution.
// * Neither name of Intel Corporation nor the names of its contributors * - Neither name of Intel Corporation nor the names of its contributors
// may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
// without specific prior written permission. * without specific prior written permission.
// *
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// *
/////////////////////////////////////////////////////////////////////////// **************************************************************************/
#include "config.h" #include "config.h"
@ -307,11 +307,12 @@ void UpnpDisplayFileAndLine(
/* Put the debug lines in the buffer */ /* Put the debug lines in the buffer */
sprintf(buf[0], "DEBUG - THREAD ID: 0x%lX", sprintf(buf[0], "DEBUG - THREAD ID: 0x%lX",
#ifndef WIN32 #ifdef WIN32
(unsigned long int)ithread_self()); (unsigned long int)ithread_self().p
#else #else
(unsigned long int) ithread_self().p ); (unsigned long int)ithread_self()
#endif #endif
);
if (DbgFileName) { if (DbgFileName) {
sprintf(buf[1], sprintf(buf[1],
"FILE: %s, LINE: %d", "FILE: %s, LINE: %d",

View File

@ -1,33 +1,34 @@
/////////////////////////////////////////////////////////////////////////// /**************************************************************************
// *
// Copyright (c) 2000-2003 Intel Corporation * Copyright (c) 2000-2003 Intel Corporation
// 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
// modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
// *
// * Redistributions of source code must retain the above copyright notice, * - Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice, * - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution. * and/or other materials provided with the distribution.
// * Neither name of Intel Corporation nor the names of its contributors * - Neither name of Intel Corporation nor the names of its contributors
// may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
// without specific prior written permission. * without specific prior written permission.
// *
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// *
/////////////////////////////////////////////////////////////////////////// **************************************************************************/
#include "config.h" #include "config.h"
#if EXCLUDE_DOM == 0 #if EXCLUDE_DOM == 0
@ -36,15 +37,16 @@
#include "uri.h" #include "uri.h"
#define HEADER_LENGTH 2000 #define HEADER_LENGTH 2000
// Structure to maintain a error code and string associated with the /* Structure to maintain a error code and string associated with the
// error code * error code
*/
struct ErrorString { struct ErrorString {
int rc; /* error code */ int rc; /* error code */
const char *rcError; /* error description */ const char *rcError; /* error description */
}; };
// Initializing the array of error structures. /* Initializing the array of error structures. */
struct ErrorString ErrorMessages[] = { {UPNP_E_SUCCESS, "UPNP_E_SUCCESS"}, struct ErrorString ErrorMessages[] = { {UPNP_E_SUCCESS, "UPNP_E_SUCCESS"},
{UPNP_E_INVALID_HANDLE, "UPNP_E_INVALID_HANDLE"}, {UPNP_E_INVALID_HANDLE, "UPNP_E_INVALID_HANDLE"},
{UPNP_E_INVALID_PARAM, "UPNP_E_INVALID_PARAM"}, {UPNP_E_INVALID_PARAM, "UPNP_E_INVALID_PARAM"},
@ -581,5 +583,5 @@ UpnpCreatePropertySet( IN int NumArg,
return PropSet; return PropSet;
} }
#endif // EXCLUDE_DOM == 0 #endif /* EXCLUDE_DOM == 0 */

View File

@ -1,57 +1,56 @@
/////////////////////////////////////////////////////////////////////////// /**************************************************************************
// *
// Copyright (c) 2000-2003 Intel Corporation * Copyright (c) 2000-2003 Intel Corporation
// 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
// modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
// *
// * Redistributions of source code must retain the above copyright notice, * - Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice, * - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution. * and/or other materials provided with the distribution.
// * Neither name of Intel Corporation nor the names of its contributors * - Neither name of Intel Corporation nor the names of its contributors
// may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
// without specific prior written permission. * without specific prior written permission.
// *
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// *
/////////////////////////////////////////////////////////////////////////// **************************************************************************/
/************************************************************************ /************************************************************************
* Purpose: This file implements the functionality and utility functions * Purpose: This file implements the functionality and utility functions
* used by the Miniserver module. * used by the Miniserver module.
************************************************************************/ ************************************************************************/
#include "config.h" #include "config.h"
#ifndef WIN32
#include <arpa/inet.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/wait.h>
#include <unistd.h>
#include <sys/time.h>
#else /* WIN32 */
#include <winsock2.h>
typedef int socklen_t; #include "miniserver.h"
#define EAFNOSUPPORT 97
#endif /* WIN32 */
#include "unixutil.h"
#include "httpreadwrite.h"
#include "ithread.h" #include "ithread.h"
#include "ssdplib.h"
#include "statcodes.h"
#include "ThreadPool.h"
#include "unixutil.h"
#include "upnpapi.h"
#include "util.h"
#include <assert.h> #include <assert.h>
#include <errno.h> #include <errno.h>
@ -60,14 +59,21 @@
#include <string.h> #include <string.h>
#include <sys/types.h> #include <sys/types.h>
#include "ssdplib.h"
#include "util.h" #ifdef WIN32
#include "miniserver.h" #include <winsock2.h>
#include "ThreadPool.h"
#include "httpreadwrite.h" typedef int socklen_t;
#include "statcodes.h" #define EAFNOSUPPORT 97
#include "upnpapi.h" #else
#include <arpa/inet.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/wait.h>
#include <sys/time.h>
#include <unistd.h>
#endif
#define APPLICATION_LISTENING_PORT 49152 #define APPLICATION_LISTENING_PORT 49152

View File

@ -395,12 +395,12 @@ scanner_get_str( IN scanner_t * scanner )
* *
* Note : * Note :
************************************************************************/ ************************************************************************/
#ifndef WIN32 #ifdef WIN32
#warning The only use of the function 'scanner_pushback()' in the code is commented out. #pragma message ("The only use of the function 'scanner_pushback()' in the code is commented out.")
#warning 'scanner_pushback()' is a candidate for removal. #pragma message ("'scanner_pushback()' is a candidate for removal.")
#else #else
#pragma message ("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.
#pragma message ("'scanner_pushback()' is a candidate for removal.") #warning 'scanner_pushback()' is a candidate for removal.
#endif #endif
static UPNP_INLINE void static UPNP_INLINE void
scanner_pushback( INOUT scanner_t * scanner, scanner_pushback( INOUT scanner_t * scanner,
@ -970,12 +970,12 @@ read_until_crlf( INOUT scanner_t * scanner,
* PARSE_FAILURE * PARSE_FAILURE
* PARSE_INCOMPLETE * PARSE_INCOMPLETE
************************************************************************/ ************************************************************************/
#ifndef WIN32 #ifdef WIN32
#warning There are currently no uses of the function 'skip_to_end_of_header()' in the code. #pragma message("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. #pragma message("'skip_to_end_of_header()' is a candidate for removal.")
#else #else
#pragma message("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.
#pragma message("'skip_to_end_of_header()' is a candidate for removal.") #warning 'skip_to_end_of_header()' is a candidate for removal.
#endif #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

@ -35,10 +35,27 @@
* messages * messages
************************************************************************/ ************************************************************************/
#include "config.h" #include "config.h"
#include "httpreadwrite.h"
#include "unixutil.h"
#include "upnp.h"
#include "upnpapi.h"
#include "membuffer.h"
#include "uri.h"
#include "statcodes.h"
#include "sock.h"
#include "webserver.h"
#include <assert.h> #include <assert.h>
#include <stdarg.h> #include <stdarg.h>
#ifndef UPNP_USE_BCBPP #ifndef UPNP_USE_BCBPP
#ifndef UPNP_USE_MSVCPP #ifndef UPNP_USE_MSVCPP
#include <inttypes.h> #include <inttypes.h>
@ -46,7 +63,11 @@
#endif #endif
#endif #endif
#ifndef WIN32
#ifdef WIN32
#include <winsock2.h>
#include <malloc.h>
#else
#include <arpa/inet.h> #include <arpa/inet.h>
#include <fcntl.h> #include <fcntl.h>
#include <netinet/in.h> #include <netinet/in.h>
@ -56,19 +77,7 @@
#include <sys/wait.h> #include <sys/wait.h>
#include <unistd.h> #include <unistd.h>
#include <sys/utsname.h> #include <sys/utsname.h>
#else
#include <winsock2.h>
#include <malloc.h>
#endif #endif
#include "unixutil.h"
#include "upnp.h"
#include "upnpapi.h"
#include "membuffer.h"
#include "uri.h"
#include "statcodes.h"
#include "httpreadwrite.h"
#include "sock.h"
#include "webserver.h"
/* /*

View File

@ -1,72 +1,82 @@
/////////////////////////////////////////////////////////////////////////// /**************************************************************************
// *
// Copyright (c) 2000-2003 Intel Corporation * Copyright (c) 2000-2003 Intel Corporation
// 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
// modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
// *
// * Redistributions of source code must retain the above copyright notice, * - Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice, * - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution. * and/or other materials provided with the distribution.
// * Neither name of Intel Corporation nor the names of its contributors * - Neither name of Intel Corporation nor the names of its contributors
// may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
// without specific prior written permission. * without specific prior written permission.
// *
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// *
/////////////////////////////////////////////////////////////////////////// **************************************************************************/
/****************************************************************************** /******************************************************************************
* Purpose: This file defines the Web Server and has functions to carry out * Purpose: This file defines the Web Server and has functions to carry out
* operations of the Web Server. * operations of the Web Server.
******************************************************************************/ ******************************************************************************/
#include "config.h" #include "config.h"
#include "webserver.h" #include "webserver.h"
#include <assert.h>
#include <fcntl.h>
#ifndef UPNP_USE_BCBPP
#include <inttypes.h>
#include <stdint.h>
#endif /* !UPNP_USE_BCBPP */
#include "FileInfo.h" #include "FileInfo.h"
#include "httpparser.h" #include "httpparser.h"
#include "httpreadwrite.h" #include "httpreadwrite.h"
#include "ithread.h"
#include "membuffer.h" #include "membuffer.h"
#include "ssdplib.h" #include "ssdplib.h"
#include "statcodes.h" #include "statcodes.h"
#include "strintmap.h" #include "strintmap.h"
#include "unixutil.h"
#include "upnp.h" #include "upnp.h"
#include "upnpapi.h" #include "upnpapi.h"
#include "util.h" #include "util.h"
#include "VirtualDir.h" #include "VirtualDir.h"
#ifndef WIN32 #include <assert.h>
#include <fcntl.h>
#include <sys/stat.h>
#ifdef UPNP_USE_BCBPP
/* Do not #include <inttypes.h> */
/* Do not #include <stdint.h> */
#else
#include <inttypes.h>
#include <stdint.h>
#endif /* !UPNP_USE_BCBPP */
#ifdef WIN32
/* Do not #include <unistd.h> */
#else
#include <unistd.h> #include <unistd.h>
#endif #endif
#include <sys/stat.h>
#include "ithread.h"
#include "unixutil.h"
/* /*
Response Types Response Types

View File

@ -1,57 +1,67 @@
/////////////////////////////////////////////////////////////////////////// /**************************************************************************
// *
// Copyright (c) 2000-2003 Intel Corporation * Copyright (c) 2000-2003 Intel Corporation
// 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
// modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
// *
// * Redistributions of source code must retain the above copyright notice, * - Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice, * - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution. * and/or other materials provided with the distribution.
// * Neither name of Intel Corporation nor the names of its contributors * - Neither name of Intel Corporation nor the names of its contributors
// may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
// without specific prior written permission. * without specific prior written permission.
// *
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// *
/////////////////////////////////////////////////////////////////////////// **************************************************************************/
/************************************************************************ /************************************************************************
* Purpose: This file implements the sockets functionality * Purpose: This file implements the sockets functionality
************************************************************************/ ************************************************************************/
#include "config.h" #include "config.h"
#include "sock.h"
#include "unixutil.h"
#include "upnp.h"
#include <assert.h> #include <assert.h>
#include <errno.h> #include <errno.h>
#include <time.h> #include <time.h>
#include <string.h> #include <string.h>
#include "sock.h"
#include "upnp.h" #ifdef WIN32
#ifndef WIN32 #include <winsock2.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <unistd.h>
#else #else
#include <winsock2.h> #include <arpa/inet.h>
#include <netinet/in.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <unistd.h>
#endif #endif
#include "unixutil.h"
#ifndef MSG_NOSIGNAL #ifndef MSG_NOSIGNAL
#define MSG_NOSIGNAL 0 #define MSG_NOSIGNAL 0

View File

@ -1,33 +1,33 @@
/////////////////////////////////////////////////////////////////////////// /**************************************************************************
// *
// Copyright (c) 2000-2003 Intel Corporation * Copyright (c) 2000-2003 Intel Corporation
// 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
// modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
// *
// * Redistributions of source code must retain the above copyright notice, * - Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice, * - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution. * and/or other materials provided with the distribution.
// * Neither name of Intel Corporation nor the names of its contributors * - Neither name of Intel Corporation nor the names of its contributors
// may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
// without specific prior written permission. * without specific prior written permission.
// *
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// *
/////////////////////////////////////////////////////////////////////////// **************************************************************************/
#ifndef CLIENT_TABLE_H #ifndef CLIENT_TABLE_H

View File

@ -1,44 +1,50 @@
/////////////////////////////////////////////////////////////////////////// /**************************************************************************
// *
// Copyright (c) 2000-2003 Intel Corporation * Copyright (c) 2000-2003 Intel Corporation
// 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
// modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
// *
// * Redistributions of source code must retain the above copyright notice, * - Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice, * - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution. * and/or other materials provided with the distribution.
// * Neither name of Intel Corporation nor the names of its contributors * - Neither name of Intel Corporation nor the names of its contributors
// may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
// without specific prior written permission. * without specific prior written permission.
// *
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// *
/////////////////////////////////////////////////////////////////////////// **************************************************************************/
#ifndef GENLIB_NET_SOCK_H #ifndef GENLIB_NET_SOCK_H
#define GENLIB_NET_SOCK_H #define GENLIB_NET_SOCK_H
#include "util.h" #include "util.h"
#ifndef WIN32
#include <netinet/in.h> #ifdef WIN32
/* Do not #include <netinet/in.h> */
#else
#include <netinet/in.h>
#endif #endif
//Following variable is not defined under winsock.h
/* Following variable is not defined under winsock.h */
#ifndef SD_RECEIVE #ifndef SD_RECEIVE
#define SD_RECEIVE 0x00 #define SD_RECEIVE 0x00
#define SD_SEND 0x01 #define SD_SEND 0x01
@ -48,17 +54,19 @@
typedef struct typedef struct
{ {
SOCKET socket; // handle/descriptor to a socket /* handle/descriptor to a socket */
SOCKET socket;
// the following two fields are filled only in incoming requests; /* the following two fields are filled only in incoming requests; */
struct sockaddr_storage foreign_sockaddr; struct sockaddr_storage foreign_sockaddr;
} SOCKINFO; } SOCKINFO;
#ifdef __cplusplus #ifdef __cplusplus
#extern "C" { #extern "C" {
#endif #endif
/************************************************************************ /************************************************************************
* Function : sock_init * Function : sock_init
* *
@ -164,9 +172,11 @@ int sock_write( IN SOCKINFO *info, IN char* buffer, IN size_t bufsize,
************************************************************************/ ************************************************************************/
int sock_destroy(INOUT SOCKINFO* info, int); int sock_destroy(INOUT SOCKINFO* info, int);
#ifdef __cplusplus #ifdef __cplusplus
} // #extern "C" } /* #extern "C" */
#endif #endif
#endif // GENLIB_NET_SOCK_H #endif /* GENLIB_NET_SOCK_H */

View File

@ -1,59 +1,65 @@
/////////////////////////////////////////////////////////////////////////// /**************************************************************************
// *
// Copyright (c) 2000-2003 Intel Corporation * Copyright (c) 2000-2003 Intel Corporation
// 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
// modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
// *
// * Redistributions of source code must retain the above copyright notice, * - Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice, * - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution. * and/or other materials provided with the distribution.
// * Neither name of Intel Corporation nor the names of its contributors * - Neither name of Intel Corporation nor the names of its contributors
// may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
// without specific prior written permission. * without specific prior written permission.
// *
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// *
/////////////////////////////////////////////////////////////////////////// **************************************************************************/
#ifndef SSDPLIB_H #ifndef SSDPLIB_H
#define SSDPLIB_H #define SSDPLIB_H
#include "httpparser.h"
#include "httpreadwrite.h"
#include "miniserver.h"
#include <sys/types.h> #include <sys/types.h>
#include <signal.h> #include <signal.h>
#include <setjmp.h> #include <setjmp.h>
#include <fcntl.h> #include <fcntl.h>
#include <errno.h> #include <errno.h>
#include "httpparser.h"
#include "httpreadwrite.h"
#include "miniserver.h" #ifdef WIN32
#ifndef WIN32 #include <winsock2.h>
#include <syslog.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <netinet/ip_icmp.h>
#include <sys/time.h>
#include <arpa/inet.h>
#else #else
#include <winsock2.h> #include <syslog.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <netinet/ip_icmp.h>
#include <sys/time.h>
#include <arpa/inet.h>
#endif #endif
//Enumeration to define all different types of ssdp searches
/* Enumeration to define all different types of ssdp searches */
typedef enum SsdpSearchType{ typedef enum SsdpSearchType{
SSDP_SERROR=-1, SSDP_SERROR=-1,
SSDP_ALL,SSDP_ROOTDEVICE, SSDP_ALL,SSDP_ROOTDEVICE,
@ -63,7 +69,7 @@ typedef enum SsdpSearchType{
} SType; } SType;
//Enumeration to define all different type of ssdp messages /* Enumeration to define all different type of ssdp messages */
typedef enum SsdpCmdType{SSDP_ERROR=-1, typedef enum SsdpCmdType{SSDP_ERROR=-1,
SSDP_OK, SSDP_OK,
SSDP_ALIVE, SSDP_ALIVE,
@ -75,7 +81,7 @@ typedef enum SsdpCmdType{SSDP_ERROR=-1,
//Constant /* Constant */
#define BUFSIZE 2500 #define BUFSIZE 2500
#define SSDP_IP "239.255.255.250" #define SSDP_IP "239.255.255.250"
#define SSDP_IPV6_LINKLOCAL "FF02::C" #define SSDP_IPV6_LINKLOCAL "FF02::C"
@ -85,7 +91,8 @@ typedef enum SsdpCmdType{SSDP_ERROR=-1,
#define THREAD_LIMIT 50 #define THREAD_LIMIT 50
#define COMMAND_LEN 300 #define COMMAND_LEN 300
#ifndef X_USER_AGENT // can be overwritten by configure CFLAGS argument /* can be overwritten by configure CFLAGS argument */
#ifndef X_USER_AGENT
/** @name X_USER_AGENT /** @name X_USER_AGENT
* The {\tt X_USER_AGENT} constant specifies the value of the X-User-Agent: * The {\tt X_USER_AGENT} constant specifies the value of the X-User-Agent:
* HTTP header. The value "redsonic" is needed for the DSM-320. See * HTTP header. The value "redsonic" is needed for the DSM-320. See
@ -95,7 +102,7 @@ typedef enum SsdpCmdType{SSDP_ERROR=-1,
#define X_USER_AGENT "redsonic" #define X_USER_AGENT "redsonic"
#endif #endif
//Error code /* Error code */
#define NO_ERROR_FOUND 0 #define NO_ERROR_FOUND 0
#define E_REQUEST_INVALID -3 #define E_REQUEST_INVALID -3
#define E_RES_EXPIRED -4 #define E_RES_EXPIRED -4
@ -106,7 +113,7 @@ typedef enum SsdpCmdType{SSDP_ERROR=-1,
//Structure to store the SSDP information /* Structure to store the SSDP information */
typedef struct SsdpEventStruct typedef struct SsdpEventStruct
{ {
enum SsdpCmdType Cmd; enum SsdpCmdType Cmd;
@ -172,10 +179,6 @@ CLIENTONLY(extern SOCKET gSsdpReqSocket6;);
typedef int (*ParserFun)(char *, Event *); typedef int (*ParserFun)(char *, Event *);
//void InitParser();
//int AnalyzeCommand(char * szCommand, Event * Evt);
/************************************************************************ /************************************************************************
* Function : Make_Socket_NoBlocking * Function : Make_Socket_NoBlocking
* *
@ -569,4 +572,5 @@ int AdvertiseAndReply(
IN char *DeviceUDN, IN char *DeviceUDN,
IN char *ServiceType, int Exp); IN char *ServiceType, int Exp);
#endif #endif /* SSDPLIB_H */

View File

@ -1,34 +1,42 @@
/* /*
** Copyright (c) 1990- 1993, 1996 Open Software Foundation, Inc. * Copyright (c) 1990- 1993, 1996 Open Software Foundation, Inc.
** Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & * Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. &
** Digital Equipment Corporation, Maynard, Mass. * Digital Equipment Corporation, Maynard, Mass.
** Copyright (c) 1998 Microsoft. * Copyright (c) 1998 Microsoft.
** To anyone who acknowledges that this file is provided "AS IS" * To anyone who acknowledges that this file is provided "AS IS"
** without any express or implied warranty: permission to use, copy, * without any express or implied warranty: permission to use, copy,
** modify, and distribute this file for any purpose is hereby * modify, and distribute this file for any purpose is hereby
** granted without fee, provided that the above copyright notices and * granted without fee, provided that the above copyright notices and
** this notice appears in all source code copies, and that none of * this notice appears in all source code copies, and that none of
** the names of Open Software Foundation, Inc., Hewlett-Packard * the names of Open Software Foundation, Inc., Hewlett-Packard
** Company, or Digital Equipment Corporation be used in advertising * Company, or Digital Equipment Corporation be used in advertising
** or publicity pertaining to distribution of the software without * or publicity pertaining to distribution of the software without
** specific, written prior permission. Neither Open Software * specific, written prior permission. Neither Open Software
** Foundation, Inc., Hewlett-Packard Company, Microsoft, nor Digital Equipment * Foundation, Inc., Hewlett-Packard Company, Microsoft, nor Digital Equipment
** Corporation makes any representations about the suitability of * Corporation makes any representations about the suitability of
** this software for any purpose. * this software for any purpose.
*/ */
#include <sys/types.h>
#ifndef WIN32
#include <sys/time.h>
#endif
//#include <sys/sysinfo.h>
#include "ithread.h" #include "ithread.h"
/* change to point to where MD5 .h's live */ /* change to point to where MD5 .h's live */
/* get MD5 sample implementation from RFC 1321 */ /* get MD5 sample implementation from RFC 1321 */
#include "global.h" #include "global.h"
#include "md5.h" #include "md5.h"
#include <sys/types.h>
#ifdef WIN32
/* Do not #include <sys/time.h> */
#else
#include <sys/time.h>
#endif
/* set the following to the number of 100ns ticks of the actual /* set the following to the number of 100ns ticks of the actual
resolution of resolution of
your system's clock */ your system's clock */
@ -46,19 +54,26 @@ typedef unsigned short unsigned16;
typedef unsigned char unsigned8; typedef unsigned char unsigned8;
typedef unsigned char byte; typedef unsigned char byte;
/* Set this to what your compiler uses for 64 bit data type */ /* Set this to what your compiler uses for 64 bit data type */
#ifndef WIN32 #ifdef WIN32
#define unsigned64_t unsigned long long #define unsigned64_t __int64
#else #else
#define unsigned64_t __int64 #define unsigned64_t unsigned long long
#endif #endif
#define I64(C) C##LL #define I64(C) C##LL
typedef unsigned64_t uuid_time_t; typedef unsigned64_t uuid_time_t;
typedef struct { typedef struct {
char nodeID[6]; char nodeID[6];
} uuid_node_t; } uuid_node_t;
void get_ieee_node_identifier(uuid_node_t *node); void get_ieee_node_identifier(uuid_node_t *node);
void get_system_time(uuid_time_t *uuid_time); void get_system_time(uuid_time_t *uuid_time);
void get_random_info(char seed[16]); void get_random_info(char seed[16]);

View File

@ -1,46 +1,52 @@
/////////////////////////////////////////////////////////////////////////// /**************************************************************************
// *
// Copyright (c) 2000-2003 Intel Corporation * Copyright (c) 2000-2003 Intel Corporation
// 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
// modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
// *
// * Redistributions of source code must retain the above copyright notice, * - Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice, * - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution. * and/or other materials provided with the distribution.
// * Neither name of Intel Corporation nor the names of its contributors * - Neither name of Intel Corporation nor the names of its contributors
// may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
// without specific prior written permission. * without specific prior written permission.
// *
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// *
/////////////////////////////////////////////////////////////////////////// **************************************************************************/
/* Unix-specific network utilities */
// Unix-specific network utilities
#ifndef GENLIB_NET_UNIXUTIL_H #ifndef GENLIB_NET_UNIXUTIL_H
#define GENLIB_NET_UNIXUTIL_H #define GENLIB_NET_UNIXUTIL_H
#include <sys/types.h> #include <sys/types.h>
#ifndef WIN32
#include <sys/socket.h>
#else #ifdef WIN32
typedef int socklen_t; typedef int socklen_t;
#define EAFNOSUPPORT 97 #define EAFNOSUPPORT 97
#else
#include <sys/socket.h>
#endif #endif
#endif // GENLIB_NET_UNIXUTIL_H
#endif /* GENLIB_NET_UNIXUTIL_H */

View File

@ -1,64 +1,68 @@
/////////////////////////////////////////////////////////////////////////// /**************************************************************************
// *
// Copyright (c) 2000-2003 Intel Corporation * Copyright (c) 2000-2003 Intel Corporation
// 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
// modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
// *
// * Redistributions of source code must retain the above copyright notice, * - Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice, * - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution. * and/or other materials provided with the distribution.
// * Neither name of Intel Corporation nor the names of its contributors * - Neither name of Intel Corporation nor the names of its contributors
// may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
// without specific prior written permission. * without specific prior written permission.
// *
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// *
/////////////////////////////////////////////////////////////////////////// **************************************************************************/
#ifndef GENLIB_NET_URI_H #ifndef GENLIB_NET_URI_H
#define GENLIB_NET_URI_H #define GENLIB_NET_URI_H
#ifdef __cplusplus
extern "C" { #include "upnp.h"
#endif
#include <fcntl.h> #include <fcntl.h>
#include <string.h> #include <string.h>
#include <sys/types.h> #include <sys/types.h>
//#include <malloc.h>
#include <time.h> #include <time.h>
#include <errno.h> #include <errno.h>
#include <ctype.h> #include <ctype.h>
#include <stdlib.h> #include <stdlib.h>
#ifndef WIN32
#include <arpa/inet.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <unistd.h>
#include <netdb.h>
#include <sys/time.h>
#else
#include <time.h>
#define strncasecmp strnicmp
#ifdef WIN32
#include <time.h>
#define strncasecmp strnicmp
#else
#include <arpa/inet.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <unistd.h>
#include <netdb.h>
#include <sys/time.h>
#endif #endif
#include "upnp.h"
//#include <upnp_debug.h> #ifdef __cplusplus
extern "C" {
#endif
#define HTTP_DATE_LENGTH 37 // length for HTTP DATE: #define HTTP_DATE_LENGTH 37 // length for HTTP DATE:
@ -76,13 +80,14 @@ extern "C" {
enum hostType { HOSTNAME, IPv4address }; enum hostType { HOSTNAME, IPv4address };
enum pathType { ABS_PATH, REL_PATH, OPAQUE_PART }; enum pathType { ABS_PATH, REL_PATH, OPAQUE_PART };
#ifndef WIN32 #ifdef WIN32
// there is a conflict in windows with other symbols // there is a conflict in windows with other symbols
enum uriType { ABSOLUTE, RELATIVE }; enum uriType { absolute, relative };
#else #else
enum uriType { absolute, relative }; enum uriType { ABSOLUTE, RELATIVE };
#endif #endif
/* Buffer used in parsinghttp messages, urls, etc. generally this simply /* Buffer used in parsinghttp messages, urls, etc. generally this simply
* holds a pointer into a larger array */ * holds a pointer into a larger array */
typedef struct TOKEN { typedef struct TOKEN {
@ -517,9 +522,11 @@ EXTERN_C void free_http_message(http_message * message);
************************************************************************/ ************************************************************************/
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif // GENLIB_NET_URI_H
#endif /* GENLIB_NET_URI_H */

View File

@ -1,74 +1,78 @@
/////////////////////////////////////////////////////////////////////////// /**************************************************************************
// *
// Copyright (c) 2000-2003 Intel Corporation * Copyright (c) 2000-2003 Intel Corporation
// 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
// modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
// *
// * Redistributions of source code must retain the above copyright notice, * - Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice, * - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution. * and/or other materials provided with the distribution.
// * Neither name of Intel Corporation nor the names of its contributors * - Neither name of Intel Corporation nor the names of its contributors
// may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
// without specific prior written permission. * without specific prior written permission.
// *
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// *
/////////////////////////////////////////////////////////////////////////// **************************************************************************/
#ifndef URLCONFIG_H #ifndef URLCONFIG_H
#define URLCONFIG_H #define URLCONFIG_H
#ifndef WIN32
#include <sys/socket.h>
#include <netinet/in.h> #ifdef WIN32
#include <arpa/inet.h> #include <winsock2.h>
#else #else
#include <winsock2.h> #include <arpa/inet.h>
#include <netinet/in.h>
#include <sys/socket.h>
#endif #endif
// functions available only if the web server is included
/* functions available only if the web server is included */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/************************************************************************ /************************************************************************
* Function : configure_urlbase * Function: configure_urlbase
* *
* Parameters : * Parameters :
* INOUT IXML_Document *doc ; IXML Description document * INOUT IXML_Document *doc ; IXML Description document
* IN const struct sockaddr *serverAddr; socket address object * IN const struct sockaddr *serverAddr; socket address object
* providing the IP address and port information * providing the IP address and port information
* IN const char* alias ; string containing the alias * IN const char* alias ; string containing the alias
* IN time_t last_modified ; time when the XML document was * IN time_t last_modified ; time when the XML document was
* downloaded * downloaded
* OUT char docURL[LINE_SIZE] ; buffer to hold the URL of the * OUT char docURL[LINE_SIZE] ; buffer to hold the URL of the
* document. * document.
* *
* Description : Configure the full URL for the description document. * Description : Configure the full URL for the description document.
* Create the URL document and add alias, description information. * Create the URL document and add alias, description information.
* The doc is added to the web server to be served using the given * The doc is added to the web server to be served using the given
* alias. * alias.
* *
* Return : int ; * Return : int ;
* UPNP_E_SUCCESS - On Success * UPNP_E_SUCCESS - On Success
* UPNP_E_OUTOF_MEMORY - Default Error * UPNP_E_OUTOF_MEMORY - Default Error
* ****************************************************************************/
* Note :
****************************************************************************/
int configure_urlbase( INOUT IXML_Document *doc, int configure_urlbase( INOUT IXML_Document *doc,
IN const struct sockaddr* serverAddr, IN const struct sockaddr* serverAddr,
IN const char* alias, IN const char* alias,
@ -77,7 +81,9 @@ int configure_urlbase( INOUT IXML_Document *doc,
#ifdef __cplusplus #ifdef __cplusplus
} // extern C } /* extern C */
#endif #endif
#endif /* URLCONFIG_H */ #endif /* URLCONFIG_H */

View File

@ -1,44 +1,38 @@
/////////////////////////////////////////////////////////////////////////// /**************************************************************************
// *
// Copyright (c) 2000-2003 Intel Corporation * Copyright (c) 2000-2003 Intel Corporation
// 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
// modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
// *
// * Redistributions of source code must retain the above copyright notice, * - Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice, * - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution. * and/or other materials provided with the distribution.
// * Neither name of Intel Corporation nor the names of its contributors * - Neither name of Intel Corporation nor the names of its contributors
// may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
// without specific prior written permission. * without specific prior written permission.
// *
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// *
/////////////////////////////////////////////////////////////////////////// **************************************************************************/
#include "config.h" #include "config.h"
#include <assert.h>
#ifndef WIN32
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#else
#include <winsock2.h>
#endif
#include "upnp.h" #include "upnp.h"
#include "util.h" #include "util.h"
#include "webserver.h" #include "webserver.h"
@ -47,6 +41,20 @@
#include "urlconfig.h" #include "urlconfig.h"
#include "unixutil.h" #include "unixutil.h"
#include <assert.h>
#ifdef WIN32
#include <winsock2.h>
#else
#include <arpa/inet.h>
#include <netinet/in.h>
#include <sys/types.h>
#include <sys/socket.h>
#endif
/************************************************************************ /************************************************************************
* Function : addrToString * Function : addrToString
* *

View File

@ -1,34 +1,44 @@
/* /**************************************************************************
** Copyright (c) 1990- 1993, 1996 Open Software Foundation, Inc. *
** Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & * Copyright (c) 1990- 1993, 1996 Open Software Foundation, Inc.
** Digital Equipment Corporation, Maynard, Mass. * Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. &
** Copyright (c) 1998 Microsoft. * Digital Equipment Corporation, Maynard, Mass.
** To anyone who acknowledges that this file is provided "AS IS" * Copyright (c) 1998 Microsoft.
** without any express or implied warranty: permission to use, copy, * To anyone who acknowledges that this file is provided "AS IS"
** modify, and distribute this file for any purpose is hereby * without any express or implied warranty: permission to use, copy,
** granted without fee, provided that the above copyright notices and * modify, and distribute this file for any purpose is hereby
** this notice appears in all source code copies, and that none of * granted without fee, provided that the above copyright notices and
** the names of Open Software Foundation, Inc., Hewlett-Packard * this notice appears in all source code copies, and that none of
** Company, or Digital Equipment Corporation be used in advertising * the names of Open Software Foundation, Inc., Hewlett-Packard
** or publicity pertaining to distribution of the software without * Company, or Digital Equipment Corporation be used in advertising
** specific, written prior permission. Neither Open Software * or publicity pertaining to distribution of the software without
** Foundation, Inc., Hewlett-Packard Company, Microsoft, nor Digital Equipment * specific, written prior permission. Neither Open Software
** Corporation makes any representations about the suitability of * Foundation, Inc., Hewlett-Packard Company, Microsoft, nor Digital Equipment
** this software for any purpose. * Corporation makes any representations about the suitability of
*/ * this software for any purpose.
*
**************************************************************************/
#include "config.h" #include "config.h"
#include "sysdep.h"
#include "uuid.h"
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <time.h> #include <time.h>
#ifndef WIN32
#include <netinet/in.h>
#ifdef WIN32
#include <winsock2.h>
#else #else
#include <winsock2.h> #include <netinet/in.h>
#endif #endif
#include "sysdep.h"
#include "uuid.h"
/* /*
various forward declarations various forward declarations
@ -386,3 +396,4 @@ uuid_compare( uuid_upnp * u1,
return 0; return 0;
}; };