diff --git a/src/main.rs b/src/main.rs index 38989bb..3202297 100644 --- a/src/main.rs +++ b/src/main.rs @@ -196,8 +196,8 @@ async fn process_sflow( .map(|seg| format!("{:02x}", seg)) .collect::>() .join(":")), - flow.output_if_idx, flow.input_if_idx, + flow.output_if_idx, bytes, ether_type ); diff --git a/src/sflow/record.rs b/src/sflow/record.rs index 5fcb6aa..307175a 100644 --- a/src/sflow/record.rs +++ b/src/sflow/record.rs @@ -228,8 +228,8 @@ struct RawPacketHeaderDataRaw { #[derive(BinRead)] pub(crate) struct EthernetHeader { - pub(crate) src: [u8; 6], pub(crate) dst: [u8; 6], + pub(crate) src: [u8; 6], pub(crate) ether_type: u16, } diff --git a/src/sflow/sample.rs b/src/sflow/sample.rs index c263122..109d89f 100644 --- a/src/sflow/sample.rs +++ b/src/sflow/sample.rs @@ -106,11 +106,9 @@ impl BinRead for FlowData { sample_rate: raw.sample_rate, sample_pool: raw.sample_pool, drops: raw.drops, - input_if_idx: raw.input_if_idx, - output_if_idx: raw.output_if_idx, - // input_if_idx: raw.input_if_idx & 0x3FFFFFFF, + input_if_idx: raw.input_if_idx & 0x3fffffff, // input_if_format: raw.input_if_idx >> 30, - // output_if_idx: raw.output_if_idx & 0x3FFFFFFF, + output_if_idx: raw.output_if_idx & 0x3fffffff, // output_if_format: raw.output_if_idx >> 30, // direction: match source_id_idx { // idx if idx == raw.output_if_idx => Direction::Egress,