conn_others.go 951 B

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