Documentation ¶
Overview ¶
Provides utility functions for sending and receiving packets over the network. Basically, it hides some of the complexity of using the capture and layers packages together.
Index ¶
- func NextHopMAC(c capture.Handle, t time.Duration, r *routing.Route, addr net.IP) (net.HardwareAddr, error)
- func Recv(c capture.Handle) (packet.Packet, error)
- func Send(c capture.Handle, pkts ...packet.Packet) error
- func SendRecv(c capture.Handle, t time.Duration, pkts ...packet.Packet) (packet.Packet, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NextHopMAC ¶
func NextHopMAC(c capture.Handle, t time.Duration, r *routing.Route, addr net.IP) (net.HardwareAddr, error)
Determine the next hop's MAX address to reach the given IP address and route by doing an ARP resolution.
func Recv ¶
Capture a single packet from the given capture handle, unpack it and return it. This will block until a packet is received.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.