Beispiel #1
0
        /// <summary>
        /// Converts a <see cref="DNSPacket"/> into a byte array.
        /// </summary>
        /// <param name="packet">The DNSPacket to convert</param>
        /// <returns>A byte Array of max length 258 </returns>
        public static byte[] PacketToRaw(DNSPacket packet)
        {
            byte[] responseArray = new byte[] { (byte)packet.Type, (byte)packet.Lookup, (byte)packet.Length };
            responseArray = responseArray.Concat(packet.Data).ToArray();

            return(responseArray);
        }
Beispiel #2
0
 public DNSException(DNSPacket p, string message) : base(message)
 {
     Packet = p;
 }
Beispiel #3
0
 public DNSException(DNSPacket p)
 {
     Packet = p;
 }