summaryrefslogtreecommitdiff
path: root/libgo/go/syscall/lsf_linux.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/syscall/lsf_linux.go')
-rw-r--r--libgo/go/syscall/lsf_linux.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/libgo/go/syscall/lsf_linux.go b/libgo/go/syscall/lsf_linux.go
index 48ba191c6d..16b702a984 100644
--- a/libgo/go/syscall/lsf_linux.go
+++ b/libgo/go/syscall/lsf_linux.go
@@ -1,4 +1,4 @@
-// Copyright 2011 The Go Authors. All rights reserved.
+// Copyright 2011 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.
@@ -10,14 +10,17 @@ import (
"unsafe"
)
+// Deprecated: Use golang.org/x/net/bpf instead.
func LsfStmt(code, k int) *SockFilter {
return &SockFilter{Code: uint16(code), K: uint32(k)}
}
+// Deprecated: Use golang.org/x/net/bpf instead.
func LsfJump(code, k, jt, jf int) *SockFilter {
return &SockFilter{Code: uint16(code), Jt: uint8(jt), Jf: uint8(jf), K: uint32(k)}
}
+// Deprecated: Use golang.org/x/net/bpf instead.
func LsfSocket(ifindex, proto int) (int, error) {
var lsall SockaddrLinklayer
s, e := Socket(AF_PACKET, SOCK_RAW, proto)
@@ -41,6 +44,7 @@ type iflags struct {
flags uint16
}
+// Deprecated: Use golang.org/x/net/bpf instead.
func SetLsfPromisc(name string, m bool) error {
s, e := Socket(AF_INET, SOCK_DGRAM, 0)
if e != nil {
@@ -56,7 +60,7 @@ func SetLsfPromisc(name string, m bool) error {
if m {
ifl.flags |= uint16(IFF_PROMISC)
} else {
- ifl.flags &= ^uint16(IFF_PROMISC)
+ ifl.flags &^= uint16(IFF_PROMISC)
}
_, _, ep = Syscall(SYS_IOCTL, uintptr(s), SIOCSIFFLAGS, uintptr(unsafe.Pointer(&ifl)))
if ep != 0 {
@@ -65,6 +69,7 @@ func SetLsfPromisc(name string, m bool) error {
return nil
}
+// Deprecated: Use golang.org/x/net/bpf instead.
func AttachLsf(fd int, i []SockFilter) error {
var p SockFprog
p.Len = uint16(len(i))
@@ -72,6 +77,7 @@ func AttachLsf(fd int, i []SockFilter) error {
return setsockopt(fd, SOL_SOCKET, SO_ATTACH_FILTER, unsafe.Pointer(&p), Socklen_t(unsafe.Sizeof(p)))
}
+// Deprecated: Use golang.org/x/net/bpf instead.
func DetachLsf(fd int) error {
var dummy int
return setsockopt(fd, SOL_SOCKET, SO_DETACH_FILTER, unsafe.Pointer(&dummy), Socklen_t(unsafe.Sizeof(dummy)))