mdlayher / raw

Package raw enables reading and writing data at the device driver level for a network interface. MIT Licensed.
MIT License
425 stars 71 forks source link

Export SetBPFDirection #48

Closed hdm closed 5 years ago

hdm commented 5 years ago

This PR exports a SetBPFDirection function, which allows this package to be used to capture outbound packets (the default is to only limit to inbound).

An alternative implementation would be to pass the direction flag as a member of the Config struct and set it in listenPacket().

This replaces #47

mdlayher commented 5 years ago

I think this is a better fit for Config instead of exporting a potentially confusing API. It should mention it's *BSD only as well.

hdm commented 5 years ago

Thanks! I'll rework this and come back with a separate PR.