Nim binding for [libplum](https://github.com/paullouisageneau/libplum), a portable C library for NAT port mapping via PCP, NAT-PMP, and UPnP-IGD.
libplum tries each protocol in order (PCP → NAT-PMP → UPnP-IGD) and falls back automatically. If the local address is already public, it uses it directly.
See [examples/port_mapping.nim](examples/port_mapping.nim) for a complete example that pauses between add and remove so you can verify the mapping on your router:
```bash
nim c -r examples/port_mapping.nim
```
### Timeouts
Pass timeout options to `init` to control how long discovery and mapping wait:
Integration tests run miniupnpd inside a Docker/Podman container and exercise the PCP, NAT-PMP, and UPnP-IGD flows.
The container needs `NET_ADMIN` to create a dummy network interface (`plum-wan`) with a public IP (1.2.3.4).
This is required because miniupnpd [disables port forwarding when the external interface has a private/RFC1918 address](https://github.com/miniupnp/miniupnp/blob/d66872e34d9ff83a07f8b71371b13419b2089953/miniupnpd/miniupnpd.c#L1160-L1193), which would be the case for any container network interface.
Tests run inside the container (not with `--network host`) so the dummy interface and route changes stay isolated from the host network.
Each protocol is tested under both `orc` and `refc` memory managers.
miniupnpd is built with a stub firewall backend (`tests/miniupnpd_stub_rdr.c`) so it accepts mapping requests without requiring iptables or nftables in the container.