forked from mdlayher/netlink
-
Notifications
You must be signed in to change notification settings - Fork 0
/
conn_others.go
62 lines (48 loc) · 1.32 KB
/
conn_others.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//+build !linux
package netlink
import (
"fmt"
"runtime"
"golang.org/x/net/bpf"
)
var (
// errUnimplemented is returned by all functions on platforms that
// cannot make use of netlink sockets.
errUnimplemented = fmt.Errorf("netlink sockets not implemented on %s/%s",
runtime.GOOS, runtime.GOARCH)
)
var _ Socket = &conn{}
// A conn is the no-op implementation of a netlink sockets connection.
type conn struct{}
// dial is the entry point for Dial. dial always returns an error.
func dial(family int, config *Config) (*conn, uint32, error) {
return nil, 0, errUnimplemented
}
// Send always returns an error.
func (c *conn) Send(m Message) error {
return errUnimplemented
}
// Receive always returns an error.
func (c *conn) Receive() ([]Message, error) {
return nil, errUnimplemented
}
// Close always returns an error.
func (c *conn) Close() error {
return errUnimplemented
}
// JoinGroup always returns an error.
func (c *conn) JoinGroup(group uint32) error {
return errUnimplemented
}
// LeaveGroup always returns an error.
func (c *conn) LeaveGroup(group uint32) error {
return errUnimplemented
}
// SetBPF always returns an error.
func (c *conn) SetBPF(filter []bpf.RawInstruction) error {
return errUnimplemented
}
// newError always returns an error.
func newError(errno int) error {
return errUnimplemented
}