Ejemplo n.º 1
0
        internal DnsMailExchangeEntry(Win32.DNS_RECORD record, IntPtr ptr) : base(record)
        {
            var data = record.GetData <Win32.DNS_MX_DATA>(ptr);

            Exchanger  = Marshal.PtrToStringUni(data.NameExchange);
            Preference = data.Preference;
        }
Ejemplo n.º 2
0
        internal DnsHostEntry(Win32.DNS_RECORD record, IntPtr ptr) : base(record)
        {
            var data = record.GetData <Win32.DnsHostUnion>(ptr);

            Address = (Type == DnsRecordType.A)
                ? Win32.ConvertUintToIpAddress(data.A.IpAddress)
                : Win32.ConvertAAAAToIpAddress(data.AAAA);
        }
Ejemplo n.º 3
0
        internal DnsServiceEntry(Win32.DNS_RECORD record, IntPtr ptr) : base(record)
        {
            var data = record.GetData <Win32.DNS_SRV_DATA>(ptr);

            Host     = Marshal.PtrToStringUni(data.NameTarget);
            Priority = data.Priority;
            Weight   = data.Weight;
            Port     = data.Port;
        }
Ejemplo n.º 4
0
        internal DnsTextEntry(Win32.DNS_RECORD record, IntPtr ptr) : base(record)
        {
            // get TXT DATA block
            var txt = record.GetData <Win32.DNS_TXT_DATA>(ptr);
            // get pointers to strings
            var    stringPointers = new IntPtr[txt.Count()];
            IntPtr pointer0       = ptr + Marshal.SizeOf(record) + Marshal.SizeOf(txt.StringCount);

            Marshal.Copy(pointer0, stringPointers, 0, stringPointers.Length);

            // get string values
            Text = new string[stringPointers.Length];
            for (int i = 0; i < stringPointers.Length; i++)
            {
                Text[i] = Marshal.PtrToStringUni(stringPointers[i]);
            }
        }
Ejemplo n.º 5
0
        internal DnsPointerEntry(Win32.DNS_RECORD record, IntPtr ptr) : base(record)
        {
            var data = record.GetData <Win32.DNS_PTR_DATA>(ptr);

            Target = Marshal.PtrToStringUni(data.NameHost);
        }