libUPnP  1.6.20
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 {
58  /* ! . */
59  uint16_t stopPort;
60  /* ! . */
61  uint16_t miniServerPort4;
62  /* ! . */
63  uint16_t miniServerPort6;
64 #ifdef INCLUDE_CLIENT_APIS
65 
71 #endif /* INCLUDE_CLIENT_APIS */
73 
75 typedef void (*MiniServerCallback) (
76  /* ! . */
77  IN http_parser_t * parser,
78  /* ! . */
79  IN http_message_t * request,
80  /* ! . */
81  IN SOCKINFO * info);
82 
83 #ifdef __cplusplus
84 extern "C" {
85 #endif
86 
92  MiniServerCallback callback);
93 
97 #ifdef INCLUDE_DEVICE_APIS
98 void SetSoapCallback(
100  MiniServerCallback callback);
101 #else /* INCLUDE_DEVICE_APIS */
102  static UPNP_INLINE void SetSoapCallback(MiniServerCallback callback) {}
103 #endif /* INCLUDE_DEVICE_APIS */
104 
107 void SetGenaCallback(
109  MiniServerCallback callback);
110 
126 int StartMiniServer(
129  uint16_t *listen_port4,
132  uint16_t *listen_port6);
133 
139 int StopMiniServer();
140 
141 #ifdef __cplusplus
142 } /* extern C */
143 #endif
144 
145 #endif /* MINISERVER_H */
SOCKET miniServerSock4
Definition: miniserver.h:47
SOCKET ssdpReqSock6
Definition: miniserver.h:70
Definition: miniserver.h:45
Definition: httpparser.h:175
SOCKET miniServerStopSock
Definition: miniserver.h:51
void SetSoapCallback(MiniServerCallback callback)
Set SOAP Callback.
SOCKET ssdpSock4
Definition: miniserver.h:53
SOCKET miniServerSock6
Definition: miniserver.h:49
void SetHTTPGetCallback(MiniServerCallback callback)
Set HTTP Get Callback.
SOCKET ssdpSock6
Definition: miniserver.h:55
SOCKET ssdpSock6UlaGua
Definition: miniserver.h:57
int StartMiniServer(uint16_t *listen_port4, uint16_t *listen_port6)
Initialize the sockets functionality for the Miniserver.
Definition: miniserver.c:856
SOCKET ssdpReqSock4
Definition: miniserver.h:67
Definition: sock.h:55
int SOCKET
Definition: UpnpInet.h:53
void(* MiniServerCallback)(http_parser_t *parser, http_message_t *request, SOCKINFO *info)
Definition: miniserver.h:75
Definition: httpparser.h:209
int StopMiniServer()
Stop and Shutdown the MiniServer and free socket resources.
Definition: miniserver.c:962
#define UPNP_INLINE
Declares an inline function.
Definition: UpnpGlobal.h:93
void SetGenaCallback(MiniServerCallback callback)
Set GENA Callback.