conn_others.go 970 B

123456789101112131415161718192021222324252627282930
  1. //go:build !linux
  2. // +build !linux
  3. package netlink
  4. import (
  5. "fmt"
  6. "runtime"
  7. )
  8. // errUnimplemented is returned by all functions on platforms that
  9. // cannot make use of netlink sockets.
  10. var errUnimplemented = fmt.Errorf("netlink: not implemented on %s/%s",
  11. runtime.GOOS, runtime.GOARCH)
  12. var _ Socket = &conn{}
  13. // A conn is the no-op implementation of a netlink sockets connection.
  14. type conn struct{}
  15. // All cross-platform functions and Socket methods are unimplemented outside
  16. // of Linux.
  17. func dial(_ int, _ *Config) (*conn, uint32, error) { return nil, 0, errUnimplemented }
  18. func newError(_ int) error { return errUnimplemented }
  19. func (c *conn) Send(_ Message) error { return errUnimplemented }
  20. func (c *conn) SendMessages(_ []Message) error { return errUnimplemented }
  21. func (c *conn) Receive() ([]Message, error) { return nil, errUnimplemented }
  22. func (c *conn) Close() error { return errUnimplemented }