Versions in this module Expand all Collapse all v0 v0.1.1 Mar 15, 2021 Changes in this version + func RegisterLinkEndpoint(linkEP LinkEndpoint) tcpip.LinkEndpointID + func RegisterNetworkProtocolFactory(name string, p NetworkProtocolFactory) + func RegisterTransportProtocolFactory(name string, p TransportProtocolFactory) + type ControlType int + const ControlPacketTooBig + const ControlPortUnreachable + const ControlUnknown + type LinkAddressCache interface + AddLinkAddress func(nicid tcpip.NICID, addr tcpip.Address, linkAddr tcpip.LinkAddress) + CheckLocalAddress func(nicid tcpip.NICID, protocol tcpip.NetworkProtocolNumber, addr tcpip.Address) tcpip.NICID + GetLinkAddress func(nicid tcpip.NICID, addr, localAddr tcpip.Address, ...) (tcpip.LinkAddress, <-chan struct{}, *tcpip.Error) + RemoveWaker func(nicid tcpip.NICID, addr tcpip.Address, waker *sleep.Waker) + type LinkAddressResolver interface + LinkAddressProtocol func() tcpip.NetworkProtocolNumber + LinkAddressRequest func(addr, localAddr tcpip.Address, linkEP LinkEndpoint) *tcpip.Error + ResolveStaticAddress func(addr tcpip.Address) (tcpip.LinkAddress, bool) + type LinkEndpoint interface + Attach func(dispatcher NetworkDispatcher) + Capabilities func() LinkEndpointCapabilities + IsAttached func() bool + LinkAddress func() tcpip.LinkAddress + MTU func() uint32 + MaxHeaderLength func() uint16 + WritePacket func(r *Route, hdr buffer.Prependable, payload buffer.VectorisedView, ...) *tcpip.Error + func FindLinkEndpoint(id tcpip.LinkEndpointID) LinkEndpoint + type LinkEndpointCapabilities uint + const CapabilityChecksumOffload + const CapabilityDisconnectOk + const CapabilityLoopback + const CapabilityResolutionRequired + const CapabilitySaveRestore + type NIC struct + func (n *NIC) AddAddress(protocol tcpip.NetworkProtocolNumber, addr tcpip.Address) *tcpip.Error + func (n *NIC) AddAddressWithOptions(protocol tcpip.NetworkProtocolNumber, addr tcpip.Address, ...) *tcpip.Error + func (n *NIC) AddSubnet(protocol tcpip.NetworkProtocolNumber, subnet tcpip.Subnet) + func (n *NIC) Addresses() []tcpip.ProtocolAddress + func (n *NIC) ContainsSubnet(subnet tcpip.Subnet) bool + func (n *NIC) DeliverNetworkPacket(linkEP LinkEndpoint, remoteLinkAddr, localLinkAddr tcpip.LinkAddress, ...) + func (n *NIC) DeliverTransportControlPacket(local, remote tcpip.Address, net tcpip.NetworkProtocolNumber, ...) + func (n *NIC) DeliverTransportPacket(r *Route, protocol tcpip.TransportProtocolNumber, vv buffer.VectorisedView) + func (n *NIC) ID() tcpip.NICID + func (n *NIC) RemoveAddress(addr tcpip.Address) *tcpip.Error + func (n *NIC) RemoveSubnet(subnet tcpip.Subnet) + func (n *NIC) Subnets() []tcpip.Subnet + type NICInfo struct + Flags NICStateFlags + LinkAddress tcpip.LinkAddress + MTU uint32 + Name string + ProtocolAddresses []tcpip.ProtocolAddress + type NICStateFlags struct + Loopback bool + Promiscuous bool + Running bool + Up bool + type NetworkDispatcher interface + DeliverNetworkPacket func(linkEP LinkEndpoint, dstLinkAddr, srcLinkAddr tcpip.LinkAddress, ...) + type NetworkEndpoint interface + Capabilities func() LinkEndpointCapabilities + Close func() + DefaultTTL func() uint8 + HandlePacket func(r *Route, vv buffer.VectorisedView) + ID func() *NetworkEndpointID + MTU func() uint32 + MaxHeaderLength func() uint16 + NICID func() tcpip.NICID + WritePacket func(r *Route, hdr buffer.Prependable, payload buffer.VectorisedView, ...) *tcpip.Error + type NetworkEndpointID struct + LocalAddress tcpip.Address + type NetworkProtocol interface + MinimumPacketSize func() int + NewEndpoint func(nicid tcpip.NICID, addr tcpip.Address, linkAddrCache LinkAddressCache, ...) (NetworkEndpoint, *tcpip.Error) + Number func() tcpip.NetworkProtocolNumber + Option func(option interface{}) *tcpip.Error + ParseAddresses func(v buffer.View) (src, dst tcpip.Address) + SetOption func(option interface{}) *tcpip.Error + type NetworkProtocolFactory func() NetworkProtocol + type Options struct + Clock tcpip.Clock + Stats tcpip.Stats + type PrimaryEndpointBehavior int + const CanBePrimaryEndpoint + const FirstPrimaryEndpoint + const NeverPrimaryEndpoint + type Route struct + LocalAddress tcpip.Address + LocalLinkAddress tcpip.LinkAddress + NetProto tcpip.NetworkProtocolNumber + NextHop tcpip.Address + RemoteAddress tcpip.Address + RemoteLinkAddress tcpip.LinkAddress + func (r *Route) Capabilities() LinkEndpointCapabilities + func (r *Route) Clone() Route + func (r *Route) DefaultTTL() uint8 + func (r *Route) IsResolutionRequired() bool + func (r *Route) MTU() uint32 + func (r *Route) MaxHeaderLength() uint16 + func (r *Route) NICID() tcpip.NICID + func (r *Route) PseudoHeaderChecksum(protocol tcpip.TransportProtocolNumber) uint16 + func (r *Route) Release() + func (r *Route) RemoveWaker(waker *sleep.Waker) + func (r *Route) Resolve(waker *sleep.Waker) (<-chan struct{}, *tcpip.Error) + func (r *Route) Stats() tcpip.Stats + func (r *Route) WritePacket(hdr buffer.Prependable, payload buffer.VectorisedView, ...) *tcpip.Error + type Stack struct + func New(network []string, transport []string, opts Options) *Stack + func (s *Stack) AddAddress(id tcpip.NICID, protocol tcpip.NetworkProtocolNumber, addr tcpip.Address) *tcpip.Error + func (s *Stack) AddAddressWithOptions(id tcpip.NICID, protocol tcpip.NetworkProtocolNumber, addr tcpip.Address, ...) *tcpip.Error + func (s *Stack) AddLinkAddress(nicid tcpip.NICID, addr tcpip.Address, linkAddr tcpip.LinkAddress) + func (s *Stack) AddSubnet(id tcpip.NICID, protocol tcpip.NetworkProtocolNumber, subnet tcpip.Subnet) *tcpip.Error + func (s *Stack) AddTCPProbe(probe TCPProbeFunc) + func (s *Stack) CheckLocalAddress(nicid tcpip.NICID, protocol tcpip.NetworkProtocolNumber, addr tcpip.Address) tcpip.NICID + func (s *Stack) CheckNetworkProtocol(protocol tcpip.NetworkProtocolNumber) bool + func (s *Stack) ContainsSubnet(id tcpip.NICID, subnet tcpip.Subnet) (bool, *tcpip.Error) + func (s *Stack) CreateDisabledNIC(id tcpip.NICID, linkEP tcpip.LinkEndpointID) *tcpip.Error + func (s *Stack) CreateDisabledNamedNIC(id tcpip.NICID, name string, linkEP tcpip.LinkEndpointID) *tcpip.Error + func (s *Stack) CreateNIC(id tcpip.NICID, linkEP tcpip.LinkEndpointID) *tcpip.Error + func (s *Stack) CreateNamedNIC(id tcpip.NICID, name string, linkEP tcpip.LinkEndpointID) *tcpip.Error + func (s *Stack) EnableNIC(id tcpip.NICID) *tcpip.Error + func (s *Stack) FindRoute(id tcpip.NICID, localAddr, remoteAddr tcpip.Address, ...) (Route, *tcpip.Error) + func (s *Stack) Forwarding() bool + func (s *Stack) GetLinkAddress(nicid tcpip.NICID, addr, localAddr tcpip.Address, ...) (tcpip.LinkAddress, <-chan struct{}, *tcpip.Error) + func (s *Stack) GetMainNICAddress(id tcpip.NICID, protocol tcpip.NetworkProtocolNumber) (tcpip.Address, tcpip.Subnet, *tcpip.Error) + func (s *Stack) GetRouteTable() []tcpip.Route + func (s *Stack) GetTCPProbe() TCPProbeFunc + func (s *Stack) JoinGroup(protocol tcpip.NetworkProtocolNumber, nicID tcpip.NICID, ...) *tcpip.Error + func (s *Stack) LeaveGroup(protocol tcpip.NetworkProtocolNumber, nicID tcpip.NICID, ...) *tcpip.Error + func (s *Stack) NICInfo() map[tcpip.NICID]NICInfo + func (s *Stack) NICSubnets() map[tcpip.NICID][]tcpip.Subnet + func (s *Stack) NetworkProtocolInstance(num tcpip.NetworkProtocolNumber) NetworkProtocol + func (s *Stack) NetworkProtocolOption(network tcpip.NetworkProtocolNumber, option interface{}) *tcpip.Error + func (s *Stack) NewEndpoint(transport tcpip.TransportProtocolNumber, network tcpip.NetworkProtocolNumber, ...) (tcpip.Endpoint, *tcpip.Error) + func (s *Stack) NowNanoseconds() int64 + func (s *Stack) RegisterTransportEndpoint(nicID tcpip.NICID, netProtos []tcpip.NetworkProtocolNumber, ...) *tcpip.Error + func (s *Stack) RemoveAddress(id tcpip.NICID, addr tcpip.Address) *tcpip.Error + func (s *Stack) RemoveSubnet(id tcpip.NICID, subnet tcpip.Subnet) *tcpip.Error + func (s *Stack) RemoveTCPProbe() + func (s *Stack) RemoveWaker(nicid tcpip.NICID, addr tcpip.Address, waker *sleep.Waker) + func (s *Stack) SetForwarding(enable bool) + func (s *Stack) SetNetworkProtocolOption(network tcpip.NetworkProtocolNumber, option interface{}) *tcpip.Error + func (s *Stack) SetPromiscuousMode(nicID tcpip.NICID, enable bool) *tcpip.Error + func (s *Stack) SetRouteTable(table []tcpip.Route) + func (s *Stack) SetSpoofing(nicID tcpip.NICID, enable bool) *tcpip.Error + func (s *Stack) SetTransportProtocolHandler(p tcpip.TransportProtocolNumber, ...) + func (s *Stack) SetTransportProtocolOption(transport tcpip.TransportProtocolNumber, option interface{}) *tcpip.Error + func (s *Stack) Stats() tcpip.Stats + func (s *Stack) TransportProtocolInstance(num tcpip.TransportProtocolNumber) TransportProtocol + func (s *Stack) TransportProtocolOption(transport tcpip.TransportProtocolNumber, option interface{}) *tcpip.Error + func (s *Stack) UnregisterTransportEndpoint(nicID tcpip.NICID, netProtos []tcpip.NetworkProtocolNumber, ...) + type TCPCubicState struct + Beta float64 + C float64 + K float64 + T time.Time + TimeSinceLastCongestion time.Duration + WC float64 + WEst float64 + WLastMax float64 + WMax float64 + type TCPEndpointID struct + LocalAddress tcpip.Address + LocalPort uint16 + RemoteAddress tcpip.Address + RemotePort uint16 + type TCPEndpointState struct + ID TCPEndpointID + PacketTooBigCount int + RcvBufSize int + RcvBufUsed int + RcvClosed bool + Receiver TCPReceiverState + RecentTS uint32 + SACK TCPSACKInfo + SACKPermitted bool + SegTime time.Time + SendTSOk bool + Sender TCPSenderState + SndBufInQueue seqnum.Size + SndBufSize int + SndBufUsed int + SndClosed bool + SndMTU int + TSOffset uint32 + type TCPFastRecoveryState struct + Active bool + First seqnum.Value + Last seqnum.Value + MaxCwnd int + type TCPProbeFunc func(s TCPEndpointState) + type TCPReceiverState struct + PendingBufSize seqnum.Size + PendingBufUsed seqnum.Size + RcvAcc seqnum.Value + RcvNxt seqnum.Value + RcvWndScale uint8 + type TCPSACKInfo struct + Blocks []header.SACKBlock + type TCPSenderState struct + Closed bool + Cubic TCPCubicState + DupAckCount int + FastRecovery TCPFastRecoveryState + LastSendTime time.Time + MaxPayloadSize int + MaxSentAck seqnum.Value + Outstanding int + RTO time.Duration + RTTMeasureSeqNum seqnum.Value + RTTMeasureTime time.Time + RTTVar time.Duration + SRTT time.Duration + SRTTInited bool + SndCAAckCount int + SndCwnd int + SndNxt seqnum.Value + SndUna seqnum.Value + SndWnd seqnum.Size + SndWndScale uint8 + Ssthresh int + type TransportDispatcher interface + DeliverTransportControlPacket func(local, remote tcpip.Address, net tcpip.NetworkProtocolNumber, ...) + DeliverTransportPacket func(r *Route, protocol tcpip.TransportProtocolNumber, vv buffer.VectorisedView) + type TransportEndpoint interface + HandleControlPacket func(id TransportEndpointID, typ ControlType, extra uint32, ...) + HandlePacket func(r *Route, id TransportEndpointID, vv buffer.VectorisedView) + type TransportEndpointID struct + LocalAddress tcpip.Address + LocalPort uint16 + RemoteAddress tcpip.Address + RemotePort uint16 + type TransportProtocol interface + HandleUnknownDestinationPacket func(r *Route, id TransportEndpointID, vv buffer.VectorisedView) bool + MinimumPacketSize func() int + NewEndpoint func(stack *Stack, netProto tcpip.NetworkProtocolNumber, waitQueue *waiter.Queue) (tcpip.Endpoint, *tcpip.Error) + Number func() tcpip.TransportProtocolNumber + Option func(option interface{}) *tcpip.Error + ParsePorts func(v buffer.View) (src, dst uint16, err *tcpip.Error) + SetOption func(option interface{}) *tcpip.Error + type TransportProtocolFactory func() TransportProtocol