2015-04-04 00:06:48 -04:00
|
|
|
package network
|
2014-04-14 02:15:31 -04:00
|
|
|
|
2015-06-30 12:41:01 -04:00
|
|
|
import "github.com/docker/docker/pkg/nat"
|
2014-04-14 02:15:31 -04:00
|
|
|
|
2015-07-21 07:34:57 -04:00
|
|
|
// Address represents an IP address
|
2015-05-06 18:39:29 -04:00
|
|
|
type Address struct {
|
|
|
|
Addr string
|
|
|
|
PrefixLen int
|
|
|
|
}
|
|
|
|
|
2015-10-09 14:21:48 -04:00
|
|
|
// IPAM represents IP Address Management
|
|
|
|
type IPAM struct {
|
|
|
|
Driver string `json:"driver"`
|
|
|
|
Config []IPAMConfig `json:"config"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// IPAMConfig represents IPAM configurations
|
|
|
|
type IPAMConfig struct {
|
|
|
|
Subnet string `json:"subnet,omitempty"`
|
|
|
|
IPRange string `json:"ip_range,omitempty"`
|
|
|
|
Gateway string `json:"gateway,omitempty"`
|
|
|
|
AuxAddress map[string]string `json:"auxiliary_address,omitempty"`
|
|
|
|
}
|
|
|
|
|
2015-07-21 07:34:57 -04:00
|
|
|
// Settings stores configuration details about the daemon network config
|
2015-08-06 22:21:00 -04:00
|
|
|
// TODO Windows. Many of these fields can be factored out.,
|
2015-04-04 00:06:48 -04:00
|
|
|
type Settings struct {
|
2015-05-06 18:39:29 -04:00
|
|
|
Bridge string
|
2015-09-02 19:43:28 -04:00
|
|
|
SandboxID string
|
2015-05-06 18:39:29 -04:00
|
|
|
HairpinMode bool
|
2015-01-08 18:03:19 -05:00
|
|
|
LinkLocalIPv6Address string
|
|
|
|
LinkLocalIPv6PrefixLen int
|
2015-10-26 08:00:49 -04:00
|
|
|
Networks map[string]*EndpointSettings
|
2015-01-08 18:03:19 -05:00
|
|
|
Ports nat.PortMap
|
2015-05-06 18:39:29 -04:00
|
|
|
SandboxKey string
|
|
|
|
SecondaryIPAddresses []Address
|
|
|
|
SecondaryIPv6Addresses []Address
|
2015-10-21 12:08:19 -04:00
|
|
|
IsAnonymousEndpoint bool
|
2014-04-14 02:15:31 -04:00
|
|
|
}
|
2015-10-26 08:00:49 -04:00
|
|
|
|
|
|
|
// EndpointSettings stores the network endpoint details
|
|
|
|
type EndpointSettings struct {
|
|
|
|
EndpointID string
|
|
|
|
Gateway string
|
|
|
|
IPAddress string
|
|
|
|
IPPrefixLen int
|
|
|
|
IPv6Gateway string
|
|
|
|
GlobalIPv6Address string
|
|
|
|
GlobalIPv6PrefixLen int
|
|
|
|
MacAddress string
|
|
|
|
}
|