Class NatMessage
Base class for all NAT related messages.
Implements
Inherited Members
Namespace: Makaretu.Nat
Assembly: Makaretu.Nat.dll
Syntax
public abstract class NatMessage : ICloneable
Remarks
Provides serialisation services, Read and Write.
Methods
| Improve this Doc View SourceClone()
Makes a deep copy of the object.
Declaration
public object Clone()
Returns
Type | Description |
---|---|
Object | A deep copy of the NAT message. |
Remarks
Uses serialisation to make a copy.
Clone<T>()
Makes a deep copy of the object.
Declaration
public T Clone<T>()
where T : NatMessage
Returns
Type | Description |
---|---|
T | A deep copy of the dns object. |
Type Parameters
Name | Description |
---|---|
T | Some type derived from NatMessage. |
Remarks
Use serialisation to make a copy.
Length()
Length in bytes of the object when serialised.
Declaration
public int Length()
Returns
Type | Description |
---|---|
Int32 | Numbers of bytes when serialised. |
Read(NatReader)
Reads the NAT message.
Declaration
public abstract void Read(NatReader reader)
Parameters
Type | Name | Description |
---|---|---|
NatReader | reader | The source for the NAT message. |
Remarks
Derived classes must override this.
ToByteArray()
Writes the NAT message to a byte array.
Declaration
public byte[] ToByteArray()
Returns
Type | Description |
---|---|
Byte[] | A byte array containing the binary representaton of the NAT message. |
Write(NatWriter)
Writes the NAT message.
Declaration
public abstract void Write(NatWriter writer)
Parameters
Type | Name | Description |
---|---|---|
NatWriter | writer | The destination for the NAT message. |
Remarks
Derived classes must override this.
Write(Stream)
Writes the NAT message to a stream.
Declaration
public void Write(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The destination for the NAT message. |