RetroArch
Macros | Functions
minissdpc.c File Reference
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sys/types.h>
#include <strings.h>
#include <unistd.h>
#include <sys/socket.h>
#include <sys/param.h>
#include <sys/time.h>
#include <sys/un.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <net/if.h>
#include "minissdpc.h"
#include "miniupnpc.h"
#include "receivedata.h"
#include <net/net_compat.h>
#include "codelength.h"
Include dependency graph for minissdpc.c:

Macros

#define closesocket   close
 
#define HAS_IP_MREQN
 
#define READ_BYTE_BUFFER(c)
 
#define MIN(a, b)   (((a) < (b)) ? (a) : (b))
 
#define READ_COPY_BUFFER(dst, len)
 
#define READ_DISCARD_BUFFER(len)
 
#define SSDP_PORT   1900
 
#define XSTR(s)   MINISSDPC_STR(s)
 
#define MINISSDPC_STR(s)   #s
 
#define UPNP_MCAST_ADDR   "239.255.255.250"
 
#define UPNP_MCAST_LL_ADDR   "FF02::C" /* link-local */
 
#define UPNP_MCAST_SL_ADDR   "FF05::C" /* site-local */
 

Functions

struct UPNPDevgetDevicesFromMiniSSDPD (const char *devtype, const char *socketpath, int *error)
 
int connectToMiniSSDPD (const char *socketpath)
 
int disconnectFromMiniSSDPD (int s)
 
int requestDevicesFromMiniSSDPD (int s, const char *devtype)
 
struct UPNPDevreceiveDevicesFromMiniSSDPD (int s, int *error)
 
static void parseMSEARCHReply (const char *reply, int size, const char **location, int *locationsize, const char **st, int *stsize, const char **usn, int *usnsize)
 
struct UPNPDevssdpDiscoverDevices (const char *const deviceTypes[], int delay, const char *multicastif, int localport, int ipv6, unsigned char ttl, int *error, int searchalltypes)
 

Macro Definition Documentation

◆ closesocket

#define closesocket   close

◆ HAS_IP_MREQN

#define HAS_IP_MREQN

◆ MIN

#define MIN (   a,
  b 
)    (((a) < (b)) ? (a) : (b))

◆ MINISSDPC_STR

#define MINISSDPC_STR (   s)    #s

◆ READ_BYTE_BUFFER

#define READ_BYTE_BUFFER (   c)
Value:
if((int)bufferindex >= n) { \
n = read(s, buffer, sizeof(buffer)); \
if(n<=0) break; \
bufferindex = 0; \
} \
c = buffer[bufferindex++];
GLdouble s
Definition: glext.h:6390
static bool read(ElfFile &file, const std::string &filename)
Definition: main.cpp:146
const GLubyte * c
Definition: glext.h:9812
Definition: video4linux2.c:51
GLdouble n
Definition: glext.h:8396

◆ READ_COPY_BUFFER

#define READ_COPY_BUFFER (   dst,
  len 
)
Value:
for(l = len, p = (unsigned char *)dst; l > 0; ) { \
unsigned int lcopy; \
if((int)bufferindex >= n) { \
n = read(s, buffer, sizeof(buffer)); \
if(n<=0) break; \
bufferindex = 0; \
} \
lcopy = (unsigned int)MIN(l, (n - bufferindex)); \
memcpy(p, buffer + bufferindex, lcopy); \
l -= lcopy; \
p += lcopy; \
bufferindex += lcopy; \
}
#define MIN(a, b)
Definition: minissdpc.c:137
GLenum GLsizei len
Definition: glext.h:7389
GLdouble s
Definition: glext.h:6390
static bool read(ElfFile &file, const std::string &filename)
Definition: main.cpp:146
bool l
Definition: connect_wiiupro.c:37
GLfloat GLfloat p
Definition: glext.h:9809
GLenum GLenum dst
Definition: glext.h:6980
Definition: video4linux2.c:51
GLdouble n
Definition: glext.h:8396
void * memcpy(void *dst, const void *src, size_t len)
Definition: string.c:26

◆ READ_DISCARD_BUFFER

#define READ_DISCARD_BUFFER (   len)
Value:
for(l = len; l > 0; ) { \
unsigned int lcopy; \
if(bufferindex >= n) { \
n = read(s, buffer, sizeof(buffer)); \
if(n<=0) break; \
bufferindex = 0; \
} \
lcopy = MIN(l, (n - bufferindex)); \
l -= lcopy; \
bufferindex += lcopy; \
}
#define MIN(a, b)
Definition: minissdpc.c:137
GLenum GLsizei len
Definition: glext.h:7389
GLdouble s
Definition: glext.h:6390
static bool read(ElfFile &file, const std::string &filename)
Definition: main.cpp:146
bool l
Definition: connect_wiiupro.c:37
Definition: video4linux2.c:51
GLdouble n
Definition: glext.h:8396

◆ SSDP_PORT

#define SSDP_PORT   1900

◆ UPNP_MCAST_ADDR

#define UPNP_MCAST_ADDR   "239.255.255.250"

◆ UPNP_MCAST_LL_ADDR

#define UPNP_MCAST_LL_ADDR   "FF02::C" /* link-local */

◆ UPNP_MCAST_SL_ADDR

#define UPNP_MCAST_SL_ADDR   "FF05::C" /* site-local */

◆ XSTR

#define XSTR (   s)    MINISSDPC_STR(s)

Function Documentation

◆ connectToMiniSSDPD()

int connectToMiniSSDPD ( const char *  socketpath)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ disconnectFromMiniSSDPD()

int disconnectFromMiniSSDPD ( int  s)
Here is the caller graph for this function:

◆ getDevicesFromMiniSSDPD()

struct UPNPDev* getDevicesFromMiniSSDPD ( const char *  devtype,
const char *  socketpath,
int *  error 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseMSEARCHReply()

static void parseMSEARCHReply ( const char *  reply,
int  size,
const char **  location,
int *  locationsize,
const char **  st,
int *  stsize,
const char **  usn,
int *  usnsize 
)
static
Here is the caller graph for this function:

◆ receiveDevicesFromMiniSSDPD()

struct UPNPDev* receiveDevicesFromMiniSSDPD ( int  s,
int *  error 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ requestDevicesFromMiniSSDPD()

int requestDevicesFromMiniSSDPD ( int  s,
const char *  devtype 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ssdpDiscoverDevices()

struct UPNPDev* ssdpDiscoverDevices ( const char *const  deviceTypes[],
int  delay,
const char *  multicastif,
int  localport,
int  ipv6,
unsigned char  ttl,
int *  error,
int  searchalltypes 
)
Here is the call graph for this function:
Here is the caller graph for this function: