Documentation ¶
Overview ¶
Package kcm provides access to Linux Kernel Connection Multiplexor sockets (AF_KCM).
Index ¶
- type ClientConn
- type Config
- type Conn
- func (c *Conn) Attach(sc syscall.Conn, bpfFD int) (*ClientConn, error)
- func (c *Conn) Clone() (*Conn, error)
- func (c *Conn) Close() error
- func (c *Conn) Read(b []byte) (int, error)
- func (c *Conn) SetDeadline(t time.Time) error
- func (c *Conn) SetReadDeadline(t time.Time) error
- func (c *Conn) SetWriteDeadline(t time.Time) error
- func (c *Conn) Write(b []byte) (int, error)
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientConn ¶
type ClientConn struct {
// contains filtered or unexported fields
}
A ClientConn is a client TCP connection which has been attached to a KCM Conn multiplexor. A ClientConn is created using the Conn.Attach method.
func (*ClientConn) Wait ¶
func (cc *ClientConn) Wait() error
Wait waits for a client TCP connection to terminate, then unattaches it from the underlying Conn's multiplexor. Wait should be used to clean up resources from completed client connections.
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
A Conn is a Linux Kernel Connection Multiplexor (AF_KCM) connection.
func Listen ¶
Listen opens a Kernel Connection Multiplexor socket using the given socket type.
The socket type must be one of the Type constants: Datagram or SequencedPacket.
The Config specifies optional configuration for the Conn. A nil *Config applies the default configuration.
func (*Conn) Attach ¶
Attach attaches a given client TCP connection to the multiplexor attached to Conn, using the input eBPF program file descriptor to frame incoming network protocol bytes into atomic messages.
The ClientConn produced by Attach takes ownership of the TCP connection; no further methods (including Close) should be called on that connection. See ClientConn.Wait to clean up a completed client connection.
func (*Conn) Clone ¶
Clone produces a cloned Conn which is attached to the same kernel multiplexor as the existing Conn. Connections will be distributed by the kernel to any Conn attached to the same multiplexor.
func (*Conn) SetDeadline ¶
SetDeadline sets a read and write deadline for Conn.
func (*Conn) SetReadDeadline ¶
SetReadDeadline sets a read deadline for Conn.
func (*Conn) SetWriteDeadline ¶
SetWriteDeadline sets a write deadline for Conn.