mUPnP for C
ssdp.h File Reference
#include <mupnp/typedef.h>
#include <mupnp/http/http.h>
#include <mupnp/net/socket.h>

Macros

#define MUPNP_SSDP_PORT   1900
 
#define MUPNP_SSDP_ADDRESS   "239.255.255.250"
 
#define MUPNP_SSDP_MULTICAST_ADDRESS   "239.255.255.250:1900"
 
#define MUPNP_AUTO_IP_NET   0xa9fe0000
 
#define MUPNP_AUTO_IP_MASK   0xffff0000
 
#define MUPNP_SSDP_MULTICAST_DEFAULT_TTL   4
 
#define MUPNP_SSDP_IPV6_IF_LOCAL_ADDRESS   "FF01::C"
 
#define MUPNP_SSDP_IPV6_LINK_LOCAL_ADDRESS   "FF02::C"
 
#define MUPNP_SSDP_IPV6_SUBNET_ADDRESS   "FF03::C"
 
#define MUPNP_SSDP_IPV6_ADMINISTRATIVE_ADDRESS   "FF04::C"
 
#define MUPNP_SSDP_IPV6_SITE_LOCAL_ADDRESS   "FF05::C"
 
#define MUPNP_SSDP_IPV6_GLOBAL_ADDRESS   "FF0E::C"
 
#define MUPNP_SSDP_DEFAULT_MSEARCH_MX   3
 
#define MUPNP_SSDP_DEFAULT_ANNOUNCE_COUNT   3
 
#define MUPNP_SSDP_HEADER_LINE_MAXSIZE   128
 
#define MUPNP_SSDP_ST   "ST"
 
#define MUPNP_SSDP_MX   "MX"
 
#define MUPNP_SSDP_MAN   "MAN"
 
#define MUPNP_SSDP_NT   "NT"
 
#define MUPNP_SSDP_NTS   "NTS"
 
#define MUPNP_SSDP_NTS_ALIVE   "ssdp:alive"
 
#define MUPNP_SSDP_NTS_BYEBYE   "ssdp:byebye"
 
#define MUPNP_SSDP_NTS_PROPCHANGE   "upnp:propchange"
 
#define MUPNP_SSDP_USN   "USN"
 
#define MUPNP_SSDP_EXT   "EXT"
 
#define MUPNP_SSDP_SID   "SID"
 
#define MUPNP_SSDP_SEQ   "SEQ"
 
#define MUPNP_SSDP_CALBACK   "CALLBACK"
 
#define MUPNP_SSDP_TIMEOUT   "TIMEOUT"
 
#define MUPNP_SSDP_SERVER   "SERVER"
 
#define MUPNP_SSDP_BOOTID_UPNP_ORG   "BOOTID.UPNP.ORG"
 
#define MUPNP_SSDP_FILTER_TABLE_SIZE   101
 
#define mupnp_ssdprequest_setmethod(ssdpReq, value)
 
#define mupnp_ssdprequest_getmethod(ssdpReq)
 
#define mupnp_ssdprequest_seturi(ssdpReq, value)
 
#define mupnp_ssdprequest_geturi(ssdpReq)
 
#define mupnp_ssdprequest_sethost(ssdpReq, addr, port)
 
#define mupnp_ssdprequest_gethost(ssdpReq)
 
#define mupnp_ssdprequest_setserver(ssdpReq, value)
 
#define mupnp_ssdprequest_getserver(ssdpReq)
 
#define mupnp_ssdprequest_setst(ssdpReq, value)
 
#define mupnp_ssdprequest_getst(ssdpReq)
 
#define mupnp_ssdprequest_setnt(ssdpReq, value)
 
#define mupnp_ssdprequest_getnt(ssdpReq)
 
#define mupnp_ssdprequest_setnts(ssdpReq, value)
 
#define mupnp_ssdprequest_getnts(ssdpReq)
 
#define mupnp_ssdprequest_setlocation(ssdpReq, value)
 
#define mupnp_ssdprequest_getlocation(ssdpReq)
 
#define mupnp_ssdprequest_setusn(ssdpReq, value)
 
#define mupnp_ssdprequest_getusn(ssdpReq)
 
#define mupnp_ssdprequest_setmx(ssdpReq, value)
 
#define mupnp_ssdprequest_getmx(ssdpReq)
 
#define mupnp_ssdprequest_setman(ssdpReq, value)
 
#define mupnp_ssdprequest_getman(ssdpReq)
 
#define mupnp_ssdprequest_setbootid(ssdpReq, value)
 
#define mupnp_ssdprequest_getbootid(ssdpReq)
 
#define mupnp_ssdprequest_print(ssdpReq)
 
#define mupnp_ssdpresponse_setst(ssdpRes, value)
 
#define mupnp_ssdpresponse_getst(ssdpRes)
 
#define mupnp_ssdpresponse_setext(ssdpRes)
 
#define mupnp_ssdpresponse_setserver(ssdpRes, value)
 
#define mupnp_ssdpresponse_setlocation(ssdpRes, value)
 
#define mupnp_ssdpresponse_getlocation(ssdpRes)
 
#define mupnp_ssdpresponse_setusn(ssdpRes, value)
 
#define mupnp_ssdpresponse_getusn(ssdpRes)
 
#define mupnp_ssdpresponse_setdate(ssdpRes, value)
 
#define mupnp_ssdpresponse_getdate(ssdpRes)
 
#define mupnp_ssdpresponse_setbootid(ssdpRes, value)
 
#define mupnp_ssdpresponse_getbootid(ssdpRes)
 
#define mupnp_ssdpresponse_print(ssdpReq)
 
#define mupnp_ssdp_socket_new()
 
#define mupnp_ssdp_socket_delete(socket)
 
#define mupnp_ssdp_socket_close(socket)
 

Typedefs

typedef mUpnpHttpResponse mUpnpSSDPResponse
 
typedef mUpnpHttpRequest mUpnpSSDPRequest
 
typedef mUpnpSocket mUpnpSSDPSocket
 

Functions

void mupnp_ssdp_setipv6address (const char *addr)
 
const char * mupnp_ssdp_getipv6address (void)
 
void mupnp_ssdp_setannouncecount (int count)
 
int mupnp_ssdp_getannouncecount (void)
 
int mupnp_ssdp_getleasetime (const char *cacheCont)
 
const char * mupnp_ssdp_gethostaddress (const char *ifAddr)
 
mUpnpSSDPRequestmupnp_ssdprequest_new (void)
 
void mupnp_ssdprequest_delete (mUpnpSSDPRequest *ssdpReq)
 
void mupnp_ssdprequest_setleasetime (mUpnpSSDPRequest *ssdpReq, mUpnpTime value)
 
mUpnpTime mupnp_ssdprequest_getleasetime (mUpnpSSDPRequest *ssdpReq)
 
char * mupnp_ssdprequest_tostring (mUpnpSSDPRequest *ssdpReq, mUpnpString *ssdpMsg)
 
mUpnpSSDPResponsemupnp_ssdpresponse_new (void)
 
void mupnp_ssdpresponse_delete (mUpnpSSDPResponse *ssdpRes)
 
void mupnp_ssdpresponse_setleasetime (mUpnpSSDPResponse *ssdpRes, mUpnpTime value)
 
int mupnp_ssdpresponse_getleasetime (mUpnpSSDPResponse *ssdpRes)
 
char * mupnp_ssdpresponse_tostring (mUpnpSSDPResponse *ssdpRes, mUpnpString *ssdpMsg)
 
bool mupnp_ssdp_socket_notifyfrom (mUpnpSSDPSocket *ssdpSock, mUpnpSSDPRequest *ssdpReq, const char *bindAddr)
 
bool mupnp_ssdp_socket_postresponse (mUpnpSSDPSocket *ssdpSock, mUpnpSSDPResponse *ssdpReq, const char *host, int port)
 

Macro Definition Documentation

◆ MUPNP_AUTO_IP_MASK

#define MUPNP_AUTO_IP_MASK   0xffff0000

◆ MUPNP_AUTO_IP_NET

#define MUPNP_AUTO_IP_NET   0xa9fe0000

◆ MUPNP_SSDP_ADDRESS

#define MUPNP_SSDP_ADDRESS   "239.255.255.250"

◆ MUPNP_SSDP_BOOTID_UPNP_ORG

#define MUPNP_SSDP_BOOTID_UPNP_ORG   "BOOTID.UPNP.ORG"

◆ MUPNP_SSDP_CALBACK

#define MUPNP_SSDP_CALBACK   "CALLBACK"

◆ MUPNP_SSDP_DEFAULT_ANNOUNCE_COUNT

#define MUPNP_SSDP_DEFAULT_ANNOUNCE_COUNT   3

◆ MUPNP_SSDP_DEFAULT_MSEARCH_MX

#define MUPNP_SSDP_DEFAULT_MSEARCH_MX   3

◆ MUPNP_SSDP_EXT

#define MUPNP_SSDP_EXT   "EXT"

◆ MUPNP_SSDP_FILTER_TABLE_SIZE

#define MUPNP_SSDP_FILTER_TABLE_SIZE   101

◆ MUPNP_SSDP_HEADER_LINE_MAXSIZE

#define MUPNP_SSDP_HEADER_LINE_MAXSIZE   128

◆ MUPNP_SSDP_IPV6_ADMINISTRATIVE_ADDRESS

#define MUPNP_SSDP_IPV6_ADMINISTRATIVE_ADDRESS   "FF04::C"

◆ MUPNP_SSDP_IPV6_GLOBAL_ADDRESS

#define MUPNP_SSDP_IPV6_GLOBAL_ADDRESS   "FF0E::C"

◆ MUPNP_SSDP_IPV6_IF_LOCAL_ADDRESS

#define MUPNP_SSDP_IPV6_IF_LOCAL_ADDRESS   "FF01::C"

◆ MUPNP_SSDP_IPV6_LINK_LOCAL_ADDRESS

#define MUPNP_SSDP_IPV6_LINK_LOCAL_ADDRESS   "FF02::C"

◆ MUPNP_SSDP_IPV6_SITE_LOCAL_ADDRESS

#define MUPNP_SSDP_IPV6_SITE_LOCAL_ADDRESS   "FF05::C"

◆ MUPNP_SSDP_IPV6_SUBNET_ADDRESS

#define MUPNP_SSDP_IPV6_SUBNET_ADDRESS   "FF03::C"

◆ MUPNP_SSDP_MAN

#define MUPNP_SSDP_MAN   "MAN"

◆ MUPNP_SSDP_MULTICAST_ADDRESS

#define MUPNP_SSDP_MULTICAST_ADDRESS   "239.255.255.250:1900"

◆ MUPNP_SSDP_MULTICAST_DEFAULT_TTL

#define MUPNP_SSDP_MULTICAST_DEFAULT_TTL   4

◆ MUPNP_SSDP_MX

#define MUPNP_SSDP_MX   "MX"

◆ MUPNP_SSDP_NT

#define MUPNP_SSDP_NT   "NT"

◆ MUPNP_SSDP_NTS

#define MUPNP_SSDP_NTS   "NTS"

◆ MUPNP_SSDP_NTS_ALIVE

#define MUPNP_SSDP_NTS_ALIVE   "ssdp:alive"

◆ MUPNP_SSDP_NTS_BYEBYE

#define MUPNP_SSDP_NTS_BYEBYE   "ssdp:byebye"

◆ MUPNP_SSDP_NTS_PROPCHANGE

#define MUPNP_SSDP_NTS_PROPCHANGE   "upnp:propchange"

◆ MUPNP_SSDP_PORT

#define MUPNP_SSDP_PORT   1900

◆ MUPNP_SSDP_SEQ

#define MUPNP_SSDP_SEQ   "SEQ"

◆ MUPNP_SSDP_SERVER

#define MUPNP_SSDP_SERVER   "SERVER"

◆ MUPNP_SSDP_SID

#define MUPNP_SSDP_SID   "SID"

◆ mupnp_ssdp_socket_close

#define mupnp_ssdp_socket_close ( socket)
Value:
bool mupnp_socket_close(mUpnpSocket *sock)
Definition socket.c:318

◆ mupnp_ssdp_socket_delete

#define mupnp_ssdp_socket_delete ( socket)
Value:
bool mupnp_socket_delete(mUpnpSocket *sock)
Definition socket.c:254

◆ mupnp_ssdp_socket_new

#define mupnp_ssdp_socket_new ( )
Value:
mUpnpSocket * mupnp_socket_new(int type)
Definition socket.c:209
#define MUPNP_NET_SOCKET_DGRAM
Definition socket.h:33

◆ MUPNP_SSDP_ST

#define MUPNP_SSDP_ST   "ST"

◆ MUPNP_SSDP_TIMEOUT

#define MUPNP_SSDP_TIMEOUT   "TIMEOUT"

◆ MUPNP_SSDP_USN

#define MUPNP_SSDP_USN   "USN"

◆ mupnp_ssdprequest_getbootid

#define mupnp_ssdprequest_getbootid ( ssdpReq)
Value:
int mupnp_http_packet_getheaderinteger(mUpnpHttpPacket *httpPkt, const char *name)
Definition http_packet.c:188
#define MUPNP_SSDP_BOOTID_UPNP_ORG
Definition ssdp.h:67
Definition http.h:178

◆ mupnp_ssdprequest_gethost

#define mupnp_ssdprequest_gethost ( ssdpReq)
Value:
#define mupnp_http_packet_gethost(httpPkt)
Definition http.h:323

◆ mupnp_ssdprequest_getlocation

#define mupnp_ssdprequest_getlocation ( ssdpReq)
Value:
#define MUPNP_HTTP_LOCATION
Definition http.h:85
const char * mupnp_http_packet_getheadervalue(mUpnpHttpPacket *httpPkt, const char *name)
Definition http_packet.c:179

◆ mupnp_ssdprequest_getman

#define mupnp_ssdprequest_getman ( ssdpReq)
Value:
#define MUPNP_SSDP_MAN
Definition ssdp.h:54

◆ mupnp_ssdprequest_getmethod

#define mupnp_ssdprequest_getmethod ( ssdpReq)
Value:
char * mupnp_http_request_getmethod(mUpnpHttpRequest *httpReq)
Definition http_request.c:182

◆ mupnp_ssdprequest_getmx

#define mupnp_ssdprequest_getmx ( ssdpReq)
Value:
#define MUPNP_SSDP_MX
Definition ssdp.h:53

◆ mupnp_ssdprequest_getnt

#define mupnp_ssdprequest_getnt ( ssdpReq)
Value:
#define MUPNP_SSDP_NT
Definition ssdp.h:55

◆ mupnp_ssdprequest_getnts

#define mupnp_ssdprequest_getnts ( ssdpReq)
Value:
#define MUPNP_SSDP_NTS
Definition ssdp.h:56

◆ mupnp_ssdprequest_getserver

#define mupnp_ssdprequest_getserver ( ssdpReq)
Value:
#define MUPNP_HTTP_SERVER
Definition http.h:86

◆ mupnp_ssdprequest_getst

#define mupnp_ssdprequest_getst ( ssdpReq)
Value:
#define MUPNP_SSDP_ST
Definition ssdp.h:52

◆ mupnp_ssdprequest_geturi

#define mupnp_ssdprequest_geturi ( ssdpReq)
Value:
char * mupnp_http_request_geturi(mUpnpHttpRequest *httpReq)
Definition http_request.c:220

◆ mupnp_ssdprequest_getusn

#define mupnp_ssdprequest_getusn ( ssdpReq)
Value:
#define MUPNP_SSDP_USN
Definition ssdp.h:60

◆ mupnp_ssdprequest_print

#define mupnp_ssdprequest_print ( ssdpReq)
Value:
void mupnp_http_request_print(mUpnpHttpRequest *httpReq)
Definition http_request.c:912

◆ mupnp_ssdprequest_setbootid

#define mupnp_ssdprequest_setbootid ( ssdpReq,
value )
Value:
void mupnp_http_packet_setheaderinteger(mUpnpHttpPacket *httpPkt, const char *name, int value)
Definition http_packet.c:119

◆ mupnp_ssdprequest_sethost

#define mupnp_ssdprequest_sethost ( ssdpReq,
addr,
port )
Value:
void mupnp_http_packet_sethost(mUpnpHttpPacket *httpPkt, const char *addr, int port)
Definition http_packet.c:256

◆ mupnp_ssdprequest_setlocation

#define mupnp_ssdprequest_setlocation ( ssdpReq,
value )
Value:
void mupnp_http_packet_setheadervalue(mUpnpHttpPacket *httpPkt, const char *name, const char *value)
Definition http_packet.c:106

◆ mupnp_ssdprequest_setman

#define mupnp_ssdprequest_setman ( ssdpReq,
value )

◆ mupnp_ssdprequest_setmethod

#define mupnp_ssdprequest_setmethod ( ssdpReq,
value )
Value:
void mupnp_http_request_setmethod(mUpnpHttpRequest *httpReq, const char *value)
Definition http_request.c:117

◆ mupnp_ssdprequest_setmx

#define mupnp_ssdprequest_setmx ( ssdpReq,
value )

◆ mupnp_ssdprequest_setnt

#define mupnp_ssdprequest_setnt ( ssdpReq,
value )

◆ mupnp_ssdprequest_setnts

#define mupnp_ssdprequest_setnts ( ssdpReq,
value )

◆ mupnp_ssdprequest_setserver

#define mupnp_ssdprequest_setserver ( ssdpReq,
value )

◆ mupnp_ssdprequest_setst

#define mupnp_ssdprequest_setst ( ssdpReq,
value )

◆ mupnp_ssdprequest_seturi

#define mupnp_ssdprequest_seturi ( ssdpReq,
value )
Value:
void mupnp_http_request_seturi(mUpnpHttpRequest *httpReq, const char *value)
Definition http_request.c:169

◆ mupnp_ssdprequest_setusn

#define mupnp_ssdprequest_setusn ( ssdpReq,
value )

◆ mupnp_ssdpresponse_getbootid

#define mupnp_ssdpresponse_getbootid ( ssdpRes)

◆ mupnp_ssdpresponse_getdate

#define mupnp_ssdpresponse_getdate ( ssdpRes)
Value:
#define MUPNP_HTTP_DATE
Definition http.h:74

◆ mupnp_ssdpresponse_getlocation

#define mupnp_ssdpresponse_getlocation ( ssdpRes)

◆ mupnp_ssdpresponse_getst

#define mupnp_ssdpresponse_getst ( ssdpRes)

◆ mupnp_ssdpresponse_getusn

#define mupnp_ssdpresponse_getusn ( ssdpRes)

◆ mupnp_ssdpresponse_print

#define mupnp_ssdpresponse_print ( ssdpReq)
Value:
void mupnp_http_response_print(mUpnpHttpResponse *httpRes)
Definition http_response.c:217

◆ mupnp_ssdpresponse_setbootid

#define mupnp_ssdpresponse_setbootid ( ssdpRes,
value )

◆ mupnp_ssdpresponse_setdate

#define mupnp_ssdpresponse_setdate ( ssdpRes,
value )

◆ mupnp_ssdpresponse_setext

#define mupnp_ssdpresponse_setext ( ssdpRes)
Value:
#define MUPNP_SSDP_EXT
Definition ssdp.h:61

◆ mupnp_ssdpresponse_setlocation

#define mupnp_ssdpresponse_setlocation ( ssdpRes,
value )

◆ mupnp_ssdpresponse_setserver

#define mupnp_ssdpresponse_setserver ( ssdpRes,
value )
Value:
#define MUPNP_SSDP_SERVER
Definition ssdp.h:66

◆ mupnp_ssdpresponse_setst

#define mupnp_ssdpresponse_setst ( ssdpRes,
value )

◆ mupnp_ssdpresponse_setusn

#define mupnp_ssdpresponse_setusn ( ssdpRes,
value )

Typedef Documentation

◆ mUpnpSSDPRequest

◆ mUpnpSSDPResponse

◆ mUpnpSSDPSocket

Function Documentation

◆ mupnp_ssdp_getannouncecount()

int mupnp_ssdp_getannouncecount ( void )

◆ mupnp_ssdp_gethostaddress()

const char * mupnp_ssdp_gethostaddress ( const char * ifAddr)

◆ mupnp_ssdp_getipv6address()

const char * mupnp_ssdp_getipv6address ( void )

◆ mupnp_ssdp_getleasetime()

int mupnp_ssdp_getleasetime ( const char * cacheCont)

◆ mupnp_ssdp_setannouncecount()

void mupnp_ssdp_setannouncecount ( int count)

◆ mupnp_ssdp_setipv6address()

void mupnp_ssdp_setipv6address ( const char * addr)

◆ mupnp_ssdp_socket_notifyfrom()

bool mupnp_ssdp_socket_notifyfrom ( mUpnpSSDPSocket * ssdpSock,
mUpnpSSDPRequest * ssdpReq,
const char * bindAddr )

◆ mupnp_ssdp_socket_postresponse()

bool mupnp_ssdp_socket_postresponse ( mUpnpSSDPSocket * ssdpSock,
mUpnpSSDPResponse * ssdpReq,
const char * host,
int port )

◆ mupnp_ssdprequest_delete()

void mupnp_ssdprequest_delete ( mUpnpSSDPRequest * ssdpReq)

◆ mupnp_ssdprequest_getleasetime()

mUpnpTime mupnp_ssdprequest_getleasetime ( mUpnpSSDPRequest * ssdpReq)

◆ mupnp_ssdprequest_new()

mUpnpSSDPRequest * mupnp_ssdprequest_new ( void )

◆ mupnp_ssdprequest_setleasetime()

void mupnp_ssdprequest_setleasetime ( mUpnpSSDPRequest * ssdpReq,
mUpnpTime value )

◆ mupnp_ssdprequest_tostring()

char * mupnp_ssdprequest_tostring ( mUpnpSSDPRequest * ssdpReq,
mUpnpString * ssdpMsg )

◆ mupnp_ssdpresponse_delete()

void mupnp_ssdpresponse_delete ( mUpnpSSDPResponse * ssdpRes)

◆ mupnp_ssdpresponse_getleasetime()

int mupnp_ssdpresponse_getleasetime ( mUpnpSSDPResponse * ssdpRes)

◆ mupnp_ssdpresponse_new()

mUpnpSSDPResponse * mupnp_ssdpresponse_new ( void )

◆ mupnp_ssdpresponse_setleasetime()

void mupnp_ssdpresponse_setleasetime ( mUpnpSSDPResponse * ssdpRes,
mUpnpTime value )

◆ mupnp_ssdpresponse_tostring()

char * mupnp_ssdpresponse_tostring ( mUpnpSSDPResponse * ssdpRes,
mUpnpString * ssdpMsg )