summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDavid Lönnhager <david.l@mullvad.net>2022-01-18 17:25:50 +0100
committerDavid Lönnhager <david.l@mullvad.net>2022-03-14 12:08:49 +0100
commit4147be42fb83495e2035d232b2a4a36d926c1a9d (patch)
tree3fe2422083817be31f8eb67d3c5084a778adbbd1
parent47585eb5b3507c65408718088c698511fbc7d389 (diff)
downloadmullvadvpn-4147be42fb83495e2035d232b2a4a36d926c1a9d.tar.xz
mullvadvpn-4147be42fb83495e2035d232b2a4a36d926c1a9d.zip
Display ports in the CLI
-rw-r--r--mullvad-cli/src/cmds/account.rs6
-rw-r--r--mullvad-types/src/device.rs7
2 files changed, 13 insertions, 0 deletions
diff --git a/mullvad-cli/src/cmds/account.rs b/mullvad-cli/src/cmds/account.rs
index 35b151a668..09c268f3c0 100644
--- a/mullvad-cli/src/cmds/account.rs
+++ b/mullvad-cli/src/cmds/account.rs
@@ -150,6 +150,9 @@ impl Account {
if verbose {
println!("Device id : {}", inner_device.id);
println!("Device pubkey : {}", inner_device.pubkey);
+ for port in inner_device.ports {
+ println!("Device port : {}", port);
+ }
}
let expiry = rpc
.get_account_data(device.account_token)
@@ -185,6 +188,9 @@ impl Account {
println!("Name : {}", device.pretty_name());
println!("Id : {}", device.id);
println!("Public key: {}", device.pubkey);
+ for port in device.ports {
+ println!("Port : {}", port);
+ }
} else {
println!("{}", device.pretty_name());
}
diff --git a/mullvad-types/src/device.rs b/mullvad-types/src/device.rs
index f27a6516de..05df853e0c 100644
--- a/mullvad-types/src/device.rs
+++ b/mullvad-types/src/device.rs
@@ -2,6 +2,7 @@ use crate::{account::AccountToken, wireguard};
#[cfg(target_os = "android")]
use jnix::IntoJava;
use serde::{Deserialize, Serialize};
+use std::fmt;
use talpid_types::net::wireguard::PublicKey;
/// UUID for a device.
@@ -50,6 +51,12 @@ pub struct DevicePort {
pub id: String,
}
+impl fmt::Display for DevicePort {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ write!(f, "{}", self.id)
+ }
+}
+
/// A complete device configuration.
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq)]
pub struct DeviceData {