示例#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);
        }
示例#2
0
 public DNSException(DNSPacket p, string message) : base(message)
 {
     Packet = p;
 }
示例#3
0
 public DNSException(DNSPacket p)
 {
     Packet = p;
 }