Beispiel #1
0
        internal static void UDPHandler(byte[] packetData)
        {
            UDPPacket udp_packet = new UDPPacket(packetData);

            Kernel.debugger.Send("[Received] UDP packet from " + udp_packet.SourceIP.ToString() + ":" + udp_packet.SourcePort.ToString());

            if (udp_packet.SourcePort == 67)
            {
                DHCP.DHCPPacket.DHCPHandler(packetData);
                return;
            }
            else if (udp_packet.SourcePort == 53)
            {
                DNS.DNSPacket.DNSHandler(packetData);
                return;
            }

            UdpClient receiver = UdpClient.Client(udp_packet.DestinationPort);

            if (receiver != null)
            {
                receiver.receiveData(udp_packet);
            }
        }
Beispiel #2
0
 public void receiveData(UDPPacket packet)
 {
     rxBuffer.Enqueue(packet);
 }