Reapply "Merge pull request #132 from eddc005/feat-pcap"

This reverts commit 2ac8783eb6.
This commit is contained in:
Haruue
2024-05-08 19:13:49 +08:00
parent 3ec5456e86
commit 8cab86b924
7 changed files with 184 additions and 10 deletions

View File

@@ -48,6 +48,9 @@ type PacketIO interface {
ProtectedDialContext(ctx context.Context, network, address string) (net.Conn, error)
// Close closes the packet IO.
Close() error
// SetCancelFunc gives packet IO access to context cancel function, enabling it to
// trigger a shutdown
SetCancelFunc(cancelFunc context.CancelFunc) error
}
type ErrInvalidPacket struct {