mirror of
https://github.com/GyulyVGC/sniffnet.git
synced 2025-12-23 22:29:01 -05:00
Merge branch 'main' into traffic-preview
This commit is contained in:
2
.github/workflows/crates.yml
vendored
2
.github/workflows/crates.yml
vendored
@@ -7,7 +7,7 @@ jobs:
|
||||
crates:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: Publish to crates.io
|
||||
|
||||
2
.github/workflows/docker.yml
vendored
2
.github/workflows/docker.yml
vendored
@@ -9,7 +9,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Extract version from Cargo.toml
|
||||
id: cargo-version
|
||||
|
||||
12
.github/workflows/package.yml
vendored
12
.github/workflows/package.yml
vendored
@@ -41,7 +41,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Install Linux dependencies
|
||||
if: matrix.os == 'ubuntu'
|
||||
@@ -130,7 +130,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Install dependencies
|
||||
run: apt-get update -y && apt-get install -y curl build-essential
|
||||
@@ -183,7 +183,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Install dependencies
|
||||
run: apt-get update -y && apt-get install -y git build-essential graphicsmagick-imagemagick-compat wget file desktop-file-utils libfuse2
|
||||
@@ -235,7 +235,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Install dependencies
|
||||
run: dnf update -y && dnf install -y @development-tools patchelf
|
||||
@@ -282,7 +282,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Install Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
@@ -348,7 +348,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Install dependencies
|
||||
shell: powershell
|
||||
|
||||
2
.github/workflows/rust.yml
vendored
2
.github/workflows/rust.yml
vendored
@@ -32,7 +32,7 @@ jobs:
|
||||
- os: windows
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
components: rustfmt, clippy
|
||||
|
||||
424
Cargo.lock
generated
424
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
10
Cargo.toml
10
Cargo.toml
@@ -37,13 +37,13 @@ strip = true
|
||||
#═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
||||
|
||||
[dependencies]
|
||||
pcap = "2.3.0"
|
||||
pcap = "2.4.0"
|
||||
etherparse = "0.19.0"
|
||||
chrono = { version = "0.4.42", default-features = false, features = ["clock"] }
|
||||
plotters = { version = "0.3.7", default-features = false, features = ["area_series", "line_series"] }
|
||||
iced = { version = "0.13.1", features = ["tokio", "svg", "advanced", "lazy", "image"] }
|
||||
plotters-iced = "0.11.0"
|
||||
maxminddb = "0.26.0"
|
||||
maxminddb = "0.27.0"
|
||||
confy = "2.0.0"
|
||||
serde = { version = "1.0.228", default-features = false, features = ["derive"] }
|
||||
serde_json = { version = "1.0.145", features = ["preserve_order"] }
|
||||
@@ -51,11 +51,11 @@ rodio = { version = "0.21.1", default-features = false, features = ["mp3", "play
|
||||
dns-lookup = "3.0.1"
|
||||
toml = "0.9.8"
|
||||
ctrlc = { version = "3.5.1", features = ["termination"] }
|
||||
rfd = "0.15.4"
|
||||
rfd = "0.16.0"
|
||||
phf = "0.13.1"
|
||||
phf_shared = "0.13.1"
|
||||
splines = "5.0.0"
|
||||
clap = { version = "4.5.51", features = ["derive"] }
|
||||
clap = { version = "4.5.53", features = ["derive"] }
|
||||
tokio = { version = "1.48.0", features = ["macros"] }
|
||||
async-channel = "2.5.0"
|
||||
semver = "1.0.27"
|
||||
@@ -81,7 +81,7 @@ serial_test = { version = "3.2.0", default-features = false }
|
||||
[build-dependencies]
|
||||
phf_codegen = "0.13.1"
|
||||
phf_shared = "0.13.1"
|
||||
rustrict = { version = "0.7.36", default-features = false, features = ["censor"] }
|
||||
rustrict = { version = "0.7.37", default-features = false, features = ["censor"] }
|
||||
|
||||
[target."cfg(windows)".build-dependencies]
|
||||
winres = "0.1.12"
|
||||
|
||||
@@ -59,6 +59,9 @@ ## _Support Sniffnet's development_ 💖
|
||||
|
||||
## Download
|
||||
|
||||
<picture><img height="28px" alt="" title="Downloads count" src="https://raw.githubusercontent.com/GyulyVGC/GyulyVGC.github.io/master/assets/img/downloads_badge.svg"/></picture>
|
||||
<a href="https://github.com/GyulyVGC/sniffnet/releases/latest"><img height="28px" alt="" title="Latest version" src="https://img.shields.io/github/v/release/gyulyvgc/sniffnet?color=blue&label=version&logo=github&style=for-the-badge"/></a>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 29 KiB |
@@ -265,6 +265,7 @@ fn window_subscription() -> Subscription<Message> {
|
||||
})
|
||||
}
|
||||
|
||||
#[allow(clippy::too_many_lines)]
|
||||
pub fn update(&mut self, message: Message) -> Task<Message> {
|
||||
self.dots_pulse.1 = (self.dots_pulse.1 + 1) % 3;
|
||||
match message {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#[allow(clippy::module_name_repetitions)]
|
||||
pub fn get_asn(address: &IpAddr, asn_db_reader: &MmdbReader) -> Asn {
|
||||
if let Ok(Some(res)) = asn_db_reader.lookup::<MmdbAsnEntry>(*address) {
|
||||
if let Some(res) = asn_db_reader.lookup::<MmdbAsnEntry>(*address) {
|
||||
return res.get_asn();
|
||||
}
|
||||
Asn::default()
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#[allow(clippy::module_name_repetitions)]
|
||||
pub fn get_country(address: &IpAddr, country_db_reader: &MmdbReader) -> Country {
|
||||
if let Ok(Some(res)) = country_db_reader.lookup::<MmdbCountryEntry>(*address) {
|
||||
if let Some(res) = country_db_reader.lookup::<MmdbCountryEntry>(*address) {
|
||||
return res.get_country();
|
||||
}
|
||||
Country::ZZ // unknown
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
use crate::location;
|
||||
use crate::utils::error_logger::{ErrorLogger, Location};
|
||||
use maxminddb::{MaxMindDbError, Reader};
|
||||
use maxminddb::Reader;
|
||||
use serde::Deserialize;
|
||||
|
||||
#[derive(Clone)]
|
||||
@@ -32,14 +32,11 @@ pub fn from(mmdb_path: &String, default_mmdb: &'static [u8]) -> MmdbReader {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn lookup<'a, T: Deserialize<'a>>(
|
||||
&'a self,
|
||||
ip: IpAddr,
|
||||
) -> Result<Option<T>, MaxMindDbError> {
|
||||
pub fn lookup<'a, T: Deserialize<'a>>(&'a self, ip: IpAddr) -> Option<T> {
|
||||
match self {
|
||||
MmdbReader::Default(reader) => reader.lookup(ip),
|
||||
MmdbReader::Custom(reader) => reader.lookup(ip),
|
||||
MmdbReader::Empty => Ok(None),
|
||||
MmdbReader::Default(reader) => reader.lookup(ip).and_then(|lr| lr.decode()).ok()?,
|
||||
MmdbReader::Custom(reader) => reader.lookup(ip).and_then(|lr| lr.decode()).ok()?,
|
||||
MmdbReader::Empty => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
use tokio::sync::broadcast::Receiver;
|
||||
|
||||
/// The calling thread enters a loop in which it waits for network packets
|
||||
#[allow(clippy::too_many_lines)]
|
||||
pub fn parse_packets(
|
||||
cap_id: usize,
|
||||
mut cs: CaptureSource,
|
||||
|
||||
@@ -14,8 +14,10 @@ fn log_err(self, location: Location) -> Result<T, E> {
|
||||
let line = location.line;
|
||||
eprintln!("Sniffnet error at [{file}:{line}]: {e}");
|
||||
// in debug mode, panic on error
|
||||
const {
|
||||
assert!(!cfg!(debug_assertions));
|
||||
}
|
||||
}
|
||||
|
||||
self
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user