RetroArch
Macros | Functions
miniupnpc.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <sys/select.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/param.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <net/if.h>
#include <poll.h>
#include <strings.h>
#include <errno.h>
#include "miniupnpc.h"
#include "minissdpc.h"
#include "miniwget.h"
#include "minisoap.h"
#include "minixml.h"
#include "upnpcommands.h"
#include "connecthostport.h"
Include dependency graph for miniupnpc.c:

Macros

#define closesocket   close
 
#define COMPARE(str, cstr)   (0==memcmp(str, cstr, sizeof(cstr) - 1))
 
#define MAXHOSTNAMELEN   64
 
#define SOAPPREFIX   "s"
 
#define SERVICEPREFIX   "u"
 
#define SERVICEPREFIX2   'u'
 

Functions

static int is_rfc1918addr (const char *addr)
 
MINIUPNP_LIBSPEC void parserootdesc (const char *buffer, int bufsize, struct IGDdatas *data)
 
char * simpleUPnPcommand2 (int s, const char *url, const char *service, const char *action, struct UPNParg *args, int *bufsize, const char *httpversion)
 
char * simpleUPnPcommand (int s, const char *url, const char *service, const char *action, struct UPNParg *args, int *bufsize)
 
MINIUPNP_LIBSPEC struct UPNPDevupnpDiscoverDevices (const char *const deviceTypes[], int delay, const char *multicastif, const char *minissdpdsock, int localport, int ipv6, unsigned char ttl, int *error, int searchalltypes)
 
MINIUPNP_LIBSPEC struct UPNPDevupnpDiscover (int delay, const char *multicastif, const char *minissdpdsock, int localport, int ipv6, unsigned char ttl, int *error)
 
MINIUPNP_LIBSPEC struct UPNPDevupnpDiscoverAll (int delay, const char *multicastif, const char *minissdpdsock, int localport, int ipv6, unsigned char ttl, int *error)
 
MINIUPNP_LIBSPEC struct UPNPDevupnpDiscoverDevice (const char *device, int delay, const char *multicastif, const char *minissdpdsock, int localport, int ipv6, unsigned char ttl, int *error)
 
static char * build_absolute_url (const char *baseurl, const char *descURL, const char *url, unsigned int scope_id)
 
MINIUPNP_LIBSPEC void GetUPNPUrls (struct UPNPUrls *urls, struct IGDdatas *data, const char *descURL, unsigned int scope_id)
 
MINIUPNP_LIBSPEC void FreeUPNPUrls (struct UPNPUrls *urls)
 
int UPNPIGD_IsConnected (struct UPNPUrls *urls, struct IGDdatas *data)
 
MINIUPNP_LIBSPEC int UPNP_GetValidIGD (struct UPNPDev *devlist, struct UPNPUrls *urls, struct IGDdatas *data, char *lanaddr, int lanaddrlen)
 
int UPNP_GetIGDFromUrl (const char *rootdescurl, struct UPNPUrls *urls, struct IGDdatas *data, char *lanaddr, int lanaddrlen)
 

Macro Definition Documentation

◆ closesocket

#define closesocket   close

◆ COMPARE

#define COMPARE (   str,
  cstr 
)    (0==memcmp(str, cstr, sizeof(cstr) - 1))

◆ MAXHOSTNAMELEN

#define MAXHOSTNAMELEN   64

◆ SERVICEPREFIX

#define SERVICEPREFIX   "u"

◆ SERVICEPREFIX2

#define SERVICEPREFIX2   'u'

◆ SOAPPREFIX

#define SOAPPREFIX   "s"

Function Documentation

◆ build_absolute_url()

static char* build_absolute_url ( const char *  baseurl,
const char *  descURL,
const char *  url,
unsigned int  scope_id 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FreeUPNPUrls()

MINIUPNP_LIBSPEC void FreeUPNPUrls ( struct UPNPUrls urls)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetUPNPUrls()

MINIUPNP_LIBSPEC void GetUPNPUrls ( struct UPNPUrls urls,
struct IGDdatas data,
const char *  descURL,
unsigned int  scope_id 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_rfc1918addr()

static int is_rfc1918addr ( const char *  addr)
static
Here is the caller graph for this function:

◆ parserootdesc()

MINIUPNP_LIBSPEC void parserootdesc ( const char *  buffer,
int  bufsize,
struct IGDdatas data 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ simpleUPnPcommand()

char* simpleUPnPcommand ( int  s,
const char *  url,
const char *  service,
const char *  action,
struct UPNParg args,
int *  bufsize 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ simpleUPnPcommand2()

char* simpleUPnPcommand2 ( int  s,
const char *  url,
const char *  service,
const char *  action,
struct UPNParg args,
int *  bufsize,
const char *  httpversion 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ UPNP_GetIGDFromUrl()

int UPNP_GetIGDFromUrl ( const char *  rootdescurl,
struct UPNPUrls urls,
struct IGDdatas data,
char *  lanaddr,
int  lanaddrlen 
)
Here is the call graph for this function:

◆ UPNP_GetValidIGD()

MINIUPNP_LIBSPEC int UPNP_GetValidIGD ( struct UPNPDev devlist,
struct UPNPUrls urls,
struct IGDdatas data,
char *  lanaddr,
int  lanaddrlen 
)
Here is the call graph for this function:

◆ upnpDiscover()

MINIUPNP_LIBSPEC struct UPNPDev* upnpDiscover ( int  delay,
const char *  multicastif,
const char *  minissdpdsock,
int  localport,
int  ipv6,
unsigned char  ttl,
int *  error 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ upnpDiscoverAll()

MINIUPNP_LIBSPEC struct UPNPDev* upnpDiscoverAll ( int  delay,
const char *  multicastif,
const char *  minissdpdsock,
int  localport,
int  ipv6,
unsigned char  ttl,
int *  error 
)
Here is the call graph for this function:

◆ upnpDiscoverDevice()

MINIUPNP_LIBSPEC struct UPNPDev* upnpDiscoverDevice ( const char *  device,
int  delay,
const char *  multicastif,
const char *  minissdpdsock,
int  localport,
int  ipv6,
unsigned char  ttl,
int *  error 
)
Here is the call graph for this function:

◆ upnpDiscoverDevices()

MINIUPNP_LIBSPEC struct UPNPDev* upnpDiscoverDevices ( const char *const  deviceTypes[],
int  delay,
const char *  multicastif,
const char *  minissdpdsock,
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:

◆ UPNPIGD_IsConnected()

int UPNPIGD_IsConnected ( struct UPNPUrls urls,
struct IGDdatas data 
)
Here is the call graph for this function:
Here is the caller graph for this function: