Skip to content

Commit

Permalink
Add total L2 length field to connection log
Browse files Browse the repository at this point in the history
  • Loading branch information
jknpark committed Jun 3, 2024
1 parent 9747b03 commit 37facba
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ file is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and
this project adheres to [Semantic
Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Changed

- Modified connection log structure to include total L2 frame length of a session.

## [0.17.0] - 2024-05-16

### Added
Expand Down
8 changes: 6 additions & 2 deletions src/ingest/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ pub struct Conn {
pub resp_bytes: u64,
pub orig_pkts: u64,
pub resp_pkts: u64,
pub orig_l2_bytes: u64,
pub resp_l2_bytes: u64,
}

impl Display for Conn {
fn fmt(&self, f: &mut Formatter) -> std::fmt::Result {
write!(
f,
"{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}",
"{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}\t{}",
self.orig_addr,
self.orig_port,
self.resp_addr,
Expand All @@ -42,7 +44,9 @@ impl Display for Conn {
self.orig_bytes,
self.resp_bytes,
self.orig_pkts,
self.resp_pkts
self.resp_pkts,
self.orig_l2_bytes,
self.resp_l2_bytes
)
}
}
Expand Down

0 comments on commit 37facba

Please sign in to comment.