home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 July (DVD) / PCWELT_7_2006.ISO / pcwsoft / ethereal-setup-0.99.0.exe / init.lua < prev    next >
Encoding:
Text File  |  2006-04-24  |  4.7 KB  |  211 lines

  1. -- init.lua
  2. --
  3. -- initilaize ethereal's lua
  4. --
  5. --  This file is going to be executed before any other lua script.
  6. --  It can be used to load libraries, disable functions and more.
  7. --
  8. -- $Id: template-init.lua 17602 2006-03-12 17:39:46Z lego $
  9. -- 
  10. -- Ethereal - Network traffic analyzer
  11. -- By Gerald Combs <gerald@ethereal.com>
  12. -- Copyright 1998 Gerald Combs
  13. --
  14. -- This program is free software; you can redistribute it and/or
  15. -- modify it under the terms of the GNU General Public License
  16. -- as published by the Free Software Foundation; either version 2
  17. -- of the License, or (at your option) any later version.
  18. --
  19. -- This program is distributed in the hope that it will be useful,
  20. -- but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  22. -- GNU General Public License for more details.
  23. --
  24. -- You should have received a copy of the GNU General Public License
  25. -- along with this program; if not, write to the Free Software
  26. -- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  27.  
  28.  
  29. -- If lua is to be disabled even if it was installed uncomment the following
  30. -- line.
  31. -- disable_lua = true; do return end;
  32.  
  33.  
  34. -- If set and we are running with special privileges this setting
  35. -- tells whether scripts other than this one are to be run.
  36. run_user_scripts_when_superuser = false
  37.  
  38. -- disable potentialy harmful lua functions when running superuser
  39. if running_superuser then
  40.     dofile = function() error("dofile has been disabled") end
  41.     loadfile = function() error("loadfile has been disabled") end
  42.     loadlib = function() error("loadlib has been disabled") end
  43.     require = function() error("require has been disabled") end
  44.     os = {}
  45.     io = {}
  46.     file = {}
  47. end
  48.  
  49. -- to avoid output to stdout which can caause problems lua's print ()
  50. -- has been suppresed so that it yields an error.
  51. -- have print() call info() instead.
  52. print = info
  53.  
  54. -- -- Wiretap encapsulations
  55. wtap = {
  56.     ["UNKNOWN"] = 0,
  57.     ["ETHERNET"] = 1,
  58.     ["TOKEN_RING"] = 2,
  59.     ["SLIP"] = 3,
  60.     ["PPP"] = 4,
  61.     ["FDDI"] = 5,
  62.     ["FDDI_BITSWAPPED"] = 6,
  63.     ["RAW_IP"] = 7,
  64.     ["ARCNET"] = 8,
  65.     ["ARCNET_LINUX"] = 9,
  66.     ["ATM_RFC1483"] = 10,
  67.     ["LINUX_ATM_CLIP"] = 11,
  68.     ["LAPB"] = 12,
  69.     ["ATM_PDUS"] = 13,
  70.     ["ATM_PDUS_UNTRUNCATED"] = 14,
  71.     ["NULL"] = 15,
  72.     ["ASCEND"] = 16,
  73.     ["ISDN"] = 17,
  74.     ["IP_OVER_FC"] = 18,
  75.     ["PPP_WITH_PHDR"] = 19,
  76.     ["IEEE_802_11"] = 20,
  77.     ["PRISM_HEADER"] = 21,
  78.     ["IEEE_802_11_WITH_RADIO"] = 22,
  79.     ["IEEE_802_11_WLAN_RADIOTAP"] = 23,
  80.     ["IEEE_802_11_WLAN_AVS"] = 24,
  81.     ["SLL"] = 25,
  82.     ["FRELAY"] = 26,
  83.     ["FRELAY_WITH_PHDR"] = 27,
  84.     ["CHDLC"] = 28,
  85.     ["CISCO_IOS"] = 29,
  86.     ["LOCALTALK"] = 30,
  87.     ["OLD_PFLOG"] = 31,
  88.     ["HHDLC"] = 32,
  89.     ["DOCSIS"] = 33,
  90.     ["COSINE"] = 34,
  91.     ["WFLEET_HDLC"] = 35,
  92.     ["SDLC"] = 36,
  93.     ["TZSP"] = 37,
  94.     ["ENC"] = 38,
  95.     ["PFLOG"] = 39,
  96.     ["CHDLC_WITH_PHDR"] = 40,
  97.     ["BLUETOOTH_H4"] = 41,
  98.     ["MTP2"] = 42,
  99.     ["MTP3"] = 43,
  100.     ["IRDA"] = 44,
  101.     ["USER0"] = 45,
  102.     ["USER1"] = 46,
  103.     ["USER2"] = 47,
  104.     ["USER3"] = 48,
  105.     ["USER4"] = 49,
  106.     ["USER5"] = 50,
  107.     ["USER6"] = 51,
  108.     ["USER7"] = 52,
  109.     ["USER8"] = 53,
  110.     ["USER9"] = 54,
  111.     ["USER10"] = 55,
  112.     ["USER11"] = 56,
  113.     ["USER12"] = 57,
  114.     ["USER13"] = 58,
  115.     ["USER14"] = 59,
  116.     ["USER15"] = 60,
  117.     ["SYMANTEC"] = 61,
  118.     ["APPLE_IP_OVER_IEEE1394"] = 62,
  119.     ["BACNET_MS_TP"] = 63,
  120.     ["NETTL_RAW_ICMP"] = 64,
  121.     ["NETTL_RAW_ICMPV6"] = 65,
  122.     ["GPRS_LLC"] = 67,
  123.     ["JUNIPER_ATM1"] = 68,
  124.     ["JUNIPER_ATM2"] = 69,
  125.     ["REDBACK"] = 70,
  126.     ["NETTL_RAW_IP"] = 71,
  127.     ["NETTL_ETHERNET"] = 72,
  128.     ["NETTL_TOKEN_RING"] = 73,
  129.     ["NETTL_FDDI"] = 74,
  130.     ["NETTL_UNKNOWN"] = 75,
  131.     ["MTP2_WITH_PHDR"] = 76,
  132.     ["JUNIPER_PPPOE"] = 77,
  133.     ["NETTL_X25"] = 80,
  134.     ["K12"] = 81,
  135.     ["JUNIPER_MLPPP"] = 82,
  136.     ["JUNIPER_MLFR"] = 83,
  137.     ["JUNIPER_ETHER"] = 84,
  138.     ["JUNIPER_PPP"] = 85,
  139.     ["JUNIPER_FRELAY"] = 86,
  140.     ["JUNIPER_CHDLC"] = 87,
  141.     ["JUNIPER_GGSN"] = 88,
  142.     ["LINUX_LAPD"] = 89
  143. }
  144.  
  145.  
  146. --  -- Field Types
  147. ftypes = {
  148.     ["NONE"] = 0,
  149.     ["PROTOCOL"] = 1,
  150.     ["BOOLEAN"] = 2,
  151.     ["UINT8"] = 3,
  152.     ["UINT16"] = 4,
  153.     ["UINT24"] = 5,
  154.     ["UINT32"] = 6,
  155.     ["UINT64"] = 7,
  156.     ["INT8"] = 8,
  157.     ["INT16"] = 9,
  158.     ["INT24"] = 10,
  159.     ["INT32"] = 11,
  160.     ["INT64"] = 12,
  161.     ["FLOAT"] = 13,
  162.     ["DOUBLE"] = 14,
  163.     ["ABSOLUTE_TIME"] = 15,
  164.     ["RELATIVE_TIME"] = 16,
  165.     ["STRING"] = 17,
  166.     ["STRINGZ"] = 18,
  167.     ["UINT_STRING"] = 19,
  168.     ["ETHER"] = 20,
  169.     ["BYTES"] = 21,
  170.     ["UINT_BYTES"] = 22,
  171.     ["IPv4"] = 23,
  172.     ["IPv6"] = 24,
  173.     ["IPXNET"] = 25,
  174.     ["FRAMENUM"] = 26,
  175.     ["PCRE"] = 27,
  176.     ["GUID"] = 28,
  177.     ["OID"] = 29
  178. }
  179.  
  180.  
  181. -- -- Display Bases
  182.  base = {
  183.     ["NONE"] = 0,
  184.     ["DEC"] = 1,
  185.     ["HEX"] = 2,
  186.     ["OCT"] = 3,
  187.     ["DEC_HEX"] = 4,
  188. }
  189.  
  190.  
  191.  
  192. -- -- Expert flags and facilities
  193. PI_SEVERITY_MASK = 28
  194. PI_CHAT = 4
  195. PI_NOTE = 8
  196. PI_WARN = 12
  197. PI_ERROR = 16
  198. PI_GROUP_MASK = 65280
  199. PI_CHECKSUM = 256
  200. PI_SEQUENCE = 512
  201. PI_RESPONSE_CODE = 1024
  202. PI_REQUEST_CODE = 1280
  203. PI_UNDECODED = 2048
  204. PI_REASSEMBLE = 4096
  205. PI_MALFORMED = 8192
  206. PI_DEBUG = 16384
  207.  
  208.  
  209.  
  210.  
  211.