(cidr string)
| 9 | var DefaultBridgeCIDR = "172.19.0.1/30" |
| 10 | |
| 11 | func BridgeIPFromCIDR(cidr string) (net.IP, int) { |
| 12 | ipNet := mustParseIPv4Net(cidr) |
| 13 | prefixLen, _ := ipNet.Mask.Size() |
| 14 | bridgeIP := mustNextIPv4(ipNet.IP, 1) |
| 15 | return bridgeIP, prefixLen |
| 16 | } |
| 17 | |
| 18 | func mustParseIPv4Net(s string) *net.IPNet { |
| 19 | _, n, err := net.ParseCIDR(s) |
no test coverage detected