/// <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); }
public DNSException(DNSPacket p, string message) : base(message) { Packet = p; }
public DNSException(DNSPacket p) { Packet = p; }