aboutsummaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2019-10-27 23:05:24 +0100
committerLuca Deri <deri@ntop.org>2019-10-27 23:05:24 +0100
commitecdb7cdc55ad7cbfce42b7ef3052d406ba249fee (patch)
tree410a4b68723256bd3685bb0c7b7f6ce326d5b55e /utils
parentfd38b752c4012c654dc51e8f835b83ee48c380ed (diff)
Various improvements in particular for CapWAP and Bloomberg
Diffstat (limited to 'utils')
-rwxr-xr-xutils/toripaddr2list.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/utils/toripaddr2list.py b/utils/toripaddr2list.py
index 13cc8e1e6..47c5412e5 100755
--- a/utils/toripaddr2list.py
+++ b/utils/toripaddr2list.py
@@ -9,6 +9,12 @@ if len (sys.argv) != 2 :
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 },")
+ x = line.rstrip().split("/")
+ ipaddr = x[0]
+ cidr = x[1]
+
+ if(cidr == None):
+ cidr = "32"
+
+ print(" { 0x"+socket.inet_aton(ipaddr).hex().upper()+" /* "+ipaddr+"/"+cidr+" */, "+cidr+", NDPI_PROTOCOL_XYX },")