segment_other.go 365 B

12345678910111213141516
  1. //go:build !linux || android
  2. package tio
  3. import "fmt"
  4. func protoFromGSOType(_ uint8) (GSOProto, error) {
  5. return 0, fmt.Errorf("GSO unsupported")
  6. }
  7. func SegmentSuperpacket(pkt Packet, fn func(seg []byte) error) error {
  8. if pkt.GSO.IsSuperpacket() {
  9. return fmt.Errorf("tio: GSO superpacket on platform without segmentation support")
  10. }
  11. return fn(pkt.Bytes)
  12. }