Source File
dontfrag.go
Belonging Package
github.com/pion/turn/v4/internal/proto
// SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>// SPDX-License-Identifier: MITpackage protoimport ()// DontFragmentAttr is a deprecated alias for DontFragment// Deprecated: Please use DontFragment.type DontFragmentAttr = DontFragment// DontFragment represents DONT-FRAGMENT attribute.//// This attribute is used by the client to request that the server set// the DF (Don't Fragment) bit in the IP header when relaying the// application data onward to the peer. This attribute has no value// part and thus the attribute length field is 0.//// RFC 5766 Section 14.8.type DontFragment struct{}const dontFragmentSize = 0// AddTo adds DONT-FRAGMENT attribute to message.func (DontFragment) ( *stun.Message) error {.Add(stun.AttrDontFragment, nil)return nil}// GetFrom decodes DONT-FRAGMENT from message.func ( *DontFragment) ( *stun.Message) error {, := .Get(stun.AttrDontFragment)if != nil {return}return stun.CheckSize(stun.AttrDontFragment, len(), dontFragmentSize)}// IsSet returns true if DONT-FRAGMENT attribute is set.func (DontFragment) ( *stun.Message) bool {, := .Get(stun.AttrDontFragment)return == nil}
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |