Versions in this module Expand all Collapse all v1 v1.0.0 Oct 18, 2019 Changes in this version + const DefaultTOS + type ControlType int + const ControlPacketTooBig + const ControlPortUnreachable + const ControlUnknown + type DirectionStats struct + Bytes *tcpip.StatCounter + Packets *tcpip.StatCounter + type GSO struct + CsumOffset uint16 + L3HdrLen uint16 + MSS uint16 + MaxSize uint32 + NeedsCsum bool + Type GSOType + type GSOEndpoint interface + GSOMaxSize func() uint32 + type GSOType int + const GSONone + const GSOTCPv4 + const GSOTCPv6 + type ICMPRateLimiter struct + func NewICMPRateLimiter() *ICMPRateLimiter + type InjectableLinkEndpoint interface + Inject func(protocol tcpip.NetworkProtocolNumber, vv buffer.VectorisedView) + WriteRawPacket func(dest tcpip.Address, packet []byte) *tcpip.Error + 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 + Wait func() + WritePacket func(r *Route, gso *GSO, hdr buffer.Prependable, payload buffer.VectorisedView, ...) *tcpip.Error + type LinkEndpointCapabilities uint + const CapabilityDisconnectOk + const CapabilityGSO + const CapabilityLoopback + const CapabilityNone + const CapabilityRXChecksumOffload + const CapabilityResolutionRequired + const CapabilitySaveRestore + const CapabilityTXChecksumOffload + type NDPConfigurations struct + DupAddrDetectTransmits uint8 + RetransmitTimer time.Duration + func DefaultNDPConfigurations() NDPConfigurations + type NIC struct + func (n *NIC) AddAddress(protocolAddress tcpip.ProtocolAddress, peb PrimaryEndpointBehavior) *tcpip.Error + func (n *NIC) AddAddressRange(protocol tcpip.NetworkProtocolNumber, subnet tcpip.Subnet) + func (n *NIC) AddressRanges() []tcpip.Subnet + func (n *NIC) AllAddresses() []tcpip.ProtocolAddress + func (n *NIC) DeliverNetworkPacket(linkEP LinkEndpoint, remote, _ tcpip.LinkAddress, ...) + func (n *NIC) DeliverTransportControlPacket(local, remote tcpip.Address, net tcpip.NetworkProtocolNumber, ...) + func (n *NIC) DeliverTransportPacket(r *Route, protocol tcpip.TransportProtocolNumber, netHeader buffer.View, ...) + func (n *NIC) ID() tcpip.NICID + func (n *NIC) PrimaryAddresses() []tcpip.ProtocolAddress + func (n *NIC) RemoveAddress(addr tcpip.Address) *tcpip.Error + func (n *NIC) RemoveAddressRange(subnet tcpip.Subnet) + func (n *NIC) Stack() *Stack + type NICInfo struct + Flags NICStateFlags + LinkAddress tcpip.LinkAddress + MTU uint32 + Name string + ProtocolAddresses []tcpip.ProtocolAddress + Stats NICStats + type NICStateFlags struct + Loopback bool + Promiscuous bool + Running bool + Up bool + type NICStats struct + Rx DirectionStats + Tx DirectionStats + type NetworkDispatcher interface + DeliverNetworkPacket func(linkEP LinkEndpoint, remote, local 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 + PrefixLen func() int + WriteHeaderIncludedPacket func(r *Route, payload buffer.VectorisedView, loop PacketLooping) *tcpip.Error + WritePacket func(r *Route, gso *GSO, hdr buffer.Prependable, payload buffer.VectorisedView, ...) *tcpip.Error + type NetworkEndpointID struct + LocalAddress tcpip.Address + type NetworkHeaderParams struct + Protocol tcpip.TransportProtocolNumber + TOS uint8 + TTL uint8 + type NetworkProtocol interface + DefaultPrefixLen func() int + MinimumPacketSize func() int + NewEndpoint func(nicid tcpip.NICID, addrWithPrefix tcpip.AddressWithPrefix, ...) (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 Options struct + Clock tcpip.Clock + HandleLocal bool + NDPConfigs NDPConfigurations + NetworkProtocols []NetworkProtocol + Stats tcpip.Stats + TransportProtocols []TransportProtocol + UnassociatedFactory UnassociatedEndpointFactory + type PacketLooping byte + const PacketLoop + const PacketOut + type PrimaryEndpointBehavior int + const CanBePrimaryEndpoint + const FirstPrimaryEndpoint + const NeverPrimaryEndpoint + type RawTransportEndpoint interface + HandlePacket func(r *Route, netHeader buffer.View, packet buffer.VectorisedView) + type RcvBufAutoTuneParams struct + CopiedBytes int + Disabled bool + MeasureTime time.Time + PrevCopiedBytes int + RTT time.Duration + RTTMeasureSeqNumber seqnum.Value + RTTMeasureTime time.Time + RTTVar time.Duration + RcvBufSize int + type ResumableEndpoint interface + Resume func(*Stack) + 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) GSOMaxSize() uint32 + func (r *Route) IsResolutionRequired() bool + func (r *Route) MTU() uint32 + func (r *Route) MakeLoopedRoute() Route + func (r *Route) MaxHeaderLength() uint16 + func (r *Route) NICID() tcpip.NICID + func (r *Route) PseudoHeaderChecksum(protocol tcpip.TransportProtocolNumber, totalLen uint16) 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) Stack() *Stack + func (r *Route) Stats() tcpip.Stats + func (r *Route) WriteHeaderIncludedPacket(payload buffer.VectorisedView) *tcpip.Error + func (r *Route) WritePacket(gso *GSO, hdr buffer.Prependable, payload buffer.VectorisedView, ...) *tcpip.Error + type Stack struct + func New(opts Options) *Stack + func (s *Stack) AddAddress(id tcpip.NICID, protocol tcpip.NetworkProtocolNumber, addr tcpip.Address) *tcpip.Error + func (s *Stack) AddAddressRange(id tcpip.NICID, protocol tcpip.NetworkProtocolNumber, subnet tcpip.Subnet) *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) AddProtocolAddress(id tcpip.NICID, protocolAddress tcpip.ProtocolAddress) *tcpip.Error + func (s *Stack) AddProtocolAddressWithOptions(id tcpip.NICID, protocolAddress tcpip.ProtocolAddress, ...) *tcpip.Error + func (s *Stack) AddTCPProbe(probe TCPProbeFunc) + func (s *Stack) AllAddresses() map[tcpip.NICID][]tcpip.ProtocolAddress + func (s *Stack) AllowICMPMessage() bool + func (s *Stack) CheckLocalAddress(nicid tcpip.NICID, protocol tcpip.NetworkProtocolNumber, addr tcpip.Address) tcpip.NICID + func (s *Stack) CheckNIC(id tcpip.NICID) bool + func (s *Stack) CheckNetworkProtocol(protocol tcpip.NetworkProtocolNumber) bool + func (s *Stack) CreateDisabledNIC(id tcpip.NICID, ep LinkEndpoint) *tcpip.Error + func (s *Stack) CreateDisabledNamedNIC(id tcpip.NICID, name string, ep LinkEndpoint) *tcpip.Error + func (s *Stack) CreateNIC(id tcpip.NICID, ep LinkEndpoint) *tcpip.Error + func (s *Stack) CreateNamedLoopbackNIC(id tcpip.NICID, name string, ep LinkEndpoint) *tcpip.Error + func (s *Stack) CreateNamedNIC(id tcpip.NICID, name string, ep LinkEndpoint) *tcpip.Error + func (s *Stack) DupTentativeAddrDetected(id tcpip.NICID, addr tcpip.Address) *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.AddressWithPrefix, *tcpip.Error) + func (s *Stack) GetRouteTable() []tcpip.Route + func (s *Stack) GetTCPProbe() TCPProbeFunc + func (s *Stack) ICMPBurst() int + func (s *Stack) ICMPLimit() rate.Limit + func (s *Stack) IPTables() iptables.IPTables + func (s *Stack) IsAddrTentative(id tcpip.NICID, addr tcpip.Address) (bool, *tcpip.Error) + 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) NICAddressRanges() map[tcpip.NICID][]tcpip.Subnet + func (s *Stack) NICInfo() map[tcpip.NICID]NICInfo + 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) NewRawEndpoint(transport tcpip.TransportProtocolNumber, network tcpip.NetworkProtocolNumber, ...) (tcpip.Endpoint, *tcpip.Error) + func (s *Stack) NowNanoseconds() int64 + func (s *Stack) PortSeed() uint32 + func (s *Stack) RegisterRawTransportEndpoint(nicID tcpip.NICID, netProto tcpip.NetworkProtocolNumber, ...) *tcpip.Error + func (s *Stack) RegisterRestoredEndpoint(e ResumableEndpoint) + 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) RemoveAddressRange(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) Resume() + func (s *Stack) SetForwarding(enable bool) + func (s *Stack) SetICMPBurst(burst int) + func (s *Stack) SetICMPLimit(newLimit rate.Limit) + func (s *Stack) SetIPTables(ipt iptables.IPTables) + 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) UnregisterRawTransportEndpoint(nicID tcpip.NICID, netProto tcpip.NetworkProtocolNumber, ...) + 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 + RcvAutoParams RcvBufAutoTuneParams + 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 + HighRxt seqnum.Value + Last seqnum.Value + MaxCwnd int + RescueRxt seqnum.Value + 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 + MaxSACKED seqnum.Value + ReceivedBlocks []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, netHeader buffer.View, ...) + 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 TransportEndpointInfo struct + BindAddr tcpip.Address + BindNICID tcpip.NICID + ID TransportEndpointID + NetProto tcpip.NetworkProtocolNumber + RegisterNICID tcpip.NICID + TransProto tcpip.TransportProtocolNumber + func (*TransportEndpointInfo) IsEndpointInfo() + type TransportProtocol interface + HandleUnknownDestinationPacket func(r *Route, id TransportEndpointID, netHeader buffer.View, ...) bool + MinimumPacketSize func() int + NewEndpoint func(stack *Stack, netProto tcpip.NetworkProtocolNumber, waitQueue *waiter.Queue) (tcpip.Endpoint, *tcpip.Error) + NewRawEndpoint 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 UnassociatedEndpointFactory interface + NewUnassociatedRawEndpoint func(stack *Stack, netProto tcpip.NetworkProtocolNumber, ...) (tcpip.Endpoint, *tcpip.Error)