Added I2P base32 address output to rnstatus utility

This commit is contained in:
Mark Qvist 2022-02-26 21:04:54 +01:00
parent d487609dcf
commit d4aabc8b89
4 changed files with 14 additions and 1 deletions

View File

@ -129,6 +129,7 @@ class I2PController:
i2p_dest = self.i2plib.Destination(data=prvd, has_private_key=True)
i2p_b32 = i2p_dest.base32
owner.b32 = i2p_b32
self.server_tunnels[i2p_b32] = False
@ -509,8 +510,9 @@ class I2PInterface(Interface):
self.connectable = connectable
self.i2p_tunneled = True
self.b32 = None
self.i2p = I2PController(rns_storagepath)
self.IN = True
self.OUT = False
self.name = name

View File

@ -669,6 +669,12 @@ class Reticulum:
else:
ifstats["clients"] = None
if hasattr(interface, "b32"):
if interface.b32 != None:
ifstats["i2p_b32"] = interface.b32+".b32.i2p"
else:
ifstats["i2p_b32"] = None
ifstats["name"] = str(interface)
ifstats["rxb"] = interface.rxb
ifstats["txb"] = interface.txb

View File

@ -216,6 +216,7 @@ loglevel = 4
[[I2P]]
type = I2PInterface
interface_enabled = yes
connectable = yes
peers = 5urvjicpzi7q3ybztsef4i5ow2aq4soktfj7zedz53s47r54jnqq.b32.i2p

View File

@ -51,6 +51,10 @@ def program_setup(configdir, dispall=False, verbosity = 0):
print(" {n}".format(n=ifstat["name"]))
print("\tStatus: {ss}".format(ss=ss))
if "i2p_b32" in ifstat:
print("\tI2P B32: {ep}".format(ep=str(ifstat["i2p_b32"])))
if clients != None:
print("\t"+clients_string)
print("\tRX: {rxb}\n\tTX: {txb}".format(rxb=size_str(ifstat["rxb"]), txb=size_str(ifstat["txb"])))