network

package
v0.0.0-...-e25d287 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendWithOpts

func SendWithOpts(driver *Driver, payload []byte, opts ...func(*layers.IPv4, *layers.TCP) error) error

Types

type Driver

type Driver struct {
	DstMAC net.HardwareAddr
	// contains filtered or unexported fields
}

func NewDriver

func NewDriver() (*Driver, error)

func NewDriverManual

func NewDriverManual(ifaceName, ifaceIP string) (*Driver, error)

func (*Driver) Close

func (d *Driver) Close() error

func (*Driver) Read

func (d *Driver) Read(buf []byte) (int, error)

func (*Driver) Write

func (d *Driver) Write(b []byte) (int, error)

func (*Driver) WriteTo

func (d *Driver) WriteTo(b []byte, mac net.HardwareAddr) (int, error)

type RawConn

type RawConn struct {
	// contains filtered or unexported fields
}

func (*RawConn) Close

func (c *RawConn) Close() error

Close implements net.Conn.

func (*RawConn) Flush

func (c *RawConn) Flush() error

func (*RawConn) GetSeq

func (c *RawConn) GetSeq() uint32

func (*RawConn) LocalAddr

func (c *RawConn) LocalAddr() net.Addr

LocalAddr implements net.Conn.

func (*RawConn) Read

func (c *RawConn) Read(b []byte) (n int, err error)

Read implements net.Conn.

func (*RawConn) RemoteAddr

func (c *RawConn) RemoteAddr() net.Addr

RemoteAddr implements net.Conn.

func (*RawConn) Send

func (*RawConn) SendWithOpts

func (c *RawConn) SendWithOpts(payload []byte, opts ...func(*layers.IPv4, *layers.TCP) error) error

func (*RawConn) SetDeadline

func (c *RawConn) SetDeadline(t time.Time) error

SetDeadline implements net.Conn.

func (*RawConn) SetReadDeadline

func (c *RawConn) SetReadDeadline(t time.Time) error

SetReadDeadline implements net.Conn.

func (*RawConn) SetSeq

func (c *RawConn) SetSeq(seq uint32)

func (*RawConn) SetWriteDeadline

func (c *RawConn) SetWriteDeadline(t time.Time) error

SetWriteDeadline implements net.Conn.

func (*RawConn) Write

func (c *RawConn) Write(b []byte) (n int, err error)

Write implements net.Conn.

type TCP

type TCP struct {
	// contains filtered or unexported fields
}

func NewTCP

func NewTCP(driver *Driver) (*TCP, error)

func (*TCP) Close

func (d *TCP) Close() error

func (*TCP) Dial

func (d *TCP) Dial(ctx context.Context, addr *net.TCPAddr) (*RawConn, error)

func (*TCP) LocalIP

func (d *TCP) LocalIP() net.IP

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL