muxer

package
v0.7.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package muxer helps solve the problem that captures take place only on a per-interface basis, but tcp-info collects flow information with no reference to the underlying interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustCaptureTCPOnInterfaces

func MustCaptureTCPOnInterfaces(ctx context.Context, interfaces []net.Interface, packets chan<- gopacket.Packet, pcapOpenLive PcapHandleOpener, maxHeaderSize int32)

MustCaptureTCPOnInterfaces fires off a packet capture on every one of the passed-in list of interfaces, and then muxes the resulting packet streams to all be sent to the passed-in packets channel.

Types

type PcapHandleOpener

type PcapHandleOpener func(device string, snaplen int32, promisc bool, timeout time.Duration) (handle *pcap.Handle, _ error)

PcapHandleOpener is a type to allow injection of fake packet captures to aid in testing. It is exactly the type of pcap.OpenLive, and in production code every variable of this type should be set to pcap.OpenLive.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL