bpf: add Setter interface

This interface can be implemented by types which are capable of
attaching compiled BPF filters to themselves, such as
x/net/ipv{4,6}.PacketConn.

Fixes golang/go#19912

Change-Id: I4674c3e312c173d5a7a3beb3cd53704f8c08e29b
Reviewed-on: https://go-review.googlesource.com/44972
Run-TryBot: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
diff --git a/bpf/setter.go b/bpf/setter.go
new file mode 100644
index 0000000..43e35f0
--- /dev/null
+++ b/bpf/setter.go
@@ -0,0 +1,10 @@
+// Copyright 2017 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package bpf
+
+// A Setter is a type which can attach a compiled BPF filter to itself.
+type Setter interface {
+	SetBPF(filter []RawInstruction) error
+}