Skip to content

Commit

Permalink
Parse Candidate Extensions (RFC5245)
Browse files Browse the repository at this point in the history
- Rewrote `UnmarshalCandidate` to better align with RFC5245.
- Added new methods for extracting candidate extensions.
- Updated `Equal` and `Marshal` to accommodate these changes.
- New Types `CandidateExtensions` and `CandidateExtension` to handle
  candidate extensions.
  • Loading branch information
joeturki committed Jan 15, 2025
1 parent 35bb3fb commit a2e7c06
Show file tree
Hide file tree
Showing 6 changed files with 1,201 additions and 58 deletions.
9 changes: 9 additions & 0 deletions candidate.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,21 @@ 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() CandidateExtensions

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
Expand Down
Loading

0 comments on commit a2e7c06

Please sign in to comment.