libUPnP 1.14.19
miniserver.h
Go to the documentation of this file.
1#ifndef MINISERVER_H
2#define MINISERVER_H
3
4/**************************************************************************
5 *
6 * Copyright (c) 2000-2003 Intel Corporation
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are met:
11 *
12 * - Redistributions of source code must retain the above copyright notice,
13 * this list of conditions and the following disclaimer.
14 * - Redistributions in binary form must reproduce the above copyright notice,
15 * this list of conditions and the following disclaimer in the documentation
16 * and/or other materials provided with the distribution.
17 * - Neither name of Intel Corporation nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
25 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
28 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
29 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 *
33 **************************************************************************/
34
39#include "UpnpStdInt.h"
40#include "httpparser.h"
41#include "sock.h"
42
43extern SOCKET gMiniServerStopSock;
44
45typedef struct MServerSockArray
46{
63 /* ! . */
64 uint16_t stopPort;
65 /* ! . */
66 uint16_t miniServerPort4;
67 /* ! . */
68 uint16_t miniServerPort6;
69 /* ! . */
70 uint16_t miniServerPort6UlaGua;
71#ifdef INCLUDE_CLIENT_APIS
78#endif /* INCLUDE_CLIENT_APIS */
80
82typedef void (*MiniServerCallback)(
83 /* ! [in] . */
84 http_parser_t *parser,
85 /* ! [in] . */
86 http_message_t *request,
87 /* ! [in] . */
88 SOCKINFO *info);
89
90#ifdef __cplusplus
91extern "C" {
92#endif
93
99 MiniServerCallback callback);
100
104#ifdef INCLUDE_DEVICE_APIS
107 MiniServerCallback callback);
108#else /* INCLUDE_DEVICE_APIS */
109static UPNP_INLINE void SetSoapCallback(MiniServerCallback callback) {}
110#endif /* INCLUDE_DEVICE_APIS */
116 MiniServerCallback callback);
117
136 uint16_t *listen_port4,
139 uint16_t *listen_port6,
142 uint16_t *listen_port6UlaGua);
143
149int StopMiniServer();
150
151#ifdef __cplusplus
152} /* extern C */
153#endif
154
155#endif /* MINISERVER_H */
#define UPNP_INLINE
Declares an inline function.
Definition UpnpGlobal.h:112
int SOCKET
Definition UpnpInet.h:48
void(* MiniServerCallback)(http_parser_t *parser, http_message_t *request, SOCKINFO *info)
Definition miniserver.h:82
void SetSoapCallback(MiniServerCallback callback)
Set SOAP Callback.
void SetHTTPGetCallback(MiniServerCallback callback)
Set HTTP Get Callback.
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
int StopMiniServer()
Stop and Shutdown the MiniServer and free socket resources.
Definition miniserver.c:1296
void SetGenaCallback(MiniServerCallback callback)
Set GENA Callback.
Definition miniserver.h:46
SOCKET miniServerSock6UlaGua
Definition miniserver.h:52
SOCKET miniServerSock6
Definition miniserver.h:50
SOCKET ssdpSock6
Definition miniserver.h:59
SOCKET ssdpSock6UlaGua
Definition miniserver.h:62
SOCKET ssdpSock4
Definition miniserver.h:56
SOCKET ssdpReqSock6
Definition miniserver.h:77
SOCKET ssdpReqSock4
Definition miniserver.h:74
SOCKET miniServerStopSock
Definition miniserver.h:54
SOCKET miniServerSock4
Definition miniserver.h:48
Definition sock.h:60
Definition httpparser.h:182
Definition httpparser.h:217