UPnPsdk 0.1
Universal Plug and Play +, Software Development Kit
 
Loading...
Searching...
No Matches
miniserver.hpp
Go to the documentation of this file.
1#ifdef COMPA_HAVE_MINISERVER
2
3#ifndef COMPA_MINISERVER_HPP
4#define COMPA_MINISERVER_HPP
5/**************************************************************************
6 *
7 * Copyright (c) 2000-2003 Intel Corporation
8 * All rights reserved.
9 * Copyright (C) 2022+ GPL 3 and higher by Ingo Höft, <Ingo@Hoeft-online.de>
10 * Redistribution only with this Copyright remark. Last modified: 2025-03-08
11 * Copied from pupnp ver 1.14.15.
12 *
13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions are met:
15 *
16 * - Redistributions of source code must retain the above copyright notice,
17 * this list of conditions and the following disclaimer.
18 * - Redistributions in binary form must reproduce the above copyright notice,
19 * this list of conditions and the following disclaimer in the documentation
20 * and/or other materials provided with the distribution.
21 * - Neither name of Intel Corporation nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
29 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
33 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 *
37 **************************************************************************/
55#include <httpparser.hpp>
56#include <sock.hpp>
57#include <UPnPsdk/socket.hpp>
58
60#include <cstdint> // for uint16_t
62
75 SOCKET ssdpSock4;
78 SOCKET ssdpSock6;
84 in_port_t stopPort;
86 in_port_t miniServerPort4;
88 in_port_t miniServerPort6;
91#ifdef COMPA_HAVE_WEBSERVER
92 UPnPsdk::CSocket* pSockLlaObj;
93 UPnPsdk::CSocket* pSockGuaObj;
94 UPnPsdk::CSocket* pSockIp4Obj;
95#endif
96#ifdef COMPA_HAVE_CTRLPT_SSDP
107#endif
108};
109
111typedef void (*MiniServerCallback)(http_parser_t* parser,
112 http_message_t* request, SOCKINFO* info);
113
116
120#ifdef COMPA_HAVE_DEVICE_SOAP
121void SetSoapCallback(
123 MiniServerCallback callback);
124#endif
125
129#ifdef COMPA_HAVE_DEVICE_GENA
130void SetGenaCallback(
132 MiniServerCallback callback);
133#endif
134
159 in_port_t* listen_port4,
162 in_port_t* listen_port6,
165 in_port_t* listen_port6UlaGua);
166
172int StopMiniServer();
173
174#endif /* COMPA_MINISERVER_HPP */
175#endif // COMPA_HAVE_MINISERVER
Structure of an HTTP parser object.
Structure of an HTTP message.
Functions to parse UPnP messages like requests and responses.
Manage all aspects of a network socket.
Definition socket.hpp:320
in_port_t miniServerPort6
Corresponding port to miniServerSock6.
in_port_t miniServerPort6UlaGua
Corresponding port to miniServerSock6UlaGua.
SOCKET ssdpSock4
IPv4 SSDP datagram Socket for incoming advertisments and search requests.
void(* MiniServerCallback)(http_parser_t *parser, http_message_t *request, SOCKINFO *info)
For a miniserver callback function.
void SetSoapCallback(MiniServerCallback callback)
Set SOAP Callback.
SOCKET miniServerSock6UlaGua
IPv6 ULA or GUA Socket for listening for miniserver requests.
int StartMiniServer(in_port_t *listen_port4, in_port_t *listen_port6, in_port_t *listen_port6UlaGua)
Initialize the sockets functionality for the Miniserver.
in_port_t stopPort
Corresponding port to miniServerStopSock. This is set with miniStopSockPort but never used.
SOCKET miniServerSock4
IPv4 socket for listening for miniserver requests.
in_port_t miniServerPort4
Corresponding port to miniServerSock4.
int StopMiniServer()
Stop and Shutdown the MiniServer and free socket resources.
MiniServerCallback gGetCallback
HTTP server callback.
SOCKET ssdpReqSock6
IPv6 SSDP socket for sending search requests and receiving search replies.
SOCKET ssdpReqSock4
IPv4 SSDP socket for sending search requests and receiving search replies.
SOCKET miniServerStopSock
Datagram Socket for stopping miniserver.
SOCKET ssdpSock6
IPv6 LLA SSDP Socket for incoming advertisments and search requests.
SOCKET miniServerSock6
IPv6 LLA Socket for listening for miniserver requests.
SOCKET ssdpSock6UlaGua
IPv6 ULA or GUA SSDP Socket for incoming advertisments and search requests.
void SetGenaCallback(MiniServerCallback callback)
Set GENA Callback.
Provides sockets for all network communications.
Manage network sockets and connections.
Additional socket information for connections and ssl.
Definition sock.hpp:65
Socket Module: manage properties and methods but not connections of ONE network socket to handle IPv4...