Documentation ¶
Overview ¶
Package phys implements an interface for reading/writing IPX packets to a physical network interface.
Package phys implements a reader/writer object for reading and writing IPX packets from a TAP device.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( Framer802_2 = framer802_2{} Framer802_3Raw = framer802_3Raw{} FramerSNAP = framerSNAP{} FramerEthernetII = framerEthernetII{} )
Functions ¶
func CopyFrames ¶
func CopyFrames(a, b DuplexEthernetStream) error
CopyFrames starts a background process that copies packets between the given two streams.
Types ¶
type DuplexEthernetStream ¶
type DuplexEthernetStream interface { gopacket.PacketDataSource PacketDataSink }
DuplexEthernetStream extends gopacket.PacketDataSource to an interface where packets can be both read and written.
type Flags ¶
func RegisterFlags ¶
func RegisterFlags() *Flags
func (*Flags) EthernetStream ¶
func (f *Flags) EthernetStream(captureNonIPX bool) (DuplexEthernetStream, error)
type PacketDataSink ¶
PacketDataSink is the complement to gopacket.PacketDataSource: the WritePacketData method implemented by gopacket's pcap.Handle that allows packets to be written to an output.
type PcapgoDataSink ¶
type PcapgoDataSink interface {
WritePacket(ci gopacket.CaptureInfo, data []byte) error
}
PcapgoDataSink is the packet writing interface implemented by the gopacket/pcapgo writer types.
type Phys ¶
type Phys struct { *Sink // contains filtered or unexported fields }
Phys is an implementation of ipx.ReadWriteCloser that reads and writes IPX packets from a physical network interface.
func NewPhys ¶
func NewPhys(stream DuplexEthernetStream, framer Framer) *Phys
func (*Phys) NonIPX ¶
func (p *Phys) NonIPX() DuplexEthernetStream
NonIPX returns a DuplexEthernetStream from which all non-IPX Ethernet frames will be returned by ReadPacketData().
func (*Phys) ReadPacket ¶
ReadPacket implements the ipx.Reader interface, and will block until an IPX packet is read from the physical interface.
type Sink ¶
type Sink struct {
// contains filtered or unexported fields
}
Sink is an implementation of ipx.WriteCloser that frames IPX packets and writes them to a physical network interface.
func NewPcapgoSink ¶
func NewPcapgoSink(pds PcapgoDataSink, framer Framer) *Sink
NewPcapgoSink returns an implementation of ipx.WriteCloser that writes packets to the given pcapgo Writer.
func NewSink ¶
func NewSink(pds PacketDataSink, framer Framer) *Sink
NewSink returns an implementation of ipx.WriteCloser that writes packets to the given gopacket data sink.