/// <summary> /// Initializes a new instance of the DnsSrvRecord class. /// </summary> /// <param name="header">Dns dnsRecord header</param> /// <param name="dataPointer">Pointer to the data portion of the dnsRecord</param> internal override void Load(DnsRecordHeader header, IntPtr dataPointer) { base.Load(header, dataPointer); Win32DnsSrvRecord record = (Win32DnsSrvRecord)Marshal.PtrToStructure(dataPointer, typeof(Win32DnsSrvRecord)); this.target = record.NameTarget; this.priority = record.Priority; this.weight = record.Weight; this.port = record.Port; }
/// <summary> /// Initializes a new instance of the DnsSrvRecord class. /// </summary> /// <param name="header">Dns dnsRecord header</param> /// <param name="dataPointer">Pointer to the data portion of the dnsRecord</param> internal override void Load(DnsRecordHeader header, IntPtr dataPointer) { base.Load(header, dataPointer); Win32DnsSrvRecord record = (Win32DnsSrvRecord)Marshal.PtrToStructure <Win32DnsSrvRecord>(dataPointer); this.target = record.NameTarget; this.priority = record.Priority; this.weight = record.Weight; this.port = record.Port; }
/// <summary> /// Loads the DNS dnsRecord. /// </summary> /// <param name="header">The header.</param> /// <param name="dataPointer">The data pointer.</param> internal virtual void Load(DnsRecordHeader header, IntPtr dataPointer) { this.name = header.Name; this.timeToLive = Math.Max(1, header.Ttl); }