@@ -4,19 +4,30 @@ import (
44 "github.com/pion/stun"
55)
66
7- // DontFragmentAttr represents DONT-FRAGMENT attribute.
8- type DontFragmentAttr struct {}
7+ // DontFragmentAttr is a deprecated alias for DontFragment
8+ // Deprecated: Please use DontFragment
9+ type DontFragmentAttr = DontFragment
10+
11+ // DontFragment represents DONT-FRAGMENT attribute.
12+ //
13+ // This attribute is used by the client to request that the server set
14+ // the DF (Don't Fragment) bit in the IP header when relaying the
15+ // application data onward to the peer. This attribute has no value
16+ // part and thus the attribute length field is 0.
17+ //
18+ // RFC 5766 Section 14.8
19+ type DontFragment struct {}
920
1021const dontFragmentSize = 0
1122
1223// AddTo adds DONT-FRAGMENT attribute to message.
13- func (DontFragmentAttr ) AddTo (m * stun.Message ) error {
24+ func (DontFragment ) AddTo (m * stun.Message ) error {
1425 m .Add (stun .AttrDontFragment , nil )
1526 return nil
1627}
1728
1829// GetFrom decodes DONT-FRAGMENT from message.
19- func (d * DontFragmentAttr ) GetFrom (m * stun.Message ) error {
30+ func (d * DontFragment ) GetFrom (m * stun.Message ) error {
2031 v , err := m .Get (stun .AttrDontFragment )
2132 if err != nil {
2233 return err
@@ -28,7 +39,7 @@ func (d *DontFragmentAttr) GetFrom(m *stun.Message) error {
2839}
2940
3041// IsSet returns true if DONT-FRAGMENT attribute is set.
31- func (DontFragmentAttr ) IsSet (m * stun.Message ) bool {
42+ func (DontFragment ) IsSet (m * stun.Message ) bool {
3243 _ , err := m .Get (stun .AttrDontFragment )
3344 return err == nil
3445}
0 commit comments