status-go/vendor/github.com/pion/turn/v2/internal/proto/dontfrag.go

19 lines
461 B
Go
Raw Normal View History

2022-03-10 09:44:48 +00:00
package proto
import "github.com/pion/stun"
2022-03-10 09:44:48 +00:00
// DontFragmentAttr represents DONT-FRAGMENT attribute.
type DontFragmentAttr struct{}
2022-03-10 09:44:48 +00:00
// AddTo adds DONT-FRAGMENT attribute to message.
func (DontFragmentAttr) AddTo(m *stun.Message) error {
2022-03-10 09:44:48 +00:00
m.Add(stun.AttrDontFragment, nil)
return nil
}
// IsSet returns true if DONT-FRAGMENT attribute is set.
func (DontFragmentAttr) IsSet(m *stun.Message) bool {
2022-03-10 09:44:48 +00:00
_, err := m.Get(stun.AttrDontFragment)
return err == nil
}