Skip to content

Commit eb15888

Browse files
committed
Self-review
1 parent 2e7cf69 commit eb15888

File tree

13 files changed

+32
-34
lines changed

13 files changed

+32
-34
lines changed

lib/opte/src/engine/port/meta.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ impl ActionMeta {
100100
self.inner.get(key).map(|v| &**v)
101101
}
102102

103-
/// Get a reference to the value at a well known key key, or `None`
103+
/// Get a reference to the value at a well known key for `T`, or `None`
104104
/// if no such entry exists.
105105
pub fn get_typed<T: ActionMetaValue>(
106106
&self,

lib/oxide-vpc/src/api.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ pub struct AttachedSubnetConfig {
141141
pub is_external: bool,
142142
}
143143

144-
/// Configuration for an exceptions to source/destination address filtering.
144+
/// Configuration for an exception to source/destination address filtering.
145145
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
146146
pub struct TransitIpConfig {
147147
/// Allow inbound traffic with a destination IP in the target CIDR.
@@ -299,7 +299,7 @@ pub struct VpcCfg {
299299
/// sourced to a single IPv6 address.
300300
pub phys_ip: Ipv6Addr,
301301

302-
/// Configuration for DHCP responses created by OPTE
302+
/// Configuration for DHCP responses created by OPTE.
303303
pub dhcp: DhcpCfg,
304304
}
305305

lib/oxide-vpc/src/cfg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ pub struct VpcCfg {
108108
/// sourced to a single IPv6 address.
109109
pub phys_ip: Ipv6Addr,
110110

111-
/// Configuration for DHCP responses created by OPTE
111+
/// Configuration for DHCP responses created by OPTE.
112112
pub dhcp: DhcpCfg,
113113
}
114114

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use opte::engine::predicate::Predicate;
1616
use opte::engine::rule::Action;
1717
use opte::engine::rule::Rule;
1818

19-
pub(crate) fn setup(ctx: &mut BuildCtx) -> Result<(), OpteError> {
19+
pub(super) fn setup(ctx: &mut BuildCtx) -> Result<(), OpteError> {
2020
// ================================================================
2121
// Outbound ARP Request for Gateway, from Guest
2222
//

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use opte::engine::ip::v4::Ipv4Cidr;
1919
use opte::engine::rule::Action;
2020
use opte::engine::rule::Rule;
2121

22-
pub(crate) fn setup(
22+
pub(super) fn setup(
2323
ctx: &mut BuildCtx,
2424
ip_cfg: &Ipv4Cfg,
2525
) -> Result<(), OpteError> {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use opte::engine::dhcpv6::LeasedAddress;
1515
use opte::engine::rule::Action;
1616
use opte::engine::rule::Rule;
1717

18-
pub(crate) fn setup(ctx: &mut BuildCtx) -> Result<(), OpteError> {
18+
pub(super) fn setup(ctx: &mut BuildCtx) -> Result<(), OpteError> {
1919
let ip_cfg = match ctx.cfg.ipv6_cfg() {
2020
None => return Ok(()),
2121
Some(ip_cfg) => ip_cfg,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use opte::engine::icmp::v4::IcmpEchoReply;
1414
use opte::engine::rule::Action;
1515
use opte::engine::rule::Rule;
1616

17-
pub(crate) fn setup(
17+
pub(super) fn setup(
1818
ctx: &mut BuildCtx,
1919
ip_cfg: &Ipv4Cfg,
2020
) -> Result<(), OpteError> {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ use smoltcp::wire::Icmpv6Message;
3232
// - Respond to NDP Neighbor Solicitations from the guest to the gateway. This
3333
// includes solicitations unicast to the gateway, and also delivered to the
3434
// solicited-node multicast group.
35-
pub(crate) fn setup(
35+
pub(super) fn setup(
3636
ctx: &mut BuildCtx,
3737
ip_cfg: &Ipv6Cfg,
3838
) -> Result<(), OpteError> {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ use super::VpcNetwork;
112112

113113
pub const NAME: &str = "gateway";
114114

115-
pub(crate) struct BuildCtx<'a> {
115+
struct BuildCtx<'a> {
116116
in_rules: Vec<Rule<Finalized>>,
117117
out_rules: Vec<Rule<Finalized>>,
118118
cfg: &'a VpcCfg,
@@ -397,7 +397,7 @@ fn setup_ipv6(ctx: &mut BuildCtx, ip_cfg: &Ipv6Cfg) -> Result<(), OpteError> {
397397
///
398398
/// This allows the outbound side of firewall layer to filter based on
399399
/// VPC.
400-
pub(crate) struct VpcMeta {
400+
struct VpcMeta {
401401
vpc_mappings: Arc<VpcMappings>,
402402
}
403403

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use opte::api::NoResp;
1818
use opte::engine::port::Port;
1919
use opte::engine::rule::Finalized;
2020

21-
pub(crate) fn make_holepunch_rule(
21+
pub(super) fn make_holepunch_rule(
2222
guest_mac: MacAddr,
2323
gateway_mac: MacAddr,
2424
dest: IpCidr,
@@ -50,8 +50,7 @@ pub(crate) fn make_holepunch_rule(
5050
cidr_in.finalize()
5151
}
5252
Direction::Out => {
53-
let vpc_meta = vpc_meta.clone();
54-
let mut cidr_out = Rule::new(1000, Action::Meta(vpc_meta));
53+
let mut cidr_out = Rule::new(1000, Action::Meta(vpc_meta.clone()));
5554
cidr_out.add_predicate(Predicate::InnerEtherSrc(vec![
5655
EtherAddrMatch::Exact(guest_mac),
5756
]));

0 commit comments

Comments
 (0)