Skip to content

Commit

Permalink
fix icmp6 log string
Browse files Browse the repository at this point in the history
  • Loading branch information
Chleba committed Apr 22, 2024
1 parent d657354 commit 4196431
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 17 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ Network scanning tool with features like:
- [x] WiFi signals strength (with charts)
- [x] (IPv4) Pinging CIDR with hostname, oui & mac address
- [x] (IPv4) Packetdump (TCP, UDP, ICMP, ARP)
- [x] (IPv6) Packetdump (ICMP6)
- [x] start/pause packetdump

**TODO:**
- [ ] scanning open ports
- [ ] modal window with packet data
- [ ] ipv6 scanning & dumping
- [ ] start/pause packetdump

## *Notes*:
- Must be run with root privileges.
Expand All @@ -28,9 +29,6 @@ sudo chmod u+s /home/user/.cargo/bin/netscanner
```
paru -S netscanner
```
```
yay -S netscanner-bin
```

## Install `Cargo`
```
Expand Down
20 changes: 7 additions & 13 deletions src/components/packetdump.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,13 +208,6 @@ impl PacketDump {
PacketTypeEnum::Icmp6,
))
.unwrap();
// println!(
// "[{}]: ICMPv6 packet {} -> {} (type={:?})",
// interface_name,
// source,
// destination,
// icmpv6_packet.get_icmpv6_type()
// )
}
}

Expand Down Expand Up @@ -581,22 +574,22 @@ impl PacketDump {
Style::default().fg(Color::Red).bg(Color::Black),
));

let mut icmp_type_str = "unknown";
let mut icmp_type_str = " unknown ";
match icmp.icmp_type {
Icmpv6Types::EchoRequest => {
icmp_type_str = " echo request";
icmp_type_str = " echo request ";
}
Icmpv6Types::EchoReply => {
icmp_type_str = " echo reply";
icmp_type_str = " echo reply ";
}
Icmpv6Types::NeighborAdvert => {
icmp_type_str = " neighbor advert";
icmp_type_str = " neighbor advert ";
}
Icmpv6Types::NeighborSolicit => {
icmp_type_str = " neighbor solicit";
icmp_type_str = " neighbor solicit ";
}
Icmpv6Types::Redirect => {
icmp_type_str = " redirect";
icmp_type_str = " redirect ";
}
_ => {}
}
Expand Down Expand Up @@ -929,6 +922,7 @@ impl Component for PacketDump {
PacketTypeEnum::Arp => self.arp_packets.push((time, packet.clone())),
PacketTypeEnum::Udp => self.udp_packets.push((time, packet.clone())),
PacketTypeEnum::Icmp => self.icmp_packets.push((time, packet.clone())),
PacketTypeEnum::Icmp6 => self.icmp6_packets.push((time, packet.clone())),
_ => {}
}
self.all_packets.push((time, packet.clone()));
Expand Down

0 comments on commit 4196431

Please sign in to comment.