Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Device ¶
type Device interface {
stack.LinkEndpoint
// Name returns the current name of the device.
Name() string
// Type returns the driver type of the device.
Type() string
}
Device is the interface that implemented by network layer devices (e.g. tun), and easy to use as stack.LinkEndpoint.
type Endpoint ¶ added in v0.2.0
Endpoint wraps a LinkEndpoint and captures all packets to PCAP
func NewEthSniffer ¶ added in v0.2.0
func NewEthSniffer(lower stack.LinkEndpoint, outputFile string) (*Endpoint, error)
NewEthSniffer creates a LinkEndpoint wrapper that captures packets to PCAP
func (*Endpoint) DeliverNetworkPacket ¶ added in v0.2.0
func (e *Endpoint) DeliverNetworkPacket(protocol tcpip.NetworkProtocolNumber, pkt *stack.PacketBuffer)
DeliverNetworkPacket implements stack.NetworkDispatcher - captures incoming packets
func (*Endpoint) WritePackets ¶ added in v0.2.0
WritePackets implements stack.LinkEndpoint - captures outgoing packets
type NetworkConfig ¶ added in v0.1.0
type NetworkConfig struct {
Network *net.IPNet
LocalIP net.IP
LocalMAC net.HardwareAddr
MTU uint32
}
NetworkConfig holds the parsed network configuration
type PCAP ¶
type PCAP struct {
stack.LinkEndpoint
Interface net.Interface
// contains filtered or unexported fields
}
func (*PCAP) SetHardwareAddr ¶
func (t *PCAP) SetHardwareAddr(srcIP net.IP, srcMAC net.HardwareAddr)
type Stacker ¶
type Stacker interface {
AddStaticNeighbor(nicID tcpip.NICID, protocol tcpip.NetworkProtocolNumber, addr tcpip.Address, linkAddr tcpip.LinkAddress) tcpip.Error
AddProtocolAddress(id tcpip.NICID, protocolAddress tcpip.ProtocolAddress, properties stack.AddressProperties) tcpip.Error
}
Click to show internal directories.
Click to hide internal directories.