mirror of
https://github.com/netbirdio/ice.git
synced 2026-05-22 17:10:58 -07:00
Parse Candidate Extensions (RFC5245)
- Rewrote `UnmarshalCandidate` to better align with RFC5245. - Added Candidate `Extensions` and `GetExtension`. - Updated `Equal` and `Marshal` to accommodate these changes. - New Type `CandidateExtension` to handle.
This commit is contained in:
@@ -52,12 +52,28 @@ type Candidate interface {
|
||||
// candidate, which is useful for diagnostics and other purposes
|
||||
RelatedAddress() *CandidateRelatedAddress
|
||||
|
||||
// Extensions returns a copy of all extension attributes associated with the ICECandidate.
|
||||
// In the order of insertion, *(key value).
|
||||
// Extension attributes are defined in RFC 5245, Section 15.1:
|
||||
// https://datatracker.ietf.org/doc/html/rfc5245#section-15.1
|
||||
//.
|
||||
Extensions() []CandidateExtension
|
||||
|
||||
// GetExtension returns the value of the extension attribute associated with the ICECandidate.
|
||||
// Extension attributes are defined in RFC 5245, Section 15.1:
|
||||
// https://datatracker.ietf.org/doc/html/rfc5245#section-15.1
|
||||
//.
|
||||
GetExtension(key string) (value CandidateExtension, ok bool)
|
||||
|
||||
String() string
|
||||
Type() CandidateType
|
||||
TCPType() TCPType
|
||||
|
||||
Equal(other Candidate) bool
|
||||
|
||||
// DeepEqual same as Equal, But it also compares the candidate extensions.
|
||||
DeepEqual(other Candidate) bool
|
||||
|
||||
Marshal() string
|
||||
|
||||
addr() net.Addr
|
||||
|
||||
+457
-78
File diff suppressed because it is too large
Load Diff
+767
-1
File diff suppressed because it is too large
Load Diff
@@ -125,10 +125,12 @@ var (
|
||||
errNotImplemented = errors.New("not implemented yet")
|
||||
errNoUDPMuxAvailable = errors.New("no UDP mux is available")
|
||||
errNoXorAddrMapping = errors.New("no address mapping")
|
||||
errParseFoundation = errors.New("failed to parse foundation")
|
||||
errParseComponent = errors.New("failed to parse component")
|
||||
errParsePort = errors.New("failed to parse port")
|
||||
errParsePriority = errors.New("failed to parse priority")
|
||||
errParseRelatedAddr = errors.New("failed to parse related addresses")
|
||||
errParseExtension = errors.New("failed to parse extension")
|
||||
errParseTCPType = errors.New("failed to parse TCP type")
|
||||
errRead = errors.New("failed to read")
|
||||
errUDPMuxDisabled = errors.New("UDPMux is not enabled")
|
||||
|
||||
Reference in New Issue
Block a user