Beispiel #1
0
        /// <summary>
        /// DNS handler.
        /// </summary>
        /// <param name="packetData">Packet data.</param>
        /// <exception cref="sysIO.IOException">Thrown on IO error.</exception>
        internal static void DNSHandler(byte[] packetData)
        {
            DNSPacket dns_packet = new DNSPacket(packetData);

            DnsClient receiver = (DnsClient)UdpClient.GetClient(dns_packet.DestinationPort);

            if (receiver != null)
            {
                receiver.ReceiveData(dns_packet);
            }
        }
Beispiel #2
0
        /// <summary>
        /// DHCP handler.
        /// </summary>
        /// <param name="packetData">Packet data.</param>
        /// <exception cref="OverflowException">Thrown if UDP_Data array length is greater than Int32.MaxValue.</exception>
        /// <exception cref="sysIO.IOException">Thrown on IO error.</exception>
        public static void DHCPHandler(byte[] packetData)
        {
            var dhcp_packet = new DHCPPacket(packetData);

            var receiver = UdpClient.GetClient(dhcp_packet.DestinationPort);

            if (receiver != null)
            {
                receiver.ReceiveData(dhcp_packet);
            }
        }