SkuldNorniern / fluere

Fluere is a powerful and versatile tool designed for network monitoring and analysis. It is capable of capturing network packets in pcap format and converting them into NetFlow data, providing a comprehensive view of network traffic. It also Provides Terminal User Interface.
Apache License 2.0
37 stars 3 forks source link

Optimize and modularize code in net module #48

Closed sweep-ai[bot] closed 1 year ago

sweep-ai[bot] commented 1 year ago

Description

This PR aims to optimize and modularize the code in the net module of the Fluere project. The current implementation is functional but can be improved in terms of readability, maintainability, and performance. The changes made in this PR include:

Summary of Changes

Fixes #47.


To checkout this PR branch, run the following command in your terminal:

git checkout {pull_request.branch_name}

🎉 Latest improvements to Sweep:


💡 To get Sweep to edit this pull request, you can:

sweep-ai[bot] commented 1 year ago

GitHub actions yielded the following error.

The command that failed is cd fluereflow; cargo build --release --verbose. Here are the relevant lines from the logs:

error[E0560]: struct `FluereRecord` has no field named `source`
fluereflow/src/types/fluereflow.rs:112:13
error[E0560]: struct `FluereRecord` has no field named `destination`
fluereflow/src/types/fluereflow.rs:113:13
error[E0560]: struct `FluereRecord` has no field named `d_pkts`
fluereflow/src/types/fluereflow.rs:114:13
error[E0560]: struct `FluereRecord` has no field named `d_octets`
fluereflow/src/types/fluereflow.rs:115:13
error[E0560]: struct `FluereRecord` has no field named `first`
fluereflow/src/types/fluereflow.rs:116:13
error[E0560]: struct `FluereRecord` has no field named `last`
fluereflow/src/types/fluereflow.rs:117:13
error[E0560]: struct `FluereRecord` has no field named `src_port`
fluereflow/src/types/fluereflow.rs:118:13
error[E0560]: struct `FluereRecord` has no field named `dst_port`
fluereflow/src/types/fluereflow.rs:119:13
error[E0560]: struct `FluereRecord` has no field named `min_pkt`
fluereflow/src/types/fluereflow.rs:120:13
error[E0560]: struct `FluereRecord` has no field named `max_pkt`
fluereflow/src/types/fluereflow.rs:121:13
error[E0560]: struct `FluereRecord` has no field named `min_ttl`
fluereflow/src/types/fluereflow.rs:122:13
error[E0560]: struct `FluereRecord` has no field named `max_ttl`
fluereflow/src/types/fluereflow.rs:123:13
error[E0560]: struct `FluereRecord` has no field named `in_pkts`
fluereflow/src/types/fluereflow.rs:124:13
error[E0560]: struct `FluereRecord` has no field named `out_pkts`
fluereflow/src/types/fluereflow.rs:125:13
error[E0560]: struct `FluereRecord` has no field named `in_bytes`
fluereflow/src/types/fluereflow.rs:126:13
error[E0560]: struct `FluereRecord` has no field named `out_bytes`
fluereflow/src/types/fluereflow.rs:127:13
error[E0560]: struct `FluereRecord` has no field named `fin_cnt`
fluereflow/src/types/fluereflow.rs:128:13
error[E0560]: struct `FluereRecord` has no field named `syn_cnt`
fluereflow/src/types/fluereflow.rs:129:13
error[E0560]: struct `FluereRecord` has no field named `rst_cnt`
fluereflow/src/types/fluereflow.rs:130:13
error[E0560]: struct `FluereRecord` has no field named `psh_cnt`
fluereflow/src/types/fluereflow.rs:131:13
error[E0560]: struct `FluereRecord` has no field named `ack_cnt`
fluereflow/src/types/fluereflow.rs:132:13
error[E0560]: struct `FluereRecord` has no field named `urg_cnt`
fluereflow/src/types/fluereflow.rs:133:13
error[E0560]: struct `FluereRecord` has no field named `ece_cnt`
fluereflow/src/types/fluereflow.rs:134:13
error[E0560]: struct `FluereRecord` has no field named `cwr_cnt`
fluereflow/src/types/fluereflow.rs:135:13
error[E0560]: struct `FluereRecord` has no field named `ns_cnt`
fluereflow/src/types/fluereflow.rs:136:13
error[E0560]: struct `FluereRecord` has no field named `prot`
fluereflow/src/types/fluereflow.rs:137:13
error[E0560]: struct `FluereRecord` has no field named `tos`
fluereflow/src/types/fluereflow.rs:138:13
error[E0609]: no field `d_pkts` on type `&mut FluereRecord`
fluereflow/src/types/fluereflow.rs:142:14
error[E0609]: no field `d_octets` on type `&mut FluereRecord`
fluereflow/src/types/fluereflow.rs:145:14
error[E0609]: no field `first` on type `&mut FluereRecord`
fluereflow/src/types/fluereflow.rs:148:14
error[E0609]: no field `last` on type `&mut FluereRecord`
fluereflow/src/types/fluereflow.rs:151:14
error[E0609]: no field `in_pkts` on type `&mut FluereRecord`
fluereflow/src/types/fluereflow.rs:154:14
error[E0609]: no field `out_pkts` on type `&mut FluereRecord`
fluereflow/src/types/fluereflow.rs:157:14
error[E0609]: no field `in_bytes` on type `&mut FluereRecord`
fluereflow/src/types/fluereflow.rs:160:14

There are a lot of errors. This is likely due to a small parsing issue or a missing import with the files changed in the PR.

This is likely a linting or type-checking issue with the source code. Update the code changed by the PR. Don't modify the existing tests.

I'm getting the same errors 3 times in a row, so I will stop working on fixing this PR.