Noble Connect
Add relays and punchthrough to Mirror or UNet
NobleConnect.Sdp.SdpMessage Class Reference

An IP, username and password guids, and a list of candidates More...

Public Member Functions

 SdpMessage (IPEndPoint defaultMediaAddress, List< Candidate > candidates, Guid username, Guid password)
 Construct an SdpMessage with the provided candidate list, credenitials, and return address More...
 
 SdpMessage (byte[] buffer, ref int index)
 Create an SdpMessage from some bytes More...
 
void Serialize (BufferView buffer)
 Serialize the message to a buffer for sending over the network More...
 
override string ToString ()
 Human readable representation of the sdp message. More...
 

Public Attributes

IPEndPoint defaultMediaAddress
 The address that recipients should send the response to More...
 
Guid usernameFragment
 Username used for ice More...
 
Guid password
 Password used for ice More...
 
List< Candidatecandidates = new List<Candidate>()
 The list of candidates to use for ice More...
 

Static Public Attributes

const int HEADER_SIZE_MIN = 40
 The minimum number of bytes that can be required to encode the sdp header More...
 
const int HEADER_SIZE_MAX = 60
 The maximum number of bytes that can be required to encode the sdp header More...
 
const byte isIPv6Mask = 0b10000000
 This mask is used when encoding and decoding messages from a sip message to encode the address family of the defaultMediaAddress end point More...
 
const byte isLinkLocalMask = 0b01000000
 This mask is used when encoding and decoding messages from a sip message to indicate whether a ipv6 defaultMediaAddress is link local More...
 

Detailed Description

An IP, username and password guids, and a list of candidates

Message format is:

header: 40 or 52 or 60 bytes 1 for is IPv6, isLinkLocal 4 or 16 for address 8 for scope id (if isIPv6 and isLinkLocal) 2 for port 16 for username guid 16 for password guid 1 for number of candidates

per candidate: 24 or 36 or 42 or 50 bytes 16 for foundation 1 for local preference 1 for candidateType, isIPv6, and isDualStack, isLinkLocal 4 or 16 for address 8 for scope id (if isIPv6 and isLinkLocal) 2 for port (4 or 16 for address) (2 for port)

Constructor & Destructor Documentation

◆ SdpMessage() [1/2]

NobleConnect.Sdp.SdpMessage.SdpMessage ( IPEndPoint  defaultMediaAddress,
List< Candidate candidates,
Guid  username,
Guid  password 
)

Construct an SdpMessage with the provided candidate list, credenitials, and return address

Parameters
defaultMediaAddress
candidates
username
password

◆ SdpMessage() [2/2]

NobleConnect.Sdp.SdpMessage.SdpMessage ( byte[]  buffer,
ref int  index 
)

Create an SdpMessage from some bytes

Parameters
buffer
index

Member Function Documentation

◆ Serialize()

void NobleConnect.Sdp.SdpMessage.Serialize ( BufferView  buffer)

Serialize the message to a buffer for sending over the network

Parameters
buffer

◆ ToString()

override string NobleConnect.Sdp.SdpMessage.ToString ( )

Human readable representation of the sdp message.

This is not what is actually sent over the network, just useful for debug.

Returns

Member Data Documentation

◆ candidates

List<Candidate> NobleConnect.Sdp.SdpMessage.candidates = new List<Candidate>()

The list of candidates to use for ice

◆ defaultMediaAddress

IPEndPoint NobleConnect.Sdp.SdpMessage.defaultMediaAddress

The address that recipients should send the response to

◆ HEADER_SIZE_MAX

const int NobleConnect.Sdp.SdpMessage.HEADER_SIZE_MAX = 60
static

The maximum number of bytes that can be required to encode the sdp header

◆ HEADER_SIZE_MIN

const int NobleConnect.Sdp.SdpMessage.HEADER_SIZE_MIN = 40
static

The minimum number of bytes that can be required to encode the sdp header

◆ isIPv6Mask

const byte NobleConnect.Sdp.SdpMessage.isIPv6Mask = 0b10000000
static

This mask is used when encoding and decoding messages from a sip message to encode the address family of the defaultMediaAddress end point

◆ isLinkLocalMask

const byte NobleConnect.Sdp.SdpMessage.isLinkLocalMask = 0b01000000
static

This mask is used when encoding and decoding messages from a sip message to indicate whether a ipv6 defaultMediaAddress is link local

◆ password

Guid NobleConnect.Sdp.SdpMessage.password

Password used for ice

◆ usernameFragment

Guid NobleConnect.Sdp.SdpMessage.usernameFragment

Username used for ice