mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Changes to support ICS network on windows
Signed-off-by: Sandeep Bansal <sabansal@microsoft.com>
This commit is contained in:
parent
57c6fab2cc
commit
6d7e9ea6b4
3 changed files with 18 additions and 0 deletions
|
@ -28,6 +28,9 @@ const (
|
|||
// DNSServers of the network
|
||||
DNSServers = "com.docker.network.windowsshim.dnsservers"
|
||||
|
||||
// MacPool of the network
|
||||
MacPool = "com.docker.network.windowsshim.macpool"
|
||||
|
||||
// SourceMac of the network
|
||||
SourceMac = "com.docker.network.windowsshim.sourcemac"
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@ type networkConfiguration struct {
|
|||
VLAN uint
|
||||
VSID uint
|
||||
DNSServers string
|
||||
MacPools []hcsshim.MacPool
|
||||
DNSSuffix string
|
||||
SourceMac string
|
||||
NetworkAdapterName string
|
||||
|
@ -168,6 +169,18 @@ func (d *driver) parseNetworkOptions(id string, genericOptions map[string]string
|
|||
config.DNSSuffix = value
|
||||
case DNSServers:
|
||||
config.DNSServers = value
|
||||
case MacPool:
|
||||
config.MacPools = make([]hcsshim.MacPool, 0)
|
||||
s := strings.Split(value, ",")
|
||||
if len(s)%2 != 0 {
|
||||
return nil, types.BadRequestErrorf("Invalid mac pool. You must specify both a start range and an end range")
|
||||
}
|
||||
for i := 0; i < len(s)-1; i += 2 {
|
||||
config.MacPools = append(config.MacPools, hcsshim.MacPool{
|
||||
StartMacAddress: s[i],
|
||||
EndMacAddress: s[i+1],
|
||||
})
|
||||
}
|
||||
case VLAN:
|
||||
vlan, err := strconv.ParseUint(value, 10, 32)
|
||||
if err != nil {
|
||||
|
@ -274,6 +287,7 @@ func (d *driver) CreateNetwork(id string, option map[string]interface{}, nInfo d
|
|||
Subnets: subnets,
|
||||
DNSServerList: config.DNSServers,
|
||||
DNSSuffix: config.DNSSuffix,
|
||||
MacPools: config.MacPools,
|
||||
SourceMac: config.SourceMac,
|
||||
NetworkAdapterName: config.NetworkAdapterName,
|
||||
}
|
||||
|
|
|
@ -16,5 +16,6 @@ func getInitializers(experimental bool) []initializer {
|
|||
{windows.GetInit("l2bridge"), "l2bridge"},
|
||||
{windows.GetInit("l2tunnel"), "l2tunnel"},
|
||||
{windows.GetInit("nat"), "nat"},
|
||||
{windows.GetInit("ics"), "ics"},
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue