Documentation ¶
Index ¶
- Constants
- type Client
- type InvalidPortOperatingModeError
- type Port
- func (*Port) ARPHardwareType() header.ARPHardwareType
- func (*Port) AddHeader(_, _ tcpip.LinkAddress, _ tcpip.NetworkProtocolNumber, _ *stack.PacketBuffer)
- func (p *Port) Attach(dispatcher stack.NetworkDispatcher)
- func (*Port) Capabilities() stack.LinkEndpointCapabilities
- func (p *Port) Class() network.DeviceClass
- func (p *Port) Close() error
- func (p *Port) DeviceClass() network.DeviceClass
- func (p *Port) Down() error
- func (*Port) GSOMaxSize() uint32
- func (p *Port) IsAttached() bool
- func (p *Port) LinkAddress() tcpip.LinkAddress
- func (p *Port) MTU() uint32
- func (*Port) MaxHeaderLength() uint16
- func (p *Port) Mode() PortMode
- func (p *Port) RxStats() *fifo.RxStats
- func (p *Port) SetOnLinkClosed(f func())
- func (p *Port) SetOnLinkOnlineChanged(f func(bool))
- func (p *Port) SetPromiscuousMode(enabled bool) error
- func (*Port) SupportedGSO() stack.SupportedGSO
- func (p *Port) TxStats() *fifo.TxStats
- func (p *Port) Up() error
- func (p *Port) Wait()
- func (p *Port) WritePacket(_ stack.RouteInfo, proto tcpip.NetworkProtocolNumber, pkt *stack.PacketBuffer) tcpip.Error
- func (p *Port) WritePackets(_ stack.RouteInfo, pkts stack.PacketBufferList, ...) (int, tcpip.Error)
- func (p *Port) WriteRawPacket(pkt *stack.PacketBuffer) tcpip.Error
- type PortAlreadyBoundError
- type PortMode
- type SessionConfig
- type SessionConfigFactory
- type SimpleSessionConfigFactory
Constants ¶
View Source
const DefaultBufferLength uint32 = 2048
DefaultBufferLength is the buffer length used by SimpleSessionConfigFactory.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a client for a network device that implements the fuchsia.hardware.network.Device protocol.
func NewClient ¶
func NewClient(ctx context.Context, dev *network.DeviceWithCtxInterface, sessionConfigFactory SessionConfigFactory) (*Client, error)
NewClient creates a new client from a provided network device interface.
type InvalidPortOperatingModeError ¶
type InvalidPortOperatingModeError struct {
// contains filtered or unexported fields
}
func (*InvalidPortOperatingModeError) Error ¶
func (e *InvalidPortOperatingModeError) Error() string
type Port ¶
type Port struct {
// contains filtered or unexported fields
}
Port is the instantiation of a network interface backed by a netdevice port.
func (*Port) ARPHardwareType ¶
func (*Port) ARPHardwareType() header.ARPHardwareType
func (*Port) AddHeader ¶
func (*Port) AddHeader(_, _ tcpip.LinkAddress, _ tcpip.NetworkProtocolNumber, _ *stack.PacketBuffer)
func (*Port) Attach ¶
func (p *Port) Attach(dispatcher stack.NetworkDispatcher)
func (*Port) Capabilities ¶
func (*Port) Capabilities() stack.LinkEndpointCapabilities
func (*Port) Class ¶
func (p *Port) Class() network.DeviceClass
func (*Port) DeviceClass ¶
func (p *Port) DeviceClass() network.DeviceClass
func (*Port) IsAttached ¶
func (*Port) LinkAddress ¶
func (p *Port) LinkAddress() tcpip.LinkAddress
func (*Port) MaxHeaderLength ¶
func (*Port) SetOnLinkClosed ¶
func (p *Port) SetOnLinkClosed(f func())
func (*Port) SetOnLinkOnlineChanged ¶
func (*Port) SetPromiscuousMode ¶
func (*Port) SupportedGSO ¶
func (*Port) SupportedGSO() stack.SupportedGSO
SupportedGSO implements stack.GSOEndpoint.
func (*Port) WritePacket ¶
func (p *Port) WritePacket(_ stack.RouteInfo, proto tcpip.NetworkProtocolNumber, pkt *stack.PacketBuffer) tcpip.Error
func (*Port) WritePackets ¶
func (p *Port) WritePackets(_ stack.RouteInfo, pkts stack.PacketBufferList, proto tcpip.NetworkProtocolNumber) (int, tcpip.Error)
func (*Port) WriteRawPacket ¶
func (p *Port) WriteRawPacket(pkt *stack.PacketBuffer) tcpip.Error
type PortAlreadyBoundError ¶
type PortAlreadyBoundError struct {
// contains filtered or unexported fields
}
func (*PortAlreadyBoundError) Error ¶
func (e *PortAlreadyBoundError) Error() string
type SessionConfig ¶
type SessionConfig struct { // Length of each buffer. BufferLength uint32 // Buffer stride on VMO. BufferStride uint32 // Descriptor length, in bytes. DescriptorLength uint64 // Tx header length, in bytes. TxHeaderLength uint16 // Tx tail length, in bytes. TxTailLength uint16 // Number of rx descriptors to allocate. RxDescriptorCount uint16 // Number of tx descriptors to allocate. TxDescriptorCount uint16 // Session flags. Options network.SessionFlags }
SessionConfig holds configuration used to open a session with a network device.
type SessionConfigFactory ¶
type SessionConfigFactory interface {
MakeSessionConfig(deviceInfo network.DeviceInfo) (SessionConfig, error)
}
SessionConfigFactory creates session configurations from device information.
type SimpleSessionConfigFactory ¶
type SimpleSessionConfigFactory struct{}
SimpleSessionConfigFactory is the default configuration factory.
func (*SimpleSessionConfigFactory) MakeSessionConfig ¶
func (c *SimpleSessionConfigFactory) MakeSessionConfig(deviceInfo network.DeviceInfo) (SessionConfig, error)
MakeSessionConfig implements SessionConfigFactory.
Click to show internal directories.
Click to hide internal directories.