netns_darwin.go 634 B

1234567891011121314151617181920212223242526
  1. // Copyright (c) 2016 Arista Networks, Inc.
  2. // Use of this source code is governed by the Apache License 2.0
  3. // that can be found in the COPYING file.
  4. package netns
  5. // stub: close closes the file descriptor mapped to a network namespace
  6. func (h nsHandle) close() error {
  7. return nil
  8. }
  9. // stub: fd returns the handle as a uintptr
  10. func (h nsHandle) fd() int {
  11. return 0
  12. }
  13. // stub: getNs returns a file descriptor mapping to the given network namespace
  14. var getNs = func(nsName string) (handle, error) {
  15. return nsHandle(1), nil
  16. }
  17. // stub: setNs sets the process's network namespace
  18. var setNs = func(fd handle) error {
  19. return nil
  20. }