aboutsummaryrefslogtreecommitdiff
path: root/wireshark
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2018-04-28 10:07:54 +0200
committerLuca Deri <deri@ntop.org>2018-04-28 10:07:54 +0200
commit64633939e00a376012572d384cdf0d020cd5e48e (patch)
treed0270ebcf17b77320a3d4b73bd378ac3ee56ba0c /wireshark
parentf717be19cbab9206193e794c71f0ec7659f34239 (diff)
Added NetFlix block for Rogers
Diffstat (limited to 'wireshark')
-rw-r--r--wireshark/ndpi.lua22
1 files changed, 14 insertions, 8 deletions
diff --git a/wireshark/ndpi.lua b/wireshark/ndpi.lua
index 028ee8ea7..88b344a85 100644
--- a/wireshark/ndpi.lua
+++ b/wireshark/ndpi.lua
@@ -22,7 +22,7 @@
-- cat /tmp/wireshark.sql | influx -database wireshark
-local ndpi_proto = Proto("ndpi", "nDPI", "nDPI Protocol Interpreter")
+local ndpi_proto = Proto("ndpi", "nDPI Protocol Interpreter")
ndpi_proto.fields = {}
local ndpi_fds = ndpi_proto.fields
@@ -30,7 +30,7 @@ ndpi_fds.network_protocol = ProtoField.new("nDPI Network Protocol", "ndpi.pr
ndpi_fds.application_protocol = ProtoField.new("nDPI Application Protocol", "ndpi.protocol.application", ftypes.UINT8, nil, base.DEC)
ndpi_fds.name = ProtoField.new("nDPI Protocol Name", "ndpi.protocol.name", ftypes.STRING)
-local ntop_proto = Proto("ntop", "ntop", "ntop Extensions")
+local ntop_proto = Proto("ntop", "ntop Extensions")
ntop_proto.fields = {}
local ntop_fds = ntop_proto.fields
@@ -117,6 +117,9 @@ local max_latency_discard = 5000 -- 5 sec
local max_appl_lat_discard = 15000 -- 15 sec
local debug = false
+local dump_file = "/tmp/wireshark-influx.txt"
+local file
+
-- ##############################################
function string.contains(String,Start)
@@ -373,6 +376,9 @@ function ndpi_proto.init()
-- RPC
rpc_ts = {}
+
+ file = assert(io.open(dump_file, "a"))
+ print("Writing to "..dump_file.."\n")
end
function slen(str)
@@ -572,14 +578,14 @@ function flow_dissector(tvb, pinfo, tree)
end
local bytes = flows[k][1]+flows[k][2]
- local row = "wireshark,"..k.." bytes=".. bytes .. " ".. (tonumber(pinfo.abs_ts)*10000).."00000\n"
-
+ local row = "wireshark,flow="..k.." bytes=".. bytes .. " ".. (tonumber(pinfo.abs_ts)*10000).."00000"
+
print(row)
- file = io.open("/tmp/wireshark.sql", "a")
- file:write(row)
- file:close()
- -- en0,metric=iface packets.rcvd=213 1524684920000000000
+
+ file:write(row.."\n")
+ file:flush()
+ -- en0,metric=iface packets.rcvd=213 1524684920000000000
end
-- ###############################################