Show / Hide Table of Contents

Class PresentationReader

Methods to read DNS data items encoded in the presentation (text) format.

Inheritance
Object
PresentationReader
Inherited Members
Object.ToString()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Namespace: Makaretu.Dns
Assembly: Makaretu.Dns.dll
Syntax
public class PresentationReader

Constructors

| Improve this Doc View Source

PresentationReader(TextReader)

Creates a new instance of the PresentationReader using the specified TextReader.

Declaration
public PresentationReader(TextReader text)
Parameters
Type Name Description
TextReader text

The source for data items.

Fields

| Improve this Doc View Source

Position

The reader relative position within the stream.

Declaration
public int Position
Field Value
Type Description
Int32

Properties

| Improve this Doc View Source

Origin

The origin domain name, sometimes called the zone name.

Declaration
public DomainName Origin { get; set; }
Property Value
Type Description
DomainName

Defaults to "".

Remarks

Origin is used when the domain name "@" is used for a domain name.

Methods

| Improve this Doc View Source

IsEndOfLine()

Determines if the reader is at the end of a line.

Declaration
public bool IsEndOfLine()
Returns
Type Description
Boolean
| Improve this Doc View Source

ReadBase64String()

Read bytes encoded in base-64.

Declaration
public byte[] ReadBase64String()
Returns
Type Description
Byte[]

The bytes.

Remarks

This must be the last field in the RDATA because the string can contain embedded spaces.

| Improve this Doc View Source

ReadByte()

Read a byte.

Declaration
public byte ReadByte()
Returns
Type Description
Byte

The number as a byte.

| Improve this Doc View Source

ReadDateTime()

Read a date/time.

Declaration
public DateTime ReadDateTime()
Returns
Type Description
DateTime

The DateTime.

Remarks

Allows a DateTime in the form "yyyyMMddHHmmss" or the number of seconds since the unix epoch (00:00:00 on 1 January 1970 UTC).

| Improve this Doc View Source

ReadDnsType()

Read a DNS Type.

Declaration
public DnsType ReadDnsType()
Returns
Type Description
DnsType
Remarks

Either the name of a DnsType or the string "TYPEx".

| Improve this Doc View Source

ReadDomainName()

Read a domain name.

Declaration
public DomainName ReadDomainName()
Returns
Type Description
DomainName

The domain name as a string.

| Improve this Doc View Source

ReadIPAddress(Int32)

Read an Internet address.

Declaration
public IPAddress ReadIPAddress(int length = 4)
Parameters
Type Name Description
Int32 length

Ignored.

Returns
Type Description
IPAddress

An IPAddress.

| Improve this Doc View Source

ReadResourceData()

Read hex encoded RDATA.

Declaration
public byte[] ReadResourceData()
Returns
Type Description
Byte[]

A byte array containing the RDATA.

Remarks

See https://tools.ietf.org/html/rfc3597#section-5 for all the details.

| Improve this Doc View Source

ReadResourceRecord()

Read a resource record.

Declaration
public ResourceRecord ReadResourceRecord()
Returns
Type Description
ResourceRecord

A ResourceRecord or null if no more resource records are available.

Remarks

Processes the "$ORIGIN" and "$TTL" specials that define the Origin and a default time-to-live respectively.

A domain name can be "@" to refer to the Origin. A missing domain name will use the previous record's domain name.

Defaults the Class to IN. Defaults the TTL to either the "$TTL" or the DefaultTTL.

| Improve this Doc View Source

ReadString()

Read a string.

Declaration
public string ReadString()
Returns
Type Description
String

The string.

| Improve this Doc View Source

ReadTimeSpan16()

Read a time span (interval) in 16-bit seconds.

Declaration
public TimeSpan ReadTimeSpan16()
Returns
Type Description
TimeSpan

A TimeSpan with second resolution.

| Improve this Doc View Source

ReadTimeSpan32()

Read a time span (interval) in 32-bit seconds.

Declaration
public TimeSpan ReadTimeSpan32()
Returns
Type Description
TimeSpan

A TimeSpan with second resolution.

| Improve this Doc View Source

ReadUInt16()

Read an unsigned short.

Declaration
public ushort ReadUInt16()
Returns
Type Description
UInt16

The number as an unsigned short.

| Improve this Doc View Source

ReadUInt32()

Read an unsigned int.

Declaration
public uint ReadUInt32()
Returns
Type Description
UInt32

The number as an unsignd int.

  • Improve this Doc
  • View Source
Back to top Generated by DocFX