Linux tsuru-no-tsurugi 5.15.0-186-generic #196-Ubuntu SMP Sat Jun 20 16:09:34 UTC 2026 x86_64
Apache/2.4.52 (Ubuntu)
Server IP : 192.168.0.18 & Your IP : 216.73.217.105
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
share /
nmap /
nselib /
Delete
Unzip
Name
Size
Permission
Date
Action
data
[ DIR ]
drwxr-xr-x
2024-08-29 14:21
afp.lua
71.48
KB
-rw-r--r--
2023-01-13 02:40
ajp.lua
16.77
KB
-rw-r--r--
2023-01-13 02:40
amqp.lua
10.41
KB
-rw-r--r--
2023-01-13 02:40
anyconnect.lua
4.31
KB
-rw-r--r--
2023-01-13 02:40
asn1.lua
14.57
KB
-rw-r--r--
2023-01-13 02:40
base32.lua
7.36
KB
-rw-r--r--
2023-01-13 02:40
base64.lua
5.83
KB
-rw-r--r--
2023-01-13 02:40
bin.lua
12.99
KB
-rw-r--r--
2023-01-13 02:40
bitcoin.lua
18.25
KB
-rw-r--r--
2023-01-13 02:40
bits.lua
2.54
KB
-rw-r--r--
2023-01-13 02:40
bittorrent.lua
35.76
KB
-rw-r--r--
2023-01-13 02:40
bjnp.lua
9.55
KB
-rw-r--r--
2023-01-13 02:40
brute.lua
50.64
KB
-rw-r--r--
2023-01-13 02:40
cassandra.lua
5.48
KB
-rw-r--r--
2023-01-13 02:40
citrixxml.lua
16
KB
-rw-r--r--
2023-01-13 02:40
coap.lua
75.1
KB
-rw-r--r--
2023-01-13 02:40
comm.lua
11.03
KB
-rw-r--r--
2023-01-13 02:40
creds.lua
18.26
KB
-rw-r--r--
2023-01-13 02:40
cvs.lua
3.05
KB
-rw-r--r--
2023-01-13 02:40
datafiles.lua
11.05
KB
-rw-r--r--
2023-01-13 02:40
datetime.lua
7.5
KB
-rw-r--r--
2023-01-13 02:40
dhcp.lua
28.57
KB
-rw-r--r--
2023-01-13 02:40
dhcp6.lua
19.86
KB
-rw-r--r--
2023-01-13 02:40
dns.lua
51.07
KB
-rw-r--r--
2023-01-13 02:40
dnsbl.lua
19.01
KB
-rw-r--r--
2023-01-13 02:40
dnssd.lua
12.61
KB
-rw-r--r--
2023-01-13 02:40
drda.lua
24.08
KB
-rw-r--r--
2023-01-13 02:40
eap.lua
7.54
KB
-rw-r--r--
2023-01-13 02:40
eigrp.lua
12.98
KB
-rw-r--r--
2023-01-13 02:40
formulas.lua
5.68
KB
-rw-r--r--
2023-01-13 02:40
ftp.lua
9.03
KB
-rw-r--r--
2023-01-13 02:40
geoip.lua
1.71
KB
-rw-r--r--
2023-01-13 02:40
giop.lua
18.42
KB
-rw-r--r--
2023-01-13 02:40
gps.lua
3.38
KB
-rw-r--r--
2023-01-13 02:40
http.lua
117.07
KB
-rw-r--r--
2023-01-13 02:40
httpspider.lua
36.65
KB
-rw-r--r--
2023-01-13 02:40
iax2.lua
9.58
KB
-rw-r--r--
2023-01-13 02:40
idna.lua
17.14
KB
-rw-r--r--
2023-01-13 02:40
ike.lua
14.63
KB
-rw-r--r--
2023-01-13 02:40
imap.lua
9.59
KB
-rw-r--r--
2023-01-13 02:40
informix.lua
39.93
KB
-rw-r--r--
2023-01-13 02:40
ipOps.lua
29.06
KB
-rw-r--r--
2023-01-13 02:40
ipmi.lua
8.08
KB
-rw-r--r--
2023-01-13 02:40
ipp.lua
12.57
KB
-rw-r--r--
2023-01-13 02:40
irc.lua
757
B
-rw-r--r--
2023-01-13 02:40
iscsi.lua
21.38
KB
-rw-r--r--
2023-01-13 02:40
isns.lua
14.98
KB
-rw-r--r--
2023-01-13 02:40
jdwp.lua
43.52
KB
-rw-r--r--
2023-01-13 02:40
json.lua
11.62
KB
-rw-r--r--
2023-01-13 02:40
knx.lua
2.42
KB
-rw-r--r--
2023-01-13 02:40
ldap.lua
31.94
KB
-rw-r--r--
2023-01-13 02:40
lfs.luadoc
1.68
KB
-rw-r--r--
2023-01-13 02:40
libssh2-utility.lua
4.69
KB
-rw-r--r--
2023-01-13 02:40
libssh2.luadoc
4.75
KB
-rw-r--r--
2023-01-13 02:40
listop.lua
4.66
KB
-rw-r--r--
2023-01-13 02:40
lpeg-utility.lua
5.64
KB
-rw-r--r--
2023-01-13 02:40
lpeg.luadoc
351
B
-rw-r--r--
2023-01-13 02:40
ls.lua
10.96
KB
-rw-r--r--
2023-01-13 02:40
match.lua
2.05
KB
-rw-r--r--
2023-01-13 02:40
membase.lua
9.93
KB
-rw-r--r--
2023-01-13 02:40
mobileme.lua
8.46
KB
-rw-r--r--
2023-01-13 02:40
mongodb.lua
21.3
KB
-rw-r--r--
2023-01-13 02:40
mqtt.lua
28.86
KB
-rw-r--r--
2023-01-13 02:40
msrpc.lua
190.07
KB
-rw-r--r--
2023-01-13 02:40
msrpcperformance.lua
29.65
KB
-rw-r--r--
2023-01-13 02:40
msrpctypes.lua
168.52
KB
-rw-r--r--
2023-01-13 02:40
mssql.lua
109.43
KB
-rw-r--r--
2023-01-13 02:40
multicast.lua
5.97
KB
-rw-r--r--
2023-01-13 02:40
mysql.lua
16.03
KB
-rw-r--r--
2023-01-13 02:40
natpmp.lua
5.11
KB
-rw-r--r--
2023-01-13 02:40
nbd.lua
16.04
KB
-rw-r--r--
2023-01-13 02:40
ncp.lua
35.64
KB
-rw-r--r--
2023-01-13 02:40
ndmp.lua
11.43
KB
-rw-r--r--
2023-01-13 02:40
netbios.lua
14.44
KB
-rw-r--r--
2023-01-13 02:40
nmap.luadoc
40.34
KB
-rw-r--r--
2023-01-13 02:40
nrpc.lua
4.46
KB
-rw-r--r--
2023-01-13 02:40
nsedebug.lua
3.49
KB
-rw-r--r--
2023-01-13 02:40
omp2.lua
4.78
KB
-rw-r--r--
2023-01-13 02:40
oops.lua
3.61
KB
-rw-r--r--
2023-01-13 02:40
openssl.luadoc
7.5
KB
-rw-r--r--
2023-01-13 02:40
ospf.lua
15.29
KB
-rw-r--r--
2023-01-13 02:40
packet.lua
36.18
KB
-rw-r--r--
2023-01-13 02:40
pcre.luadoc
6.79
KB
-rw-r--r--
2023-01-13 02:40
pgsql.lua
20.6
KB
-rw-r--r--
2023-01-13 02:40
pop3.lua
5.74
KB
-rw-r--r--
2023-01-13 02:40
pppoe.lua
29.42
KB
-rw-r--r--
2023-01-13 02:40
proxy.lua
11.37
KB
-rw-r--r--
2023-01-13 02:40
punycode.lua
11.5
KB
-rw-r--r--
2023-01-13 02:40
rand.lua
2.7
KB
-rw-r--r--
2023-01-13 02:40
rdp.lua
14.73
KB
-rw-r--r--
2023-01-13 02:40
re.lua
8.22
KB
-rw-r--r--
2023-01-13 02:40
redis.lua
3.61
KB
-rw-r--r--
2023-01-13 02:40
rmi.lua
47.77
KB
-rw-r--r--
2023-01-13 02:40
rpc.lua
107.64
KB
-rw-r--r--
2023-01-13 02:40
rpcap.lua
11.08
KB
-rw-r--r--
2023-01-13 02:40
rsync.lua
5.22
KB
-rw-r--r--
2023-01-13 02:40
rtsp.lua
8.62
KB
-rw-r--r--
2023-01-13 02:40
sasl.lua
16.51
KB
-rw-r--r--
2023-01-13 02:40
shortport.lua
11.99
KB
-rw-r--r--
2023-01-13 02:40
sip.lua
30.07
KB
-rw-r--r--
2023-01-13 02:40
slaxml.lua
17.9
KB
-rw-r--r--
2023-01-13 02:40
smb.lua
173.22
KB
-rw-r--r--
2023-01-13 02:40
smb2.lua
15.34
KB
-rw-r--r--
2023-01-13 02:40
smbauth.lua
37.33
KB
-rw-r--r--
2023-01-13 02:40
smtp.lua
19.85
KB
-rw-r--r--
2023-01-13 02:40
snmp.lua
16
KB
-rw-r--r--
2023-01-13 02:40
socks.lua
8.25
KB
-rw-r--r--
2023-01-13 02:40
srvloc.lua
10.99
KB
-rw-r--r--
2023-01-13 02:40
ssh1.lua
9.15
KB
-rw-r--r--
2023-01-13 02:40
ssh2.lua
11.73
KB
-rw-r--r--
2023-01-13 02:40
sslcert.lua
33.35
KB
-rw-r--r--
2023-01-13 02:40
sslv2.lua
9.68
KB
-rw-r--r--
2023-01-13 02:40
stdnse.lua
32.64
KB
-rw-r--r--
2023-01-13 02:40
strbuf.lua
4.52
KB
-rw-r--r--
2023-01-13 02:40
strict.lua
2.53
KB
-rw-r--r--
2023-01-13 02:40
stringaux.lua
4.32
KB
-rw-r--r--
2023-01-13 02:40
stun.lua
11.08
KB
-rw-r--r--
2023-01-13 02:40
tab.lua
3.35
KB
-rw-r--r--
2023-01-13 02:40
tableaux.lua
2.06
KB
-rw-r--r--
2023-01-13 02:40
target.lua
3.93
KB
-rw-r--r--
2023-01-13 02:40
tftp.lua
9.41
KB
-rw-r--r--
2023-01-13 02:40
tls.lua
58.05
KB
-rw-r--r--
2023-01-13 02:40
tn3270.lua
46.99
KB
-rw-r--r--
2023-01-13 02:40
tns.lua
64.16
KB
-rw-r--r--
2023-01-13 02:40
unicode.lua
14.23
KB
-rw-r--r--
2023-01-13 02:40
unittest.lua
12.41
KB
-rw-r--r--
2023-01-13 02:40
unpwdb.lua
10.42
KB
-rw-r--r--
2023-01-13 02:40
upnp.lua
11.18
KB
-rw-r--r--
2023-01-13 02:40
url.lua
16.7
KB
-rw-r--r--
2023-01-13 02:40
versant.lua
8.58
KB
-rw-r--r--
2023-01-13 02:40
vnc.lua
25.54
KB
-rw-r--r--
2023-01-13 02:40
vulns.lua
76.45
KB
-rw-r--r--
2023-01-13 02:40
vuzedht.lua
16.21
KB
-rw-r--r--
2023-01-13 02:40
wsdd.lua
11.98
KB
-rw-r--r--
2023-01-13 02:40
xdmcp.lua
12.09
KB
-rw-r--r--
2023-01-13 02:40
xmpp.lua
15.91
KB
-rw-r--r--
2023-01-13 02:40
zlib.luadoc
4.88
KB
-rw-r--r--
2023-01-13 02:40
Save
Rename
--- -- A limited OSPF (Open Shortest Path First routing protocol) library, currently supporting IPv4 and the following -- OSPF message types: HELLO, DB_DESCRIPTION, LS_REQUEST, LS_UPDATE -- -- The library consists of an OSPF class that contains code to handle OSPFv2 packets. -- -- @author Patrik Karlsson <patrik@cqure.net> -- @author Emiliano Ticci <emiticci@gmail.com> -- @copyright Same as Nmap--See https://nmap.org/book/man-legal.html local math = require "math" local stdnse = require "stdnse" local string = require "string" local table = require "table" local ipOps = require "ipOps" local packet = require "packet" _ENV = stdnse.module("ospf", stdnse.seeall) local have_ssl, openssl = pcall(require, "openssl") -- The OSPF class. OSPF = { -- Message Type constants Message = { HELLO = 1, DB_DESCRIPTION = 2, LS_REQUEST = 3, LS_UPDATE = 4, }, Header = { size = 24, new = function(self, type, area_id, router_id, auth_type, auth_data) local o = { ver = 2, type = type, length = 0, router_id = router_id or 0, area_id = area_id or 0, chksum = 0, auth_type = auth_type or 0, auth_data = auth_data or {}, } setmetatable(o, self) self.__index = self return o end, parse = function(data) local header = OSPF.Header:new() local pos header.ver, header.type, header.length, pos = string.unpack(">BBI2", data) assert( header.ver == 2, "Invalid OSPF version detected") header.router_id, header.area_id, header.chksum, header.auth_type, pos = string.unpack(">I4 I4 I2 I2", data, pos) -- No authentication if header.auth_type == 0x00 then header.auth_data.password = nil -- Clear text password elseif header.auth_type == 0x01 then header.auth_data.password, pos = string.unpack("c8", data, pos) -- MD5 hash authentication elseif header.auth_type == 0x02 then header.auth_data.keyid, header.auth_data.length, header.auth_data.seq = string.unpack(">BB I4", data, pos+2) local hash = stdnse.tohex(string.sub(data, header.length+1, header.length+1+header.auth_data.length)) header.auth_data.hash = hash else -- Shouldn't happen stdnse.debug1("Unknown authentication type " .. header.auth_type) return nil end header.router_id = ipOps.fromdword(header.router_id) return header end, --- Sets the OSPF Area ID -- @param areaid Area ID. setAreaID = function(self, areaid) self.area_id = (type(areaid) == "number") and areaid or ipOps.todword(areaid) end, --- Sets the OSPF Router ID -- @param router_id Router ID. setRouterId = function(self, router_id) self.router_id = router_id end, --- Sets the OSPF Packet length -- @param length Packet length. setLength = function(self, length) self.length = self.size + length end, __tostring = function(self) local auth if self.auth_type == 0x00 then auth = string.rep("\0", 8) elseif self.auth_type == 0x01 then auth = self.auth_data.password elseif self.auth_type == 0x02 then auth = string.pack(">I2 BB I4", 0, self.auth_data.keyid, self.auth_data.length, self.auth_data.seq) end local hdr = string.pack(">BB I2 I4 I4 I2 I2", self.ver, self.type, self.length, ipOps.todword(self.router_id), self.area_id, self.chksum, self.auth_type ) .. auth return hdr end, }, Hello = { new = function(self) local o = { header = OSPF.Header:new(OSPF.Message.HELLO), options = 0x02, prio = 0, interval = 10, router_dead_interval = 40, neighbors = {}, DR = "0.0.0.0", BDR = "0.0.0.0", } setmetatable(o, self) self.__index = self return o end, --- Adds a neighbor to the list of neighbors. -- @param neighbor IP Address of the neighbor. addNeighbor = function(self, neighbor) table.insert(self.neighbors, neighbor) end, --- Sets the OSPF netmask. -- @param netmask Netmask in A.B.C.D setNetmask = function(self, netmask) if netmask then self.netmask = netmask end end, --- Sets the OSPF designated Router. -- @param router IP address of the designated router. setDesignatedRouter = function(self, router) if router then self.DR = router end end, --- Sets the OSPF backup Router. -- @param router IP Address of the backup router. setBackupRouter = function(self, router) if router then self.BDR = router end end, __tostring = function(self) self.neighbors = self.neighbors or {} local function tostr() local data = { string.pack(">I4 I2 BB I4 I4 I4", ipOps.todword(self.netmask), self.interval, self.options, self.prio, self.router_dead_interval, ipOps.todword(self.DR), ipOps.todword(self.BDR)) } for _, n in ipairs(self.neighbors) do data[#data+1] = string.pack(">I4", ipOps.todword(n)) end data = table.concat(data) self.header:setLength(#data) return tostring(self.header) .. data .. (self.header.auth_data.hash or "") end local data = tostr() if have_ssl and self.header.auth_type == 0x02 then self.header.auth_data.key = self.header.auth_data.key .. string.rep("\0", 16 - #self.header.auth_data.key) self.header.auth_data.hash = openssl.md5(data .. self.header.auth_data.key) else self.header.chksum = packet.in_cksum(data:sub(1,16) .. data:sub(25)) end return tostr() end, parse = function(data) local hello = OSPF.Hello:new() local pos = OSPF.Header.size + 1 hello.header = OSPF.Header.parse(data) assert( #data >= hello.header.length, "OSPF packet too short") hello.netmask, hello.interval, hello.options, hello.prio, hello.router_dead_interval, hello.DR, hello.BDR, pos = string.unpack(">I4 I2 BB I4 I4 I4", data, pos) hello.netmask = ipOps.fromdword(hello.netmask) hello.DR = ipOps.fromdword(hello.DR) hello.BDR = ipOps.fromdword(hello.BDR) if ( ( #data - pos + 1 ) % 4 ~= 0 ) then stdnse.debug2("Unexpected OSPF packet length, aborting ...") return end local neighbor_count = ( hello.header.length - pos + 1 ) / 4 local neighbor hello.neighbors = {} for i=1, neighbor_count do neighbor, pos = string.unpack(">I4", data, pos) neighbor = ipOps.fromdword(neighbor) table.insert(hello.neighbors, neighbor) end return hello end, }, LSA = { Header = { size = 20, new = function(self) local o = { age = 0, options = 0, type = 1, id = 0, adv_router = 0, sequence = 0, checksum = 0, length = 0, } setmetatable(o, self) self.__index = self return o end, parse = function(data) local lsa_h = OSPF.LSA.Header:new() local pos = 1 lsa_h.age, lsa_h.options, lsa_h.type, lsa_h.id, lsa_h.adv_router, lsa_h.sequence, lsa_h.checksum, lsa_h.length, pos = string.unpack(">I2 BB I4 I4 c4 c2 I2", data, pos) lsa_h.id = ipOps.fromdword(lsa_h.id) lsa_h.adv_router = ipOps.fromdword(lsa_h.adv_router) lsa_h.sequence = stdnse.tohex(lsa_h.sequence) lsa_h.checksum = stdnse.tohex(lsa_h.checksum) return lsa_h end, }, Link = { new = function(self) local o = { id = 0, data = 0, type = 2, num_metrics = 0, metric = 10, } setmetatable(o, self) self.__index = self return o end, parse = function(data) local lsa_link = OSPF.LSA.Link:new() local pos = 1 lsa_link.id, lsa_link.data, lsa_link.type, lsa_link.num_metrics, lsa_link.metric, pos = string.unpack(">I4 I4 BB I2", data, pos) lsa_link.id = ipOps.fromdword(lsa_link.id) lsa_link.data = ipOps.fromdword(lsa_link.data) return lsa_link end, }, Router = { new = function(self) local o = { header = OSPF.LSA.Header:new(), flags = 0, num_links = 0, links = {}, } setmetatable(o, self) self.__index = self return o end, parse = function(data) local router = OSPF.LSA.Router:new() local pos = OSPF.LSA.Header.size + 1 router.header = OSPF.LSA.Header.parse(data) router.flags, router.num_links, pos = string.unpack(">B x I2", data, pos) while ( pos < router.header.length ) do table.insert(router.links, OSPF.LSA.Link.parse(data:sub(pos, pos + 12))) pos = pos + 12 end return router end, }, ASExternal = { new = function(self) local o = { header = OSPF.LSA.Header:new(), netmask = 0, ext_type = 1, metric = 1, fw_address = 0, ext_tag = 0, } setmetatable(o, self) self.__index = self return o end, parse = function(data) local as_ext = OSPF.LSA.ASExternal:new() local pos = OSPF.LSA.Header.size + 1 as_ext.header = OSPF.LSA.Header.parse(data) as_ext.netmask, as_ext.metric, as_ext.fw_address, as_ext.ext_tag, pos = string.unpack(">I4 I4 I4 I4", data, pos) as_ext.netmask = ipOps.fromdword(as_ext.netmask) as_ext.ext_type = 1 + ((as_ext.metric & 0xFF000000) >> 31) as_ext.metric = as_ext.metric & 0x00FFFFFF as_ext.fw_address = ipOps.fromdword(as_ext.fw_address) return as_ext end, }, parse = function(data) local header = OSPF.LSA.Header.parse(data) if header.type == 1 then return OSPF.LSA.Router.parse(data) elseif header.type == 5 then return OSPF.LSA.ASExternal.parse(data) end return header.length end, }, DBDescription = { new = function(self) local o = { header = OSPF.Header:new(OSPF.Message.DB_DESCRIPTION), mtu = 1500, options = 2, -- external routing capability init = true, more = true, master = true, sequence = math.random(123456789), lsa_headers = {} } setmetatable(o, self) self.__index = self return o end, __tostring = function(self) local function tostr() local flags = 0 if ( self.init ) then flags = flags + 4 end if ( self.more ) then flags = flags + 2 end if ( self.master) then flags= flags + 1 end local data = string.pack(">I2 BB I4", self.mtu, self.options, flags, self.sequence) self.header:setLength(#data) return tostring(self.header) .. data .. (self.header.auth_data.hash or "") end local data = tostr() if have_ssl and self.header.auth_type == 0x02 then self.header.auth_data.key = self.header.auth_data.key .. string.rep("\0", 16 - #self.header.auth_data.key) self.header.auth_data.hash = openssl.md5(data .. self.header.auth_data.key) else self.header.chksum = packet.in_cksum(data:sub(1,16) .. data:sub(25)) end return tostr() end, parse = function(data) local desc = OSPF.DBDescription:new() local pos = OSPF.Header.size + 1 desc.header = OSPF.Header.parse(data) assert( #data >= desc.header.length, "OSPF packet too short") local flags = 0 desc.mtu, desc.options, flags, desc.sequence, pos = string.unpack(">I2 BB I4", data, pos) desc.init = (flags & 4) == 4 desc.more = (flags & 2) == 2 desc.master = (flags & 1) == 1 while ( pos < desc.header.length ) do table.insert(desc.lsa_headers, OSPF.LSA.Header.parse(data:sub(pos, pos + 20))) pos = pos + 20 end if ( desc.init or not(desc.more) ) then return desc end return desc end, }, LSRequest = { new = function(self) local o = { header = OSPF.Header:new(OSPF.Message.LS_REQUEST), ls_requests = {}, } setmetatable(o, self) self.__index = self return o end, --- Adds a request to the list of requests. -- @param type LS Type. -- @param id Link State ID -- @param adv_router Advertising Router addRequest = function(self, type, id, adv_router) local request = { type = type, id = id, adv_router = adv_router } table.insert(self.ls_requests, request) end, __tostring = function(self) local function tostr() local data = {} for _, req in ipairs(self.ls_requests) do data[#data+1] = string.pack(">I4 I4 I4", req.type, ipOps.todword(req.id), ipOps.todword(req.adv_router)) end data = table.concat(data) self.header:setLength(#data) return tostring(self.header) .. data .. (self.header.auth_data.hash or "") end local data = tostr() if have_ssl and self.header.auth_type == 0x02 then self.header.auth_data.key = self.header.auth_data.key .. string.rep("\0", 16 - #self.header.auth_data.key) self.header.auth_data.hash = openssl.md5(data .. self.header.auth_data.key) else self.header.chksum = packet.in_cksum(data:sub(1,16) .. data:sub(25)) end return tostr() end, parse = function(data) local ls_req = OSPF.LSRequest:new() local pos = OSPF.Header.size + 1 ls_req.header = OSPF.Header.parse(data) assert( #data >= ls_req.header.length, "OSPF packet too short") while ( pos < #data ) do local req = {} req.type, req.id, req.adv_router, pos = string.unpack(">I4 I4 I4", data, pos) table.insert(ls_req.ls_requests, req) end return ls_req end, }, LSUpdate = { new = function(self) local o = { header = OSPF.Header:new(OSPF.Message.LS_UPDATE), num_lsas = 0, lsas = {}, } setmetatable(o, self) self.__index = self return o end, parse = function(data) local lsu = OSPF.LSUpdate:new() local pos = OSPF.Header.size + 1 lsu.header = OSPF.Header.parse(data) assert( #data >= lsu.header.length, "OSPF packet too short") lsu.num_lsas, pos = string.unpack(">I4", data, pos) while ( pos < lsu.header.length ) do local lsa = OSPF.LSA.parse(data:sub(pos)) if ( type(lsa) == "table" ) then table.insert(lsu.lsas, lsa) pos = pos + lsa.header.length else pos = pos + lsa end end return lsu end, }, Response = { parse = function(data) local ver, ospf_type, pos = string.unpack("BB", data) if ( ospf_type == OSPF.Message.HELLO ) then return OSPF.Hello.parse( data ) elseif( ospf_type == OSPF.Message.DB_DESCRIPTION ) then return OSPF.DBDescription.parse(data) elseif( ospf_type == OSPF.Message.LS_REQUEST ) then return OSPF.LSRequest.parse(data) elseif( ospf_type == OSPF.Message.LS_UPDATE ) then return OSPF.LSUpdate.parse(data) end return end, } } return _ENV;