MCPcopy
hub / github.com/google/gvisor / fakeNetworkEndpoint

Struct fakeNetworkEndpoint

pkg/tcpip/stack/stack_test.go:81–95  ·  view source on GitHub ↗

fakeNetworkEndpoint is a network-layer protocol endpoint. It counts sent and received packets; the counts of all endpoints are aggregated in the protocol descriptor. Headers of this protocol are fakeNetHeaderLen bytes. Addresses are 4 bytes, but we only use the first byte.

Source from the content-addressed store, hash-verified

79// Headers of this protocol are fakeNetHeaderLen bytes. Addresses are 4 bytes,
80// but we only use the first byte.
81type fakeNetworkEndpoint struct {
82 stack.AddressableEndpointState
83
84 mu struct {
85 sync.RWMutex
86
87 enabled bool
88 forwarding bool
89 multicastForwarding bool
90 }
91
92 nic stack.NetworkInterface
93 proto *fakeNetworkProtocol
94 dispatcher stack.TransportDispatcher
95}
96
97func (f *fakeNetworkEndpoint) Enable() tcpip.Error {
98 f.mu.Lock()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected