libUPnP 1.18.5
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
38
39#include "UpnpStdInt.h" /* IWYU pragma: keep */
40
41#include "httpparser.h"
42#include "sock.h"
43
44extern SOCKET gMiniServerStopSock;
45
46typedef struct MServerSockArray
47{
65 /* ! . */
66 uint16_t stopPort;
67 /* ! . */
68 uint16_t miniServerPort4;
69 /* ! . */
70 uint16_t miniServerPort6;
71 /* ! . */
72 uint16_t miniServerPort6UlaGua;
73#ifdef INCLUDE_CLIENT_APIS
80#endif /* INCLUDE_CLIENT_APIS */
81} MiniServerSockArray;
82
84typedef void (*MiniServerCallback)(
85 /* ! [in] . */
86 http_parser_t *parser,
87 /* ! [in] . */
88 http_message_t *request,
89 /* ! [in] . */
90 SOCKINFO *info);
91
92#ifdef __cplusplus
93extern "C" {
94#endif
95
101 MiniServerCallback callback);
102
106#ifdef INCLUDE_DEVICE_APIS
109 MiniServerCallback callback);
110#else /* INCLUDE_DEVICE_APIS */
112{
113 (void)callback;
114}
115#endif /* INCLUDE_DEVICE_APIS */
121 MiniServerCallback callback);
122
141 uint16_t *listen_port4,
144 uint16_t *listen_port6,
147 uint16_t *listen_port6UlaGua);
148
154int StopMiniServer(void);
155
161
162#ifdef __cplusplus
163} /* extern C */
164#endif
165
166#endif /* MINISERVER_H */
#define UPNP_INLINE
Declares an inline function.
Definition UpnpGlobal.h:119
int SOCKET
Definition UpnpInet.h:50
void(* MiniServerCallback)(http_parser_t *parser, http_message_t *request, SOCKINFO *info)
Definition miniserver.h:84
int StopMiniServer(void)
Stop and Shutdown the MiniServer and free socket resources.
Definition miniserver.c:1454
void shutdown_all_active_connections(void)
Shutdown all active socket connections to interrupt blocking operations.
Definition miniserver.c:606
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:1344
void SetGenaCallback(MiniServerCallback callback)
Set GENA Callback.
Definition miniserver.h:47
SOCKET miniServerSock6UlaGua
Definition miniserver.h:53
SOCKET miniServerSock6
Definition miniserver.h:51
SOCKET ssdpSock6
Definition miniserver.h:61
SOCKET ssdpSock6UlaGua
Definition miniserver.h:64
SOCKET ssdpSock4
Definition miniserver.h:57
SOCKET ssdpReqSock6
Definition miniserver.h:79
SOCKET ssdpReqSock4
Definition miniserver.h:76
SOCKET miniServerStopSock
Definition miniserver.h:55
SOCKET miniServerSock4
Definition miniserver.h:49
Definition sock.h:60
Definition httpparser.h:181
Definition httpparser.h:216