miniupnpc.3 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. \" $Id: miniupnpc.3,v 1.2 2008/10/07 13:51:55 nanard Exp $
  2. .TH miniupnpc 3
  3. .SH NAME
  4. miniupnpc \- UPnP client library
  5. .SH SYNOPSIS
  6. .SH DESCRIPTION
  7. The miniupnpc library implement the UPnP protocol defined
  8. to dialog with Internet Gateway Devices. It also has
  9. the ability to use data gathered by minissdpd(1) about
  10. UPnP devices up on the network in order to skip the
  11. long UPnP device discovery process.
  12. .PP
  13. At first, upnpDiscover(3) has to be used to discover UPnP IGD present
  14. on the network. Then UPNP_GetValidIGD(3) to select the right one.
  15. Alternatively, UPNP_GetIGDFromUrl(3) could be used to bypass discovery
  16. process if the root description url of the device to use is known.
  17. Then all the UPNP_* functions can be used, such as
  18. UPNP_GetConnectionTypeInfo(3), UPNP_AddPortMapping(3), etc...
  19. .SH "HEADER FILES"
  20. .IP miniupnpc.h
  21. That's the main header file for the miniupnpc library API.
  22. It contains all the functions and structures related to device discovery.
  23. .IP upnpcommands.h
  24. This header file contain the UPnP IGD methods that are accessible
  25. through the miniupnpc API. The name of the C functions are matching
  26. the UPnP methods names. ie: GetGenericPortMappingEntry is
  27. UPNP_GetGenericPortMappingEntry.
  28. .SH "API FUNCTIONS"
  29. .IP "struct UPNPDev * upnpDiscover(int delay, const char * multicastif, const char * minissdpdsock, int sameport);"
  30. execute the discovery process.
  31. delay (in millisecond) is the maximum time for waiting any device response.
  32. If available, device list will be obtained from MiniSSDPd.
  33. Default path for minissdpd socket will be used if minissdpdsock argument is NULL.
  34. If multicastif is not NULL, it will be used instead of the default multicast interface for sending SSDP discover packets.
  35. If sameport is not null, SSDP packets will be sent from the source port 1900 (same as destination port) otherwise system assign a source port.
  36. .IP "void freeUPNPDevlist(struct UPNPDev * devlist);"
  37. free the list returned by upnpDiscover().
  38. .IP "int UPNP_GetValidIGD(struct UPNPDev * devlist, struct UPNPUrls * urls, struct IGDdatas * data, char * lanaddr, int lanaddrlen);"
  39. browse the list of device returned by upnpDiscover(), find
  40. a live UPnP internet gateway device and fill structures passed as arguments
  41. with data used for UPNP methods invokation.
  42. .IP "int UPNP_GetIGDFromUrl(const char * rootdescurl, struct UPNPUrls * urls, struct IGDdatas * data, char * lanaddr, int lanaddrlen);"
  43. permit to bypass the upnpDiscover() call if the xml root description
  44. URL of the UPnP IGD is known.
  45. Fill structures passed as arguments
  46. with data used for UPNP methods invokation.
  47. .IP "void GetUPNPUrls(struct UPNPUrls *, struct IGDdatas *, const char *);"
  48. .IP "void FreeUPNPUrls(struct UPNPUrls *);"
  49. .SH "SEE ALSO"
  50. minissdpd(1)
  51. .SH BUGS