miniserver.h
Go to the documentation of this file.
#ifndef MINISERVER_H
#define MINISERVER_H
/**************************************************************************
*
* Copyright (c) 2000-2003 Intel Corporation
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* - Neither name of Intel Corporation nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
**************************************************************************/
#include "UpnpStdInt.h"
#include "httpparser.h"
#include "sock.h"
extern SOCKET gMiniServerStopSock;
typedef struct MServerSockArray
{
SOCKET miniServerSock4;
SOCKET miniServerSock6;
SOCKET miniServerSock6UlaGua;
SOCKET miniServerStopSock;
SOCKET ssdpSock4;
SOCKET ssdpSock6;
SOCKET ssdpSock6UlaGua;
/* ! . */
uint16_t stopPort;
/* ! . */
uint16_t miniServerPort4;
/* ! . */
uint16_t miniServerPort6;
/* ! . */
uint16_t miniServerPort6UlaGua;
#ifdef INCLUDE_CLIENT_APIS
SOCKET ssdpReqSock4;
SOCKET ssdpReqSock6;
#endif /* INCLUDE_CLIENT_APIS */
} MiniServerSockArray;
typedef void (*MiniServerCallback)(
/* ! [in] . */
http_parser_t *parser,
/* ! [in] . */
http_message_t *request,
/* ! [in] . */
SOCKINFO *info);
#ifdef __cplusplus
extern "C" {
#endif
void SetHTTPGetCallback(
MiniServerCallback callback);
#ifdef INCLUDE_DEVICE_APIS
void SetSoapCallback(
MiniServerCallback callback);
#else /* INCLUDE_DEVICE_APIS */
static UPNP_INLINE void SetSoapCallback(MiniServerCallback callback) {}
#endif /* INCLUDE_DEVICE_APIS */
void SetGenaCallback(
MiniServerCallback callback);
int StartMiniServer(
uint16_t *listen_port4,
uint16_t *listen_port6,
uint16_t *listen_port6UlaGua);
int StopMiniServer();
#ifdef __cplusplus
} /* extern C */
#endif
#endif /* MINISERVER_H */
UPNP_INLINE
#define UPNP_INLINE
Declares an inline function.
Definition UpnpGlobal.h:119
SOCKET
int SOCKET
Definition UpnpInet.h:50
httpparser.h
MiniServerCallback
void(* MiniServerCallback)(http_parser_t *parser, http_message_t *request, SOCKINFO *info)
Definition miniserver.h:82
SetSoapCallback
void SetSoapCallback(MiniServerCallback callback)
Set SOAP Callback.
SetHTTPGetCallback
void SetHTTPGetCallback(MiniServerCallback callback)
Set HTTP Get Callback.
StartMiniServer
int StartMiniServer(uint16_t *listen_port4, uint16_t *listen_port6, uint16_t *listen_port6UlaGua)
Initialize the sockets functionality for the Miniserver.
Definition miniserver.c:1186
StopMiniServer
int StopMiniServer()
Stop and Shutdown the MiniServer and free socket resources.
Definition miniserver.c:1296
SetGenaCallback
void SetGenaCallback(MiniServerCallback callback)
Set GENA Callback.
sock.h
MServerSockArray
Definition miniserver.h:46
MServerSockArray::miniServerSock6UlaGua
SOCKET miniServerSock6UlaGua
Definition miniserver.h:52
MServerSockArray::miniServerSock6
SOCKET miniServerSock6
Definition miniserver.h:50
MServerSockArray::ssdpSock6
SOCKET ssdpSock6
Definition miniserver.h:59
MServerSockArray::ssdpSock6UlaGua
SOCKET ssdpSock6UlaGua
Definition miniserver.h:62
MServerSockArray::ssdpSock4
SOCKET ssdpSock4
Definition miniserver.h:56
MServerSockArray::ssdpReqSock6
SOCKET ssdpReqSock6
Definition miniserver.h:77
MServerSockArray::ssdpReqSock4
SOCKET ssdpReqSock4
Definition miniserver.h:74
MServerSockArray::miniServerStopSock
SOCKET miniServerStopSock
Definition miniserver.h:54
MServerSockArray::miniServerSock4
SOCKET miniServerSock4
Definition miniserver.h:48
SOCKINFO
Definition sock.h:60
http_message_t
Definition httpparser.h:182
http_parser_t
Definition httpparser.h:217