libUPnP  1.14.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 
39 #include "sock.h"
40 #include "httpparser.h"
41 #include "UpnpStdInt.h"
42 
43 extern SOCKET gMiniServerStopSock;
44 
45 typedef struct MServerSockArray {
60  /* ! . */
61  uint16_t stopPort;
62  /* ! . */
63  uint16_t miniServerPort4;
64  /* ! . */
65  uint16_t miniServerPort6;
66  /* ! . */
67  uint16_t miniServerPort6UlaGua;
68 #ifdef INCLUDE_CLIENT_APIS
75 #endif /* INCLUDE_CLIENT_APIS */
77 
79 typedef void (*MiniServerCallback) (
80  /* ! [in] . */
81  http_parser_t * parser,
82  /* ! [in] . */
83  http_message_t * request,
84  /* ! [in] . */
85  SOCKINFO * info);
86 
87 #ifdef __cplusplus
88 extern "C" {
89 #endif
90 
96  MiniServerCallback callback);
97 
101 #ifdef INCLUDE_DEVICE_APIS
104  MiniServerCallback callback);
105 #else /* INCLUDE_DEVICE_APIS */
106  static UPNP_INLINE void SetSoapCallback(MiniServerCallback callback) {}
107 #endif /* INCLUDE_DEVICE_APIS */
113  MiniServerCallback callback);
114 
130 int StartMiniServer(
133  uint16_t *listen_port4,
136  uint16_t *listen_port6,
139  uint16_t *listen_port6UlaGua);
140 
146 int StopMiniServer();
147 
148 #ifdef __cplusplus
149 } /* extern C */
150 #endif
151 
152 #endif /* MINISERVER_H */
#define UPNP_INLINE
Declares an inline function.
Definition: UpnpGlobal.h:103
int SOCKET
Definition: UpnpInet.h:48
void(* MiniServerCallback)(http_parser_t *parser, http_message_t *request, SOCKINFO *info)
Definition: miniserver.h:79
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:1004
int StopMiniServer()
Stop and Shutdown the MiniServer and free socket resources.
Definition: miniserver.c:1114
void SetGenaCallback(MiniServerCallback callback)
Set GENA Callback.
Definition: miniserver.h:45
SOCKET miniServerSock6UlaGua
Definition: miniserver.h:51
SOCKET miniServerSock6
Definition: miniserver.h:49
SOCKET ssdpSock6
Definition: miniserver.h:57
SOCKET ssdpSock6UlaGua
Definition: miniserver.h:59
SOCKET ssdpSock4
Definition: miniserver.h:55
SOCKET ssdpReqSock6
Definition: miniserver.h:74
SOCKET ssdpReqSock4
Definition: miniserver.h:71
SOCKET miniServerStopSock
Definition: miniserver.h:53
SOCKET miniServerSock4
Definition: miniserver.h:47
Definition: sock.h:60
Definition: httpparser.h:182
Definition: httpparser.h:217