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
|
|
|
|
|
|
|
// Address contains the IP and mask to set on the network interface
|
|
|
|
Address string `json:"address,omitempty"`
|
|
|
|
|
|
|
|
// Gateway sets the gateway address that is used as the default for the interface
|
|
|
|
Gateway string `json:"gateway,omitempty"`
|
|
|
|
|
|
|
|
// 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
|
|
|
|
Mtu int `json:"mtu,omitempty"`
|
|
|
|
}
|