diff --git a/src/net/parser/ports.rs b/src/net/parser/ports.rs index 0e8dec9..17f2853 100644 --- a/src/net/parser/ports.rs +++ b/src/net/parser/ports.rs @@ -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)), @@ -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(), })