Skip to content

Commit

Permalink
completed get_flag(), restructured /resources folder, github images a…
Browse files Browse the repository at this point in the history
…re now uploaded on git cloud
  • Loading branch information
GyulyVGC committed Dec 6, 2022
1 parent 956a2e6 commit a045efd
Show file tree
Hide file tree
Showing 27 changed files with 291 additions and 42 deletions.
4 changes: 2 additions & 2 deletions .design/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div align="center">
<p align="center"><a href="https://github.com/GyulyVGC/sniffnet"><img alt="Sniffnet" src="../resources/header_repository.png" width="100%"/></a></p>
<p align="center"><a href="https://github.com/GyulyVGC/sniffnet"><img alt="Sniffnet" src="https://user-images.githubusercontent.com/100347457/205967236-e086d1df-a266-4127-8e73-c2cbb889c007.png" width="100%"/></a></p>
<h1>Design Guidelines & Resources</h1>
<p>A collection of design contribution guidelines and resources for Sniffnet.</p>
</div>
Expand Down Expand Up @@ -66,7 +66,7 @@ For info on the used RGB colors, I suggest you to give a look at the file [style

### Logos

You can find a set of logos [here](https://github.com/GyulyVGC/sniffnet/tree/main/resources)
You can find a set of logos [here](https://github.com/GyulyVGC/sniffnet/tree/main/resources/logos)

## 🎓 License

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<p align="center"><a href="https://github.com/GyulyVGC/sniffnet"><img alt="Sniffnet" src="resources/header_repository.png" width="100%"/></a></p>
<p align="center"><a href="https://github.com/GyulyVGC/sniffnet"><img alt="Sniffnet" src="https://user-images.githubusercontent.com/100347457/205967236-e086d1df-a266-4127-8e73-c2cbb889c007.png" width="100%"/></a></p>

# How can you contribute to the Sniffnet project?

Expand Down
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ repository = "https://github.com/GyulyVGC/sniffnet"
license = "MIT OR Apache-2.0"
keywords = ["filter", "network", "packet", "sniffer", "parser"]
categories = ["command-line-utilities", "concurrency", "network-programming"]
include = ["src/**/*", "LICENSE-*", "README.md", "CHANGELOG.md"]


[package.metadata.bundle]
name = "Sniffnet"
identifier = "gyulyvgc.sniffnet"
icon = ["./resources/icon.ico"]
icon = ["./resources/logos/icon.ico"]


[profile.release]
Expand All @@ -32,4 +33,4 @@ indexmap = "1.9.1"
plotters-iced = "0.3.3"
iced = { version = "0.4.2", features = ["tokio", "image"] }
iced_style = "0.4.0"
db_ip = "0.3.7"
db_ip = "0.3.7"
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<p align="center"><a href="https://github.com/GyulyVGC/sniffnet"><img alt="Sniffnet" src="resources/header_repository.png" width="100%"/></a></p>
<p align="center"><a href="https://github.com/GyulyVGC/sniffnet"><img alt="Sniffnet" src="https://user-images.githubusercontent.com/100347457/205967236-e086d1df-a266-4127-8e73-c2cbb889c007.png" width="100%"/></a></p>


<hr>
Expand All @@ -15,7 +15,7 @@

<hr>

<p align="center"><img alt="" src="resources/sniffnet_run_example.gif" width="85%"/></p>
<p align="center"><img alt="" src="https://user-images.githubusercontent.com/100347457/205967647-ef77cf89-20b0-49e3-a10d-0d4fe1da7752.gif" width="85%"/></p>

<div align="center">
<p>Sniffnet is a simple yet insightful application to let you have a glance into your network traffic
Expand Down Expand Up @@ -81,19 +81,19 @@ sudo setcap cap_net_raw,cap_net_admin=eip <your/Sniffnet/executable/path>
## Features

- choose a network adapter to inspect
<p align="center"><img alt="" src="resources/adapters_view.png" width="50%"/></p>
<p align="center"><img alt="" src="https://user-images.githubusercontent.com/100347457/205967942-1ee5d1b2-222e-46ee-bad7-e9aa63492628.png" width="50%"/></p>

- select filters to apply to the observed traffic
<p align="center"><img alt="" src="resources/filters_view.png" width="60%"/></p>
<p align="center"><img alt="" src="https://user-images.githubusercontent.com/100347457/205968099-a68f32c4-c077-4f82-be2c-1cf88ce5522d.png" width="60%"/></p>

- view real-time charts about traffic intensity (bytes and packets per second, incoming and outgoing)
<p align="center"><img alt="" src="resources/charts_view.png" width="80%"/></p>
<p align="center"><img alt="" src="https://user-images.githubusercontent.com/100347457/205968195-f979f1b4-b737-4ece-8433-cf539d140eb4.png" width="80%"/></p>

- view overall statistics about the filtered traffic
<p align="center"><img alt="" src="resources/packets_view.png" width="50%"/></p>
<p align="center"><img alt="" src="https://user-images.githubusercontent.com/100347457/205968251-b331a2b7-14df-45ab-aafd-20d93d9156bf.png" width="50%"/></p>

- view most relevant connections (most recent, most packets, most bytes)
<p align="center"><img alt="" src="resources/report_view.png" width="95%"/></p>
<p align="center"><img alt="" src="https://user-images.githubusercontent.com/100347457/205967785-ff98bc0a-f3e8-44ad-bafe-4b9a46344f74.png" width="95%"/></p>

- save complete textual report with detailed information for each connection:
* source and destination IP addresses
Expand Down
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
19 changes: 18 additions & 1 deletion src/gui/gui_run_page.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,22 @@ pub fn run_page(sniffer: &mut Sniffer) -> Column<Message> {
})
.on_press(Message::Reset);

let button_settings = Button::new(
&mut sniffer.settings,
Text::new("Settings")
.font(font)
.size(FONT_SIZE_SUBTITLE)
.horizontal_alignment(alignment::Horizontal::Center)
.vertical_alignment(alignment::Vertical::Center),
)
.height(Length::Units(30))
.width(Length::FillPortion(1))
.style(match sniffer.style {
StyleType::Day => StyleType::TabsInactiveDay,
_ => StyleType::TabsInactiveNight,
})
.on_press(Message::Reset);

let header = Container::new(
Row::new()
.height(Length::Fill)
Expand Down Expand Up @@ -221,7 +237,8 @@ pub fn run_page(sniffer: &mut Sniffer) -> Column<Message> {
.width(Length::Fill)
.align_items(Alignment::Center)
.push(button_overview)
.push(button_inspect);
.push(button_inspect)
.push(button_settings);

let active_radio_chart = sniffer.chart_type;
let row_radio_chart = Row::new()
Expand Down
14 changes: 1 addition & 13 deletions src/gui/style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,6 @@ pub const NIGHT_BUTTONS: Color = Color {
b: 0.1,
a: 1.0,
};
pub const TAB_BUTTONS_BORDER: Color = Color {
r: 0.45,
g: 0.45,
b: 0.45,
a: 1.0,
};
pub const SPECIAL_NIGHT: Color = Color {
r: 0.7,
g: 0.35,
Expand Down Expand Up @@ -298,13 +292,7 @@ impl button::StyleSheet for StyleType {
| StyleType::TabsActiveDay => 0.0,
_ => 12.0,
},
border_width: match self {
StyleType::TabsActiveNight
| StyleType::TabsInactiveNight
| StyleType::TabsInactiveDay
| StyleType::TabsActiveDay => 2.0,
_ => BORDER_WIDTH,
},
border_width: BORDER_WIDTH,
border_color: match self {
StyleType::Day => SPECIAL_DAY,
StyleType::Night => SPECIAL_NIGHT,
Expand Down
3 changes: 2 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ pub fn main() -> iced::Result {
git: button::State::new(),
overview: button::State::new(),
inspect: button::State::new(),
settings: button::State::new(),
app: pick_list::State::new(),
scroll_adapters: scrollable::State::new(),
scroll_packets: scrollable::State::new(),
Expand All @@ -111,7 +112,7 @@ pub fn main() -> iced::Result {
},
default_font: None,
default_text_size: FONT_SIZE_BODY,
text_multithreading: false,
text_multithreading: true,
antialiasing: false,
exit_on_close_request: true,
try_opengles_first: false,
Expand Down
2 changes: 1 addition & 1 deletion src/structs/info_address_port_pair.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ impl InfoAddressPortPair {
.unwrap()
.to_string()
.replace('|', "")
.add(&*format!(" {} ", &self.country))
.add(&*format!(" {} ", &self.country))
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/structs/sniffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ pub struct Sniffer {
pub overview: button::State,
/// Inspect button state
pub inspect: button::State,
/// Settings button state
pub settings: button::State,
/// Application protocol picklist state
pub app: pick_list::State<AppProtocol>,
/// Adapters scrollbar state
Expand Down
Loading

0 comments on commit a045efd

Please sign in to comment.