Documentation ¶
Index ¶
- func GetLocalIP(dstIP net.IP) (net.IP, *net.Interface, net.IP, error)
- func Htons(port uint16) uint16
- func ListInterfaces() error
- type ARPCache
- type ARPEntry
- type RawIPConn
- func (conn *RawIPConn) Close() error
- func (conn *RawIPConn) LocalIP() net.IP
- func (conn *RawIPConn) Read(buffer []byte) (int, error)
- func (conn *RawIPConn) ReadFrom(buffer []byte) (int, net.Addr, error)
- func (conn *RawIPConn) RemoteIP() net.IP
- func (conn *RawIPConn) SetReadDeadline(t time.Time) error
- func (conn *RawIPConn) Write(data []byte) (int, error)
- func (conn *RawIPConn) WriteTo(data []byte, addr net.Addr) (int, error)
- type RawIPConnConfig
- type RawIPConnParams
- type RawSocketCore
- type TimeoutError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLocalIP ¶
getLocalIP finds the local IP that can route to the given destination IP
func ListInterfaces ¶
func ListInterfaces() error
listInterfaces prints the available network interfaces
Types ¶
type ARPCache ¶
type ARPCache struct {
// contains filtered or unexported fields
}
func NewARPCache ¶
type RawIPConn ¶
type RawIPConn struct {
// contains filtered or unexported fields
}
RawIPConn represents a connection for raw IP packets.
func NewRawIPConn ¶
func NewRawIPConn(params *RawIPConnParams, config *RawIPConnConfig) (*RawIPConn, error)
func (*RawIPConn) ReadFrom ¶
ReadFrom reads a packet from the RawIPConn and returns the payload and the source address.
type RawIPConnConfig ¶
type RawIPConnConfig struct {
// contains filtered or unexported fields
}
type RawIPConnParams ¶
type RawIPConnParams struct {
// contains filtered or unexported fields
}
type RawSocketCore ¶
type RawSocketCore struct {
// contains filtered or unexported fields
}
func NewRawSocketCore ¶
func NewRawSocketCore(arpCacheTimeout, arpRequestTimeout int) *RawSocketCore
func (*RawSocketCore) Close ¶
func (core *RawSocketCore) Close()
func (*RawSocketCore) DialIP ¶
func (core *RawSocketCore) DialIP(protocol layers.IPProtocol, srcIP, dstIP net.IP) (*RawIPConn, error)
func (*RawSocketCore) ListenIP ¶
func (core *RawSocketCore) ListenIP(ip net.IP, protocol layers.IPProtocol) (*RawIPConn, error)
type TimeoutError ¶
type TimeoutError struct {
// contains filtered or unexported fields
}
func (*TimeoutError) Error ¶
func (e *TimeoutError) Error() string
func (*TimeoutError) Temporary ¶
func (e *TimeoutError) Temporary() bool
func (*TimeoutError) Timeout ¶
func (e *TimeoutError) Timeout() bool
Click to show internal directories.
Click to hide internal directories.