Ejemplo n.º 1
0
		/// <summary>
		/// Constructs an ANAME record by reading bytes from a return message
		/// </summary>
		/// <param name="pointer">A logical pointer to the bytes holding the record</param>
		internal ANameRecord(Pointer pointer) {
			byte b1 = pointer.ReadByte();
			byte b2 = pointer.ReadByte();
			byte b3 = pointer.ReadByte();
			byte b4 = pointer.ReadByte();

			// this next line's not brilliant - couldn't find a better way though
			_ipAddress = IPAddress.Parse(string.Format("{0}.{1}.{2}.{3}", b1, b2, b3, b4));
		}
Ejemplo n.º 2
0
        /// <summary>
        /// Constructs an ANAME record by reading bytes from a return message
        /// </summary>
        /// <param name="pointer">A logical pointer to the bytes holding the record</param>
        internal ANameRecord(Pointer pointer)
        {
            byte b1 = pointer.ReadByte();
            byte b2 = pointer.ReadByte();
            byte b3 = pointer.ReadByte();
            byte b4 = pointer.ReadByte();

            // this next line's not brilliant - couldn't find a better way though
            _ipAddress = IPAddress.Parse(string.Format("{0}.{1}.{2}.{3}", b1, b2, b3, b4));
        }
Ejemplo n.º 3
0
        // An ANAME records consists simply of an IP address


        /// <summary>
        ///     Constructs an ANAME record by reading bytes from a return message
        /// </summary>
        /// <param name="pointer">A logical pointer to the bytes holding the record</param>
        internal ANameRecord(Pointer pointer)
        {
            var b1 = pointer.ReadByte();
            var b2 = pointer.ReadByte();
            var b3 = pointer.ReadByte();
            var b4 = pointer.ReadByte();

            // this next line's not brilliant - couldn't find a better way though
            IPAddress = IPAddress.Parse($"{b1}.{b2}.{b3}.{b4}");
        }
Ejemplo n.º 4
0
        internal TXTRecord(Pointer pointer)
        {
            Length = pointer.ReadByte();
            var sb = new StringBuilder(Length);

            for (int i = 0; i < Length; i++)
            {
                sb.Append(pointer.ReadChar());
            }
            Value = sb.ToString();
        }