UPnPsdk 0.1
Universal Plug and Play +, Software Development Kit
 
Loading...
Searching...
No Matches
ssdp_common.cpp File Reference

Manage "Step 1: Discovery" of the UPnP+™ specification for common SSDP usage. More...

#include <ssdp_ctrlpt.hpp>
#include <ssdp_device.hpp>
#include <upnpapi.hpp>
#include <UPnPsdk/socket.hpp>
#include <umock/sys_socket.hpp>
#include <umock/winsock2.hpp>
+ Include dependency graph for ssdp_common.cpp:

Go to the source code of this file.

Functions

int unique_service_name (char *cmd, SsdpEvent *Evt)
 Fills the fields of the event structure like DeviceType, Device UDN and Service Type.
 
SsdpSearchType ssdp_request_type1 (char *cmd)
 This function figures out the type of the SSDP search in the request.
 
int ssdp_request_type (char *cmd, SsdpEvent *Evt)
 Starts filling the SSDP event structure based upon the request received.
 
int readFromSSDPSocket (SOCKET socket)
 This function reads the data from the ssdp socket.
 
int get_ssdp_sockets (MiniServerSockArray *out)
 Creates the IPv4 and IPv6 ssdp sockets required by the control point and device operation.
 
Functions scope restricted to file
void anonymous_namespace{ssdp_common.cpp}::free_ssdp_event_handler_data (void *the_data)
 Frees the ssdp request.
 
int anonymous_namespace{ssdp_common.cpp}::valid_ssdp_msg (http_message_t *hmsg)
 Does some quick checking of the ssdp msg.
 
int anonymous_namespace{ssdp_common.cpp}::start_event_handler (void *Data)
 Parses the message and dispatches it to a handler which handles the ssdp request msg.
 
void anonymous_namespace{ssdp_common.cpp}::ssdp_event_handler_thread (void *the_data)
 This function is a thread that handles SSDP requests.
 
int anonymous_namespace{ssdp_common.cpp}::create_ssdp_sock_v4 (SOCKET *ssdpSock)
 Create an SSDP IPv4 socket.
 
int anonymous_namespace{ssdp_common.cpp}::create_ssdp_sock_v6 (SOCKET *ssdpSock)
 Create an SSDP IPv6 socket.
 
int anonymous_namespace{ssdp_common.cpp}::create_ssdp_sock_v6_ula_gua (SOCKET *ssdpSock)
 Create an SSDP IPv6 ULA_GUA socket.
 

Detailed Description

Manage "Step 1: Discovery" of the UPnP+™ specification for common SSDP usage.

Definition in file ssdp_common.cpp.

Function Documentation

◆ ssdp_request_type1()

SsdpSearchType ssdp_request_type1 ( char *  cmd)

This function figures out the type of the SSDP search in the request.

Returns
On success: Returns appropriate search type.
On error: SSDP_ERROR
Parameters
[in]cmdcommand came in the ssdp request.

Definition at line 667 of file ssdp_common.cpp.

+ Here is the caller graph for this function:

◆ ssdp_request_type()

int ssdp_request_type ( char *  cmd,
SsdpEvent Evt 
)

Starts filling the SSDP event structure based upon the request received.

Returns
On success: 0
On error: -1
Parameters
[in]cmdcommand came in the ssdp request.
[out]EvtThe event structure partially filled by this function.

Definition at line 681 of file ssdp_common.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readFromSSDPSocket()

int readFromSSDPSocket ( SOCKET  socket)

This function reads the data from the ssdp socket.

Returns
On success: 0
On error: -1
Parameters
[in]socketSSDP socket.

Definition at line 694 of file ssdp_common.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_ssdp_sockets()

int get_ssdp_sockets ( MiniServerSockArray out)

Creates the IPv4 and IPv6 ssdp sockets required by the control point and device operation.

Returns
On success: UPNP_E_SUCCESS
On error:
  • UPNP_E_OUTOF_SOCKET
  • UPNP_E_SOCKET_ERROR
  • UPNP_E_SOCKET_BIND
  • UPNP_E_NETWORK_ERROR
Parameters
[out]outArray of SSDP sockets.

Definition at line 782 of file ssdp_common.cpp.

+ Here is the call graph for this function: