Skip to content

Commit 319c4be

Browse files
committed
Style.
1 parent aec629d commit 319c4be

File tree

7 files changed

+27
-13
lines changed

7 files changed

+27
-13
lines changed

bin/opteadm/src/bin/opteadm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ enum Command {
283283
/// The OPTE port to read...
284284
#[arg(short)]
285285
port: String,
286-
}
286+
},
287287
}
288288

289289
#[derive(Debug, Parser)]
@@ -870,7 +870,7 @@ fn main() -> anyhow::Result<()> {
870870

871871
// XXX TEMP
872872
Command::DumpFlowStats { port } => {
873-
let DumpFlowStatsResp{ data } = hdl.dump_flowstats(&port)?;
873+
let DumpFlowStatsResp { data } = hdl.dump_flowstats(&port)?;
874874
println!("{data}");
875875
}
876876
}

lib/opte-ioctl/src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,10 @@ impl OpteHdl {
386386
}
387387

388388
/// TEMP METHOD
389-
pub fn dump_flowstats(&self, port_name: &str) -> Result<DumpFlowStatsResp, Error> {
389+
pub fn dump_flowstats(
390+
&self,
391+
port_name: &str,
392+
) -> Result<DumpFlowStatsResp, Error> {
390393
let cmd = OpteCmd::DumpFlowStats;
391394
run_cmd_ioctl(
392395
self.device.as_raw_fd(),

lib/oxide-vpc/src/api/stat.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ pub static NAT_VALID_IGW_V4: Uuid =
3030
pub static NAT_VALID_IGW_V6: Uuid =
3131
Uuid::from_fields(0x01de_f00d, 0x7777, 0x0003, &3u64.to_be_bytes());
3232
pub static NAT_NONE: Uuid =
33-
Uuid::from_fields(0x01de_f00d, 0x7777, 0x0003, &255u64.to_be_bytes());
33+
Uuid::from_fields(0x01de_f00d, 0x7777, 0x0003, &255u64.to_be_bytes());

lib/oxide-vpc/src/engine/gateway/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
4343
use crate::api::DhcpCfg;
4444
use crate::api::MacAddr;
45+
use crate::api::stat::*;
4546
use crate::cfg::Ipv4Cfg;
4647
use crate::cfg::Ipv6Cfg;
4748
use crate::cfg::VpcCfg;
@@ -77,7 +78,6 @@ use opte::engine::rule::MetaAction;
7778
use opte::engine::rule::ModMetaResult;
7879
use opte::engine::rule::Rule;
7980
use opte::engine::rule::StaticAction;
80-
use crate::api::stat::*;
8181

8282
pub mod arp;
8383
pub mod dhcp;

lib/oxide-vpc/src/engine/nat.rs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use super::router::RouterTargetClass;
1010
use super::router::RouterTargetInternal;
1111
use crate::api::ExternalIpCfg;
1212
use crate::api::SetExternalIpsReq;
13+
use crate::api::stat::*;
1314
use crate::cfg::IpCfg;
1415
use crate::cfg::Ipv4Cfg;
1516
use crate::cfg::Ipv6Cfg;
@@ -47,7 +48,6 @@ use opte::engine::rule::Rule;
4748
use opte::engine::snat::ConcreteIpAddr;
4849
use opte::engine::snat::SNat;
4950
use uuid::Uuid;
50-
use crate::api::stat::*;
5151

5252
pub const NAT_LAYER_NAME: &str = "nat";
5353
const FLOATING_ONE_TO_ONE_NAT_PRIORITY: u16 = 5;
@@ -291,8 +291,11 @@ fn setup_ipv4_nat(
291291
let snat = Arc::new(snat);
292292

293293
for igw_id in igw_matches {
294-
let mut rule =
295-
Rule::new_with_id(SNAT_PRIORITY, Action::Stateful(snat.clone()), Some(NAT_SNAT_V4));
294+
let mut rule = Rule::new_with_id(
295+
SNAT_PRIORITY,
296+
Action::Stateful(snat.clone()),
297+
Some(NAT_SNAT_V4),
298+
);
296299

297300
rule.add_predicate(Predicate::InnerEtherType(vec![
298301
EtherTypeMatch::Exact(ETHER_TYPE_IPV4),
@@ -440,8 +443,11 @@ fn setup_ipv6_nat(
440443
let snat = Arc::new(snat);
441444

442445
for igw_id in igw_matches {
443-
let mut rule =
444-
Rule::new_with_id(SNAT_PRIORITY, Action::Stateful(snat.clone()), Some(NAT_SNAT_V6));
446+
let mut rule = Rule::new_with_id(
447+
SNAT_PRIORITY,
448+
Action::Stateful(snat.clone()),
449+
Some(NAT_SNAT_V6),
450+
);
445451

446452
rule.add_predicate(Predicate::InnerEtherType(vec![
447453
EtherTypeMatch::Exact(ETHER_TYPE_IPV6),

lib/oxide-vpc/src/engine/router.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ use super::firewall as fw;
1313
use crate::api::DelRouterEntryResp;
1414
use crate::api::RouterClass;
1515
use crate::api::RouterTarget;
16+
use crate::api::stat::*;
1617
use crate::cfg::VpcCfg;
1718
use alloc::string::String;
1819
use alloc::string::ToString;
@@ -48,7 +49,6 @@ use opte::engine::rule::MetaAction;
4849
use opte::engine::rule::ModMetaResult;
4950
use opte::engine::rule::Rule;
5051
use uuid::Uuid;
51-
use crate::api::stat::*;
5252

5353
pub const ROUTER_LAYER_NAME: &str = "router";
5454

xde/src/xde.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -700,11 +700,16 @@ unsafe extern "C" fn xde_ioc_opte_cmd(karg: *mut c_void, mode: c_int) -> c_int {
700700
}
701701

702702
#[unsafe(no_mangle)]
703-
fn flow_stats_hdlr(env: &mut IoctlEnvelope) -> Result<oxide_vpc::api::DumpFlowStatsResp, OpteError> {
703+
fn flow_stats_hdlr(
704+
env: &mut IoctlEnvelope,
705+
) -> Result<oxide_vpc::api::DumpFlowStatsResp, OpteError> {
704706
let req: oxide_vpc::api::DumpUftReq = env.copy_in_req()?;
705707
let devs = xde_devs().read();
706708
match devs.get_by_name(&req.port_name) {
707-
Some(dev) => dev.port.dump_flow_stats().map(|data| oxide_vpc::api::DumpFlowStatsResp {data}),
709+
Some(dev) => dev
710+
.port
711+
.dump_flow_stats()
712+
.map(|data| oxide_vpc::api::DumpFlowStatsResp { data }),
708713
None => Err(OpteError::PortNotFound(req.port_name)),
709714
}
710715
}

0 commit comments

Comments
 (0)