Skip to content

Commit

Permalink
fixed correct decoding of in and out
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcelCoding committed Feb 24, 2024
1 parent 246d46f commit e5ce030
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ async fn process_sflow(
.map(|seg| format!("{:02x}", seg))
.collect::<Vec<String>>()
.join(":")),
flow.output_if_idx,
flow.input_if_idx,
flow.output_if_idx,
bytes,
ether_type
);
Expand Down
2 changes: 1 addition & 1 deletion src/sflow/record.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand Down
6 changes: 2 additions & 4 deletions src/sflow/sample.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit e5ce030

Please sign in to comment.