Class Message
A Port Control Protocol message.
Implements
Inherited Members
Namespace: Makaretu.Nat.Pcp
Assembly: Makaretu.Nat.dll
Syntax
public class Message : NatMessage, ICloneable
Fields
| Improve this Doc View SourceNonceLength
The size of a nonce in bytes.
Declaration
public const int NonceLength = 12
Field Value
| Type | Description |
|---|---|
| Int32 | 12 bytes. |
Properties
| Improve this Doc View SourceIsResponse
Indicates that the message is a response.
Declaration
public bool IsResponse { get; set; }
Property Value
| Type | Description |
|---|---|
| Boolean | Defaults to false, e.g. its a request. |
Opcode
The operatation.
Declaration
public Opcode Opcode { get; set; }
Property Value
| Type | Description |
|---|---|
| Opcode | One of the Opcode values. |
Version
The protocol version.
Declaration
public byte Version { get; set; }
Property Value
| Type | Description |
|---|---|
| Byte | Defaults to zero, ProtocolVersion. |
Methods
| Improve this Doc View SourceCreate(Byte[])
Create a message from the specified datagram.
Declaration
public static Message Create(byte[] datagram)
Parameters
| Type | Name | Description |
|---|---|---|
| Byte[] | datagram | The byte array containing the message. |
Returns
| Type | Description |
|---|---|
| Message | A Message that represents the |
Create<T>(Byte[])
Create a specific message from the specified datagram.
Declaration
public static T Create<T>(byte[] datagram)
where T : Message
Parameters
| Type | Name | Description |
|---|---|---|
| Byte[] | datagram | The byte array containing the message. |
Returns
| Type | Description |
|---|---|
| T | A specific Message that represents the |
Type Parameters
| Name | Description |
|---|---|
| T | The type of Message. |
Read(NatReader)
Reads the NAT message.
Declaration
public override void Read(NatReader reader)
Parameters
| Type | Name | Description |
|---|---|---|
| NatReader | reader | The source for the NAT message. |
Overrides
Remarks
Derived classes must override this.
Write(NatWriter)
Writes the NAT message.
Declaration
public override void Write(NatWriter writer)
Parameters
| Type | Name | Description |
|---|---|---|
| NatWriter | writer | The destination for the NAT message. |
Overrides
Remarks
Derived classes must override this.