#[cfg(any(test, feature = "test-helpers"))]
pub mod parse;
#[cfg(not(any(test, feature = "test-helpers")))]
pub(crate) mod parse;
pub mod five_tuple;
pub mod ip_pair;
pub mod mac_pair;
pub mod encap_gre;
pub mod encap_gtp;
pub mod encap_mpls;
pub mod encap_vlan;
pub mod encap_vxlan;
pub mod auto_detect;
pub mod flow_label;
pub mod tagged;
pub use auto_detect::{AutoDetectEncap, AutoEncapVariants};
pub(crate) fn rebase<K>(
e: crate::Extracted<K>,
outer: &[u8],
inner: &[u8],
synthetic_prefix: usize,
) -> crate::Extracted<K> {
match parse::byte_offset(outer, inner) {
Some(at) => e.rebased(at as isize - synthetic_prefix as isize),
None => {
let mut e = e;
if let Some(t) = e.tcp.as_mut() {
t.payload_len = 0;
}
e.l4_meta = None;
e
}
}
}
pub use encap_gre::InnerGre;
pub use encap_gtp::InnerGtpU;
pub use encap_mpls::StripMpls;
pub use encap_vlan::StripVlan;
pub use encap_vxlan::InnerVxlan;
pub use five_tuple::{FiveTuple, FiveTupleKey};
pub use flow_label::{FlowLabel, FlowLabelKey};
pub use ip_pair::{IpPair, IpPairKey};
pub use mac_pair::{MacPair, MacPairKey};
pub use tagged::{Tagged, TaggedKey, Tagger};