Class NetworkAdmin
java.lang.Object
com.biglybt.core.networkmanager.admin.NetworkAdmin
- Direct Known Subclasses:
NetworkAdminImpl
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidabstract voidabstract booleanabstract StringclassifyRoute(InetAddress address) abstract NetworkAdminProtocolcreateInboundProtocol(Core core, int type, int port) abstract NetworkAdminSocksProxycreateSocksProxy(String host, int port, String username, String password) abstract voidabstract InetAddress[]getAllBindAddresses(boolean include_wildcard) abstract InetAddressabstract InetAddress[]Returns the list of current addresses that can successfully be bound to with an ephemeral portabstract intgetBindablePort(int preferred_port) abstract Stringabstract NetworkAdminASNabstract InetAddressabstract InetAddressgetDefaultPublicAddress(boolean peek) abstract InetAddressabstract NetworkAdminHTTPProxyabstract List<Inet6Address> abstract NetworkAdminProtocol[]getInboundProtocols(Core core) abstract Object[]getInterfaceForAddress(InetAddress address) abstract NetworkAdminNetworkInterface[]abstract InetAddressabstract InetAddressabstract InetAddress[]getMultiHomedServiceBindAddresses(boolean forNIO) abstract NetworkAdminNATDevice[]getNATDevices(Core core) abstract StringgetNetworkInterfacesAsString(boolean only_with_addresses) abstract NetworkAdminProtocol[]getOutboundProtocols(Core core) abstract InetAddressgetSingleHomedServiceBindAddress(int protocolVersion) abstract InetAddress[]Selects a bind address based on available host address and bind protocol familiesabstract List<InetAddress[]> static NetworkAdminabstract NetworkAdminSocksProxy[]abstract InetAddressabstract booleanabstract booleanabstract booleanbooleanabstract booleanhasIPV6Potential(boolean forNIO) abstract booleanabstract booleanabstract booleanabstract booleanisRecentPublicIPAddress(InetAddress address) abstract booleanabstract voidabstract NetworkAdminASNlookupASN(InetAddress address) ad-hoc queryabstract voidlookupASN(InetAddress address, NetworkAdminASNListener listener) abstract NetworkAdminASNlookupCurrentASN(InetAddress address) Only call if the supplied address is believed to be the current public addressabstract booleanmustBind()abstract voidabstract InetAddress[]resolveBindAddresses(String bind_to) Given an interface name etc this will return the corresponding ip addressesabstract voidrunInitialChecks(Core core) abstract InetAddresstestProtocol(NetworkAdminProtocol protocol)
-
Field Details
-
PR_NETWORK_INTERFACES
- See Also:
-
PR_DEFAULT_BIND_ADDRESS
- See Also:
-
PR_ADDITIONAL_SERVICE_ADDRESS
- See Also:
-
PR_AS
- See Also:
-
IP_PROTOCOL_VERSION_AUTO
public static final int IP_PROTOCOL_VERSION_AUTO- See Also:
-
IP_PROTOCOL_VERSION_REQUIRE_V4
public static final int IP_PROTOCOL_VERSION_REQUIRE_V4- See Also:
-
IP_PROTOCOL_VERSION_REQUIRE_V6
public static final int IP_PROTOCOL_VERSION_REQUIRE_V6- See Also:
-
PR_NAMES
-
DNS_SPI_TEST_HOST
- See Also:
-
-
Constructor Details
-
NetworkAdmin
public NetworkAdmin()
-
-
Method Details
-
getSingleton
-
getSingleHomedServiceBindAddress
-
getSingleHomedServiceBindAddress
public abstract InetAddress getSingleHomedServiceBindAddress(int protocolVersion) throws UnsupportedAddressTypeException - Throws:
UnsupportedAddressTypeException- when no address matching the v4/v6 requirements is found, always returns an address when auto is selected
-
getSingleHomedServiceBinding
public abstract InetAddress[] getSingleHomedServiceBinding(String host) throws UnknownHostException, UnsupportedAddressTypeException Selects a bind address based on available host address and bind protocol families- Parameters:
host-- Returns:
- Array with 2 entries, first is selected host address, second is selected bind address (possibly null of course)
- Throws:
UnknownHostExceptionUnsupportedAddressTypeException
-
getSingleHomedServiceBindings
public abstract List<InetAddress[]> getSingleHomedServiceBindings(String host) throws UnknownHostException, UnsupportedAddressTypeException -
getMultiHomedServiceBindAddresses
-
getMultiHomedOutgoingRoundRobinBindAddress
-
getNetworkInterfacesAsString
-
getNetworkInterfacesAsString
-
getAllBindAddresses
-
resolveBindAddresses
Given an interface name etc this will return the corresponding ip addresses- Parameters:
bind_to-- Returns:
-
guessRoutableBindAddress
-
getAlternativeProtocolBindAddress
-
getBindableAddresses
Returns the list of current addresses that can successfully be bound to with an ephemeral port- Returns:
-
getBindablePort
- Throws:
IOException
-
mustBind
public abstract boolean mustBind() -
hasMissingForcedBind
public abstract boolean hasMissingForcedBind() -
getBindStatus
-
isIgnoredBindAddress
-
getIgnoredTemporaryIPv6
-
getInterfaces
-
hasIPV4Potential
public abstract boolean hasIPV4Potential() -
isIPV6Enabled
public abstract boolean isIPV6Enabled() -
hasIPV6Potential
public boolean hasIPV6Potential() -
hasIPV6Potential
public abstract boolean hasIPV6Potential(boolean forNIO) -
getLoopbackAddress
-
getOutboundProtocols
-
getInboundProtocols
-
createInboundProtocol
-
testProtocol
public abstract InetAddress testProtocol(NetworkAdminProtocol protocol) throws NetworkAdminException - Throws:
NetworkAdminException
-
createSocksProxy
public abstract NetworkAdminSocksProxy createSocksProxy(String host, int port, String username, String password) -
isSocksActive
public abstract boolean isSocksActive() -
getSocksProxies
-
getHTTPProxy
-
getNATDevices
-
lookupCurrentASN
Only call if the supplied address is believed to be the current public address- Parameters:
address-- Returns:
- Throws:
NetworkAdminException
-
getCurrentASN
-
lookupASN
ad-hoc query- Parameters:
address-- Returns:
- Throws:
NetworkAdminException
-
lookupASN
-
classifyRoute
-
canTraceRoute
public abstract boolean canTraceRoute() -
isRecentPublicIPAddress
-
getDefaultPublicAddress
-
getDefaultPublicAddress
-
getDefaultPublicAddressV6
-
hasDHTIPV4
public abstract boolean hasDHTIPV4() -
hasDHTIPV6
public abstract boolean hasDHTIPV6() -
getInterfaceForAddress
- Parameters:
address-- Returns:
- { NetworkInterface, InetAddress (best intf address)}, {NetworkInterface} or {InetAddress (nomatch, same as arg)}
-
addPropertyChangeListener
-
addAndFirePropertyChangeListener
-
removePropertyChangeListener
-
runInitialChecks
-
logNATStatus
-
generateDiagnostics
-