utils_windows.go 934 B

12345678910111213141516171819202122232425
  1. package netutils
  2. import (
  3. "net"
  4. "github.com/docker/libnetwork/types"
  5. )
  6. // ElectInterfaceAddresses looks for an interface on the OS with the specified name
  7. // and returns returns all its IPv4 and IPv6 addresses in CIDR notation.
  8. // If a failure in retrieving the addresses or no IPv4 address is found, an error is returned.
  9. // If the interface does not exist, it chooses from a predefined
  10. // list the first IPv4 address which does not conflict with other
  11. // interfaces on the system.
  12. func ElectInterfaceAddresses(name string) ([]*net.IPNet, []*net.IPNet, error) {
  13. return nil, nil, types.NotImplementedErrorf("not supported on windows")
  14. }
  15. // FindAvailableNetwork returns a network from the passed list which does not
  16. // overlap with existing interfaces in the system
  17. // TODO : Use appropriate windows APIs to identify non-overlapping subnets
  18. func FindAvailableNetwork(list []*net.IPNet) (*net.IPNet, error) {
  19. return nil, nil
  20. }