Show / Hide Table of Contents

Class Message

A Port Control Protocol message.

Inheritance
Object
NatMessage
Message
Request
Response
Implements
ICloneable
Inherited Members
NatMessage.Length()
NatMessage.Clone()
NatMessage.Clone<T>()
NatMessage.ToByteArray()
NatMessage.Write(Stream)
Object.ToString()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Namespace: Makaretu.Nat.Pcp
Assembly: Makaretu.Nat.dll
Syntax
public class Message : NatMessage, ICloneable

Fields

| Improve this Doc View Source

NonceLength

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 Source

IsResponse

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.

| Improve this Doc View Source

Opcode

The operatation.

Declaration
public Opcode Opcode { get; set; }
Property Value
Type Description
Opcode

One of the Opcode values.

| Improve this Doc View Source

Version

The protocol version.

Declaration
public byte Version { get; set; }
Property Value
Type Description
Byte

Defaults to zero, ProtocolVersion.

Methods

| Improve this Doc View Source

Create(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 datagram.

| Improve this Doc View Source

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 datagram.

Type Parameters
Name Description
T

The type of Message.

| Improve this Doc View Source

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
NatMessage.Read(NatReader)
Remarks

Derived classes must override this.

| Improve this Doc View Source

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
NatMessage.Write(NatWriter)
Remarks

Derived classes must override this.

Implements

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