UPnPsdk 0.1
Universal Plug and Play +, Software Development Kit
 
Loading...
Searching...
No Matches
anonymous_namespace{ssdp_device.cpp} Namespace Reference

Functions

Functions scope restricted to file
int NewRequestHandler (struct sockaddr *DestAddr, int NumPacket, char **RqPacket)
 Works as a request handler which passes the HTTP request string to multicast channel.
 
int extractIPv6address (char *url, char *address)
 Extract IPv6 address.
 
int isUrlV6UlaGua (char *descdocUrl)
 Test if a Url contains an ULA or GUA IPv6 address.
 
void CreateServicePacket (int msg_type, const char *nt, char *usn, char *location, int duration, char **packet, int AddressFamily, int PowerState, int SleepPeriod, int RegistrationState)
 Creates a HTTP request packet.
 

Variables

Variables scope restricted to file
constexpr int MSGTYPE_SHUTDOWN {0}
 Message type.
 
constexpr int MSGTYPE_ADVERTISEMENT {1}
 Message type.
 
constexpr int MSGTYPE_REPLY {2}
 Message type.
 

Function Documentation

◆ NewRequestHandler()

int anonymous_namespace{ssdp_device.cpp}::NewRequestHandler ( struct sockaddr *  DestAddr,
int  NumPacket,
char **  RqPacket 
)

Works as a request handler which passes the HTTP request string to multicast channel.

Returns
On success: UPNP_E_SUCCESS
On error:
  • UPNP_E_INVALID_PARAM
  • UPNP_E_OUTOF_SOCKET
  • UPNP_E_NETWORK_ERROR
  • UPNP_E_SOCKET_WRITE
Parameters
[in]DestAddrIp address, to send the reply.
[in]NumPacketNumber of packet to be sent.
[in]RqPacket

Definition at line 89 of file ssdp_device.cpp.

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

◆ extractIPv6address()

int anonymous_namespace{ssdp_device.cpp}::extractIPv6address ( char *  url,
char *  address 
)
inline

Extract IPv6 address.

Returns
1 if an inet6 has been found, othherwise 0.
Parameters
[in]url
[out]addressExtracted IPv6 address.

Definition at line 185 of file ssdp_device.cpp.

+ Here is the caller graph for this function:

◆ isUrlV6UlaGua()

int anonymous_namespace{ssdp_device.cpp}::isUrlV6UlaGua ( char *  descdocUrl)

Test if a Url contains an ULA or GUA IPv6 address.

Returns
1 if the Url contains an ULA or GUA IPv6 address, 0 otherwise.
Parameters
[in]descdocUrlUrl

Definition at line 226 of file ssdp_device.cpp.

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

◆ CreateServicePacket()

void anonymous_namespace{ssdp_device.cpp}::CreateServicePacket ( int  msg_type,
const char *  nt,
char *  usn,
char *  location,
int  duration,
char **  packet,
int  AddressFamily,
int  PowerState,
int  SleepPeriod,
int  RegistrationState 
)

Creates a HTTP request packet.

Depending on the input parameter, it either creates a service advertisement request or service shutdown request etc.

Parameters
[in]msg_typetype of the message (Search Reply, Advertisement or Shutdown).
[in]ntssdp type.
[in]usnunique service name ( go in the HTTP Header).
[in]locationLocation URL.
[in]durationService duration in sec.
[out]packetOutput buffer filled with HTTP statement.
[in]AddressFamilyAddress family of the HTTP request.
[in]PowerStatePowerState as defined by UPnP Low Power.
[in]SleepPeriodSleepPeriod as defined by UPnP Low Power.
[in]RegistrationStateRegistrationState as defined by UPnP Low Power.

Definition at line 246 of file ssdp_device.cpp.

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

Variable Documentation

◆ MSGTYPE_SHUTDOWN

constexpr int anonymous_namespace{ssdp_device.cpp}::MSGTYPE_SHUTDOWN {0}
constexpr

Message type.

Definition at line 68 of file ssdp_device.cpp.

◆ MSGTYPE_ADVERTISEMENT

constexpr int anonymous_namespace{ssdp_device.cpp}::MSGTYPE_ADVERTISEMENT {1}
constexpr

Message type.

Definition at line 69 of file ssdp_device.cpp.

◆ MSGTYPE_REPLY

constexpr int anonymous_namespace{ssdp_device.cpp}::MSGTYPE_REPLY {2}
constexpr

Message type.

Definition at line 70 of file ssdp_device.cpp.