This is a simple library that communicates with an UPNP enabled gateway device (a router). Contributions and feedback are welcome.
At the moment, you can search for the gateway, request the gateway's external address and, add/remove port mappings. See the examples/
folder for a demo.
Contributions are welcome! This is pretty delicate to test, please submit an issue if you have trouble using this.
```rust
// Bind the UDP socket to all interfaces
fn searchgateway() -> Result
// Gateway struct
pub struct Gateway {
pub addr: SocketAddrV4,
pub controlurl: String,
}
// Gateway methods
impl Gateway {
// Get the gateway's external ip address
pub fn getexternalip(&self) -> Result
MIT