From 6bae3f7c24e7b19d27ea29290fe5894822685986 Mon Sep 17 00:00:00 2001 From: pythops Date: Wed, 11 Sep 2024 16:41:38 +0200 Subject: [PATCH] remove comments --- oryx-common/src/lib.rs | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/oryx-common/src/lib.rs b/oryx-common/src/lib.rs index cd5ba27..4b08af8 100644 --- a/oryx-common/src/lib.rs +++ b/oryx-common/src/lib.rs @@ -56,10 +56,6 @@ impl From<[u8; RawPacket::LEN]> for AppPacket { RawPacket::Ip(packet, proto) => match packet { IpHdr::V4(ipv4_packet) => match proto { ip::ProtoHdr::Tcp(header) => { - //FIX: This does not work - // let tcphdr = - // unsafe { raw_packet.add(mem::size_of::()) } as *const TcpHdr; - let tcp_packet = TcpPacket { src_ip: IpAddr::V4(Ipv4Addr::from(u32::from_be(ipv4_packet.src_addr))), src_port: u16::from_be(header.source), @@ -69,10 +65,6 @@ impl From<[u8; RawPacket::LEN]> for AppPacket { AppPacket::Ip(IpPacket::Tcp(tcp_packet)) } ip::ProtoHdr::Udp(header) => { - // let udphdr = unsafe { - // raw_packet.offset(Ipv4Hdr::LEN.try_into().unwrap()) as *const UdpHdr - // }; - let udp_packet = UdpPacket { src_ip: IpAddr::V4(Ipv4Addr::from(u32::from_be(ipv4_packet.src_addr))), src_port: u16::from_be(header.source), @@ -82,10 +74,6 @@ impl From<[u8; RawPacket::LEN]> for AppPacket { Self::Ip(IpPacket::Udp(udp_packet)) } ip::ProtoHdr::Icmp(header) => { - // let icmphdr = unsafe { - // raw_packet.offset(Ipv4Hdr::LEN.try_into().unwrap()) as *const IcmpHdr - // }; - let icmp_type = match header.type_ { 0 => IcmpType::EchoRequest, 1 => IcmpType::EchoReply, @@ -99,7 +87,6 @@ impl From<[u8; RawPacket::LEN]> for AppPacket { }; Self::Ip(IpPacket::Icmp(icmp_packet)) } - _ => unreachable!(), }, IpHdr::V6(ipv6_packet) => match ipv6_packet.next_hdr { IpProto::Tcp => {