Packages that use RouterAddress
Package
Description
Router-specific data structures: RouterInfo and RouterIdentity with their transport addresses and capabilities, router key generation, and the optionally password-protected router private key file.
The I2P router application handles I2P network communication.
Network database message handling shared by all facades: database lookup jobs and local RouterInfo publication.
The Kademlia distributed hash table (DHT) network database: lookup, store and explore jobs, the data store, the floodfill variants, and lookup throttling.
Transport framework: the transport lifecycle and pool management, connection handling and bandwidth throttling for the transports (NTCP2 over TCP, SSU over UDP) that carry I2P messages between routers, plus NAT traversal via UPnP and GeoIP country lookups.
NTCP2, the TCP transport: framed, ratchet-encrypted and mutually authenticated connections between routers.
SSU2, the UDP transport: datagram sessions with Holepunch peer discovery, plus the older SSU compatibility code.
Tunnel pool management: pool lifecycle, peer selection, build scheduling and failure handling for client and exploratory tunnels.
Helpers and handlers for the router console user interface, packaged in routerconsole.war and accessible only from JSP files.
Uses of RouterAddress in net.i2p.data.router
Fields in net.i2p.data.router with type parameters of type RouterAddressModifier and TypeFieldDescriptionprivate final List<RouterAddress> RouterInfo._addressesSave addresses in the order received so the signature works.Methods in net.i2p.data.router that return RouterAddressModifier and TypeMethodDescriptionRouterInfo.getTargetAddress(String transportStyle) Pull the first workable target address for the given transport.Methods in net.i2p.data.router that return types with arguments of type RouterAddressModifier and TypeMethodDescriptionRouterInfo.getAddresses()Retrieve the set of RouterAddress structures at which this router can be contacted.RouterInfo.getTargetAddresses(String transportStyle) For multiple addresses per-transport (IPv4 or IPv6).RouterInfo.getTargetAddresses(String transportStyle1, String transportStyle2) For multiple addresses per-transport (IPv4 or IPv6) Return addresses matching either of two styles.Methods in net.i2p.data.router with parameters of type RouterAddressModifier and TypeMethodDescriptionbooleanRouterAddress.deepEquals(RouterAddress addr) Everything, including Transport, host, port, options, and cost.Method parameters in net.i2p.data.router with type arguments of type RouterAddressModifier and TypeMethodDescriptionvoidRouterInfo.setAddresses(Collection<RouterAddress> addresses) Specify a set of RouterAddress structures at which this router can be contacted.Uses of RouterAddress in net.i2p.router
Methods in net.i2p.router that return types with arguments of type RouterAddressModifier and TypeMethodDescriptionCommSystemFacade.createAddresses()Create the list of RouterAddress structures based on the router's config.Methods in net.i2p.router with parameters of type RouterAddressModifier and TypeMethodDescriptionvoidCommSystemFacade.notifyRemoveAddress(RouterAddress address) Tell other transports our address changed.voidCommSystemFacade.notifyReplaceAddress(RouterAddress address) Tell other transports our address changed.Method parameters in net.i2p.router with type arguments of type RouterAddressModifier and TypeMethodDescriptionprivate voidRouter.locked_rebuildRouterInfo(List<RouterAddress> addresses) Rebuild and republish our routerInfo since something significant has changed.Uses of RouterAddress in net.i2p.router.networkdb
Classes in net.i2p.router.networkdb that implement interfaces with type arguments of type RouterAddressModifier and TypeClassDescriptionprivate static classArbitrary sort so we can attempt to compare costs between two RIs to see if they have changed.Methods in net.i2p.router.networkdb with parameters of type RouterAddressModifier and TypeMethodDescriptionintPublishLocalRouterInfoJob.AddrComparator.compare(RouterAddress l, RouterAddress r) Compare two RouterAddresses by transport style, then host.Uses of RouterAddress in net.i2p.router.networkdb.kademlia
Method parameters in net.i2p.router.networkdb.kademlia with type arguments of type RouterAddressModifier and TypeMethodDescriptionIntroducerLookupJob.getIntroducerHashes(Collection<RouterAddress> addresses) Extract SSU2 introducer router hashes ("ih0".."ih4") from the given addresses.(package private) static booleanKademliaNetworkDatabaseFacade.tooManyIntroducers(Collection<RouterAddress> addrs) Whether any single transport address advertises more introducers than the SSU2 spec allows.Uses of RouterAddress in net.i2p.router.transport
Classes in net.i2p.router.transport that implement interfaces with type arguments of type RouterAddressModifier and TypeClassDescriptionprivate static classArbitrary sort for consistency.private static classCompare based on published cost, adjusting for our IPv6 preference.Fields in net.i2p.router.transport with type parameters of type RouterAddressModifier and TypeFieldDescriptionprivate final List<RouterAddress> TransportImpl._currentAddressesThe addresses currently published.Methods in net.i2p.router.transport that return RouterAddressModifier and TypeMethodDescriptionTransport.getCurrentAddress(boolean ipv6) The first currently listening address of specified IP version.TransportImpl.getCurrentAddress(boolean ipv6) What address are we currently listening to? Replaces getCurrentAddress()Methods in net.i2p.router.transport that return types with arguments of type RouterAddressModifier and TypeMethodDescriptionCommSystemFacadeImpl.createAddresses()Create router addresses for all configured transport protocols.(package private) List<RouterAddress> TransportManager.getAddresses()This forces a rebuild.Transport.getCurrentAddresses()All addresses this transport is currently listening on.TransportImpl.getCurrentAddresses()What addresses are we currently listening to? ReplacesTransportImpl.getCurrentAddress(boolean).TransportImpl.getTargetAddresses(RouterInfo target) All available addresses we can use, shuffled and then sorted by cost/preference.Transport.updateAddress()Request transport to update its addresses based on current conditions.TransportImpl.updateAddress()Ask the transport to update its address based on current information and return it Transports should override.Methods in net.i2p.router.transport with parameters of type RouterAddressModifier and TypeMethodDescriptionintCommSystemFacadeImpl.AddrComparator.compare(RouterAddress l, RouterAddress r) Compare two router addresses for consistent ordering.intTransportImpl.AddrComparator.compare(RouterAddress l, RouterAddress r) Compare router addresses for sort order.static AddressTypeTransportUtil.getType(RouterAddress addr) Address type of the given RouterAddress.static booleanTransportUtil.isIPv6(RouterAddress addr) Addresses without a host (i.e.static booleanTransportUtil.isUsableRouterAddress(RouterAddress ra) Is the RouterAddress usable for tunnel building?static booleanTransportUtil.isYggdrasil(RouterAddress addr) Whether the address is an in-network Yggdrasil address.voidCommSystemFacadeImpl.notifyRemoveAddress(RouterAddress address) Tell other transports our address changed.voidCommSystemFacadeImpl.notifyReplaceAddress(RouterAddress udpAddr) UDP changed addresses, tell NTCP and restart All the work moved toNTCPTransport.externalAddressReceived(Transport.AddressSource, byte[], int).protected voidTransportImpl.removeAddress(RouterAddress address) Remove only this address.protected voidTransportImpl.replaceAddress(RouterAddress address) Replace any existing addresses for the current transport with the same IP length (4 or 16) with the given one.Uses of RouterAddress in net.i2p.router.transport.ntcp
Fields in net.i2p.router.transport.ntcp declared as RouterAddressModifier and TypeFieldDescriptionprivate final RouterAddressNTCPConnection._remAddrThe peer's address as configured.Methods in net.i2p.router.transport.ntcp that return RouterAddressModifier and TypeMethodDescriptionprivate RouterAddressNTCPTransport.bindAddress(int port) Only does something if port > 0 and port != current bound port (or there's no current port, or the configured interface or hostname changed).private RouterAddressNTCPTransport.buildBoundAddress(InetAddress bindToAddr, String bindTo, int port) Builds the RouterAddress to publish for a specific-interface bind.private RouterAddressNTCPTransport.configureLocalAddress()Generally returns null.private RouterAddressNTCPTransport.createNTCPAddress()This only creates an address if the hostname AND port are set inrouter.config, which should be rare.NTCPConnection.getRemoteAddress()Only valid for outbound; null for inbound.private RouterAddressNTCPTransport.getTargetAddress(RouterInfo target) Get first available address we can use.Methods in net.i2p.router.transport.ntcp with parameters of type RouterAddressModifier and TypeMethodDescriptionprivate intNTCPTransport.chooseListenPort(RouterAddress addr, boolean ssuDisabled) Selects the port to listen on.private static intNTCPTransport.getNTCPVersion(RouterAddress addr) Valid NTCP version of Bob's NTCP address for our outbound connections as Alice.private booleanNTCPTransport.handleIPv6FirewalledTransition(boolean isIPv6, RouterAddress oldAddr, byte[] ip, int port) Handles a notification that carries no host at all.private voidNTCPTransport.restartListening(RouterAddress addr, boolean ipv6) Only called byNTCPTransport.externalAddressReceived(byte[], boolean, int).Constructors in net.i2p.router.transport.ntcp with parameters of type RouterAddressModifierConstructorDescriptionprivateNTCPConnection(RouterContext ctx, NTCPTransport transport, RouterAddress remAddr, boolean isIn) Base constructor for an inbound or outbound connection.NTCPConnection(RouterContext ctx, NTCPTransport transport, RouterIdentity remotePeer, RouterAddress remAddr, int version) Create an outbound unconnected NTCP connection.Uses of RouterAddress in net.i2p.router.transport.udp
Fields in net.i2p.router.transport.udp declared as RouterAddressModifier and TypeFieldDescriptionprivate RouterAddressUDPTransport._currentOurV4AddressWe don't publish our IP/port if introduced, so we need to store it somewhere.private RouterAddressUDPTransport._currentOurV6AddressOur current IPv6 endpoint as a router address.private final RouterAddressOutboundEstablishState2._routerAddressThe router address being connected to.(package private) final RouterAddressInboundEstablishState2.AddressSelection.raThe selected address, or null when no address qualified.Methods in net.i2p.router.transport.udp that return RouterAddressModifier and TypeMethodDescriptionprivate RouterAddressIntroductionManager.getAddress(RouterInfo ri, boolean isIPv6) Address out of a RouterInfo.(package private) static RouterAddressPeerTestManager.getAddress(List<RouterAddress> addrs, boolean isIPv6) Get an address out of a list of addresses.private RouterAddressPeerTestManager.getAddress(RouterInfo ri, boolean isIPv6) Get an address out of a RI.UDPTransport.getCurrentExternalAddress(boolean isIPv6) Simple fetch of stored IP and port, since we don't put them in the real, published RouterAddress anymore if we are firewalled.(package private) RouterAddressUDPTransport.getTargetAddress(RouterInfo target) First available address of the target that we can use.private RouterAddressUDPTransport.locked_rebuildExternalAddress(String host, int port, boolean allowRebuildRouterInfo) Rebuild the external address from the given validated host; caller must hold the rebuild lock.private RouterAddressUDPTransport.rebuildEmptyAddress(String host, int port, boolean allowRebuildRouterInfo, boolean isIPv6, boolean introducersRequired, int mtu) No direct address and no introducers available; publish an empty "4" or "6" address so peers know the address exists, and retry later.private RouterAddressUDPTransport.rebuildExternalAddress(boolean ipv6) Rebuilds the external router address for either IPv4 or IPv6.private RouterAddressUDPTransport.rebuildExternalAddress(boolean allowRebuildRouterInfo, boolean ipv6) Update our IPv4 address and optionally tell the router to rebuild and republish the router info.private RouterAddressUDPTransport.rebuildExternalAddress(byte[] ip, int port, boolean allowRebuildRouterInfo) Update our IPv4 or IPv6 address and optionally tell the router to rebuild and republish the router info.private RouterAddressUDPTransport.rebuildExternalAddress(String host, int port, boolean allowRebuildRouterInfo) Rebuilds the router address for our external endpoint.private RouterAddressUDPTransport.rebuildHiddenExternalAddress(String host, int port, boolean allowRebuildRouterInfo, boolean isIPv6) Rebuild the external address of a hidden router: nothing is published, so only an address with 4/6 caps is made.private RouterAddressUDPTransport.rebuildPublishedAddress(String host, int port, boolean allowRebuildRouterInfo, boolean isIPv6, boolean directIncluded, boolean introducersIncluded, int mtu, OrderedProperties options) Publish the fully populated address (direct and/or introducers).Methods in net.i2p.router.transport.udp that return types with arguments of type RouterAddressModifier and TypeMethodDescriptionUDPTransport.updateAddress()Rebuild to get updated cost and introducers.Methods in net.i2p.router.transport.udp with parameters of type RouterAddressModifier and TypeMethodDescriptionprivate voidOutboundEstablishState2.createNewState(RouterAddress addr) This will be called 0 times if we don't have a token and never get a retry; once if we have a token; and twice if the token we had was bad and we got a retry.private OutboundEstablishStateEstablishmentManager.createOutboundState(OutNetMessage msg, RemoteHostId to, RemoteHostId maybeTo, RouterIdentity toIdentity, boolean isIndirect, UDPAddress addr, RouterAddress ra, Hash toHash, String truncHash, String ipAddress, int maybePort, long now, boolean isBanned) Create a new outbound establish state for the peer, after verifying that its introducers, MTU, and introduction key are usable.(package private) static SessionKeyPeerTestManager.getIntroKey(RouterAddress ra) Get an intro key out of an address.(package private) intUDPTransport.getSSUVersion(RouterAddress addr) Valid SSU version of Bob's SSU address for our outbound connections as Alice.(package private) static intInboundEstablishState2.parseMTU(RouterAddress ra, boolean isIPv6) Resolve the session MTU from the peer's "mtu" option.(package private) static byte[]InboundEstablishState2.parseSessionKeys(RouterAddress ra, byte[] publicKey) Decode and verify the SSU2 IKey/S options of the negotiated RouterInfo address and verify that the peer's S key matches the X25519 public key already derived from the handshake.intIntroductionManager.pickInbound(RouterAddress current, boolean ipv6, Properties ssuOptions, int howMany) Grab a bunch of peers who are willing to be introducers for us that are locally known (duh) and have published their own SSU address (duh^2).protected voidUDPTransport.removeAddress(RouterAddress address) Remove then tell NTCP that we changed.protected voidUDPTransport.replaceAddress(RouterAddress address) Replace then tell NTCP that we changed.private voidUDPTransport.replaceCurrentExternalAddress(RouterAddress ra, boolean isIPv6) Simple storage of IP and port, since we don't put them in the real, published RouterAddress anymore if we are firewalled.private TransportBidUDPTransport.selectBid(RouterAddress addr, int cost, boolean weAreFirewalled) Select the bid tier for a message to an unestablished peer.private booleanUDPTransport.selectIntroducers(boolean isIPv6, RouterAddress current, OrderedProperties options) Pick inbound introducers for the address options.(package private) static booleanUDPAddress.tooManyIntroducers(RouterAddress addr) Check whether a peer address declares more introducers than the spec allows.private voidInboundEstablishState2.validateRouterInfo(RouterInfo ri, RouterAddress ra, String mismatchMessage) Validates the RouterInfo for banning conditions and throws RIException if any issue is found.Method parameters in net.i2p.router.transport.udp with type arguments of type RouterAddressModifier and TypeMethodDescription(package private) static RouterAddressPeerTestManager.getAddress(List<RouterAddress> addrs, boolean isIPv6) Get an address out of a list of addresses.(package private) static InboundEstablishState2.AddressSelectionInboundEstablishState2.selectSessionAddress(List<RouterAddress> addrs, boolean isIPv6, byte[] aliceIP) Choose the RouterInfo address this session negotiates with, given the sender's IP family, so the caller can determine the MTU and keys.Constructors in net.i2p.router.transport.udp with parameters of type RouterAddressModifierConstructorDescription(package private)AddressSelection(RouterAddress ra, String mismatchMessage) Record the chosen address and any IP-mismatch warning that came with it.OutboundEstablishState2(RouterContext ctx, UDPTransport transport, RemoteHostId claimedAddress, RemoteHostId remoteHostId, RouterIdentity remotePeer, boolean needIntroduction, SessionKey introKey, RouterAddress ra, UDPAddress addr, int version) Prepare to start a new handshake with the given peer.UDPAddress(RouterAddress addr) Parse and cache router address data.Uses of RouterAddress in net.i2p.router.tunnel.pool
Methods in net.i2p.router.tunnel.pool with parameters of type RouterAddressModifier and TypeMethodDescription(package private) static booleanTunnelPeerSelector.isUsableRouterAddress(RouterAddress ra) Is the RouterAddress usable for tunnel building? SSU requires protocol v2 plus a valid IP/port or an introduction; SSU2 requires a valid IP/port or an introduction; NTCP/NTCP2 require a valid IP/port.Method parameters in net.i2p.router.tunnel.pool with type arguments of type RouterAddressModifier and TypeMethodDescriptionprivate static intConnectChecker.getConnectMask(Collection<RouterAddress> addrs) The bitmask of supported transports for the given addresses.Uses of RouterAddress in net.i2p.router.web.helpers
Classes in net.i2p.router.web.helpers that implement interfaces with type arguments of type RouterAddressModifier and TypeClassDescription(package private) static classComparator for router addresses by transport then host.Methods in net.i2p.router.web.helpers with parameters of type RouterAddressModifier and TypeMethodDescriptionintNetDbComparators.RAComparator.compare(RouterAddress l, RouterAddress r)