diff --git a/common/types/src/gateway.rs b/common/types/src/gateway.rs index 750871e881..90d012a5ff 100644 --- a/common/types/src/gateway.rs +++ b/common/types/src/gateway.rs @@ -77,7 +77,7 @@ impl GatewayBond { } } -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] pub struct GatewayNodeDetailsResponse { pub identity_key: String, pub sphinx_key: String, @@ -88,6 +88,7 @@ pub struct GatewayNodeDetailsResponse { pub data_store: String, pub network_requester: Option, + pub ip_packet_router: Option, } impl fmt::Display for GatewayNodeDetailsResponse { @@ -98,7 +99,7 @@ impl fmt::Display for GatewayNodeDetailsResponse { writeln!(f, "bind address: {}", self.bind_address)?; writeln!( f, - "mix Port: {}, clients port: {}", + "mix port: {}, clients port: {}", self.mix_port, self.clients_port )?; @@ -107,11 +108,15 @@ impl fmt::Display for GatewayNodeDetailsResponse { if let Some(nr) = &self.network_requester { nr.fmt(f)?; } + + if let Some(ipr) = &self.ip_packet_router { + ipr.fmt(f)?; + } Ok(()) } } -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] pub struct GatewayNetworkRequesterDetails { pub enabled: bool, @@ -149,7 +154,7 @@ impl fmt::Display for GatewayNetworkRequesterDetails { } } -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] pub struct GatewayIpPacketRouterDetails { pub enabled: bool, @@ -164,7 +169,7 @@ pub struct GatewayIpPacketRouterDetails { impl fmt::Display for GatewayIpPacketRouterDetails { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - writeln!(f, "IP packet router:")?; + writeln!(f, "ip packet router:")?; writeln!(f, "\tenabled: {}", self.enabled)?; writeln!(f, "\tconfig path: {}", self.config_path)?; diff --git a/gateway/src/node/helpers.rs b/gateway/src/node/helpers.rs index abeb50d009..b6765cc7bb 100644 --- a/gateway/src/node/helpers.rs +++ b/gateway/src/node/helpers.rs @@ -8,7 +8,9 @@ use nym_crypto::asymmetric::{encryption, identity}; use nym_pemstore::traits::{PemStorableKey, PemStorableKeyPair}; use nym_pemstore::KeyPairPath; use nym_sphinx::addressing::clients::Recipient; -use nym_types::gateway::{GatewayNetworkRequesterDetails, GatewayNodeDetailsResponse}; +use nym_types::gateway::{ + GatewayIpPacketRouterDetails, GatewayNetworkRequesterDetails, GatewayNodeDetailsResponse, +}; use std::path::Path; fn display_maybe_path>(path: Option

) -> String { @@ -71,6 +73,40 @@ pub(crate) fn node_details(config: &Config) -> Result Result