// SPDX-FileCopyrightText: 2026 Echolot contributors // SPDX-License-Identifier: GPL-3.0-or-later //go:build !linux package dataplane import ( "fmt" "echo-lot.app/server/internal/session" ) // Crafting IP fragments needs a raw socket and Linux's IP_HDRINCL semantics. Off Linux the // capability is simply not advertised, so a client never asks for it — better than answering // with a measurement we cannot actually make. type FragMode string const ( FragInOrder FragMode = "in_order" FragReversed FragMode = "reversed" FragFirstLast FragMode = "first_last" ) type FragResult struct { Mode FragMode `json:"mode"` SizeBytes int `json:"size_bytes"` Fragments int `json:"fragments"` Sent bool `json:"sent"` Err string `json:"err,omitempty"` } func RawFragSupported() bool { return false } func (s *Server) FragSend( sess *session.Session, g *session.Grant, sizeBytes int, mode FragMode, fragSize int, ) (FragResult, error) { return FragResult{Mode: mode, SizeBytes: sizeBytes}, fmt.Errorf("crafted fragmentation is only implemented on Linux") }