summaryrefslogtreecommitdiff
path: root/wireshark-lua
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2008-02-06 19:11:45 +0000
committerChristian Pointner <equinox@anytun.org>2008-02-06 19:11:45 +0000
commit729b6da8a74a6ddba6539f641e4faf8d6de44d16 (patch)
tree16c4a835cd4b481e0d36701ff82ee7d3327a3b32 /wireshark-lua
parentupdated example pcap filupdated example pcap file (diff)
added wireshakr lua script for satp
Diffstat (limited to 'wireshark-lua')
-rw-r--r--wireshark-lua/satp.lua32
1 files changed, 32 insertions, 0 deletions
diff --git a/wireshark-lua/satp.lua b/wireshark-lua/satp.lua
new file mode 100644
index 0000000..e10cdba
--- /dev/null
+++ b/wireshark-lua/satp.lua
@@ -0,0 +1,32 @@
+do
+ -- satp example
+ -- declare our protocol
+
+ satp_proto = Proto("SATP","Secure Anycast Tunneling Protocol")
+
+ -- create a function to dissect it
+ function satp_proto.dissector(buffer,pinfo,tree)
+ pinfo.cols.protocol = "SATP"
+ local subtree = tree:add(satp_proto,buffer(),"SATP Protocol Data")
+ subtree:add(buffer(0,4),"Sequence Number: " .. buffer(0,4):uint())
+ subtree:add(buffer(4,2),"Sender ID: " .. buffer(4,2):uint())
+ subtree:add(buffer(6,2),"Mux: " .. buffer(6,2):uint())
+ subtree:add(buffer(8,2),"Payload Type: " .. buffer(8,2):uint())
+
+ local data_dis = Dissector.get("data")
+ local payload_dis = Dissector.get("ip")
+
+ if payload_dis ~= nil then
+ payload_dis:call(buffer(10):tvb(),pinfo,tree)
+ else
+ data_dis:call(buffer(10):tvb(),pinfo,tree)
+ end
+ end
+
+ -- load the udp.port table
+
+ udp_table = DissectorTable.get("udp.port")
+
+ -- register our protocol to handle udp port 4444
+ udp_table:add(4444,satp_proto)
+end