mirror of
https://github.com/GyulyVGC/sniffnet.git
synced 2025-12-23 22:29:01 -05:00
@@ -2,7 +2,7 @@ # Changelog
|
||||
|
||||
All Sniffnet releases with the relative changes are documented in this file.
|
||||
|
||||
## [UNRELEASED]
|
||||
## [1.4.2] - 2025-11-04
|
||||
- Send remote notifications via webhook ([#991](https://github.com/GyulyVGC/sniffnet/pull/991) — fixes [#841](https://github.com/GyulyVGC/sniffnet/issues/841))
|
||||
- Pause and resume packet captures ([#992](https://github.com/GyulyVGC/sniffnet/pull/992) — fixes [#551](https://github.com/GyulyVGC/sniffnet/issues/551))
|
||||
- Added Czech translation 🇨🇿 ([#960](https://github.com/GyulyVGC/sniffnet/pull/960))
|
||||
@@ -11,6 +11,7 @@ ## [UNRELEASED]
|
||||
- Updated some of the existing translations to v1.4:
|
||||
- Spanish ([#955](https://github.com/GyulyVGC/sniffnet/pull/955))
|
||||
- Vietnamese ([#982](https://github.com/GyulyVGC/sniffnet/pull/982))
|
||||
- Fix data representation not being saved as a configuration
|
||||
- Fix AppImage error with `libpcap` dependency ([#971](https://github.com/GyulyVGC/sniffnet/pull/971))
|
||||
- Fix Sniffnet wrapper script on macOS to use a relative path to the executable ([#948](https://github.com/GyulyVGC/sniffnet/pull/948) — fixes [#898](https://github.com/GyulyVGC/sniffnet/issues/898))
|
||||
- Remove pre-uninstall script from Linux RPM package (fixes [#989](https://github.com/GyulyVGC/sniffnet/issues/989))
|
||||
|
||||
495
Cargo.lock
generated
495
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "sniffnet"
|
||||
version = "1.4.1"
|
||||
version = "1.4.2"
|
||||
authors = ["Giuliano Bellini <gyulyvgc99@gmail.com>"]
|
||||
edition = "2024"
|
||||
description = "Application to comfortably monitor your network traffic"
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
Cross-platform. Intuitive. Reliable.
|
||||
|
||||
Translated in:<br>
|
||||
🇨🇳 🇩🇪 🇫🇷 🇷🇺 🇵🇹 🇪🇦 🇮🇹 🇵🇱 [+ 15 more languages](https://github.com/GyulyVGC/sniffnet/issues/60)
|
||||
🇨🇳 🇩🇪 🇫🇷 🇷🇺 🇵🇹 🇪🇦 🇮🇹 🇵🇱 [+ 16 more languages](https://github.com/GyulyVGC/sniffnet/issues/60)
|
||||
</div>
|
||||
|
||||
<p>
|
||||
@@ -65,7 +65,7 @@ ## Download
|
||||
<picture><img alt="Windows" title="Windows" height="85px" src="https://raw.githubusercontent.com/GyulyVGC/sniffnet/main/resources/repository/badges/windows.svg"/></picture>
|
||||
</td>
|
||||
<td>
|
||||
<a href="https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_Windows_64-bit.msi">64-bit</a> | <a href="https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_Windows_32-bit.msi">32-bit</a>
|
||||
<a href="https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_Windows_x64.msi">x64</a> | <a href="https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_Windows_arm64.msi">arm64</a> | <a href="https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_Windows_x86.msi">x86</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 160 KiB After Width: | Height: | Size: 208 KiB |
@@ -60,7 +60,7 @@ pub struct TrafficChart {
|
||||
}
|
||||
|
||||
impl TrafficChart {
|
||||
pub fn new(style: StyleType, language: Language) -> Self {
|
||||
pub fn new(style: StyleType, language: Language, data_repr: DataRepr) -> Self {
|
||||
TrafficChart {
|
||||
ticks: 0,
|
||||
out_bytes: ChartSeries::default(),
|
||||
@@ -72,7 +72,7 @@ pub fn new(style: StyleType, language: Language) -> Self {
|
||||
min_packets: 0.0,
|
||||
max_packets: 0.0,
|
||||
language,
|
||||
data_repr: DataRepr::Bytes,
|
||||
data_repr,
|
||||
style,
|
||||
thumbnail: false,
|
||||
is_live_capture: true,
|
||||
|
||||
@@ -87,6 +87,7 @@ mod tests {
|
||||
use crate::gui::types::settings::Settings;
|
||||
use crate::networking::types::capture_context::CaptureSourcePicklist;
|
||||
use crate::networking::types::config_device::ConfigDevice;
|
||||
use crate::networking::types::data_representation::DataRepr;
|
||||
use crate::notifications::types::notifications::Notifications;
|
||||
use crate::report::types::sort_type::SortType;
|
||||
use crate::{ConfigWindow, Language, Sniffer, StyleType};
|
||||
@@ -139,6 +140,7 @@ fn test_restore_default_configs() {
|
||||
},
|
||||
last_opened_setting: SettingsPage::General,
|
||||
last_opened_page: RunningPage::Inspect,
|
||||
data_repr: DataRepr::Packets,
|
||||
};
|
||||
// we want to be sure that modified config is different from defaults
|
||||
assert_ne!(Conf::default(), modified_conf);
|
||||
|
||||
@@ -57,7 +57,7 @@ fn page_content<'a>(sniffer: &Sniffer, key: &AddressPortPair) -> Container<'a, M
|
||||
color_gradient,
|
||||
..
|
||||
} = sniffer.conf.settings;
|
||||
let data_repr = sniffer.traffic_chart.data_repr;
|
||||
let data_repr = sniffer.conf.data_repr;
|
||||
let font = style.get_extension().font;
|
||||
let font_headers = style.get_extension().font_headers;
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ pub fn inspect_page(sniffer: &Sniffer) -> Container<'_, Message, StyleType> {
|
||||
&sniffer.search,
|
||||
font,
|
||||
sniffer.conf.report_sort_type,
|
||||
sniffer.traffic_chart.data_repr,
|
||||
sniffer.conf.data_repr,
|
||||
))
|
||||
.push(Space::with_height(4))
|
||||
.push(Rule::horizontal(5))
|
||||
@@ -110,7 +110,7 @@ fn report<'a>(sniffer: &Sniffer) -> Column<'a, Message, StyleType> {
|
||||
let Settings {
|
||||
style, language, ..
|
||||
} = sniffer.conf.settings;
|
||||
let data_repr = sniffer.traffic_chart.data_repr;
|
||||
let data_repr = sniffer.conf.data_repr;
|
||||
let font = style.get_extension().font;
|
||||
|
||||
let (search_results, results_number, agglomerate) = get_searched_entries(sniffer);
|
||||
@@ -152,7 +152,7 @@ fn report<'a>(sniffer: &Sniffer) -> Column<'a, Message, StyleType> {
|
||||
.push(get_agglomerates_row(
|
||||
font,
|
||||
agglomerate,
|
||||
sniffer.traffic_chart.data_repr,
|
||||
sniffer.conf.data_repr,
|
||||
))
|
||||
.push(Rule::horizontal(5))
|
||||
.push(get_change_page_row(
|
||||
|
||||
@@ -286,7 +286,7 @@ fn logged_notifications<'a>(sniffer: &Sniffer) -> Column<'a, Message, StyleType>
|
||||
let Settings {
|
||||
style, language, ..
|
||||
} = sniffer.conf.settings;
|
||||
let data_repr = sniffer.traffic_chart.data_repr;
|
||||
let data_repr = sniffer.conf.data_repr;
|
||||
let font = style.get_extension().font;
|
||||
let mut ret_val = Column::new()
|
||||
.padding(Padding::ZERO.right(15))
|
||||
|
||||
@@ -223,7 +223,7 @@ fn col_host<'a>(sniffer: &Sniffer) -> Column<'a, Message, StyleType> {
|
||||
style, language, ..
|
||||
} = sniffer.conf.settings;
|
||||
let font = style.get_extension().font;
|
||||
let data_repr = sniffer.traffic_chart.data_repr;
|
||||
let data_repr = sniffer.conf.data_repr;
|
||||
|
||||
let mut scroll_host = Column::new()
|
||||
.padding(Padding::ZERO.right(11.0))
|
||||
@@ -304,7 +304,7 @@ fn col_service<'a>(sniffer: &Sniffer) -> Column<'a, Message, StyleType> {
|
||||
style, language, ..
|
||||
} = sniffer.conf.settings;
|
||||
let font = style.get_extension().font;
|
||||
let data_repr = sniffer.traffic_chart.data_repr;
|
||||
let data_repr = sniffer.conf.data_repr;
|
||||
|
||||
let mut scroll_service = Column::new()
|
||||
.padding(Padding::ZERO.right(11.0))
|
||||
@@ -459,8 +459,7 @@ fn col_info(sniffer: &Sniffer) -> Container<'_, Message, StyleType> {
|
||||
&sniffer.conf.filters,
|
||||
);
|
||||
|
||||
let col_data_representation =
|
||||
col_data_representation(language, font, sniffer.traffic_chart.data_repr);
|
||||
let col_data_representation = col_data_representation(language, font, sniffer.conf.data_repr);
|
||||
|
||||
let donut_row = donut_row(language, font, sniffer);
|
||||
|
||||
@@ -612,7 +611,7 @@ fn donut_row(
|
||||
font: Font,
|
||||
sniffer: &Sniffer,
|
||||
) -> Container<'_, Message, StyleType> {
|
||||
let data_repr = sniffer.traffic_chart.data_repr;
|
||||
let data_repr = sniffer.conf.data_repr;
|
||||
|
||||
let (in_data, out_data, dropped) = sniffer.info_traffic.get_thumbnail_data(data_repr);
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ pub fn thumbnail_page(sniffer: &Sniffer) -> Container<'_, Message, StyleType> {
|
||||
}
|
||||
|
||||
let info_traffic = &sniffer.info_traffic;
|
||||
let data_repr = sniffer.traffic_chart.data_repr;
|
||||
let data_repr = sniffer.conf.data_repr;
|
||||
|
||||
let (in_data, out_data, dropped) = info_traffic.get_thumbnail_data(data_repr);
|
||||
|
||||
|
||||
@@ -136,6 +136,7 @@ pub fn new(conf: Conf) -> Self {
|
||||
mmdb_asn,
|
||||
..
|
||||
} = conf.settings.clone();
|
||||
let data_repr = conf.data_repr;
|
||||
let capture_source = CaptureSource::from_conf(&conf);
|
||||
Self {
|
||||
conf,
|
||||
@@ -149,7 +150,7 @@ pub fn new(conf: Conf) -> Self {
|
||||
my_devices: Vec::new(),
|
||||
pcap_error: None,
|
||||
dots_pulse: (".".to_string(), 0),
|
||||
traffic_chart: TrafficChart::new(style, language),
|
||||
traffic_chart: TrafficChart::new(style, language, data_repr),
|
||||
modal: None,
|
||||
settings_page: None,
|
||||
running_page: None,
|
||||
@@ -281,7 +282,10 @@ pub fn update(&mut self, message: Message) -> Task<Message> {
|
||||
Message::BpfFilter(value) => {
|
||||
self.conf.filters.set_bpf(value);
|
||||
}
|
||||
Message::DataReprSelection(unit) => self.traffic_chart.change_kind(unit),
|
||||
Message::DataReprSelection(unit) => {
|
||||
self.conf.data_repr = unit;
|
||||
self.traffic_chart.change_kind(unit);
|
||||
}
|
||||
Message::ReportSortSelection(sort) => {
|
||||
self.page_number = 1;
|
||||
self.conf.report_sort_type = sort;
|
||||
@@ -819,7 +823,7 @@ fn reset(&mut self) {
|
||||
self.favorite_hosts = HashSet::new();
|
||||
self.logged_notifications = (VecDeque::new(), 0);
|
||||
self.pcap_error = None;
|
||||
self.traffic_chart = TrafficChart::new(style, language);
|
||||
self.traffic_chart = TrafficChart::new(style, language, self.conf.data_repr);
|
||||
self.modal = None;
|
||||
self.settings_page = None;
|
||||
self.running_page = None;
|
||||
@@ -1163,14 +1167,19 @@ fn test_correctly_update_chart_kind() {
|
||||
let mut sniffer = Sniffer::new(Conf::default());
|
||||
|
||||
assert_eq!(sniffer.traffic_chart.data_repr, DataRepr::Bytes);
|
||||
assert_eq!(sniffer.conf.data_repr, DataRepr::Bytes);
|
||||
sniffer.update(Message::DataReprSelection(DataRepr::Packets));
|
||||
assert_eq!(sniffer.traffic_chart.data_repr, DataRepr::Packets);
|
||||
assert_eq!(sniffer.conf.data_repr, DataRepr::Packets);
|
||||
sniffer.update(Message::DataReprSelection(DataRepr::Packets));
|
||||
assert_eq!(sniffer.traffic_chart.data_repr, DataRepr::Packets);
|
||||
assert_eq!(sniffer.conf.data_repr, DataRepr::Packets);
|
||||
sniffer.update(Message::DataReprSelection(DataRepr::Bytes));
|
||||
assert_eq!(sniffer.traffic_chart.data_repr, DataRepr::Bytes);
|
||||
assert_eq!(sniffer.conf.data_repr, DataRepr::Bytes);
|
||||
sniffer.update(Message::DataReprSelection(DataRepr::Bits));
|
||||
assert_eq!(sniffer.traffic_chart.data_repr, DataRepr::Bits);
|
||||
assert_eq!(sniffer.conf.data_repr, DataRepr::Bits);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -1241,14 +1250,19 @@ fn test_correctly_update_style() {
|
||||
let mut sniffer = Sniffer::new(Conf::default());
|
||||
|
||||
sniffer.update(Message::Style(StyleType::MonAmour));
|
||||
assert_eq!(sniffer.traffic_chart.style, StyleType::MonAmour);
|
||||
assert_eq!(sniffer.conf.settings.style, StyleType::MonAmour);
|
||||
sniffer.update(Message::Style(StyleType::Day));
|
||||
assert_eq!(sniffer.traffic_chart.style, StyleType::Day);
|
||||
assert_eq!(sniffer.conf.settings.style, StyleType::Day);
|
||||
sniffer.update(Message::Style(StyleType::Night));
|
||||
assert_eq!(sniffer.traffic_chart.style, StyleType::Night);
|
||||
assert_eq!(sniffer.conf.settings.style, StyleType::Night);
|
||||
sniffer.update(Message::Style(StyleType::DeepSea));
|
||||
assert_eq!(sniffer.traffic_chart.style, StyleType::DeepSea);
|
||||
assert_eq!(sniffer.conf.settings.style, StyleType::DeepSea);
|
||||
sniffer.update(Message::Style(StyleType::DeepSea));
|
||||
assert_eq!(sniffer.traffic_chart.style, StyleType::DeepSea);
|
||||
assert_eq!(sniffer.conf.settings.style, StyleType::DeepSea);
|
||||
}
|
||||
|
||||
@@ -1879,6 +1893,7 @@ fn test_conf() {
|
||||
sniffer.update(Message::OutputPcapDir("/".to_string()));
|
||||
sniffer.update(Message::SetPcapImport("/test.pcap".to_string()));
|
||||
sniffer.update(Message::ChangeRunningPage(RunningPage::Notifications));
|
||||
sniffer.update(Message::DataReprSelection(DataRepr::Bits));
|
||||
|
||||
// quit the app by sending a CloseRequested message
|
||||
sniffer.update(Message::Quit);
|
||||
@@ -1930,6 +1945,7 @@ fn test_conf() {
|
||||
directory: "/".to_string()
|
||||
},
|
||||
import_pcap_path: "/test.pcap".to_string(),
|
||||
data_repr: DataRepr::Bits,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
use crate::gui::types::settings::Settings;
|
||||
use crate::networking::types::capture_context::CaptureSourcePicklist;
|
||||
use crate::networking::types::config_device::ConfigDevice;
|
||||
use crate::networking::types::data_representation::DataRepr;
|
||||
use crate::report::types::sort_type::SortType;
|
||||
#[cfg(not(test))]
|
||||
use crate::utils::error_logger::{ErrorLogger, Location};
|
||||
@@ -44,6 +45,8 @@ pub struct Conf {
|
||||
pub export_pcap: ExportPcap,
|
||||
/// Import path for PCAP file
|
||||
pub import_pcap_path: String,
|
||||
/// Data representation
|
||||
pub data_repr: DataRepr,
|
||||
}
|
||||
|
||||
impl Conf {
|
||||
|
||||
@@ -6,9 +6,10 @@
|
||||
use crate::translations::types::language::Language;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize, Default)]
|
||||
pub enum DataRepr {
|
||||
Packets,
|
||||
#[default]
|
||||
Bytes,
|
||||
Bits,
|
||||
}
|
||||
|
||||
@@ -48,11 +48,7 @@ pub fn get_searched_entries(
|
||||
.collect();
|
||||
|
||||
all_results.sort_by(|&(_, a), &(_, b)| {
|
||||
a.compare(
|
||||
b,
|
||||
sniffer.conf.report_sort_type,
|
||||
sniffer.traffic_chart.data_repr,
|
||||
)
|
||||
a.compare(b, sniffer.conf.report_sort_type, sniffer.conf.data_repr)
|
||||
});
|
||||
|
||||
let upper_bound = min(sniffer.page_number * 20, all_results.len());
|
||||
|
||||
Reference in New Issue
Block a user