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 Type `CandidateExtension` to handle.

Signed-off-by: Joe Turki <[email protected]>
  • Loading branch information
joeturki committed Jan 15, 2025
1 parent abdc0ca commit dddadd5
Show file tree
Hide file tree
Showing 4 changed files with 1,211 additions and 58 deletions.
16 changes: 16 additions & 0 deletions candidate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 string, 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
Expand Down
Loading

0 comments on commit dddadd5

Please sign in to comment.