Show / Hide Table of Contents

Class DnsObject

Base class for all DNS objects.

Inheritance
Object
DnsObject
Message
Question
ResourceRecord
UpdateMessage
Implements
IWireSerialiser
ICloneable
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 abstract class DnsObject : IWireSerialiser, ICloneable
Remarks

Provides helper methods for IWireSerialiser, cloning and caching.

Properties

| Improve this Doc View Source

CreationTime

When the object was created.

Declaration
public DateTime CreationTime { get; set; }
Property Value
Type Description
DateTime

Local time.

Remarks

Cloning does not alter the value.

Methods

| Improve this Doc View Source

Clone()

Makes a deep copy of the object.

Declaration
public virtual object Clone()
Returns
Type Description
Object

A deep copy of the dns object.

Remarks

Uses serialisation to make a copy.

| Improve this Doc View Source

Clone<T>()

Makes a deep copy of the object.

Declaration
public T Clone<T>()
    where T : DnsObject
Returns
Type Description
T

A deep copy of the dns object.

Type Parameters
Name Description
T

Some type derived from DnsObject.

Remarks

Use serialisation to make a copy.

| Improve this Doc View Source

Length()

Length in bytes of the object when serialised.

Declaration
public int Length()
Returns
Type Description
Int32

Numbers of bytes when serialised.

| Improve this Doc View Source

Read(WireReader)

Reads the DNS object that is encoded in the wire format.

Declaration
public abstract IWireSerialiser Read(WireReader reader)
Parameters
Type Name Description
WireReader reader

The source of the DNS object.

Returns
Type Description
IWireSerialiser

The final DNS object.

Remarks

Reading a ResourceRecord will return a new instance that is type specific unless the GetDataLength() is zero.

| Improve this Doc View Source

Read(Byte[])

Reads the DNS object from a byte array.

Declaration
public IWireSerialiser Read(byte[] buffer)
Parameters
Type Name Description
Byte[] buffer

The source for the DNS object.

Returns
Type Description
IWireSerialiser
| Improve this Doc View Source

Read(Byte[], Int32, Int32)

Reads the DNS object from a byte array.

Declaration
public IWireSerialiser Read(byte[] buffer, int offset, int count)
Parameters
Type Name Description
Byte[] buffer

The source for the DNS object.

Int32 offset

The offset into the buffer.

Int32 count

The number of bytes in the buffer.

Returns
Type Description
IWireSerialiser
| Improve this Doc View Source

Read(Stream)

Reads the DNS object from a stream.

Declaration
public IWireSerialiser Read(Stream stream)
Parameters
Type Name Description
Stream stream

The source for the DNS object.

Returns
Type Description
IWireSerialiser
| Improve this Doc View Source

ToByteArray()

Writes the DNS object to a byte array.

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

A byte array containing the binary representaton of the DNS object.

| Improve this Doc View Source

Write(WireWriter)

Writes the DNS object encoded in the wire format.

Declaration
public abstract void Write(WireWriter writer)
Parameters
Type Name Description
WireWriter writer

The destination of the DNS object.

| Improve this Doc View Source

Write(Stream)

Writes the DNS object to a stream.

Declaration
public void Write(Stream stream)
Parameters
Type Name Description
Stream stream

The destination for the DNS object.

Implements

IWireSerialiser
System.ICloneable
  • Improve this Doc
  • View Source
Back to top Generated by DocFX