MCPcopy Create free account
hub / github.com/pion/ice / AddToWithType

Method AddToWithType

renomination.go:53–63  ·  view source on GitHub ↗

AddToWithType adds a Nomination attribute to a STUN message using a specific attribute type.

(m *stun.Message, attrType stun.AttrType)

Source from the content-addressed store, hash-verified

51
52// AddToWithType adds a Nomination attribute to a STUN message using a specific attribute type.
53func (a NominationAttribute) AddToWithType(m *stun.Message, attrType stun.AttrType) error {
54 // Store as 4 bytes with first byte as 0
55 v := make([]byte, 4)
56 v[1] = byte(a.Value >> 16) //nolint:gosec
57 v[2] = byte(a.Value >> 8) //nolint:gosec
58 v[3] = byte(a.Value) //nolint:gosec
59
60 m.Add(attrType, v)
61
62 return nil
63}
64
65// String returns string representation of the nomination attribute.
66func (a NominationAttribute) String() string {

Callers 3

AddToMethod · 0.95
AddToMethod · 0.95

Calls

no outgoing calls

Tested by 1