diff --git a/src/args.rs b/src/args.rs index d3d5bfa..c1d8dcc 100644 --- a/src/args.rs +++ b/src/args.rs @@ -65,6 +65,8 @@ pub enum GetCommands { WanIpaddr, /// Fetch PPP status. PppStatus, + /// Fetch LAN IP address. + LanIpaddr, /// Fetch firmware version. CrVersion, /// Fetch battery percentage. diff --git a/src/main.rs b/src/main.rs index 277d76a..3fb44b6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -31,6 +31,7 @@ async fn main() -> EyreResult<()> { GetCommands::LteEnodebId => router.show::().await?, GetCommands::LteTac => router.show::().await?, GetCommands::NvArfcn => router.show::().await?, + GetCommands::LanIpaddr => router.show::().await?, }, TopLevelCommands::Post { command } => match command { PostCommands::Reboot => router.reboot().await.print_table(), diff --git a/src/proc_get.rs b/src/proc_get.rs index 46786b4..9bd6d58 100644 --- a/src/proc_get.rs +++ b/src/proc_get.rs @@ -326,6 +326,22 @@ impl ProcGet for PppStatus { } } +#[derive(Debug, Deserialize)] +pub struct LanIpaddr { + pub lan_ipaddr: BoxStr, +} + +impl ProcGet for LanIpaddr { + const CMD: &str = "lan_ipaddr"; + type Params = (); + + fn print_table(&self) { + let mut table = create_table(); + table.set_header(["LAN IP"]).add_row([&self.lan_ipaddr]); + println!("{table}"); + } +} + #[derive(Debug, Deserialize)] pub struct CrVersion { pub cr_version: BoxStr,