actually implement port forwards
This commit is contained in:
		| @@ -5,3 +5,4 @@ pub const LOGIN: u32 = 15; | ||||
| // Getters | ||||
|  | ||||
| pub const LAN_TABLE: u32 = 123; | ||||
| pub const FORWARDS: u32 = 121; | ||||
| @@ -173,7 +173,12 @@ impl ConnectBox { | ||||
|     } | ||||
|  | ||||
|     /// 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 | ||||
|     } | ||||
|  | ||||
|     /// 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")] | ||||
|     pub subnet_mask: Ipv4Addr, | ||||
|     #[serde(rename = "instance")] | ||||
|     #[serde(deserialize_with = "unwrap_xml_list")] | ||||
|     pub entries: Vec<PortForwardEntry>, | ||||
| } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user