Improved rnprobe utility output.

This commit is contained in:
Mark Qvist 2021-09-24 16:49:07 +02:00
parent 7e9d608530
commit 05e0b17fbf

View File

@ -34,6 +34,13 @@ def program_setup(configdir, destination_hexhash, size=DEFAULT_PROBE_SIZE, full_
print(str(e)) print(str(e))
exit() exit()
if verbosity > 0:
more_output = True
verbosity -= 1
else:
more_output = False
verbosity -= 1
reticulum = RNS.Reticulum(configdir = configdir, loglevel = 3+verbosity) reticulum = RNS.Reticulum(configdir = configdir, loglevel = 3+verbosity)
@ -63,7 +70,12 @@ def program_setup(configdir, destination_hexhash, size=DEFAULT_PROBE_SIZE, full_
probe = RNS.Packet(request_destination, os.urandom(size)) probe = RNS.Packet(request_destination, os.urandom(size))
receipt = probe.send() receipt = probe.send()
print("\rSent "+str(size)+" byte probe to "+RNS.prettyhexrep(destination_hash)+" via "+RNS.prettyhexrep(RNS.Transport.next_hop(destination_hash))+" on "+str(RNS.Transport.next_hop_interface(destination_hash))+" ", end=" ") if more_output:
more = " via "+RNS.prettyhexrep(RNS.Transport.next_hop(destination_hash))+" on "+str(RNS.Transport.next_hop_interface(destination_hash))
else:
more = ""
print("\rSent "+str(size)+" byte probe to "+RNS.prettyhexrep(destination_hash)+more+" ", end=" ")
i = 0 i = 0
while not receipt.status == RNS.PacketReceipt.DELIVERED: while not receipt.status == RNS.PacketReceipt.DELIVERED: