2014-06-20 07:36:39 +08:00
|
|
|
package network
|
|
|
|
|
|
|
|
// Network defines configuration for a container's networking stack
|
|
|
|
//
|
|
|
|
// The network configuration can be omited from a container causing the
|
|
|
|
// container to be setup with the host's networking stack
|
|
|
|
type Network struct {
|
|
|
|
// Type sets the networks type, commonly veth and loopback
|
|
|
|
Type string `json:"type,omitempty"`
|
|
|
|
|
|
|
|
// Path to network namespace
|
2014-06-24 04:40:37 +08:00
|
|
|
NsPath string `json:"ns_path,omitempty"`
|
2014-06-20 07:36:39 +08:00
|
|
|
|
|
|
|
// The bridge to use.
|
2014-06-24 04:40:37 +08:00
|
|
|
Bridge string `json:"bridge,omitempty"`
|
2014-06-20 07:36:39 +08:00
|
|
|
|
|
|
|
// Prefix for the veth interfaces.
|
2014-06-24 06:19:14 +08:00
|
|
|
VethPrefix string `json:"veth_prefix,omitempty"`
|
2014-06-20 07:36:39 +08:00
|
|
|
|
2014-09-24 17:36:40 +08:00
|
|
|
// Address contains the IPv4 and mask to set on the network interface
|
2014-06-20 07:36:39 +08:00
|
|
|
Address string `json:"address,omitempty"`
|
|
|
|
|
2014-09-25 02:47:23 +08:00
|
|
|
// IPv6Address contains the IPv6 and mask to set on the network interface
|
|
|
|
IPv6Address string `json:"ipv6_address,omitempty"`
|
2014-09-24 17:36:40 +08:00
|
|
|
|
2014-06-20 07:36:39 +08:00
|
|
|
// Gateway sets the gateway address that is used as the default for the interface
|
|
|
|
Gateway string `json:"gateway,omitempty"`
|
|
|
|
|
2014-09-25 02:47:23 +08:00
|
|
|
// IPv6Gateway sets the ipv6 gateway address that is used as the default for the interface
|
|
|
|
IPv6Gateway string `json:"ipv6_gateway,omitempty"`
|
2014-09-24 17:36:40 +08:00
|
|
|
|
2014-06-20 07:36:39 +08:00
|
|
|
// Mtu sets the mtu value for the interface and will be mirrored on both the host and
|
|
|
|
// container's interfaces if a pair is created, specifically in the case of type veth
|
2014-07-15 08:50:54 +08:00
|
|
|
// Note: This does not apply to loopback interfaces.
|
2014-06-20 07:36:39 +08:00
|
|
|
Mtu int `json:"mtu,omitempty"`
|
|
|
|
}
|
2014-06-26 06:51:28 +08:00
|
|
|
|
|
|
|
// Struct describing the network specific runtime state that will be maintained by libcontainer for all running containers
|
|
|
|
// Do not depend on it outside of libcontainer.
|
|
|
|
type NetworkState struct {
|
|
|
|
// The name of the veth interface on the Host.
|
|
|
|
VethHost string `json:"veth_host,omitempty"`
|
|
|
|
// The name of the veth interface created inside the container for the child.
|
|
|
|
VethChild string `json:"veth_child,omitempty"`
|
|
|
|
// Net namespace path.
|
|
|
|
NsPath string `json:"ns_path,omitempty"`
|
|
|
|
}
|