Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add af_packet capture engine #950

Merged
merged 1 commit into from
Jun 26, 2021
Merged

Add af_packet capture engine #950

merged 1 commit into from
Jun 26, 2021

Conversation

buger
Copy link
Owner

@buger buger commented Jun 26, 2021

It is a high performant alternative to libpcap engine.
Only Linux supported.

Performance gain can be up to 50% depending on traffic type.
Can be enabled using:

--input-raw-engine af_packet

It is a high performant alternative to libpcap engine.
Only Linux supported.

Performance gain can be up to 50% depending on traffic type.
Can be enabled using:

`--input-raw-engine af_packet`
@buger buger merged commit 05d09ce into master Jun 26, 2021
@buger buger deleted the af_packet branch June 26, 2021 20:03
TPacket *afpacket.TPacket
}

func newAfpacketHandle(device string, snaplen int, block_size int, num_blocks int,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't use underscores in Go names; func parameter block_size should be blockSize
don't use underscores in Go names; func parameter num_blocks should be numBlocks

"github.com/google/gopacket/pcap"
"golang.org/x/net/bpf"

_ "github.com/google/gopacket/layers"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a blank import should be only in a main or test package, or have a comment justifying it

xingren23 referenced this pull request in xingren23/goreplay Sep 4, 2021
It is a high performant alternative to libpcap engine.
Only Linux supported.

Performance gain can be up to 50% depending on traffic type.
Can be enabled using:

`--input-raw-engine af_packet`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants