actually implement port forwards

This commit is contained in:
lemonsh 2023-05-01 12:25:50 +02:00
parent 734cf7a2a8
commit 5e7a3adafa
3 changed files with 7 additions and 2 deletions

View File

@ -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;

View File

@ -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
}
} }

View File

@ -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>,
} }