3 -- The secure anycast tunneling protocol (satp) defines a protocol used
4 -- for communication between any combination of unicast and anycast
5 -- tunnel endpoints. It has less protocol overhead than IPSec in Tunnel
6 -- mode and allows tunneling of every ETHER TYPE protocol (e.g.
7 -- ethernet, ip, arp ...). satp directly includes cryptography and
8 -- message authentication based on the methodes used by SRTP. It is
9 -- intended to deliver a generic, scaleable and secure solution for
10 -- tunneling and relaying of packets of any protocol.
13 -- Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl,
14 -- Christian Pointner <satp@wirdorange.org>
16 -- This file is part of Anytun.
18 -- Anytun is free software: you can redistribute it and/or modify
19 -- it under the terms of the GNU General Public License as published by
20 -- the Free Software Foundation, either version 3 of the License, or
23 -- Anytun is distributed in the hope that it will be useful,
24 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
25 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 -- GNU General Public License for more details.
28 -- You should have received a copy of the GNU General Public License
29 -- along with anytun. If not, see <http://www.gnu.org/licenses/>.
33 local proto_satp = Proto("SATP","Secure Anycast Tunneling Protocol")
35 local payload_types = {
37 [0x6558] = "Ethernet",
41 local payload_dissector = {
47 local field_seq = ProtoField.uint32("satp.seq","Sequence Number",base.DEC)
48 local field_sid = ProtoField.uint16("satp.sid","Sender ID",base.DEC)
49 local field_mux = ProtoField.uint16("satp.mux","Mux",base.DEC)
50 local field_ptype = ProtoField.uint16("satp.ptype","Payload Type (plain?)",base.HEX,payload_types)
52 proto_satp.fields = { field_seq, field_sid, field_mux, field_ptype }
55 -- create a function to dissect it
56 function proto_satp.dissector(buffer,pinfo,tree)
57 local info_string = "Sender Id: " .. buffer(4,2):uint() .. ", Mux: " .. buffer(6,2):uint() .. ", SeqNr: " .. buffer(0,4):uint()
58 pinfo.cols.protocol = "SATP"
59 pinfo.cols.info = info_string
61 local subtree = tree:add(proto_satp,buffer(),"SATP, " .. info_string)
63 subtree:add(field_seq, buffer(0,4))
64 subtree:add(field_sid, buffer(4,2))
65 subtree:add(field_mux, buffer(6,2))
67 local payload_type = buffer(8,2):uint()
69 if payload_dissector[payload_type] ~= nil then
70 subtree:add(field_ptype, buffer(8,2))
71 Dissector.get(payload_dissector[payload_type]):call(buffer(10):tvb(),pinfo,tree)
73 Dissector.get("data"):call(buffer(8):tvb(),pinfo,tree)
77 -- load the udp.port table
79 udp_table = DissectorTable.get("udp.port")
81 -- register our protocol to handle udp port 4444
82 udp_table:add(4444,proto_satp)