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 "sock.h"
#include "httpparser.h"
#include "UpnpStdInt.h"
extern SOCKET gMiniServerStopSock;
typedef struct MServerSockArray {
SOCKET miniServerSock4;
SOCKET miniServerSock6;
SOCKET miniServerStopSock;
SOCKET ssdpSock4;
SOCKET ssdpSock6;
SOCKET ssdpSock6UlaGua;
/* ! . */
uint16_t stopPort;
/* ! . */
uint16_t miniServerPort4;
/* ! . */
uint16_t miniServerPort6;
#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);
int StopMiniServer();
#ifdef __cplusplus
} /* extern C */
#endif
#endif /* MINISERVER_H */
MServerSockArray::miniServerSock4
SOCKET miniServerSock4
Definition: miniserver.h:47
MServerSockArray::ssdpReqSock6
SOCKET ssdpReqSock6
Definition: miniserver.h:70
MServerSockArray
Definition: miniserver.h:45
http_message_t
Definition: httpparser.h:179
MServerSockArray::miniServerStopSock
SOCKET miniServerStopSock
Definition: miniserver.h:51
SetSoapCallback
void SetSoapCallback(MiniServerCallback callback)
Set SOAP Callback.
MServerSockArray::ssdpSock4
SOCKET ssdpSock4
Definition: miniserver.h:53
MServerSockArray::miniServerSock6
SOCKET miniServerSock6
Definition: miniserver.h:49
SetHTTPGetCallback
void SetHTTPGetCallback(MiniServerCallback callback)
Set HTTP Get Callback.
MServerSockArray::ssdpSock6
SOCKET ssdpSock6
Definition: miniserver.h:55
MServerSockArray::ssdpSock6UlaGua
SOCKET ssdpSock6UlaGua
Definition: miniserver.h:57
StartMiniServer
int StartMiniServer(uint16_t *listen_port4, uint16_t *listen_port6)
Initialize the sockets functionality for the Miniserver.
Definition: miniserver.c:862
MServerSockArray::ssdpReqSock4
SOCKET ssdpReqSock4
Definition: miniserver.h:67
sock.h
SOCKINFO
Definition: sock.h:59
SOCKET
int SOCKET
Definition: UpnpInet.h:48
MiniServerCallback
void(* MiniServerCallback)(http_parser_t *parser, http_message_t *request, SOCKINFO *info)
Definition: miniserver.h:75
http_parser_t
Definition: httpparser.h:213
httpparser.h
StopMiniServer
int StopMiniServer()
Stop and Shutdown the MiniServer and free socket resources.
Definition: miniserver.c:968
UPNP_INLINE
#define UPNP_INLINE
Declares an inline function.
Definition: UpnpGlobal.h:99
SetGenaCallback
void SetGenaCallback(MiniServerCallback callback)
Set GENA Callback.