Documentation ¶
Index ¶
- Constants
- func MakeDialer(p Protector) *net.Dialer
- func MakeListenConfig(p Protector) *net.ListenConfig
- func MakeNsDialer(who string, c Controller) *net.Dialer
- func MakeNsICMPListener(who string, c Controller) *icmplistener
- func MakeNsICMPListenerExt(who string, ctl Controller, ext []ControlFn) *icmplistener
- func MakeNsListenConfigExt(who string, ctl Controller, ext []ControlFn) *net.ListenConfig
- func MakeNsListener(who string, c Controller) *net.ListenConfig
- func NeverResolve(hostname string) bool
- type Conn
- type ControlFn
- type Controller
- type DialFn
- type Listener
- type MinConn
- type PacketConn
- type Protector
- type RDial
- func (d *RDial) Accept(network, local string) (net.Listener, error)
- func (d *RDial) AcceptTCP(network string, local string) (*net.TCPListener, error)
- func (d *RDial) Announce(network, local string) (net.PacketConn, error)
- func (d *RDial) AnnounceUDP(network, local string) (*net.UDPConn, error)
- func (d *RDial) Dial(network, addr string) (net.Conn, error)
- func (d *RDial) DialBind(network, local, remote string) (net.Conn, error)
- func (d *RDial) DialContext(ctx context.Context, network, addr string) (net.Conn, error)
- func (d *RDial) DialTCP(network string, laddr, raddr *net.TCPAddr) (*net.TCPConn, error)
- func (d *RDial) DialUDP(network string, laddr, raddr *net.UDPAddr) (*net.UDPConn, error)
- func (d *RDial) Handle() uintptr
- func (d *RDial) Probe(network, local string) (PacketConn, error)
- func (d *RDial) ProbeICMP(network, local string) (net.PacketConn, error)
- type RDialer
Constants ¶
See: ipmap.LookupNetIP; UidSelf -> dnsx.Default; UidSystem -> dnsx.System
Variables ¶
This section is empty.
Functions ¶
func MakeDialer ¶
unused: Creates a dialer that binds to a particular ip.
func MakeListenConfig ¶
func MakeListenConfig(p Protector) *net.ListenConfig
unused: Creates a listener that binds to a particular ip.
func MakeNsDialer ¶
func MakeNsDialer(who string, c Controller) *net.Dialer
Creates a net.Dialer that can bind to any active interface.
func MakeNsICMPListener ¶
func MakeNsICMPListener(who string, c Controller) *icmplistener
func MakeNsICMPListenerExt ¶
func MakeNsICMPListenerExt(who string, ctl Controller, ext []ControlFn) *icmplistener
func MakeNsListenConfigExt ¶
func MakeNsListenConfigExt(who string, ctl Controller, ext []ControlFn) *net.ListenConfig
Creates a listener that can bind to any active interface, with additional control fns.
func MakeNsListener ¶
func MakeNsListener(who string, c Controller) *net.ListenConfig
Creates a listener that can bind to any active interface.
func NeverResolve ¶
never resolve system/default resolver; expected to have seeded ips
Types ¶
type Controller ¶
type Controller = b.Controller
type PacketConn ¶
type PacketConn = net.PacketConn
type RDial ¶
type RDial struct {
// contains filtered or unexported fields
}
RDial adapts dialers and listeners to RDialer. It always discards bind address.
func MakeNsRDial ¶
func MakeNsRDial(who string, ctx context.Context, c Controller) *RDial
Creates a RDial that can bind to any active interface.
func MakeNsRDialExt ¶
Creates a RDial that can bind to any active interface, with additional control fns.
func (*RDial) AcceptTCP ¶
AcceptTCP creates a listener on the local address. network must be "tcp" or "tcp4" or "tcp6". Helper method for d.Accept("tcp", local)
func (*RDial) Announce ¶
func (d *RDial) Announce(network, local string) (net.PacketConn, error)
Announce implements RDialer.
func (*RDial) AnnounceUDP ¶
AnnounceUDP announces the local address. network must be "udp" or "udp4" or "udp6". Helper method for d.Announce("udp", local)
func (*RDial) DialContext ¶
func (*RDial) DialTCP ¶
DialTCP creates a net.TCPConn to raddr. Helper method for d.Dial("tcp", laddr.String(), raddr.String())
func (*RDial) DialUDP ¶
DialUDP creates a net.UDPConn to raddr. Helper method for d.Dial("udp", laddr.String(), raddr.String())
type RDialer ¶
type RDialer interface { // Handle uniquely identifies the concrete type backing this dialer. // Useful as a phantom reference to this dialer. // github.com/hashicorp/terraform/blob/325d18262/internal/configs/configschema/decoder_spec.go#L32 Handle() uintptr // Dial creates a connection to the given address, // the resulting net.Conn must be a *net.TCPConn if // network is "tcp" or "tcp4" or "tcp6" and must be // a *net.UDPConn if network is "udp" or "udp4" or "udp6". Dial(network, addr string) (Conn, error) // DialBind is like Dial but creates a connection to // the remote address bounded from the local port (not ip). // If local is invalid ip:port (ip must be present but not used), // it delegates to Dial(network, remote). DialBind(network, local, remote string) (Conn, error) // Announce announces the local address. network must be // packet-oriented ("udp" or "udp4" or "udp6"). Announce(network, local string) (PacketConn, error) // Accept creates a listener on the local address. network // must be stream-oriented ("tcp" or "tcp4" or "tcp6"). Accept(network, local string) (Listener, error) // Probe listens on the local address for ICMP packets sent // over UDP. Network must be "udp" or "udp4" or "udp6". Probe(network, local string) (PacketConn, error) }