Skip to content

Commit

Permalink
refactor: re-batch imports
Browse files Browse the repository at this point in the history
  • Loading branch information
SkuldNorniern committed Mar 13, 2024
1 parent 345ed80 commit 69efc2f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/net/parser/ports.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
use pnet::packet::tcp::TcpPacket;
use pnet::packet::udp::UdpPacket;

use crate::net::errors::NetError;

use log::debug;
use pnet::packet::{
tcp::TcpPacket,
udp::UdpPacket,
};

pub fn parse_ports(protocol: u8, payload: &[u8]) -> Result<(u16, u16), NetError> {
match protocol {
58 => Ok((0, 0)),
Expand All @@ -20,7 +23,7 @@ pub fn parse_ports(protocol: u8, payload: &[u8]) -> Result<(u16, u16), NetError>
1 => Ok((0, 0)),
0 => Ok((0, 0)),
_ => {
println!("Unknown protocol: {}", protocol);
debug!("Unknown protocol: {}", protocol);
Err(NetError::UnknownProtocol {
protocol: protocol.to_string(),
})
Expand Down

0 comments on commit 69efc2f

Please sign in to comment.