summaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorDaniel Salzman <daniel.salzman@nic.cz>2023-01-03 14:03:07 +0100
committerDaniel Salzman <daniel.salzman@nic.cz>2023-01-04 08:48:43 +0100
commitc71600db1498a9bbf6745dcaf603159ab892fe83 (patch)
treed3104d61ad556dc0b23a8488364326afb035508d /python
parentcontrol: set 0220 UNIX socket file mode (diff)
downloadknot-c71600db1498a9bbf6745dcaf603159ab892fe83.tar.xz
knot-c71600db1498a9bbf6745dcaf603159ab892fe83.zip
probe: add support for UNIX socket protocol
Diffstat (limited to 'python')
-rw-r--r--python/libknot/probe.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/python/libknot/probe.py b/python/libknot/probe.py
index 666b6019d..e6f09db3d 100644
--- a/python/libknot/probe.py
+++ b/python/libknot/probe.py
@@ -122,9 +122,12 @@ class KnotProbeData(ctypes.Structure):
string = str()
if timestamp:
string += "%s " % COL(datetime.datetime.now().time(), YELW)
- string += "%s -> %s, " % (COL(self.addr_str(self.remote_addr), UNDR),
- COL(self.addr_str(self.local_addr), UNDR))
- string += "port %u -> %u " % (self.remote_port, self.local_port)
+ if self.ip != 0:
+ string += "%s -> %s, " % (COL(self.addr_str(self.remote_addr), UNDR),
+ COL(self.addr_str(self.local_addr), UNDR))
+ string += "port %u -> %u " % (self.remote_port, self.local_port)
+ else:
+ string += "%s, " % COL("UNIX", UNDR)
if self.proto == KnotProbeDataProto.UDP:
string += COL("UDP", GRN)
elif self.proto == KnotProbeDataProto.TCP: