Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tcp connection state string #91

Merged
merged 2 commits into from
Jan 9, 2024
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 CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Versioning](https://semver.org/spec/v2.0.0.html).
### Changed

- Modified event structure to store NTLM error information.
- Modified connection event structure to report connection state.

## [0.15.2] - 2023-11-16

Expand Down
1 change: 1 addition & 0 deletions src/ingest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ mod tests {
resp_addr: "192.168.4.76".parse::<IpAddr>().unwrap(),
resp_port: 80,
proto: 6,
conn_state: String::new(),
duration: 1000,
service: "-".to_string(),
orig_bytes: 77,
Expand Down
4 changes: 3 additions & 1 deletion src/ingest/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ pub struct Conn {
pub resp_addr: IpAddr,
pub resp_port: u16,
pub proto: u8,
pub conn_state: String,
pub duration: i64,
pub service: String,
pub orig_bytes: u64,
Expand All @@ -29,12 +30,13 @@ 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{}",
self.orig_addr,
self.orig_port,
self.resp_addr,
self.resp_port,
self.proto,
as_str_or_default(&self.conn_state),
convert_time_format(self.duration),
self.service,
self.orig_bytes,
Expand Down
2 changes: 2 additions & 0 deletions src/publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,7 @@ mod tests {
resp_addr: "192.168.4.76".parse::<IpAddr>().unwrap(),
resp_port: 80,
proto: 6,
conn_state: String::new(),
duration: 1000,
service: "-".to_string(),
orig_bytes: 77,
Expand Down Expand Up @@ -695,6 +696,7 @@ mod tests {
resp_addr: "192.168.4.76".parse::<IpAddr>().unwrap(),
resp_port: 80,
proto: 6,
conn_state: String::new(),
duration: 1000,
service: "-".to_string(),
orig_bytes: 77,
Expand Down