* More MSVC fixes, using XINLINE instead of inline, MSVC has troubles
with inline. Thanks to David Maass for reporting. * Changed XINLINE to UPNP_INLINE. * Lots of white space changes. git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@192 119443c7-1b9e-41f8-b6fc-b9c35fce742c
This commit is contained in:
parent
d8ba182d85
commit
81635d74c1
@ -2,6 +2,11 @@
|
||||
Version 1.4.7
|
||||
*******************************************************************************
|
||||
|
||||
2007-05-21 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||
* More MSVC fixes, using XINLINE instead of inline, MSVC has troubles
|
||||
with inline. Thanks to David Maass for reporting.
|
||||
* Changed XINLINE to UPNP_INLINE.
|
||||
|
||||
2007-05-21 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
|
||||
* Added the file build/inc/msvc/inttypes.h. This file is for use with
|
||||
MSVC only, because it does not provide C99 compatibility.
|
||||
|
@ -39,7 +39,7 @@
|
||||
#define MAXVAL( a, b ) ( (a) > (b) ? (a) : (b) )
|
||||
|
||||
#ifndef WIN32
|
||||
#define XINLINE inline
|
||||
#define UPNP_INLINE inline
|
||||
#endif
|
||||
|
||||
#define MEMBUF_DEF_SIZE_INC 20
|
||||
|
@ -65,20 +65,35 @@
|
||||
#else
|
||||
#define EXPORT_SPEC
|
||||
#endif
|
||||
#ifdef UPNP_USE_MSVCPP // define some things the M$ VC++ doesn't know
|
||||
#ifdef UPNP_USE_MSVCPP
|
||||
// define some things the M$ VC++ doesn't know
|
||||
#define UPNP_INLINE
|
||||
typedef __int64 int64_t;
|
||||
#define PRId64 "I64d"
|
||||
#define PRIzu "lu"
|
||||
#endif
|
||||
#ifdef UPNP_USE_BCBPP // define some things Borland Builder doesn't know
|
||||
#ifdef UPNP_USE_BCBPP
|
||||
// define some things Borland Builder doesn't know
|
||||
#define UPNP_INLINE inline
|
||||
typedef __int64 int64_t;
|
||||
#warning The Borland C compiler is probably broken on PRId64, please someone provide a proper fix here
|
||||
#define PRId64 "I64d"
|
||||
#define PRIzu "zu"
|
||||
#endif
|
||||
#else
|
||||
#define EXPORT_SPEC
|
||||
#define UPNP_INLINE inline
|
||||
// Invented this macro so that we can live a little longer with MSVC lack of C99.
|
||||
#define PRIzu "zu"
|
||||
#endif
|
||||
|
||||
//
|
||||
// Defining this macro here gives some interesting information about unused
|
||||
// functions in the code. Of course, this should never go uncommented on a
|
||||
// release.
|
||||
//
|
||||
//#define inline
|
||||
|
||||
|
||||
#ifndef WIN32
|
||||
#define UpnpCloseSocket close
|
||||
|
@ -106,6 +106,7 @@ typedef enum Upnp_LogLevel_e {
|
||||
*
|
||||
* Description:
|
||||
* This functions initializes the log files
|
||||
*
|
||||
* Returns: int
|
||||
* -1 : If fails
|
||||
* UPNP_E_SUCCESS : if success
|
||||
@ -113,7 +114,7 @@ typedef enum Upnp_LogLevel_e {
|
||||
#ifdef DEBUG
|
||||
int UpnpInitLog();
|
||||
#else
|
||||
static inline int UpnpInitLog() { return UPNP_E_SUCCESS; }
|
||||
static UPNP_INLINE int UpnpInitLog() { return UPNP_E_SUCCESS; }
|
||||
#endif
|
||||
|
||||
// for backward compatibility
|
||||
@ -132,7 +133,7 @@ static inline int UpnpInitLog() { return UPNP_E_SUCCESS; }
|
||||
#ifdef DEBUG
|
||||
void UpnpSetLogLevel(Upnp_LogLevel log_level);
|
||||
#else
|
||||
static inline void UpnpSetLogLevel(Upnp_LogLevel log_level) {}
|
||||
static UPNP_INLINE void UpnpSetLogLevel(Upnp_LogLevel log_level) {}
|
||||
#endif
|
||||
|
||||
|
||||
@ -148,7 +149,7 @@ static inline void UpnpSetLogLevel(Upnp_LogLevel log_level) {}
|
||||
#ifdef DEBUG
|
||||
void UpnpCloseLog();
|
||||
#else
|
||||
static inline void UpnpCloseLog() {}
|
||||
static UPNP_INLINE void UpnpCloseLog() {}
|
||||
#endif
|
||||
|
||||
// for backward compatibility
|
||||
@ -174,7 +175,7 @@ void UpnpSetLogFileNames(
|
||||
const char *ErrFileName,
|
||||
const char *InfoFileName);
|
||||
#else
|
||||
static inline void UpnpSetLogFileNames(
|
||||
static UPNP_INLINE void UpnpSetLogFileNames(
|
||||
const char *ErrFileName,
|
||||
const char *InfoFileName) {}
|
||||
#endif
|
||||
@ -202,7 +203,7 @@ static inline void UpnpSetLogFileNames(
|
||||
#ifdef DEBUG
|
||||
FILE *UpnpGetDebugFile(Upnp_LogLevel level, Dbg_Module module);
|
||||
#else
|
||||
static inline FILE *UpnpGetDebugFile(Upnp_LogLevel level, Dbg_Module module)
|
||||
static UPNP_INLINE FILE *UpnpGetDebugFile(Upnp_LogLevel level, Dbg_Module module)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
@ -232,7 +233,7 @@ int DebugAtThisLevel(
|
||||
IN Upnp_LogLevel DLevel,
|
||||
IN Dbg_Module Module);
|
||||
#else
|
||||
static inline int DebugAtThisLevel(
|
||||
static UPNP_INLINE int DebugAtThisLevel(
|
||||
IN Upnp_LogLevel DLevel,
|
||||
IN Dbg_Module Module) { return 0; }
|
||||
#endif
|
||||
@ -269,7 +270,7 @@ void UpnpPrintf (Upnp_LogLevel DLevel, Dbg_Module Module,
|
||||
#endif
|
||||
;
|
||||
#else
|
||||
static inline void UpnpPrintf(
|
||||
static UPNP_INLINE void UpnpPrintf(
|
||||
Upnp_LogLevel DLevel,
|
||||
Dbg_Module Module,
|
||||
const char* DbgFileName,
|
||||
@ -300,7 +301,7 @@ void UpnpDisplayBanner(
|
||||
size_t size,
|
||||
int starlength);
|
||||
#else
|
||||
static inline void UpnpDisplayBanner(
|
||||
static UPNP_INLINE void UpnpDisplayBanner(
|
||||
FILE *fd,
|
||||
const char **lines,
|
||||
size_t size,
|
||||
@ -328,7 +329,7 @@ void UpnpDisplayFileAndLine(
|
||||
const char *DbgFileName,
|
||||
int DbgLineNo);
|
||||
#else
|
||||
static inline void UpnpDisplayFileAndLine(
|
||||
static UPNP_INLINE void UpnpDisplayFileAndLine(
|
||||
FILE *fd,
|
||||
const char *DbgFileName,
|
||||
int DbgLineNo) {}
|
||||
|
@ -94,12 +94,13 @@ UpnpSetLogFileNames ( IN const char *ErrFileName,
|
||||
*
|
||||
* Description:
|
||||
* This functions initializes the log files
|
||||
*
|
||||
* Returns: int
|
||||
* -1 : If fails
|
||||
* UPNP_E_SUCCESS : if success
|
||||
***************************************************************************/
|
||||
int
|
||||
UpnpInitLog( )
|
||||
UpnpInitLog()
|
||||
{
|
||||
ithread_mutex_init( &GlobalDebugMutex, NULL );
|
||||
|
||||
@ -139,7 +140,7 @@ UpnpSetLogLevel (Upnp_LogLevel log_level)
|
||||
* Returns: void
|
||||
***************************************************************************/
|
||||
void
|
||||
UpnpCloseLog( )
|
||||
UpnpCloseLog()
|
||||
{
|
||||
if( DEBUG_TARGET == 1 ) {
|
||||
fflush( ErrFileHnd );
|
||||
|
@ -188,7 +188,7 @@ free_notify_struct( IN notify_thread_struct * input )
|
||||
*
|
||||
* Note : called by genaNotify
|
||||
****************************************************************************/
|
||||
static XINLINE int
|
||||
static UPNP_INLINE int
|
||||
notify_send_and_recv( IN uri_type * destination_url,
|
||||
IN membuffer * mid_msg,
|
||||
IN char *propertySet,
|
||||
|
@ -215,7 +215,7 @@ dispatch_request( IN SOCKINFO * info,
|
||||
*
|
||||
* Note :
|
||||
************************************************************************/
|
||||
static XINLINE void
|
||||
static UPNP_INLINE void
|
||||
handle_error( IN SOCKINFO * info,
|
||||
int http_error_code,
|
||||
int major,
|
||||
@ -333,7 +333,7 @@ handle_request( void *args )
|
||||
*
|
||||
* Note :
|
||||
************************************************************************/
|
||||
static XINLINE void
|
||||
static UPNP_INLINE void
|
||||
schedule_request_job( IN int connfd,
|
||||
IN struct sockaddr_in *clientAddr )
|
||||
{
|
||||
|
@ -121,7 +121,7 @@ str_int_entry Http_Header_Names[NUM_HTTP_HEADER_NAMES] = {
|
||||
*
|
||||
* Note :
|
||||
************************************************************************/
|
||||
static XINLINE void
|
||||
static UPNP_INLINE void
|
||||
scanner_init( OUT scanner_t * scanner,
|
||||
IN membuffer * bufptr )
|
||||
{
|
||||
@ -142,7 +142,7 @@ scanner_init( OUT scanner_t * scanner,
|
||||
*
|
||||
* Note :
|
||||
************************************************************************/
|
||||
static XINLINE xboolean
|
||||
static UPNP_INLINE xboolean
|
||||
is_separator_char( IN char c )
|
||||
{
|
||||
return strchr( " \t()<>@,;:\\\"/[]?={}", c ) != NULL;
|
||||
@ -160,7 +160,7 @@ is_separator_char( IN char c )
|
||||
*
|
||||
* Note :
|
||||
************************************************************************/
|
||||
static XINLINE xboolean
|
||||
static UPNP_INLINE xboolean
|
||||
is_identifier_char( IN char c )
|
||||
{
|
||||
return ( c >= 32 && c <= 126 ) && !is_separator_char( c );
|
||||
@ -178,7 +178,7 @@ is_identifier_char( IN char c )
|
||||
*
|
||||
* Note :
|
||||
************************************************************************/
|
||||
static XINLINE xboolean
|
||||
static UPNP_INLINE xboolean
|
||||
is_control_char( IN char c )
|
||||
{
|
||||
return ( ( c >= 0 && c <= 31 ) || ( c == 127 ) );
|
||||
@ -196,7 +196,7 @@ is_control_char( IN char c )
|
||||
*
|
||||
* Note :
|
||||
************************************************************************/
|
||||
static XINLINE xboolean
|
||||
static UPNP_INLINE xboolean
|
||||
is_qdtext_char( IN char cc )
|
||||
{
|
||||
unsigned char c = ( unsigned char )cc;
|
||||
@ -375,7 +375,7 @@ scanner_get_token( INOUT scanner_t * scanner,
|
||||
*
|
||||
* Note :
|
||||
************************************************************************/
|
||||
static XINLINE char *
|
||||
static UPNP_INLINE char *
|
||||
scanner_get_str( IN scanner_t * scanner )
|
||||
{
|
||||
return scanner->msg->buf + scanner->cursor;
|
||||
@ -395,7 +395,9 @@ scanner_get_str( IN scanner_t * scanner )
|
||||
*
|
||||
* Note :
|
||||
************************************************************************/
|
||||
static XINLINE void
|
||||
#warning The only use of the function 'scanner_pushback()' in the code is commented out.
|
||||
#warning 'scanner_pushback()' is a good candidate for removal.
|
||||
static UPNP_INLINE void
|
||||
scanner_pushback( INOUT scanner_t * scanner,
|
||||
IN size_t pushback_bytes )
|
||||
{
|
||||
@ -614,7 +616,7 @@ httpmsg_find_hdr( IN http_message_t * msg,
|
||||
*
|
||||
* Note :
|
||||
************************************************************************/
|
||||
static XINLINE int
|
||||
static UPNP_INLINE int
|
||||
skip_blank_lines( INOUT scanner_t * scanner )
|
||||
{
|
||||
memptr token;
|
||||
@ -651,7 +653,7 @@ skip_blank_lines( INOUT scanner_t * scanner )
|
||||
*
|
||||
* Note :
|
||||
************************************************************************/
|
||||
static XINLINE int
|
||||
static UPNP_INLINE int
|
||||
skip_lws( INOUT scanner_t * scanner )
|
||||
{
|
||||
memptr token;
|
||||
@ -698,7 +700,7 @@ skip_lws( INOUT scanner_t * scanner )
|
||||
*
|
||||
* Description : Match a string without whitespace or CRLF (%S)
|
||||
*
|
||||
* Return : XINLINE parse_status_t ;
|
||||
* Return : UPNP_INLINE parse_status_t ;
|
||||
* PARSE_OK
|
||||
* PARSE_NO_MATCH
|
||||
* PARSE_FAILURE
|
||||
@ -706,7 +708,7 @@ skip_lws( INOUT scanner_t * scanner )
|
||||
*
|
||||
* Note :
|
||||
************************************************************************/
|
||||
static XINLINE parse_status_t
|
||||
static UPNP_INLINE parse_status_t
|
||||
match_non_ws_string( INOUT scanner_t * scanner,
|
||||
OUT memptr * str )
|
||||
{
|
||||
@ -772,7 +774,7 @@ match_non_ws_string( INOUT scanner_t * scanner,
|
||||
*
|
||||
* Note :
|
||||
************************************************************************/
|
||||
static XINLINE parse_status_t
|
||||
static UPNP_INLINE parse_status_t
|
||||
match_raw_value( INOUT scanner_t * scanner,
|
||||
OUT memptr * raw_value )
|
||||
{
|
||||
@ -863,7 +865,7 @@ match_raw_value( INOUT scanner_t * scanner,
|
||||
* PARSE_FAILURE -- bad input
|
||||
* PARSE_INCOMPLETE
|
||||
************************************************************************/
|
||||
static XINLINE int
|
||||
static UPNP_INLINE int
|
||||
match_int( INOUT scanner_t * scanner,
|
||||
IN int base,
|
||||
OUT int *value )
|
||||
@ -922,7 +924,7 @@ match_int( INOUT scanner_t * scanner,
|
||||
* PARSE_FAILURE
|
||||
* PARSE_INCOMPLETE
|
||||
************************************************************************/
|
||||
static XINLINE int
|
||||
static UPNP_INLINE int
|
||||
read_until_crlf( INOUT scanner_t * scanner,
|
||||
OUT memptr * str )
|
||||
{
|
||||
@ -963,7 +965,9 @@ read_until_crlf( INOUT scanner_t * scanner,
|
||||
* PARSE_FAILURE
|
||||
* PARSE_INCOMPLETE
|
||||
************************************************************************/
|
||||
static XINLINE int
|
||||
#warning There are currently no uses of the function 'skip_to_end_of_header()' in the code.
|
||||
#warning 'skip_to_end_of_header()' is a good candidate for removal.
|
||||
static UPNP_INLINE int
|
||||
skip_to_end_of_header( INOUT scanner_t * scanner )
|
||||
{
|
||||
memptr dummy_raw_value;
|
||||
@ -990,7 +994,7 @@ skip_to_end_of_header( INOUT scanner_t * scanner )
|
||||
* PARSE_NO_MATCH
|
||||
* PARSE_INCOMPLETE
|
||||
************************************************************************/
|
||||
static XINLINE parse_status_t
|
||||
static UPNP_INLINE parse_status_t
|
||||
match_char( INOUT scanner_t * scanner,
|
||||
IN char c,
|
||||
IN xboolean case_sensitive )
|
||||
@ -1337,7 +1341,7 @@ matchstr( IN char *str,
|
||||
* Returns:
|
||||
* void
|
||||
************************************************************************/
|
||||
static XINLINE void
|
||||
static UPNP_INLINE void
|
||||
parser_init( OUT http_parser_t * parser )
|
||||
{
|
||||
memset( parser, 0, sizeof( http_parser_t ) );
|
||||
@ -1872,7 +1876,7 @@ parser_parse_headers_old( INOUT http_parser_t * parser )
|
||||
* PARSE_FAILURE -- entity length > content-length value
|
||||
* PARSE_SUCCESS
|
||||
************************************************************************/
|
||||
static XINLINE parse_status_t
|
||||
static UPNP_INLINE parse_status_t
|
||||
parser_parse_entity_using_clen( INOUT http_parser_t * parser )
|
||||
{
|
||||
//int entity_length;
|
||||
@ -1919,7 +1923,7 @@ parser_parse_entity_using_clen( INOUT http_parser_t * parser )
|
||||
* PARSE_FAILURE -- entity length > content-length value
|
||||
* PARSE_SUCCESS
|
||||
************************************************************************/
|
||||
static XINLINE parse_status_t
|
||||
static UPNP_INLINE parse_status_t
|
||||
parser_parse_chunky_body( INOUT http_parser_t * parser )
|
||||
{
|
||||
parse_status_t status;
|
||||
@ -1964,7 +1968,7 @@ parser_parse_chunky_body( INOUT http_parser_t * parser )
|
||||
* PARSE_FAILURE -- entity length > content-length value
|
||||
* PARSE_SUCCESS
|
||||
************************************************************************/
|
||||
static XINLINE parse_status_t
|
||||
static UPNP_INLINE parse_status_t
|
||||
parser_parse_chunky_headers( INOUT http_parser_t * parser )
|
||||
{
|
||||
parse_status_t status;
|
||||
@ -2004,7 +2008,7 @@ parser_parse_chunky_headers( INOUT http_parser_t * parser )
|
||||
* PARSE_SUCCESS
|
||||
* PARSE_CONTINUE_1
|
||||
************************************************************************/
|
||||
static XINLINE parse_status_t
|
||||
static UPNP_INLINE parse_status_t
|
||||
parser_parse_chunky_entity( INOUT http_parser_t * parser )
|
||||
{
|
||||
scanner_t *scanner = &parser->scanner;
|
||||
@ -2055,7 +2059,7 @@ parser_parse_chunky_entity( INOUT http_parser_t * parser )
|
||||
* Returns:
|
||||
* PARSE_INCOMPLETE_ENTITY
|
||||
************************************************************************/
|
||||
static XINLINE parse_status_t
|
||||
static UPNP_INLINE parse_status_t
|
||||
parser_parse_entity_until_close( INOUT http_parser_t * parser )
|
||||
{
|
||||
size_t cursor;
|
||||
@ -2090,7 +2094,7 @@ parser_parse_entity_until_close( INOUT http_parser_t * parser )
|
||||
* PARSE_FAILURE
|
||||
* PARSE_COMPLETE -- no more reading to do
|
||||
************************************************************************/
|
||||
XINLINE parse_status_t
|
||||
UPNP_INLINE parse_status_t
|
||||
parser_get_entity_read_method( INOUT http_parser_t * parser )
|
||||
{
|
||||
http_message_t *hmsg = &parser->msg;
|
||||
@ -2195,7 +2199,7 @@ parser_get_entity_read_method( INOUT http_parser_t * parser )
|
||||
* PARSE_FAILURE
|
||||
* PARSE_COMPLETE -- no more reading to do
|
||||
************************************************************************/
|
||||
XINLINE parse_status_t
|
||||
UPNP_INLINE parse_status_t
|
||||
parser_parse_entity( INOUT http_parser_t * parser )
|
||||
{
|
||||
parse_status_t status = PARSE_OK;
|
||||
|
@ -2343,7 +2343,7 @@ http_OpenHttpGetEx( IN const char *url_str,
|
||||
* Description : Returns the server information for the operating
|
||||
* system
|
||||
*
|
||||
* Return : XINLINE void
|
||||
* Return : UPNP_INLINE void
|
||||
*
|
||||
* Note :
|
||||
************************************************************************/
|
||||
|
@ -118,7 +118,7 @@ static xboolean gInitialized = FALSE;
|
||||
* Returns:
|
||||
* void
|
||||
************************************************************************/
|
||||
static XINLINE void
|
||||
static UPNP_INLINE void
|
||||
init_table( IN const char *encoded_str,
|
||||
OUT const char *table[],
|
||||
IN int tbl_size )
|
||||
@ -144,7 +144,7 @@ init_table( IN const char *encoded_str,
|
||||
* Returns:
|
||||
* void
|
||||
************************************************************************/
|
||||
static XINLINE void
|
||||
static UPNP_INLINE void
|
||||
init_tables( void )
|
||||
{
|
||||
init_table( Http1xxStr, Http1xxCodes, NUM_1XX_CODES );
|
||||
|
@ -205,7 +205,7 @@ extern str_int_entry Http_Header_Names[NUM_HTTP_HEADER_NAMES];
|
||||
* Returns:
|
||||
* void
|
||||
************************************************************************/
|
||||
static XINLINE void
|
||||
static UPNP_INLINE void
|
||||
media_list_init( void )
|
||||
{
|
||||
int i;
|
||||
@ -243,7 +243,7 @@ media_list_init( void )
|
||||
* 0 on success;
|
||||
* -1 on error
|
||||
************************************************************************/
|
||||
static XINLINE int
|
||||
static UPNP_INLINE int
|
||||
search_extension( IN const char *extension,
|
||||
OUT const char **con_type,
|
||||
OUT const char **con_subtype )
|
||||
@ -290,7 +290,7 @@ search_extension( IN const char *extension,
|
||||
* 0 - On Sucess
|
||||
* UPNP_E_OUTOF_MEMORY - on memory allocation failures
|
||||
************************************************************************/
|
||||
XINLINE int
|
||||
UPNP_INLINE int
|
||||
get_content_type( IN const char *filename,
|
||||
OUT DOMString * content_type )
|
||||
{
|
||||
@ -348,7 +348,7 @@ get_content_type( IN const char *filename,
|
||||
* Returns:
|
||||
* void
|
||||
************************************************************************/
|
||||
static XINLINE void
|
||||
static UPNP_INLINE void
|
||||
glob_alias_init( void )
|
||||
{
|
||||
struct xml_alias_t *alias = &gAliasDoc;
|
||||
@ -370,7 +370,7 @@ glob_alias_init( void )
|
||||
* Returns:
|
||||
* BOOLEAN
|
||||
************************************************************************/
|
||||
static XINLINE xboolean
|
||||
static UPNP_INLINE xboolean
|
||||
is_valid_alias( IN const struct xml_alias_t *alias )
|
||||
{
|
||||
return alias->doc.buf != NULL;
|
||||
@ -700,7 +700,7 @@ web_server_set_root_dir( IN const char *root_dir )
|
||||
* TRUE - On Success
|
||||
* FALSE if request is not an alias
|
||||
************************************************************************/
|
||||
static XINLINE xboolean
|
||||
static UPNP_INLINE xboolean
|
||||
get_alias( IN const char *request_file,
|
||||
OUT struct xml_alias_t *alias,
|
||||
OUT struct File_Info *info )
|
||||
|
@ -171,7 +171,7 @@ memptr_cmp_nocase( IN memptr * m,
|
||||
*
|
||||
* Note :
|
||||
************************************************************************/
|
||||
static XINLINE void
|
||||
static UPNP_INLINE void
|
||||
membuffer_initialize( INOUT membuffer * m )
|
||||
{
|
||||
m->buf = NULL;
|
||||
|
@ -491,7 +491,7 @@ const char* method_to_str( IN http_method_t method );
|
||||
#ifdef DEBUG
|
||||
void print_http_headers( IN http_message_t *hmsg );
|
||||
#else
|
||||
static inline void print_http_headers( IN http_message_t *hmsg ) {}
|
||||
static UPNP_INLINE void print_http_headers( IN http_message_t *hmsg ) {}
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -269,7 +269,7 @@ void printService(
|
||||
Dbg_Level level,
|
||||
Dbg_Module module);
|
||||
#else
|
||||
static inline void printService(
|
||||
static UPNP_INLINE void printService(
|
||||
service_info *service,
|
||||
Dbg_Level level,
|
||||
Dbg_Module module) {}
|
||||
@ -296,7 +296,7 @@ void printServiceList(
|
||||
Dbg_Level level,
|
||||
Dbg_Module module);
|
||||
#else
|
||||
static inline void printServiceList(
|
||||
static UPNP_INLINE void printServiceList(
|
||||
service_info *service,
|
||||
Dbg_Level level,
|
||||
Dbg_Module module) {}
|
||||
@ -324,7 +324,7 @@ void printServiceTable(
|
||||
Dbg_Level level,
|
||||
Dbg_Module module);
|
||||
#else
|
||||
static inline void printServiceTable(
|
||||
static UPNP_INLINE void printServiceTable(
|
||||
service_table *table,
|
||||
Dbg_Level level,
|
||||
Dbg_Module module) {}
|
||||
|
@ -228,10 +228,10 @@ static inline void ssdp_handle_device_request(
|
||||
* IN http_message_t* hmsg: SSDP message from the device
|
||||
* IN struct sockaddr_in* dest_addr: Address of the device
|
||||
* IN xboolean timeout: timeout kept by the control point while sending
|
||||
* search message
|
||||
* search message
|
||||
* IN void* cookie: Cookie stored by the control point application.
|
||||
* This cookie will be returned to the control point
|
||||
* in the callback
|
||||
* This cookie will be returned to the control point
|
||||
* in the callback
|
||||
*
|
||||
* Description:
|
||||
* This function handles the ssdp messages from the devices. These
|
||||
@ -241,10 +241,11 @@ static inline void ssdp_handle_device_request(
|
||||
* Returns: void
|
||||
*
|
||||
***************************************************************************/
|
||||
void ssdp_handle_ctrlpt_msg( IN http_message_t* hmsg,
|
||||
IN struct sockaddr_in* dest_addr,
|
||||
IN xboolean timeout,
|
||||
IN void* cookie );
|
||||
void ssdp_handle_ctrlpt_msg(
|
||||
IN http_message_t* hmsg,
|
||||
IN struct sockaddr_in* dest_addr,
|
||||
IN xboolean timeout,
|
||||
IN void* cookie );
|
||||
|
||||
/************************************************************************
|
||||
* Function : unique_service_name
|
||||
@ -252,7 +253,7 @@ void ssdp_handle_ctrlpt_msg( IN http_message_t* hmsg,
|
||||
* Parameters:
|
||||
* IN char *cmd: Service Name string
|
||||
* OUT SsdpEvent *Evt: The SSDP event structure partially filled
|
||||
* by all the function.
|
||||
* by all the function.
|
||||
*
|
||||
* Description:
|
||||
* This function fills the fields of the event structure like DeviceType,
|
||||
@ -333,12 +334,10 @@ int ssdp_request_type(IN char * cmd, OUT SsdpEvent * Evt);
|
||||
* Function : SearchByTarget
|
||||
*
|
||||
* Parameters:
|
||||
* IN int Mx:Number of seconds to wait, to collect all the
|
||||
* responses.
|
||||
* char *St: Search target.
|
||||
* void *Cookie: cookie provided by control point application. This
|
||||
* cokie will be returned to application in the
|
||||
* callback.
|
||||
* IN int Mx:Number of seconds to wait, to collect all the responses.
|
||||
* char *St: Search target.
|
||||
* void *Cookie: cookie provided by control point application. This
|
||||
* cokie will be returned to application in the callback.
|
||||
*
|
||||
* Description:
|
||||
* This function creates and send the search request for a specific URL.
|
||||
@ -352,12 +351,11 @@ int SearchByTarget(IN int Mx, IN char *St, IN void *Cookie);
|
||||
* Function : DeviceAdvertisement
|
||||
*
|
||||
* Parameters:
|
||||
* IN char * DevType : type of the device
|
||||
* IN int RootDev: flag to indicate if the device is root device
|
||||
* IN char * nt : value of NT
|
||||
* IN char * usn :
|
||||
* IN char * location :Location URL.
|
||||
* IN int duration :Service duration in sec.
|
||||
* IN char *DevType : type of the device
|
||||
* IN int RootDev : flag to indicate if the device is root device
|
||||
* IN char *Udn :
|
||||
* IN char *Location: Location URL.
|
||||
* IN int Duration : Service duration in sec.
|
||||
*
|
||||
* Description:
|
||||
* This function creates the device advertisement request based on
|
||||
@ -366,8 +364,12 @@ int SearchByTarget(IN int Mx, IN char *St, IN void *Cookie);
|
||||
* Returns: int
|
||||
* UPNP_E_SUCCESS if successful else appropriate error
|
||||
***************************************************************************/
|
||||
int DeviceAdvertisement(IN char * DevType, int RootDev,char * Udn,
|
||||
IN char * Location, IN int Duration);
|
||||
int DeviceAdvertisement(
|
||||
IN char *DevType,
|
||||
IN int RootDev,
|
||||
IN char *Udn,
|
||||
IN char *Location,
|
||||
IN int Duration);
|
||||
|
||||
|
||||
/************************************************************************
|
||||
@ -376,10 +378,10 @@ int DeviceAdvertisement(IN char * DevType, int RootDev,char * Udn,
|
||||
* Parameters:
|
||||
* IN char *DevType: Device Type.
|
||||
* IN int RootDev:1 means root device.
|
||||
* IN char * Udn: Device UDN
|
||||
* IN char *Udn: Device UDN
|
||||
* IN char *_Server:
|
||||
* IN char * Location: Location URL
|
||||
* IN int Duration :Device duration in sec.
|
||||
* IN char *Location: Location URL
|
||||
* IN int Duration :Device duration in sec.
|
||||
*
|
||||
* Description:
|
||||
* This function creates a HTTP device shutdown request packet
|
||||
@ -388,12 +390,13 @@ int DeviceAdvertisement(IN char * DevType, int RootDev,char * Udn,
|
||||
* Returns: int
|
||||
* UPNP_E_SUCCESS if successful else appropriate error
|
||||
***************************************************************************/
|
||||
int DeviceShutdown( IN char * DevType,
|
||||
IN int RootDev,
|
||||
IN char * Udn,
|
||||
IN char * _Server,
|
||||
IN char * Location,
|
||||
IN int Duration );
|
||||
int DeviceShutdown(
|
||||
IN char *DevType,
|
||||
IN int RootDev,
|
||||
IN char *Udn,
|
||||
IN char *_Server,
|
||||
IN char *Location,
|
||||
IN int Duration);
|
||||
|
||||
/************************************************************************
|
||||
* Function : DeviceReply
|
||||
@ -402,10 +405,10 @@ int DeviceShutdown( IN char * DevType,
|
||||
* IN struct sockaddr_in * DestAddr:destination IP address.
|
||||
* IN char *DevType: Device type
|
||||
* IN int RootDev: 1 means root device 0 means embedded device.
|
||||
* IN char * Udn: Device UDN
|
||||
* IN char * Location: Location of Device description document.
|
||||
* IN int Duration :Life time of this device.
|
||||
|
||||
* IN char *Udn: Device UDN
|
||||
* IN char *Location: Location of Device description document.
|
||||
* IN int Duration :Life time of this device.
|
||||
*
|
||||
* Description:
|
||||
* This function creates the reply packet based on the input parameter,
|
||||
* and send it to the client address given in its input parameter DestAddr.
|
||||
@ -413,11 +416,12 @@ int DeviceShutdown( IN char * DevType,
|
||||
* Returns: int
|
||||
* UPNP_E_SUCCESS if successful else appropriate error
|
||||
***************************************************************************/
|
||||
int DeviceReply(IN struct sockaddr_in * DestAddr,
|
||||
IN char *DevType,
|
||||
IN int RootDev,
|
||||
IN char * Udn,
|
||||
IN char * Location, IN int Duration);
|
||||
int DeviceReply(
|
||||
IN struct sockaddr_in * DestAddr,
|
||||
IN char *DevType,
|
||||
IN int RootDev,
|
||||
IN char *Udn,
|
||||
IN char *Location, IN int Duration);
|
||||
|
||||
/************************************************************************
|
||||
* Function : SendReply
|
||||
@ -428,8 +432,8 @@ int DeviceReply(IN struct sockaddr_in * DestAddr,
|
||||
* IN int RootDev: 1 means root device 0 means embedded device.
|
||||
* IN char * Udn: Device UDN
|
||||
* IN char *_Server:
|
||||
* IN char * Location: Location of Device description document.
|
||||
* IN int Duration :Life time of this device.
|
||||
* IN char *Location: Location of Device description document.
|
||||
* IN int Duration :Life time of this device.
|
||||
* IN int ByType:
|
||||
*
|
||||
* Description:
|
||||
@ -439,13 +443,14 @@ int DeviceReply(IN struct sockaddr_in * DestAddr,
|
||||
* Returns: int
|
||||
* UPNP_E_SUCCESS if successful else appropriate error
|
||||
***************************************************************************/
|
||||
int SendReply(IN struct sockaddr_in * DestAddr,
|
||||
IN char *DevType,
|
||||
IN int RootDev,
|
||||
IN char * Udn,
|
||||
IN char * Location,
|
||||
IN int Duration,
|
||||
IN int ByType );
|
||||
int SendReply(
|
||||
IN struct sockaddr_in * DestAddr,
|
||||
IN char *DevType,
|
||||
IN int RootDev,
|
||||
IN char *Udn,
|
||||
IN char *Location,
|
||||
IN int Duration,
|
||||
IN int ByType );
|
||||
|
||||
/************************************************************************
|
||||
* Function : ServiceAdvertisement
|
||||
@ -454,55 +459,55 @@ int SendReply(IN struct sockaddr_in * DestAddr,
|
||||
* IN char * Udn: Device UDN
|
||||
* IN char *ServType: Service Type.
|
||||
* IN char * Location: Location of Device description document.
|
||||
* IN int Duration :Life time of this device.
|
||||
|
||||
* IN int Duration :Life time of this device.
|
||||
*
|
||||
* Description:
|
||||
* This function creates the advertisement packet based
|
||||
* on the input parameter, and send it to the multicast channel.
|
||||
|
||||
*
|
||||
* Returns: int
|
||||
* UPNP_E_SUCCESS if successful else appropriate error
|
||||
***************************************************************************/
|
||||
int ServiceAdvertisement( IN char * Udn,
|
||||
IN char * ServType,
|
||||
IN char * Location,
|
||||
IN int Duration);
|
||||
int ServiceAdvertisement(
|
||||
IN char *Udn,
|
||||
IN char *ServType,
|
||||
IN char *Location,
|
||||
IN int Duration);
|
||||
|
||||
/************************************************************************
|
||||
* Function : ServiceReply
|
||||
*
|
||||
* Parameters:
|
||||
* IN struct sockaddr_in *DestAddr:
|
||||
* IN char * Udn: Device UDN
|
||||
* IN char *Udn: Device UDN
|
||||
* IN char *ServType: Service Type.
|
||||
* IN char *Server: Not used
|
||||
* IN char * Location: Location of Device description document.
|
||||
* IN int Duration :Life time of this device.
|
||||
|
||||
* IN char *Location: Location of Device description document.
|
||||
* IN int Duration :Life time of this device.
|
||||
*
|
||||
* Description:
|
||||
* This function creates the advertisement packet based
|
||||
* on the input parameter, and send it to the multicast channel.
|
||||
|
||||
*
|
||||
* Returns: int
|
||||
* UPNP_E_SUCCESS if successful else appropriate error
|
||||
***************************************************************************/
|
||||
int ServiceReply(IN struct sockaddr_in *DestAddr,
|
||||
IN char * ServType,
|
||||
IN char * Udn,
|
||||
IN char * Location,
|
||||
IN int Duration);
|
||||
int ServiceReply(
|
||||
IN struct sockaddr_in *DestAddr,
|
||||
IN char *ServType,
|
||||
IN char *Udn,
|
||||
IN char *Location,
|
||||
IN int Duration);
|
||||
|
||||
/************************************************************************
|
||||
* Function : ServiceShutdown
|
||||
*
|
||||
* Parameters:
|
||||
* IN char * Udn: Device UDN
|
||||
* IN char *Udn: Device UDN
|
||||
* IN char *ServType: Service Type.
|
||||
* IN char * Location: Location of Device description document.
|
||||
* IN int Duration :Service duration in sec.
|
||||
|
||||
* IN char *Location: Location of Device description document.
|
||||
* IN int Duration :Service duration in sec.
|
||||
*
|
||||
* Description:
|
||||
* This function creates a HTTP service shutdown request packet
|
||||
* and sent it to the multicast channel through RequestHandler.
|
||||
@ -510,16 +515,18 @@ int ServiceReply(IN struct sockaddr_in *DestAddr,
|
||||
* Returns: int
|
||||
* UPNP_E_SUCCESS if successful else appropriate error
|
||||
***************************************************************************/
|
||||
int ServiceShutdown( IN char * Udn, IN char * ServType,
|
||||
IN char * Location,
|
||||
IN int Duration);
|
||||
int ServiceShutdown(
|
||||
IN char *Udn,
|
||||
IN char *ServType,
|
||||
IN char *Location,
|
||||
IN int Duration);
|
||||
|
||||
|
||||
/************************************************************************
|
||||
* Function : advertiseAndReplyThread
|
||||
*
|
||||
* Parameters:
|
||||
* IN void *data: Structure containing the search request
|
||||
* IN void *data: Structure containing the search request
|
||||
*
|
||||
* Description:
|
||||
* This function is a wrapper function to reply the search request
|
||||
@ -528,20 +535,21 @@ int ServiceShutdown( IN char * Udn, IN char * ServType,
|
||||
* Returns: void *
|
||||
* always return NULL
|
||||
***************************************************************************/
|
||||
void * advertiseAndReplyThread(IN void * data);
|
||||
void *advertiseAndReplyThread(IN void * data);
|
||||
|
||||
/************************************************************************
|
||||
* Function : AdvertiseAndReply
|
||||
*
|
||||
* Parameters:
|
||||
* IN int AdFlag: -1 = Send shutdown, 0 = send reply,
|
||||
* 1 = Send Advertisement
|
||||
* IN int AdFlag: -1 = Send shutdown,
|
||||
* 0 = send reply,
|
||||
* 1 = Send Advertisement
|
||||
* IN UpnpDevice_Handle Hnd: Device handle
|
||||
* IN enum SsdpSearchType SearchType:Search type for sending replies
|
||||
* IN struct sockaddr_in *DestAddr:Destination address
|
||||
* IN char *DeviceType:Device type
|
||||
* IN char *DeviceType:Device type
|
||||
* IN char *DeviceUDN:Device UDN
|
||||
* IN char *ServiceType:Service type
|
||||
* IN char *ServiceType:Service type
|
||||
* IN int Exp:Advertisement age
|
||||
*
|
||||
* Description:
|
||||
@ -550,13 +558,14 @@ void * advertiseAndReplyThread(IN void * data);
|
||||
* Returns: int
|
||||
* UPNP_E_SUCCESS if successful else appropriate error
|
||||
***************************************************************************/
|
||||
int AdvertiseAndReply(IN int AdFlag,
|
||||
IN UpnpDevice_Handle Hnd,
|
||||
IN enum SsdpSearchType SearchType,
|
||||
IN struct sockaddr_in *DestAddr,
|
||||
IN char *DeviceType,
|
||||
IN char *DeviceUDN,
|
||||
IN char *ServiceType, int Exp);
|
||||
int AdvertiseAndReply(
|
||||
IN int AdFlag,
|
||||
IN UpnpDevice_Handle Hnd,
|
||||
IN enum SsdpSearchType SearchType,
|
||||
IN struct sockaddr_in *DestAddr,
|
||||
IN char *DeviceType,
|
||||
IN char *DeviceUDN,
|
||||
IN char *ServiceType, int Exp);
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -36,12 +36,11 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
#ifndef WIN32
|
||||
#include <sys/socket.h>
|
||||
#include <sys/socket.h>
|
||||
#else
|
||||
#define XINLINE
|
||||
|
||||
typedef int socklen_t;
|
||||
#define EAFNOSUPPORT 97
|
||||
typedef int socklen_t;
|
||||
#define EAFNOSUPPORT 97
|
||||
#endif
|
||||
|
||||
#endif // GENLIB_NET_UNIXUTIL_H
|
||||
|
||||
|
@ -190,7 +190,7 @@ void free_URL_list(URL_list * list);
|
||||
#ifdef DEBUG
|
||||
void print_uri(uri_type *in);
|
||||
#else
|
||||
static inline void print_uri(uri_type *in) {}
|
||||
static UPNP_INLINE void print_uri(uri_type *in) {}
|
||||
#endif
|
||||
|
||||
/************************************************************************
|
||||
@ -208,7 +208,7 @@ static inline void print_uri(uri_type *in) {}
|
||||
#ifdef DEBUG
|
||||
void print_token(token *in);
|
||||
#else
|
||||
static inline void print_token(token * in) {}
|
||||
static UPNP_INLINE void print_token(token * in) {}
|
||||
#endif
|
||||
|
||||
/************************************************************************
|
||||
|
@ -136,31 +136,28 @@ void linecopylen( OUT char dest[LINE_SIZE], IN const char* src, IN size_t srclen
|
||||
#endif
|
||||
|
||||
//////////////////////////////////
|
||||
|
||||
// C specific
|
||||
#ifndef __cplusplus
|
||||
|
||||
#ifndef WIN32
|
||||
#define XINLINE inline
|
||||
#else
|
||||
#ifdef WIN32
|
||||
#ifndef S_ISREG
|
||||
#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
|
||||
#endif
|
||||
|
||||
#ifndef S_ISREG
|
||||
#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
|
||||
#endif
|
||||
#ifndef S_ISDIR
|
||||
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
||||
#endif
|
||||
|
||||
#ifndef S_ISDIR
|
||||
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
||||
#endif
|
||||
#define EADDRINUSE WSAEADDRINUSE
|
||||
|
||||
#define EADDRINUSE WSAEADDRINUSE
|
||||
#define strcasecmp stricmp
|
||||
#define strncasecmp strnicmp
|
||||
|
||||
#define strcasecmp stricmp
|
||||
#define strncasecmp strnicmp
|
||||
|
||||
#define sleep(a) Sleep((a)*1000)
|
||||
#define usleep(a) Sleep((a)/1000)
|
||||
#define sleep(a) Sleep((a)*1000)
|
||||
#define usleep(a) Sleep((a)/1000)
|
||||
#endif
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif /* GENLIB_UTIL_UTIL_H */
|
||||
|
||||
|
@ -244,7 +244,7 @@ get_node_value( IN IXML_Node * node )
|
||||
*
|
||||
* Note :
|
||||
****************************************************************************/
|
||||
static XINLINE int
|
||||
static UPNP_INLINE int
|
||||
get_host_and_path( IN char *ctrl_url,
|
||||
OUT const memptr *host,
|
||||
OUT const memptr *path,
|
||||
@ -277,7 +277,7 @@ get_host_and_path( IN char *ctrl_url,
|
||||
*
|
||||
* Note :
|
||||
****************************************************************************/
|
||||
static XINLINE int
|
||||
static UPNP_INLINE int
|
||||
get_action_name( IN char *action,
|
||||
OUT memptr * name )
|
||||
{
|
||||
@ -303,7 +303,7 @@ get_action_name( IN char *action,
|
||||
*
|
||||
* Note :
|
||||
****************************************************************************/
|
||||
static XINLINE int
|
||||
static UPNP_INLINE int
|
||||
add_man_header( INOUT membuffer * headers )
|
||||
{
|
||||
char *soap_action_hdr;
|
||||
|
@ -85,7 +85,7 @@ const char *ContentTypeHeader =
|
||||
* 0 if successful else returns appropriate error.
|
||||
* Note :
|
||||
****************************************************************************/
|
||||
static XINLINE int
|
||||
static UPNP_INLINE int
|
||||
get_request_type( IN http_message_t * request,
|
||||
OUT memptr * action_name )
|
||||
{
|
||||
@ -262,7 +262,7 @@ send_error_response( IN SOCKINFO * info,
|
||||
*
|
||||
* Note :
|
||||
****************************************************************************/
|
||||
static XINLINE void
|
||||
static UPNP_INLINE void
|
||||
send_var_query_response( IN SOCKINFO * info,
|
||||
IN const char *var_value,
|
||||
IN http_message_t * hmsg )
|
||||
@ -326,12 +326,12 @@ send_var_query_response( IN SOCKINFO * info,
|
||||
* Description : This function separates the action node from
|
||||
* the root DOM node.
|
||||
*
|
||||
* Return : static XINLINE int
|
||||
* Return : static UPNP_INLINE int
|
||||
* 0 if successful, or -1 if fails.
|
||||
*
|
||||
* Note :
|
||||
****************************************************************************/
|
||||
static XINLINE int
|
||||
static UPNP_INLINE int
|
||||
get_action_node( IN IXML_Document * TempDoc,
|
||||
IN char *NodeName,
|
||||
OUT IXML_Document ** RespNode )
|
||||
@ -681,7 +681,7 @@ get_device_info( IN http_message_t * request,
|
||||
*
|
||||
* Note :
|
||||
****************************************************************************/
|
||||
static XINLINE void
|
||||
static UPNP_INLINE void
|
||||
send_action_response( IN SOCKINFO * info,
|
||||
IN IXML_Document * action_resp,
|
||||
IN http_message_t * request )
|
||||
@ -769,7 +769,7 @@ error_handler:
|
||||
* returns 0 if successful else returns -1.
|
||||
* Note :
|
||||
****************************************************************************/
|
||||
static XINLINE int
|
||||
static UPNP_INLINE int
|
||||
get_var_name( IN IXML_Document * TempDoc,
|
||||
OUT char *VarName )
|
||||
{
|
||||
@ -840,7 +840,7 @@ error_handler:
|
||||
*
|
||||
* Note :
|
||||
****************************************************************************/
|
||||
static XINLINE void
|
||||
static UPNP_INLINE void
|
||||
handle_query_variable( IN SOCKINFO * info,
|
||||
IN http_message_t * request,
|
||||
IN IXML_Document * xml_doc )
|
||||
|
@ -125,16 +125,16 @@ ssdp_handle_ctrlpt_msg( IN http_message_t * hmsg,
|
||||
|
||||
// we are assuming that there can be only one client supported at a time
|
||||
|
||||
HandleLock( );
|
||||
HandleLock();
|
||||
|
||||
if( GetClientHandleInfo( &handle, &ctrlpt_info ) != HND_CLIENT ) {
|
||||
HandleUnlock( );
|
||||
HandleUnlock();
|
||||
return;
|
||||
}
|
||||
// copy
|
||||
ctrlpt_callback = ctrlpt_info->Callback;
|
||||
ctrlpt_cookie = ctrlpt_info->Cookie;
|
||||
HandleUnlock( );
|
||||
HandleUnlock();
|
||||
|
||||
// search timeout
|
||||
if( timeout ) {
|
||||
@ -268,9 +268,9 @@ ssdp_handle_ctrlpt_msg( IN http_message_t * hmsg,
|
||||
return; // bad reply
|
||||
}
|
||||
//check each current search
|
||||
HandleLock( );
|
||||
HandleLock();
|
||||
if( GetClientHandleInfo( &handle, &ctrlpt_info ) != HND_CLIENT ) {
|
||||
HandleUnlock( );
|
||||
HandleUnlock();
|
||||
return;
|
||||
}
|
||||
node = ListHead( &ctrlpt_info->SsdpSearchList );
|
||||
@ -344,7 +344,7 @@ ssdp_handle_ctrlpt_msg( IN http_message_t * hmsg,
|
||||
node = ListNext( &ctrlpt_info->SsdpSearchList, node );
|
||||
}
|
||||
|
||||
HandleUnlock( );
|
||||
HandleUnlock();
|
||||
//ctrlpt_callback( UPNP_DISCOVERY_SEARCH_RESULT, ¶m, cookie );
|
||||
}
|
||||
}
|
||||
@ -353,11 +353,11 @@ ssdp_handle_ctrlpt_msg( IN http_message_t * hmsg,
|
||||
* Function : process_reply
|
||||
*
|
||||
* Parameters:
|
||||
* IN char* request_buf: the response came from the device
|
||||
* IN int buf_len: The length of the response buffer
|
||||
* IN struct sockaddr_in* dest_addr: The address of the device
|
||||
* IN void *cookie : cookie passed by the control point application
|
||||
* at the time of sending search message
|
||||
* IN char* request_buf: the response came from the device
|
||||
* IN int buf_len: The length of the response buffer
|
||||
* IN struct sockaddr_in* dest_addr: The address of the device
|
||||
* IN void *cookie : cookie passed by the control point application
|
||||
* at the time of sending search message
|
||||
*
|
||||
* Description:
|
||||
* This function processes reply recevied from a search
|
||||
@ -365,7 +365,9 @@ ssdp_handle_ctrlpt_msg( IN http_message_t * hmsg,
|
||||
* Returns: void
|
||||
*
|
||||
***************************************************************************/
|
||||
static XINLINE void
|
||||
#warning There are currently no uses of the function 'process_reply()' in the code.
|
||||
#warning 'process_reply()' is a good candidate for removal.
|
||||
static UPNP_INLINE void
|
||||
process_reply( IN char *request_buf,
|
||||
IN int buf_len,
|
||||
IN struct sockaddr_in *dest_addr,
|
||||
@ -391,14 +393,14 @@ process_reply( IN char *request_buf,
|
||||
* Function : CreateClientRequestPacket
|
||||
*
|
||||
* Parameters:
|
||||
* IN char * RqstBuf:Output string in HTTP format.
|
||||
* IN char *SearchTarget:Search Target
|
||||
* IN int Mx dest_addr: Number of seconds to wait to
|
||||
* collect all the responses
|
||||
* IN char * RqstBuf:Output string in HTTP format.
|
||||
* IN char *SearchTarget:Search Target
|
||||
* IN int Mx dest_addr: Number of seconds to wait to
|
||||
* collect all the responses
|
||||
*
|
||||
* Description:
|
||||
* This function creates a HTTP search request packet
|
||||
* depending on the input parameter.
|
||||
* depending on the input parameter.
|
||||
*
|
||||
* Returns: void
|
||||
*
|
||||
@ -456,13 +458,13 @@ searchExpired( void *arg )
|
||||
void *cookie = NULL;
|
||||
int found = 0;
|
||||
|
||||
HandleLock( );
|
||||
HandleLock();
|
||||
|
||||
//remove search target from search list
|
||||
|
||||
if( GetClientHandleInfo( &handle, &ctrlpt_info ) != HND_CLIENT ) {
|
||||
free( id );
|
||||
HandleUnlock( );
|
||||
HandleUnlock();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -483,7 +485,7 @@ searchExpired( void *arg )
|
||||
}
|
||||
node = ListNext( &ctrlpt_info->SsdpSearchList, node );
|
||||
}
|
||||
HandleUnlock( );
|
||||
HandleUnlock();
|
||||
|
||||
if( found ) {
|
||||
ctrlpt_callback( UPNP_DISCOVERY_SEARCH_TIMEOUT, NULL, cookie );
|
||||
@ -558,9 +560,9 @@ SearchByTarget( IN int Mx,
|
||||
FD_SET( gSsdpReqSocket, &wrSet );
|
||||
|
||||
//add search criteria to list
|
||||
HandleLock( );
|
||||
HandleLock();
|
||||
if( GetClientHandleInfo( &handle, &ctrlpt_info ) != HND_CLIENT ) {
|
||||
HandleUnlock( );
|
||||
HandleUnlock();
|
||||
free( ReqBuf );
|
||||
return UPNP_E_INTERNAL_ERROR;
|
||||
}
|
||||
@ -581,7 +583,7 @@ SearchByTarget( IN int Mx,
|
||||
newArg->timeoutEventId = ( *id );
|
||||
|
||||
ListAddTail( &ctrlpt_info->SsdpSearchList, newArg );
|
||||
HandleUnlock( );
|
||||
HandleUnlock();
|
||||
|
||||
setsockopt( gSsdpReqSocket, IPPROTO_IP, IP_MULTICAST_IF,
|
||||
( char * )&addr, sizeof( addr ) );
|
||||
|
@ -641,7 +641,7 @@ free_ssdp_event_handler_data( void *the_data )
|
||||
* Returns: xboolean
|
||||
* returns TRUE if msg is valid else FALSE
|
||||
***************************************************************************/
|
||||
static XINLINE xboolean
|
||||
static UPNP_INLINE xboolean
|
||||
valid_ssdp_msg( IN http_message_t * hmsg )
|
||||
{
|
||||
memptr hdr_value;
|
||||
@ -683,7 +683,7 @@ valid_ssdp_msg( IN http_message_t * hmsg )
|
||||
* Returns: int
|
||||
* 0 if successful -1 if error
|
||||
***************************************************************************/
|
||||
static XINLINE int
|
||||
static UPNP_INLINE int
|
||||
start_event_handler( void *Data )
|
||||
{
|
||||
|
||||
|
@ -62,7 +62,7 @@
|
||||
*
|
||||
* Note :
|
||||
************************************************************************/
|
||||
static XINLINE void
|
||||
static UPNP_INLINE void
|
||||
addrToString( IN const struct sockaddr_in *addr,
|
||||
OUT char ipaddr_port[] )
|
||||
{
|
||||
@ -87,7 +87,7 @@ addrToString( IN const struct sockaddr_in *addr,
|
||||
*
|
||||
* Note : 'newAlias' should be freed using free()
|
||||
************************************************************************/
|
||||
static XINLINE int
|
||||
static UPNP_INLINE int
|
||||
calc_alias( IN const char *alias,
|
||||
IN const char *rootPath,
|
||||
OUT char **newAlias )
|
||||
@ -148,7 +148,7 @@ calc_alias( IN const char *alias,
|
||||
*
|
||||
* Note :
|
||||
************************************************************************/
|
||||
static XINLINE int
|
||||
static UPNP_INLINE int
|
||||
calc_descURL( IN const char *ipPortStr,
|
||||
IN const char *alias,
|
||||
OUT char descURL[LINE_SIZE] )
|
||||
|
Loading…
x
Reference in New Issue
Block a user