MCPcopy
hub / github.com/google/gopacket / Packets

Method Packets

packet.go:858–864  ·  view source on GitHub ↗

Packets returns a channel of packets, allowing easy iterating over packets. Packets will be asynchronously read in from the underlying PacketDataSource and written to the returned channel. If the underlying PacketDataSource returns an io.EOF error, the channel will be closed. If any other error is

()

Source from the content-addressed store, hash-verified

856//
857// If called more than once, returns the same channel.
858func (p *PacketSource) Packets() chan Packet {
859 if p.c == nil {
860 p.c = make(chan Packet, 1000)
861 go p.packetsToChannel()
862 }
863 return p.c
864}

Callers 9

RunFunction · 0.95
TestPcapFileReadFunction · 0.95
mainFunction · 0.95
Example_captureEthernetFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95
readARPFunction · 0.95
mainFunction · 0.95
mainFunction · 0.95

Calls 1

packetsToChannelMethod · 0.95

Tested by 2

TestPcapFileReadFunction · 0.76
Example_captureEthernetFunction · 0.76