private static async Task <IDnsPacket> ConstructPacketFromSimpleAsync(SimpleDnsPacket packet) { var header = new DnsHeader(GenerateId(), new SendParameters(OPCode.Standard, true, false), 1, 0, 0, 0); var dnsPacket = new SendDnsPacket(header, packet.Query); return(await TransmitAsync(new Send(dnsPacket, packet.ServerIPAddress, packet.Type))); }
public Send(SendDnsPacket sendPacket, IPAddress serverIpAddress, int port, TransmissionType type) { SendingDnsPacket = sendPacket; ServerAddress = serverIpAddress; Type = type; Port = port; var socketOptions = SocketTypes(type); _st = socketOptions.Item1; _pt = socketOptions.Item2; }
public Send(SendDnsPacket sendPacket, IPAddress serverIpAddress, TransmissionType type) : this(sendPacket, serverIpAddress, 53, type) { }
/// <summary> /// Queries DNS using the SendDnsPacket object asynchronously. /// </summary> /// <param name="packet"></param> /// <param name="serverIpAddress"></param> /// <returns></returns> /// <exception cref="T:Kitson.Dns.CustomExceptions.DnsConnectException"></exception> public static async Task <IDnsPacket> DnsAsync(SendDnsPacket packet, IPAddress serverIpAddress) { return(await TransmitAsync(new Send(packet, serverIpAddress, TransmissionType.UDP))); }
/// <summary> /// Queries DNS using the SendDnsPacket object synchronously. /// </summary> /// <param name="packet"></param> /// <param name="serverIpAddress"></param> /// <returns></returns> /// <exception cref="T:Kitson.Dns.CustomExceptions.DnsConnectException"></exception> public static IDnsPacket Dns(SendDnsPacket packet, IPAddress serverIpAddress) { return(TransmitSynchronous(new Send(packet, serverIpAddress, TransmissionType.UDP))); }