2022-03-10 09:44:48 +00:00
|
|
|
package proto
|
|
|
|
|
2024-01-18 18:54:54 +00:00
|
|
|
import "github.com/pion/stun"
|
2022-03-10 09:44:48 +00:00
|
|
|
|
2024-01-18 18:54:54 +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.
|
2024-01-18 18:54:54 +00:00
|
|
|
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.
|
2024-01-18 18:54:54 +00:00
|
|
|
func (DontFragmentAttr) IsSet(m *stun.Message) bool {
|
2022-03-10 09:44:48 +00:00
|
|
|
_, err := m.Get(stun.AttrDontFragment)
|
|
|
|
return err == nil
|
|
|
|
}
|