docker: github.com/docker/docker/vendor/github.com/docker/libnetwork/portmapper Index | Files

package portmapper

import "github.com/docker/docker/vendor/github.com/docker/libnetwork/portmapper"

Index

Package Files

mapper.go mapper_linux.go mock_proxy.go proxy.go proxy_linux.go

Variables

var (
    // ErrUnknownBackendAddressType refers to an unknown container or unsupported address type
    ErrUnknownBackendAddressType = errors.New("unknown container address type not supported")
    // ErrPortMappedForIP refers to a port already mapped to an ip address
    ErrPortMappedForIP = errors.New("port is already mapped to ip")
    // ErrPortNotMapped refers to an unmapped port
    ErrPortNotMapped = errors.New("port is not mapped")
    // ErrSCTPAddrNoIP refers to a SCTP address without IP address.
    ErrSCTPAddrNoIP = errors.New("sctp address does not contain any IP address")
)

type PortMapper Uses

type PortMapper struct {
    Allocator *portallocator.PortAllocator
    // contains filtered or unexported fields
}

PortMapper manages the network address translation

func New Uses

func New(proxyPath string) *PortMapper

New returns a new instance of PortMapper

func NewWithPortAllocator Uses

func NewWithPortAllocator(allocator *portallocator.PortAllocator, proxyPath string) *PortMapper

NewWithPortAllocator returns a new instance of PortMapper which will use the specified PortAllocator

func (*PortMapper) AppendForwardingTableEntry Uses

func (pm *PortMapper) AppendForwardingTableEntry(proto string, sourceIP net.IP, sourcePort int, containerIP string, containerPort int) error

AppendForwardingTableEntry adds a port mapping to the forwarding table

func (*PortMapper) DeleteForwardingTableEntry Uses

func (pm *PortMapper) DeleteForwardingTableEntry(proto string, sourceIP net.IP, sourcePort int, containerIP string, containerPort int) error

DeleteForwardingTableEntry removes a port mapping from the forwarding table

func (*PortMapper) Map Uses

func (pm *PortMapper) Map(container net.Addr, hostIP net.IP, hostPort int, useProxy bool) (host net.Addr, err error)

Map maps the specified container transport address to the host's network address and transport port

func (*PortMapper) MapRange Uses

func (pm *PortMapper) MapRange(container net.Addr, hostIP net.IP, hostPortStart, hostPortEnd int, useProxy bool) (host net.Addr, err error)

MapRange maps the specified container transport address to the host's network address and transport port range

func (*PortMapper) ReMapAll Uses

func (pm *PortMapper) ReMapAll()

ReMapAll will re-apply all port mappings

func (*PortMapper) SetIptablesChain Uses

func (pm *PortMapper) SetIptablesChain(c *iptables.ChainInfo, bridgeName string)

SetIptablesChain sets the specified chain into portmapper

func (*PortMapper) Unmap Uses

func (pm *PortMapper) Unmap(host net.Addr) error

Unmap removes stored mapping for the specified host transport address

Package portmapper imports 15 packages (graph). Updated 2020-12-24. Refresh now. Tools for package owners.