summaryrefslogtreecommitdiffhomepage
path: root/net/tstun/netstack_disabled.go
blob: 6425668a36c873c4456051d15f819f34349a5ba3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// Copyright (c) Tailscale Inc & contributors
// SPDX-License-Identifier: BSD-3-Clause

//go:build ts_omit_netstack

package tstun

type netstack_PacketBuffer struct {
	GSOOptions netstack_GSO
}

func (*netstack_PacketBuffer) DecRef()   { panic("unreachable") }
func (*netstack_PacketBuffer) Size() int { panic("unreachable") }

type netstack_GSOType int

const (
	netstack_GSONone netstack_GSOType = iota
	netstack_GSOTCPv4
	netstack_GSOTCPv6
	netstack_GSOGvisor
)

type netstack_GSO struct {
	// Type is one of GSONone, GSOTCPv4, etc.
	Type netstack_GSOType
	// NeedsCsum is set if the checksum offload is enabled.
	NeedsCsum bool
	// CsumOffset is offset after that to place checksum.
	CsumOffset uint16

	// Mss is maximum segment size.
	MSS uint16
	// L3Len is L3 (IP) header length.
	L3HdrLen uint16

	// MaxSize is maximum GSO packet size.
	MaxSize uint32
}

func (p *netstack_PacketBuffer) NetworkHeader() slicer {
	panic("unreachable")
}

func (p *netstack_PacketBuffer) TransportHeader() slicer {
	panic("unreachable")
}

func (p *netstack_PacketBuffer) ToBuffer() netstack_Buffer { panic("unreachable") }

func (p *netstack_PacketBuffer) Data() asRanger {
	panic("unreachable")
}

type asRanger struct{}

func (asRanger) AsRange() toSlicer { panic("unreachable") }

type toSlicer struct{}

func (toSlicer) ToSlice() []byte { panic("unreachable") }

type slicer struct{}

func (s slicer) Slice() []byte { panic("unreachable") }

type netstack_Buffer struct{}

func (netstack_Buffer) Flatten() []byte { panic("unreachable") }