UpnpInet.h is now the only place where winsock2.h and Ws2tcpip.h are included.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@455 119443c7-1b9e-41f8-b6fc-b9c35fce742c
This commit is contained in:
parent
d991fbe26c
commit
943483e8b7
@ -42,6 +42,7 @@
|
|||||||
#include "FreeList.h"
|
#include "FreeList.h"
|
||||||
#include "ithread.h"
|
#include "ithread.h"
|
||||||
#include "LinkedList.h"
|
#include "LinkedList.h"
|
||||||
|
#include "UpnpInet.h"
|
||||||
#include "UpnpGlobal.h" /* for UPNP_INLINE, EXPORT_SPEC */
|
#include "UpnpGlobal.h" /* for UPNP_INLINE, EXPORT_SPEC */
|
||||||
|
|
||||||
|
|
||||||
@ -50,7 +51,6 @@
|
|||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <winsock2.h>
|
|
||||||
struct timezone
|
struct timezone
|
||||||
{
|
{
|
||||||
int tz_minuteswest; /* minutes W of Greenwich */
|
int tz_minuteswest; /* minutes W of Greenwich */
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
|
#include <winsock2.h>
|
||||||
#include <Ws2tcpip.h>
|
#include <Ws2tcpip.h>
|
||||||
#else
|
#else
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
@ -50,6 +50,7 @@
|
|||||||
#include "uri.h"
|
#include "uri.h"
|
||||||
#include "statcodes.h"
|
#include "statcodes.h"
|
||||||
#include "sock.h"
|
#include "sock.h"
|
||||||
|
#include "UpnpInet.h"
|
||||||
#include "webserver.h"
|
#include "webserver.h"
|
||||||
|
|
||||||
|
|
||||||
@ -66,12 +67,10 @@
|
|||||||
|
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#include <winsock2.h>
|
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#else
|
#else
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <netinet/in.h>
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
@ -1,33 +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.
|
||||||
//
|
*
|
||||||
///////////////////////////////////////////////////////////////////////////
|
**************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef GLOBAL_H
|
||||||
|
#define GLOBAL_H
|
||||||
|
|
||||||
|
|
||||||
/* GLOBAL.H - RSAREF types and constants */
|
/* GLOBAL.H - RSAREF types and constants */
|
||||||
/* PROTOTYPES should be set to one if and only if the compiler supports
|
/* PROTOTYPES should be set to one if and only if the compiler supports
|
||||||
@ -37,8 +42,9 @@
|
|||||||
been defined with C compiler flags.
|
been defined with C compiler flags.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef PROTOTYPES
|
#ifndef PROTOTYPES
|
||||||
#define PROTOTYPES 0
|
#define PROTOTYPES 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* POINTER defines a generic pointer type */
|
/* POINTER defines a generic pointer type */
|
||||||
@ -50,13 +56,17 @@ typedef unsigned short int UINT2;
|
|||||||
/* UINT4 defines a four byte word */
|
/* UINT4 defines a four byte word */
|
||||||
typedef unsigned long int UINT4;
|
typedef unsigned long int UINT4;
|
||||||
|
|
||||||
/* PROTO_LIST is defined depending on how PROTOTYPES is defined above.
|
/*
|
||||||
If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it
|
* PROTO_LIST is defined depending on how PROTOTYPES is defined above.
|
||||||
returns an empty list.
|
* If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it
|
||||||
|
* returns an empty list.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if PROTOTYPES
|
#if PROTOTYPES
|
||||||
#define PROTO_LIST(list) list
|
#define PROTO_LIST(list) list
|
||||||
#else
|
#else
|
||||||
#define PROTO_LIST(list) ()
|
#define PROTO_LIST(list) ()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* GLOBAL_H */
|
||||||
|
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
#include "httpparser.h"
|
#include "httpparser.h"
|
||||||
#include "httpreadwrite.h"
|
#include "httpreadwrite.h"
|
||||||
#include "miniserver.h"
|
#include "miniserver.h"
|
||||||
|
#include "UpnpInet.h"
|
||||||
|
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@ -46,11 +47,9 @@
|
|||||||
|
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#include <winsock2.h>
|
|
||||||
#else
|
#else
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <netinet/in.h>
|
|
||||||
#include <netinet/in_systm.h>
|
#include <netinet/in_systm.h>
|
||||||
#include <netinet/ip.h>
|
#include <netinet/ip.h>
|
||||||
#include <netinet/ip_icmp.h>
|
#include <netinet/ip_icmp.h>
|
||||||
|
@ -18,6 +18,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef SYSDEP_H
|
||||||
|
#define SYSDEP_H
|
||||||
|
|
||||||
|
|
||||||
#include "ithread.h"
|
#include "ithread.h"
|
||||||
|
|
||||||
|
|
||||||
@ -42,13 +46,16 @@
|
|||||||
your system's clock */
|
your system's clock */
|
||||||
#define UUIDS_PER_TICK 1024
|
#define UUIDS_PER_TICK 1024
|
||||||
|
|
||||||
|
|
||||||
/* Set the following to a call to acquire a system wide global lock
|
/* Set the following to a call to acquire a system wide global lock
|
||||||
*/
|
*/
|
||||||
extern ithread_mutex_t gUUIDMutex;
|
extern ithread_mutex_t gUUIDMutex;
|
||||||
|
|
||||||
|
|
||||||
#define UUIDLock() ithread_mutex_lock(&gUUIDMutex)
|
#define UUIDLock() ithread_mutex_lock(&gUUIDMutex)
|
||||||
#define UUIDUnlock() ithread_mutex_unlock(&gUUIDMutex)
|
#define UUIDUnlock() ithread_mutex_unlock(&gUUIDMutex)
|
||||||
|
|
||||||
|
|
||||||
typedef unsigned long unsigned32;
|
typedef unsigned long unsigned32;
|
||||||
typedef unsigned short unsigned16;
|
typedef unsigned short unsigned16;
|
||||||
typedef unsigned char unsigned8;
|
typedef unsigned char unsigned8;
|
||||||
@ -70,7 +77,7 @@ typedef unsigned64_t uuid_time_t;
|
|||||||
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char nodeID[6];
|
char nodeID[6];
|
||||||
} uuid_node_t;
|
} uuid_node_t;
|
||||||
|
|
||||||
|
|
||||||
@ -78,3 +85,6 @@ 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]);
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* SYSDEP_H */
|
||||||
|
|
||||||
|
@ -37,13 +37,14 @@
|
|||||||
#define GENLIB_NET_UNIXUTIL_H
|
#define GENLIB_NET_UNIXUTIL_H
|
||||||
|
|
||||||
|
|
||||||
|
#include "UpnpInet.h"
|
||||||
|
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#include <winsock2.h>
|
|
||||||
typedef int socklen_t;
|
typedef int socklen_t;
|
||||||
#define EAFNOSUPPORT 97
|
#define EAFNOSUPPORT 97
|
||||||
#else
|
#else
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <netinet/in.h>
|
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
|
@ -34,11 +34,12 @@
|
|||||||
#define URLCONFIG_H
|
#define URLCONFIG_H
|
||||||
|
|
||||||
|
|
||||||
|
#include "UpnpInet.h"
|
||||||
|
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#include <winsock2.h>
|
|
||||||
#else
|
#else
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <netinet/in.h>
|
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1,50 +1,90 @@
|
|||||||
/*
|
/*
|
||||||
** 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.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef struct _uuid_upnp {
|
|
||||||
unsigned32 time_low;
|
|
||||||
unsigned16 time_mid;
|
|
||||||
unsigned16 time_hi_and_version;
|
|
||||||
unsigned8 clock_seq_hi_and_reserved;
|
|
||||||
unsigned8 clock_seq_low;
|
|
||||||
byte node[6];
|
|
||||||
} uuid_upnp;
|
|
||||||
|
|
||||||
/* uuid_create -- generate a UUID */
|
#include "sysdep.h"
|
||||||
int uuid_create(uuid_upnp * id);
|
|
||||||
void uuid_unpack(uuid_upnp *u, char *out); // out will be xxxx-xx-xx-xx-xxxxxx format
|
|
||||||
|
|
||||||
/* uuid_create_from_name -- create a UUID using a "name"
|
|
||||||
from a "name space" */
|
|
||||||
void uuid_create_from_name(
|
|
||||||
uuid_upnp * uid, /* resulting UUID */
|
|
||||||
uuid_upnp nsid, /* UUID to serve as context, so identical
|
|
||||||
names from different name spaces generate
|
|
||||||
different UUIDs */
|
|
||||||
void * name, /* the name from which to generate a UUID */
|
|
||||||
int namelen /* the length of the name */
|
|
||||||
);
|
|
||||||
|
|
||||||
/* uuid_compare -- Compare two UUID's "lexically" and return
|
/*! . */
|
||||||
-1 u1 is lexically before u2
|
typedef struct _uuid_upnp {
|
||||||
0 u1 is equal to u2
|
/*! . */
|
||||||
1 u1 is lexically after u2
|
unsigned32 time_low;
|
||||||
Note: lexical ordering is not temporal ordering!
|
/*! . */
|
||||||
*/
|
unsigned16 time_mid;
|
||||||
int uuid_compare(uuid_upnp *u1, uuid_upnp *u2);
|
/*! . */
|
||||||
|
unsigned16 time_hi_and_version;
|
||||||
|
/*! . */
|
||||||
|
unsigned8 clock_seq_hi_and_reserved;
|
||||||
|
/*! . */
|
||||||
|
unsigned8 clock_seq_low;
|
||||||
|
/*! . */
|
||||||
|
byte node[6];
|
||||||
|
} uuid_upnp;
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Generate a UUID.
|
||||||
|
*/
|
||||||
|
int uuid_create(
|
||||||
|
/*! . */
|
||||||
|
uuid_upnp * id);
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Out will be xxxx-xx-xx-xx-xxxxxx format.
|
||||||
|
*/
|
||||||
|
void uuid_unpack(
|
||||||
|
/*! . */
|
||||||
|
uuid_upnp *u,
|
||||||
|
/*! . */
|
||||||
|
char *out);
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Create a UUID using a "name" from a "name space"
|
||||||
|
*/
|
||||||
|
void uuid_create_from_name(
|
||||||
|
/*! Resulting UUID. */
|
||||||
|
uuid_upnp *uid,
|
||||||
|
/*! UUID to serve as context, so identical names from different name
|
||||||
|
* spaces generate different UUIDs. */
|
||||||
|
uuid_upnp nsid,
|
||||||
|
/*! The name from which to generate a UUID. */
|
||||||
|
void *name,
|
||||||
|
/*! The length of the name. */
|
||||||
|
int namelen
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Compare two UUID's "lexically".
|
||||||
|
*
|
||||||
|
* \return
|
||||||
|
* -1 u1 is lexically before u2
|
||||||
|
* 0 u1 is equal to u2
|
||||||
|
* 1 u1 is lexically after u2
|
||||||
|
*
|
||||||
|
* \note Lexical ordering is not temporal ordering!
|
||||||
|
*/
|
||||||
|
int uuid_compare(
|
||||||
|
/*! . */
|
||||||
|
uuid_upnp *u1,
|
||||||
|
/*! . */
|
||||||
|
uuid_upnp *u2);
|
||||||
|
|
||||||
|
@ -1,54 +1,60 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////
|
/**************************************************************************
|
||||||
//
|
*
|
||||||
// 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 "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
|
|
||||||
#ifdef INCLUDE_CLIENT_APIS
|
#ifdef INCLUDE_CLIENT_APIS
|
||||||
#if EXCLUDE_SSDP == 0
|
#if EXCLUDE_SSDP == 0
|
||||||
|
|
||||||
#include "ssdp_ResultData.h"
|
|
||||||
#include "ssdplib.h"
|
|
||||||
#include "upnpapi.h"
|
|
||||||
#include <stdio.h>
|
|
||||||
#include "ThreadPool.h"
|
|
||||||
|
|
||||||
#include "httpparser.h"
|
#include "httpparser.h"
|
||||||
#include "httpreadwrite.h"
|
#include "httpreadwrite.h"
|
||||||
|
#include "ssdp_ResultData.h"
|
||||||
|
#include "ssdplib.h"
|
||||||
#include "statcodes.h"
|
#include "statcodes.h"
|
||||||
|
|
||||||
#include "unixutil.h"
|
#include "unixutil.h"
|
||||||
|
#include "upnpapi.h"
|
||||||
|
#include "UpnpInet.h"
|
||||||
|
#include "ThreadPool.h"
|
||||||
|
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#include <ws2tcpip.h>
|
|
||||||
#include <winsock2.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#endif /* WIN32 */
|
#endif /* WIN32 */
|
||||||
|
|
||||||
|
@ -1,60 +1,62 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////
|
/**************************************************************************
|
||||||
//
|
*
|
||||||
// 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"
|
||||||
|
|
||||||
|
|
||||||
#ifdef INCLUDE_DEVICE_APIS
|
#ifdef INCLUDE_DEVICE_APIS
|
||||||
#if EXCLUDE_SSDP == 0
|
#if EXCLUDE_SSDP == 0
|
||||||
|
|
||||||
|
|
||||||
|
#include "httpparser.h"
|
||||||
|
#include "httpreadwrite.h"
|
||||||
|
#include "ssdplib.h"
|
||||||
|
#include "statcodes.h"
|
||||||
|
#include "ThreadPool.h"
|
||||||
|
#include "unixutil.h"
|
||||||
|
#include "upnpapi.h"
|
||||||
|
#include "UpnpInet.h"
|
||||||
|
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "ssdplib.h"
|
|
||||||
#include "upnpapi.h"
|
|
||||||
#include "ThreadPool.h"
|
|
||||||
#include "httpparser.h"
|
|
||||||
#include "httpreadwrite.h"
|
|
||||||
#include "statcodes.h"
|
|
||||||
#include "unixutil.h"
|
|
||||||
|
|
||||||
#ifdef WIN32
|
|
||||||
#include <ws2tcpip.h>
|
|
||||||
#include <winsock2.h>
|
|
||||||
#endif /* WIN32 */
|
|
||||||
|
|
||||||
#define MSGTYPE_SHUTDOWN 0
|
#define MSGTYPE_SHUTDOWN 0
|
||||||
#define MSGTYPE_ADVERTISEMENT 1
|
#define MSGTYPE_ADVERTISEMENT 1
|
||||||
#define MSGTYPE_REPLY 2
|
#define MSGTYPE_REPLY 2
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Function : advertiseAndReplyThread
|
* Function : advertiseAndReplyThread
|
||||||
*
|
*
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
#include "unixutil.h"
|
#include "unixutil.h"
|
||||||
#include "upnp.h"
|
#include "upnp.h"
|
||||||
#include "upnpdebug.h"
|
#include "upnpdebug.h"
|
||||||
|
#include "UpnpInet.h"
|
||||||
#include "uri.h"
|
#include "uri.h"
|
||||||
#include "urlconfig.h"
|
#include "urlconfig.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
@ -48,10 +49,8 @@
|
|||||||
|
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#include <winsock2.h>
|
|
||||||
#else
|
#else
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <netinet/in.h>
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -18,14 +18,16 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#ifdef WIN32
|
|
||||||
#include <winsock2.h>
|
|
||||||
#else /* WIN32 */
|
#include "sysdep.h"
|
||||||
#include <unistd.h>
|
|
||||||
#endif /* WIN32 */
|
|
||||||
|
#include "UpnpInet.h"
|
||||||
|
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "sysdep.h"
|
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------*/
|
||||||
/*
|
/*
|
||||||
|
@ -23,23 +23,18 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
|
||||||
#include "sysdep.h"
|
|
||||||
#include "uuid.h"
|
#include "uuid.h"
|
||||||
|
|
||||||
|
|
||||||
|
#include "UpnpInet.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>
|
||||||
|
|
||||||
|
|
||||||
#ifdef WIN32
|
|
||||||
#include <winsock2.h>
|
|
||||||
#else
|
|
||||||
#include <netinet/in.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
various forward declarations
|
various forward declarations
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user