1MINIUPNPC(3)               Library Functions Manual               MINIUPNPC(3)
2
3
4

NAME

6       miniupnpc - UPnP client library
7

SYNOPSIS

DESCRIPTION

10       The  miniupnpc  library  implement  the UPnP protocol defined to dialog
11       with Internet Gateway Devices. It also has  the  ability  to  use  data
12       gathered  by minissdpd(1) about UPnP devices up on the network in order
13       to skip the long UPnP device discovery process.
14
15       At first, upnpDiscover(3) has to be used to discover UPnP  IGD  present
16       on  the  network.  Then  UPNP_GetValidIGD(3)  to  select the right one.
17       Alternatively, UPNP_GetIGDFromUrl(3) could be used to bypass  discovery
18       process  if  the  root  description  url of the device to use is known.
19       Then all the UPNP_* functions can be used, such as  UPNP_GetConnection‐
20       TypeInfo(3), UPNP_AddPortMapping(3), etc...
21

HEADER FILES

23       miniupnpc.h
24              That's  the  main header file for the miniupnpc library API.  It
25              contains all the functions and structures related to device dis‐
26              covery.
27
28       upnpcommands.h
29              This  header file contain the UPnP IGD methods that are accessi‐
30              ble through the miniupnpc API. The name of the C  functions  are
31              matching  the UPnP methods names. ie: GetGenericPortMappingEntry
32              is UPNP_GetGenericPortMappingEntry.
33

API FUNCTIONS

35       struct UPNPDev * upnpDiscover(int  delay,  const  char  *  multicastif,
36       const char * minissdpdsock, int localport, int ipv6, int * error);
37              execute  the  discovery  process.  delay (in millisecond) is the
38              maximum time for waiting any  device  response.   If  available,
39              device  list  will be obtained from MiniSSDPd.  Default path for
40              minissdpd socket will be used if minissdpdsock argument is NULL.
41              If  multicastif  is  not  NULL,  it  will be used instead of the
42              default multicast interface for sending SSDP  discover  packets.
43              If localport is set to UPNP_LOCAL_PORT_SAME(1) SSDP packets will
44              be sent from the source port 1900 (same as destination port), if
45              set  to  UPNP_LOCAL_PORT_ANY(0) system assign a source port, any
46              other value will be attempted as the source port.   If  ipv6  is
47              not 0, IPv6 is used instead of IPv4 for the discovery process.
48
49       void freeUPNPDevlist(struct UPNPDev * devlist);
50              free the list returned by upnpDiscover().
51
52       int  UPNP_GetValidIGD(struct UPNPDev * devlist, struct UPNPUrls * urls,
53       struct IGDdatas * data, char * lanaddr, int lanaddrlen);
54              browse the list of device returned  by  upnpDiscover(),  find  a
55              live  UPnP internet gateway device and fill structures passed as
56              arguments with data used for UPNP methods invokation.
57
58       int UPNP_GetIGDFromUrl(const char  *  rootdescurl,  struct  UPNPUrls  *
59       urls, struct IGDdatas * data, char * lanaddr, int lanaddrlen);
60              permit  to  bypass  the  upnpDiscover()  call  if  the  xml root
61              description URL of the  UPnP  IGD  is  known.   Fill  structures
62              passed as arguments with data used for UPNP methods invokation.
63
64       void GetUPNPUrls(struct UPNPUrls *, struct IGDdatas *, const char *);
65
66       void FreeUPNPUrls(struct UPNPUrls *);
67
68

SEE ALSO

70       minissdpd(1)
71

BUGS

73                                                                  MINIUPNPC(3)
Impressum