Documentation ¶
Index ¶
- Constants
- type Client
- func (*Client) ARPHardwareType() header.ARPHardwareType
- func (*Client) AddHeader(_, _ tcpip.LinkAddress, _ tcpip.NetworkProtocolNumber, _ *stack.PacketBuffer)
- func (c *Client) Attach(dispatcher stack.NetworkDispatcher)
- func (c *Client) Capabilities() stack.LinkEndpointCapabilities
- func (c *Client) Close() error
- func (c *Client) DeviceClass() network.DeviceClass
- func (c *Client) Down() error
- func (c *Client) GSOMaxSize() uint32
- func (c *Client) Info() network.Info
- func (c *Client) IsAttached() bool
- func (c *Client) LinkAddress() tcpip.LinkAddress
- func (c *Client) MTU() uint32
- func (c *Client) MaxHeaderLength() uint16
- func (c *Client) RxStats() *fifo.RxStats
- func (c *Client) SetOnLinkClosed(f func())
- func (c *Client) SetOnLinkOnlineChanged(f func(bool))
- func (c *Client) SetPromiscuousMode(bool) error
- func (c *Client) TxStats() *fifo.TxStats
- func (c *Client) Up() error
- func (c *Client) Wait()
- func (c *Client) WritePacket(_ stack.RouteInfo, _ *stack.GSO, proto tcpip.NetworkProtocolNumber, ...) tcpip.Error
- func (c *Client) WritePackets(_ stack.RouteInfo, _ *stack.GSO, pkts stack.PacketBufferList, ...) (int, tcpip.Error)
- type InfoProvider
- type MacAddressingClient
- type SessionConfig
- type SessionConfigFactory
- type SimpleSessionConfigFactory
Constants ¶
const DefaultBufferLength uint32 = 2048
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
}
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.
func (*Client) ARPHardwareType ¶
func (*Client) ARPHardwareType() header.ARPHardwareType
func (*Client) AddHeader ¶
func (*Client) AddHeader(_, _ tcpip.LinkAddress, _ tcpip.NetworkProtocolNumber, _ *stack.PacketBuffer)
func (*Client) Attach ¶
func (c *Client) Attach(dispatcher stack.NetworkDispatcher)
func (*Client) Capabilities ¶
func (c *Client) Capabilities() stack.LinkEndpointCapabilities
func (*Client) DeviceClass ¶
func (c *Client) DeviceClass() network.DeviceClass
func (*Client) GSOMaxSize ¶
func (*Client) IsAttached ¶
func (*Client) LinkAddress ¶
func (c *Client) LinkAddress() tcpip.LinkAddress
func (*Client) MaxHeaderLength ¶
func (*Client) SetOnLinkClosed ¶
func (c *Client) SetOnLinkClosed(f func())
func (*Client) SetOnLinkOnlineChanged ¶
func (*Client) SetPromiscuousMode ¶
func (*Client) WritePacket ¶
func (*Client) WritePackets ¶
type InfoProvider ¶
InfoProvider abstracts a common information interface for different Clients.
type MacAddressingClient ¶
type MacAddressingClient struct { *Client // contains filtered or unexported fields }
A fuchsia.hardware.network/Device client with an auxiliary fuchsia.hardware.network/MacAddressing proxy that provides the link layer information.
func NewMacAddressingClient ¶
func NewMacAddressingClient(ctx context.Context, dev *network.DeviceWithCtxInterface, mac *network.MacAddressingWithCtxInterface, sessionConfigFactory SessionConfigFactory) (*MacAddressingClient, error)
NewMacAddressingClient creates a new Network Device client with attached link-layer MAC information.
func (*MacAddressingClient) LinkAddress ¶
func (c *MacAddressingClient) LinkAddress() tcpip.LinkAddress
func (*MacAddressingClient) SetPromiscuousMode ¶
func (c *MacAddressingClient) SetPromiscuousMode(b bool) error
type SessionConfig ¶
type SessionConfig struct { // Length of each buffer. BufferLength uint32 // Buffer stride on VMO. BufferStride uint32 // Descriptor length, in bytes. DescriptorLength uint64 // Number of rx descriptors to allocate. RxDescriptorCount uint16 // Number of tx descriptors to allocate. TxDescriptorCount uint16 // Session flags. Options network.SessionFlags // Types of rx frames to subscribe to. RxFrames []network.FrameType }
Configuration used to open a session with a network device.
type SessionConfigFactory ¶
type SessionConfigFactory interface { // Creates a SessionConfig for a given network device based on the provided // deviceInfo. MakeSessionConfig(deviceInfo *network.Info) (SessionConfig, error) }
A factory of session configurations from device information. A default implementation is provided by SimpleSessionConfigFactory.
type SimpleSessionConfigFactory ¶
type SimpleSessionConfigFactory struct { // The frame types to subscribe to. Will subscribe to all frame types if // empty. FrameTypes []network.FrameType }
A simple session configuration factory.
func (*SimpleSessionConfigFactory) MakeSessionConfig ¶
func (c *SimpleSessionConfigFactory) MakeSessionConfig(deviceInfo *network.Info) (SessionConfig, error)
MakeSessionConfig implements SessionConfigFactory.