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 void
abstract void
abstract boolean
canPing()
abstract boolean
abstract String
classifyRoute
(InetAddress address) abstract NetworkAdminProtocol
createInboundProtocol
(Core core, int type, int port) abstract NetworkAdminSocksProxy
createSocksProxy
(String host, int port, String username, String password) abstract void
abstract InetAddress[]
getAllBindAddresses
(boolean include_wildcard) abstract InetAddress
abstract InetAddress[]
Returns the list of current addresses that can successfully be bound to with an ephemeral portabstract int
getBindablePort
(int preferred_port) abstract String
abstract NetworkAdminASN
abstract InetAddress
abstract InetAddress
getDefaultPublicAddress
(boolean peek) abstract InetAddress
abstract NetworkAdminHTTPProxy
abstract NetworkAdminProtocol[]
getInboundProtocols
(Core core) abstract Object[]
getInterfaceForAddress
(InetAddress address) abstract NetworkAdminNetworkInterface[]
abstract InetAddress
abstract InetAddress
abstract InetAddress[]
getMultiHomedServiceBindAddresses
(boolean forNIO) abstract NetworkAdminNATDevice[]
getNATDevices
(Core core) abstract String
getNetworkInterfacesAsString
(boolean only_with_addresses) abstract NetworkAdminProtocol[]
getOutboundProtocols
(Core core) abstract void
getRoutes
(InetAddress target, int max_millis, NetworkAdminRoutesListener listener) abstract InetAddress
getSingleHomedServiceBindAddress
(int protocolVersion) abstract InetAddress[]
Selects a bind address based on available host address and bind protocol familiesabstract List
<InetAddress[]> static NetworkAdmin
abstract NetworkAdminSocksProxy[]
abstract InetAddress
abstract boolean
abstract boolean
abstract boolean
boolean
abstract boolean
hasIPV6Potential
(boolean forNIO) abstract boolean
abstract boolean
abstract boolean
isRecentPublicIPAddress
(InetAddress address) abstract boolean
abstract void
abstract NetworkAdminASN
lookupASN
(InetAddress address) ad-hoc queryabstract void
lookupASN
(InetAddress address, NetworkAdminASNListener listener) abstract NetworkAdminASN
lookupCurrentASN
(InetAddress address) Only call if the supplied address is believed to be the current public addressabstract boolean
mustBind()
abstract void
pingTargets
(InetAddress target, int max_millis, NetworkAdminRoutesListener listener) abstract void
abstract InetAddress[]
resolveBindAddresses
(String bind_to) Given an interface name etc this will return the corresponding ip addressesabstract void
runInitialChecks
(Core core) abstract InetAddress
testProtocol
(NetworkAdminProtocol protocol)
-
Field Details
-
singleton
-
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:
UnknownHostException
UnsupportedAddressTypeException
-
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
-
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() -
getRoutes
public abstract void getRoutes(InetAddress target, int max_millis, NetworkAdminRoutesListener listener) throws NetworkAdminException - Throws:
NetworkAdminException
-
canPing
public abstract boolean canPing() -
pingTargets
public abstract void pingTargets(InetAddress target, int max_millis, NetworkAdminRoutesListener listener) throws NetworkAdminException - Throws:
NetworkAdminException
-
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
-