MINIUPNPC(3)
π MINIUPNPC π
okay bestie, welcome to the miniupnpc page β it's the UPnP client library and it's lowkey iconic. Manual section 3, library functions energy. let's get into it π«Ά
β¨ SYNOPSIS β¨
ngl this section is literally empty in the original. no synopsis line, no nothing. she said "I contain multitudes" and then said nothing at all π so we move.
π¦ DESCRIPTION π¦
so the miniupnpc library implements the UPnP protocol β the one defined to dialog with Internet Gateway Devices. and the way that it ALSO has the ability to use data gathered by minissdpd(1) about UPnP devices up on the network?? to skip the long UPnP device discovery process?? yeah. shortcut queen. periodt. β¨
here's the flow, bestie, step by step:
- At first,
upnpDiscover(3)has to be used to discover the UPnP IGD present on the network. - Then
UPNP_GetValidIGD(3)to select the right one. - Alternatively,
UPNP_GetIGDFromUrl(3)could be used to bypass the discovery process if the root description url of the device to use is known. (iykyk β if you already know the url, you don't gotta go looking π) - Then all the
UPNP_*functions can be used, such asUPNP_GetConnectionTypeInfo(3),UPNP_AddPortMapping(3), etc...
like. the pipeline is pipeline-ing. slay. π
π HEADER FILES π
miniupnpc.hβ that's the main header file for theminiupnpclibrary API. It contains all the functions and structures related to device discovery. main character header fr fr.upnpcommands.hβ this header file contains the UPnP IGD methods that are accessible through theminiupnpcAPI. The name of the C functions are matching the UPnP methods names, ie:GetGenericPortMappingEntryisUPNP_GetGenericPortMappingEntry. so if you ever forget the name, just slapUPNP_on the front and vibe check it πΈ
π API FUNCTIONS π
struct UPNPDev * upnpDiscover(int delay, const char * multicastif, const char * minissdpdsock, int localport, int ipv6, int * error);
execute the discovery process. okay so:
delay(in millisecond) is the maximum time for waiting any device response. patience is a virtue bestie β³- If available, device list will be obtained from MiniSSDPd.
- Default path for minissdpd socket will be used if
minissdpdsockargument isNULL. - If
multicastifis notNULL, it will be used instead of the default multicast interface for sending SSDP discover packets. - If
localportis set toUPNP_LOCAL_PORT_SAME(1)SSDP packets will be sent from the source port1900(same as destination port), if set toUPNP_LOCAL_PORT_ANY(0)system assign a source port, any other value will be attempted as the source port. - If
ipv6is not0, IPv6 is used instead of IPv4 for the discovery process.
struct UPNPDev * upnpDiscover(int delay, const char * multicastif, const char * minissdpdsock, int localport, int ipv6, int * error);
void freeUPNPDevlist(struct UPNPDev * devlist);
free the list returned by upnpDiscover(). clean up after yourself, bestie, it's giving responsibility π§Ή
void freeUPNPDevlist(struct UPNPDev * devlist);
int UPNP_GetValidIGD(struct UPNPDev * devlist, struct UPNPUrls * urls, struct IGDdatas * data, char * lanaddr, int lanaddrlen, char * wanaddr, int wanaddrlen);
browse the list of device returned by upnpDiscover(), find a live UPnP internet gateway device and fill structures passed as arguments with data used for UPNP methods invocation. it's the vibe check that says "yeah this one's alive, use her" β
int UPNP_GetValidIGD(struct UPNPDev * devlist, struct UPNPUrls * urls, struct IGDdatas * data, char * lanaddr, int lanaddrlen, char * wanaddr, int wanaddrlen);
int UPNP_GetIGDFromUrl(const char * rootdescurl, struct UPNPUrls * urls, struct IGDdatas * data, char * lanaddr, int lanaddrlen);
permit one to bypass the upnpDiscover() call if the xml root description URL of the UPnP IGD is known. Fill structures passed as arguments with data used for UPNP methods invocation. skipping the line and still getting in?? that's the dream π₯
int UPNP_GetIGDFromUrl(const char * rootdescurl, struct UPNPUrls * urls, struct IGDdatas * data, char * lanaddr, int lanaddrlen);
void GetUPNPUrls(struct UPNPUrls *, struct IGDdatas *, const char *);
void GetUPNPUrls(struct UPNPUrls *, struct IGDdatas *, const char *);
void FreeUPNPUrls(struct UPNPUrls *);
void FreeUPNPUrls(struct UPNPUrls *);
π SEE ALSO π
go read that one too bestie, it's the whole reason we can skip the discovery grind π«Ά
π BUGS π
literally nothing listed here. no bugs were reported. flawless behavior. we love to see it πβ¨
and that's the whole page bestie!! every flag, every argument, every function, nothing skipped, no cap. go forth and UPnP π
sign-off szn π this lil masterpiece came out of the Library Functions Manual as MINIUPNPC(3) on both ends β same name top and bottom, symmetrical queen π β and it's filed under that same MINIUPNPC(3) source/version-and-date footer vibe. mwah. π
πΈ
π¦ where this page comes from
- alpine 3.24: miniupnpc-doc 2.3.3-r2 Β· BSD-3-Clause
- arch rolling: miniupnpc 2.3.3-3 Β· BSD-3-Clause
- debian trixie: libminiupnpc-dev 2.2.8-2+b2 Β· BSD-3-Clause
- epel 10: miniupnpc-devel 2.2.8-1.el10_0 Β· LicenseRef-Callaway-BSD
- fedora 43: miniupnpc-devel 2.3.3-3.fc43 Β· LicenseRef-Callaway-BSD
- fedora 43: miniupnpc-devel 2.3.3-3.fc43 Β· LicenseRef-Callaway-BSD
- fedora 44: miniupnpc-devel 2.3.3-4.fc44 Β· LicenseRef-Callaway-BSD
- fedora 44: miniupnpc-devel 2.3.3-4.fc44 Β· LicenseRef-Callaway-BSD
- nixos 26.05: miniupnpc 2.3.3
- nixpkgs unstable: miniupnpc 2.3.3
- ubuntu questing: libminiupnpc-dev 2.2.8-2build2
- ubuntu resolute: libminiupnpc-dev 2.3.3-2build1 Β· BSD-3-Clause
- ubuntu stonking: libminiupnpc-dev 2.3.3-2build1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms