diff options
author | Luca Deri <deri@ntop.org> | 2019-09-08 21:42:33 +0200 |
---|---|---|
committer | Luca Deri <deri@ntop.org> | 2019-09-08 21:42:33 +0200 |
commit | d457b07f9f182ff2c8fa7d22d9772f3ace4e53a1 (patch) | |
tree | 2c151ff29a2459814aafd748854efd345a6f1fdc /utils | |
parent | a0a8149833d0ae4ee128ee0ac3488a67dbc4b2f9 (diff) |
Refreshed Tor node list
Diffstat (limited to 'utils')
-rwxr-xr-x | utils/toripaddr2list.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/utils/toripaddr2list.py b/utils/toripaddr2list.py new file mode 100755 index 000000000..13cc8e1e6 --- /dev/null +++ b/utils/toripaddr2list.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python3 + +import sys +import socket, struct + +if len (sys.argv) != 2 : + print("Usage: toripaddr2list.py <file>") + sys.exit (1) + +with open(sys.argv[1]) as fp: + for cnt, line in enumerate(fp): + ipaddr = line.rstrip() + print(" { 0x"+socket.inet_aton(ipaddr).hex()+", /* "+ipaddr+" */, 32, NDPI_PROTOCOL_TOR },") + |