Documentation ¶
Index ¶
- Constants
- func IsDHCPPlugin(driver string) bool
- type CapabilitiesResponse
- type CreateEndpointRequest
- type CreateEndpointResponse
- type CreateNetworkRequest
- type DHCPNetworkOptions
- type DeleteEndpointRequest
- type DeleteNetworkRequest
- type EndpointInterface
- type IPAMData
- type InfoRequest
- type InfoResponse
- type InterfaceName
- type JoinRequest
- type JoinResponse
- type LeaveRequest
- type Plugin
- func (p *Plugin) Close() error
- func (p *Plugin) CreateEndpoint(ctx context.Context, r CreateEndpointRequest) (CreateEndpointResponse, error)
- func (p *Plugin) CreateNetwork(r CreateNetworkRequest) error
- func (p *Plugin) DeleteEndpoint(r DeleteEndpointRequest) error
- func (p *Plugin) DeleteNetwork(r DeleteNetworkRequest) error
- func (p *Plugin) EndpointOperInfo(ctx context.Context, r InfoRequest) (InfoResponse, error)
- func (p *Plugin) Join(ctx context.Context, r JoinRequest) (JoinResponse, error)
- func (p *Plugin) Leave(ctx context.Context, r LeaveRequest) error
- func (p *Plugin) Listen(bindSock string) error
- type StaticRoute
Constants ¶
const CLIOptionsKey string = "com.docker.network.generic"
CLIOptionsKey is the key used in create network options by the CLI for custom options
const DriverName string = "net-dhcp"
DriverName is the name of the Docker Network Driver
Variables ¶
This section is empty.
Functions ¶
func IsDHCPPlugin ¶
IsDHCPPlugin checks if a Docker network driver is an instance of this plugin
Types ¶
type CapabilitiesResponse ¶
CapabilitiesResponse returns whether or not this network is global or local
type CreateEndpointRequest ¶
type CreateEndpointRequest struct { NetworkID string EndpointID string Interface *EndpointInterface Options map[string]interface{} }
CreateEndpointRequest is sent by the daemon when an endpoint should be created
type CreateEndpointResponse ¶
type CreateEndpointResponse struct {
Interface *EndpointInterface
}
CreateEndpointResponse is sent as a response to a CreateEndpointRequest
type CreateNetworkRequest ¶
type CreateNetworkRequest struct { NetworkID string Options map[string]interface{} IPv4Data []*IPAMData IPv6Data []*IPAMData }
CreateNetworkRequest is sent by the daemon when a network needs to be created
type DHCPNetworkOptions ¶
type DHCPNetworkOptions struct { Bridge string IPv6 bool LeaseTimeout time.Duration `mapstructure:"lease_timeout"` IgnoreConflicts bool `mapstructure:"ignore_conflicts"` SkipRoutes bool `mapstructure:"skip_routes"` }
DHCPNetworkOptions contains options for the DHCP network driver
type DeleteEndpointRequest ¶
DeleteEndpointRequest is sent by the daemon when an endpoint needs to be removed
type DeleteNetworkRequest ¶
type DeleteNetworkRequest struct {
NetworkID string
}
DeleteNetworkRequest is sent by the daemon when a network needs to be removed
type EndpointInterface ¶
EndpointInterface contains endpoint interface information
type IPAMData ¶
type IPAMData struct { AddressSpace string Pool string Gateway string AuxAddresses map[string]interface{} }
IPAMData contains IPv4 or IPv6 addressing information
type InfoRequest ¶
InfoRequest is sent by the daemon when querying endpoint information
type InfoResponse ¶
InfoResponse is endpoint information sent in response to an InfoRequest
type InterfaceName ¶
InterfaceName consists of the name of the interface in the global netns and the desired prefix to be appended to the interface inside the container netns
type JoinRequest ¶
type JoinRequest struct { NetworkID string EndpointID string SandboxKey string Options map[string]interface{} }
JoinRequest is sent by the Daemon when an endpoint needs be joined to a network
type JoinResponse ¶
type JoinResponse struct { InterfaceName InterfaceName Gateway string GatewayIPv6 string StaticRoutes []*StaticRoute DisableGatewayService bool }
JoinResponse is sent in response to a JoinRequest
type LeaveRequest ¶
LeaveRequest is sent by the daemon when a endpoint is leaving a network
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
Plugin is the DHCP network plugin
func (*Plugin) CreateEndpoint ¶
func (p *Plugin) CreateEndpoint(ctx context.Context, r CreateEndpointRequest) (CreateEndpointResponse, error)
CreateEndpoint creates a veth pair and uses udhcpc to acquire an initial IP address on the container end. Docker will move the interface into the container's namespace and apply the address.
func (*Plugin) CreateNetwork ¶
func (p *Plugin) CreateNetwork(r CreateNetworkRequest) error
CreateNetwork "creates" a new DHCP network (just checks if the provided bridge exists and the null IPAM driver is used)
func (*Plugin) DeleteEndpoint ¶
func (p *Plugin) DeleteEndpoint(r DeleteEndpointRequest) error
DeleteEndpoint deletes the veth pair
func (*Plugin) DeleteNetwork ¶
func (p *Plugin) DeleteNetwork(r DeleteNetworkRequest) error
DeleteNetwork "deletes" a DHCP network (does nothing, the bridge is managed by the user)
func (*Plugin) EndpointOperInfo ¶
func (p *Plugin) EndpointOperInfo(ctx context.Context, r InfoRequest) (InfoResponse, error)
EndpointOperInfo retrieves some info about an existing endpoint
func (*Plugin) Join ¶
func (p *Plugin) Join(ctx context.Context, r JoinRequest) (JoinResponse, error)
Join passes the veth name and route information (gateway from DHCP and existing routes on the host bridge) to Docker and starts a persistent DHCP client to maintain the lease on the acquired IP
type StaticRoute ¶
StaticRoute contains static route information