github.com/pwn-term/docker@v0.0.0-20210616085119-6e977cce2565/libnetwork/portmapper/mapper_windows.go (about) 1 package portmapper 2 3 import ( 4 "net" 5 "sync" 6 7 "github.com/docker/libnetwork/portallocator" 8 ) 9 10 // PortMapper manages the network address translation 11 type PortMapper struct { 12 bridgeName string 13 14 // udp:ip:port 15 currentMappings map[string]*mapping 16 lock sync.Mutex 17 18 proxyPath string 19 20 Allocator *portallocator.PortAllocator 21 } 22 23 // AppendForwardingTableEntry adds a port mapping to the forwarding table 24 func (pm *PortMapper) AppendForwardingTableEntry(proto string, sourceIP net.IP, sourcePort int, containerIP string, containerPort int) error { 25 return nil 26 } 27 28 // DeleteForwardingTableEntry removes a port mapping from the forwarding table 29 func (pm *PortMapper) DeleteForwardingTableEntry(proto string, sourceIP net.IP, sourcePort int, containerIP string, containerPort int) error { 30 return nil 31 } 32 33 // checkIP checks if IP is valid and matching to chain version 34 func (pm *PortMapper) checkIP(ip net.IP) bool { 35 // no IPv6 for port mapper on windows -> only IPv4 valid 36 return ip.To4() != nil 37 }