actually implement port forwards
This commit is contained in:
parent
734cf7a2a8
commit
5e7a3adafa
@ -5,3 +5,4 @@ pub const LOGIN: u32 = 15;
|
|||||||
// Getters
|
// Getters
|
||||||
|
|
||||||
pub const LAN_TABLE: u32 = 123;
|
pub const LAN_TABLE: u32 = 123;
|
||||||
|
pub const FORWARDS: u32 = 121;
|
@ -173,7 +173,12 @@ impl ConnectBox {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Get all devices connected to the router.
|
/// Get all devices connected to the router.
|
||||||
pub async fn get_devices(&self) -> Result<models::LanUserTable> {
|
pub async fn devices(&self) -> Result<models::LanUserTable> {
|
||||||
self.xml_getter(functions::LAN_TABLE).await
|
self.xml_getter(functions::LAN_TABLE).await
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Get all port forwarding entries.
|
||||||
|
pub async fn port_forwards(&self) -> Result<models::PortForwards> {
|
||||||
|
self.xml_getter(functions::FORWARDS).await
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,6 @@ pub struct PortForwards {
|
|||||||
#[serde(rename = "subnetmask")]
|
#[serde(rename = "subnetmask")]
|
||||||
pub subnet_mask: Ipv4Addr,
|
pub subnet_mask: Ipv4Addr,
|
||||||
#[serde(rename = "instance")]
|
#[serde(rename = "instance")]
|
||||||
#[serde(deserialize_with = "unwrap_xml_list")]
|
|
||||||
pub entries: Vec<PortForwardEntry>,
|
pub entries: Vec<PortForwardEntry>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user