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