Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions flow-filter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ dpdk = { workspace = true, features = ["test"] }
lpm = { workspace = true, features = ["testing"] }
# Enable generated header stacks for classifier tests.
net = { workspace = true, features = ["builder", "bolero"] }
tracing-test = { workspace = true }
Comment thread
qmonnet marked this conversation as resolved.
20 changes: 19 additions & 1 deletion flow-filter/src/context/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//! Tables retain typed rules for backend-independent display. Each field's type controls its
//! formatting, keeping values coupled to their key fields.

use super::tables::FlowFilterContext;
use super::tables::{FlowFilterContext, GateVni, SourceGate};

impl crate::NatRequirement {
fn label(self) -> &'static str {
Expand All @@ -24,6 +24,24 @@ impl std::fmt::Display for crate::NatRequirement {
}
}

impl std::fmt::Display for GateVni {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self.0 {
Some(vni) => write!(f, "{vni}"),
None => f.write_str("-"),
}
}
}

impl std::fmt::Display for SourceGate {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
SourceGate::Ungated => f.write_str("-"),
SourceGate::PortFwdReply => f.write_str("pfwd"),
}
}
}

// -------------------------------------------------------------------------------------------------
// Rendering: one section per table, each rule on a line, in match order.

Expand Down
283 changes: 160 additions & 123 deletions flow-filter/src/context/fuzz.rs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion flow-filter/src/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ mod tests;

pub use tables::FlowFilterContext;
use tables::PRODUCTION_BACKEND;
pub(crate) use tables::{LookupInput, LookupResult};
pub(crate) use tables::{LookupInput, LookupResult, SourceGate};

impl TryFrom<&ValidatedOverlay> for FlowFilterContext {
type Error = ConfigError;
Expand Down
Loading
Loading