externaladdrs

package
v0.0.0-...-0cf96f8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 9, 2024 License: ISC Imports: 7 Imported by: 0

Documentation

Overview

Copyright (c) 2013-2016 The btcsuite developers Copyright (c) 2015-2018 The Decred developers Use of this source code is governed by an ISC license that can be found in the LICENSE file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressPriority

type AddressPriority int

AddressPriority type is used to describe the hierarchy of local address discovery methods.

const (
	// InterfacePrio signifies the address is on a local interface
	InterfacePrio AddressPriority = iota

	// BoundPrio signifies the address has been explicitly bounded to.
	BoundPrio

	// UpnpPrio signifies the address was obtained from UPnP.
	UpnpPrio

	// HTTPPrio signifies the address was obtained from an external HTTP service.
	//lint:ignore U1001 removing this will cause ManualPrio to change number
	HTTPPrio

	// ManualPrio signifies the address was provided by --externalip.
	ManualPrio
)

type ExternalLocalAddrs

type ExternalLocalAddrs struct {
	// contains filtered or unexported fields
}

func (*ExternalLocalAddrs) Add

func (a *ExternalLocalAddrs) Add(na *wire.NetAddress, priority AddressPriority) er.R

AddLocalAddress adds na to the list of known local external addresses to advertise with the given priority.

func (*ExternalLocalAddrs) GetBest

func (a *ExternalLocalAddrs) GetBest(remoteAddr *wire.NetAddress) *wire.NetAddress

GetBestLocalAddress returns the most appropriate local address to use for the given remote address.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL