UPnPsdk 0.1
Universal Plug and Play +, Software Development Kit
 
Loading...
Searching...
No Matches
ssdp_device.hpp
Go to the documentation of this file.
1#ifdef COMPA_HAVE_DEVICE_SSDP
2
3#ifndef COMPA_SSDP_DEVICE_HPP
4#define COMPA_SSDP_DEVICE_HPP
5/**************************************************************************
6 *
7 * Copyright (c) 2000-2003 Intel Corporation
8 * All rights reserved.
9 * Copyright (C) 2011-2012 France Telecom All rights reserved.
10 * Copyright (C) 2024+ GPL 3 and higher by Ingo Höft, <Ingo@Hoeft-online.de>
11 * Redistribution only with this Copyright remark. Last modified: 2025-06-12
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 **************************************************************************/
38// Last compare with ./pupnp source file on 2023-08-30, ver 1.14.18
47#include <ssdp_common.hpp>
48
49
62 http_message_t* hmsg,
64 struct sockaddr_storage* dest_addr);
65
66
84 int AdFlag,
88 enum SsdpSearchType SearchType,
90 struct sockaddr* DestAddr,
92 char* DeviceType,
94 char* DeviceUDN,
96 char* ServiceType,
98 int Exp);
99
106 void* data);
107
122 /* [in] type of the device. */
123 char* DevType,
124 /* [in] flag to indicate if the device is root device. */
125 int RootDev,
126 /* [in] UDN. */
127 char* Udn,
128 /* [in] Location URL. */
129 char* Location,
130 /* [in] Service duration in sec. */
131 int Duration,
132 /* [in] Device address family. */
133 int AddressFamily,
134 /* [in] PowerState as defined by UPnP Low Power. */
135 int PowerState,
136 /* [in] SleepPeriod as defined by UPnP Low Power. */
137 int SleepPeriod,
138 /* [in] RegistrationState as defined by UPnP Low Power. */
139 int RegistrationState);
140
155int SendReply(
157 struct sockaddr* DestAddr,
159 char* DevType,
161 int RootDev,
163 char* Udn,
165 char* Location,
167 int Duration,
169 int ByType,
171 int PowerState,
173 int SleepPeriod,
175 int RegistrationState);
176
192int DeviceReply(
194 struct sockaddr* DestAddr,
196 char* DevType,
198 int RootDev,
200 char* Udn,
202 char* Location,
204 int Duration,
206 int PowerState,
208 int SleepPeriod,
210 int RegistrationState);
211
226 char* Udn,
228 char* ServType,
230 char* Location,
232 int Duration,
234 int AddressFamily,
236 int PowerState,
238 int SleepPeriod,
240 int RegistrationState);
241
254int ServiceReply(
256 struct sockaddr* DestAddr,
258 char* ServType,
260 char* Udn,
262 char* Location,
264 int Duration,
266 int PowerState,
268 int SleepPeriod,
270 int RegistrationState);
271
286 /* [in] Device UDN. */
287 char* Udn,
288 /* [in] Service Type. */
289 char* ServType,
290 /* [in] Location of Device description document. */
291 char* Location,
292 /* [in] Service duration in sec. */
293 int Duration,
294 /* [in] Device address family. */
295 int AddressFamily,
296 /* [in] PowerState as defined by UPnP Low Power. */
297 int PowerState,
298 /* [in] SleepPeriod as defined by UPnP Low Power. */
299 int SleepPeriod,
300 /* [in] RegistrationState as defined by UPnP Low Power. */
301 int RegistrationState);
302
318 char* DevType,
320 int RootDev,
322 char* Udn,
324 char* Location,
326 int Duration,
328 int AddressFamily,
330 int PowerState,
332 int SleepPeriod,
334 int RegistrationState);
335
337
338#endif // COMPA_SSDP_DEVICE_HPP
339#endif // COMPA_HAVE_DEVICE_SSDP
int UpnpDevice_Handle
Returned when a device application registers with UpnpRegisterRootDevice(),UpnpRegisterRootDevice2(),...
Definition API.hpp:425
Structure of an HTTP message.
Duration
Duration.
int DeviceReply(struct sockaddr *DestAddr, char *DevType, int RootDev, char *Udn, char *Location, int Duration, int PowerState, int SleepPeriod, int RegistrationState)
Creates the reply packet and send it to the Control Point address.
int AdvertiseAndReply(int AdFlag, UpnpDevice_Handle Hnd, enum SsdpSearchType SearchType, struct sockaddr *DestAddr, char *DeviceType, char *DeviceUDN, char *ServiceType, int Exp)
Sends SSDP advertisements, replies and shutdown messages.
int DeviceAdvertisement(char *DevType, int RootDev, char *Udn, char *Location, int Duration, int AddressFamily, int PowerState, int SleepPeriod, int RegistrationState)
Creates the device advertisement request.
int DeviceShutdown(char *DevType, int RootDev, char *Udn, char *Location, int Duration, int AddressFamily, int PowerState, int SleepPeriod, int RegistrationState)
Creates a HTTP device shutdown request packet and send it to the multicast channel through RequestHan...
void advertiseAndReplyThread(void *data)
Wrapper function to reply the search request coming from the control point.
int ServiceAdvertisement(char *Udn, char *ServType, char *Location, int Duration, int AddressFamily, int PowerState, int SleepPeriod, int RegistrationState)
Creates the advertisement packet and send it to the multicast channel.
int ServiceShutdown(char *Udn, char *ServType, char *Location, int Duration, int AddressFamily, int PowerState, int SleepPeriod, int RegistrationState)
Creates a HTTP service shutdown request packet and sends it to the multicast channel through RequestH...
int SendReply(struct sockaddr *DestAddr, char *DevType, int RootDev, char *Udn, char *Location, int Duration, int ByType, int PowerState, int SleepPeriod, int RegistrationState)
Creates the reply packet and send it to the Control Point addesss.
int ServiceReply(struct sockaddr *DestAddr, char *ServType, char *Udn, char *Location, int Duration, int PowerState, int SleepPeriod, int RegistrationState)
Creates the advertisement packet and send it to the multicast channel.
Manage "Step 1: Discovery" of the UPnP+™ specification with SSDP.
SsdpSearchType
Enumeration to define all different types of ssdp searches.
void ssdp_handle_device_request(http_message_t *hmsg, struct sockaddr_storage *dest_addr)
Handles the search request.