aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/lua/packet-lua.c
AgeCommit message (Collapse)AuthorFilesLines
2006-02-21- rename all the c filesLuis Ontanon1-466/+0
- have elua_makereg.pl generating the declaration and registration Macros for each module - start of elua_makedoc.pl that should generate the Reference Manual from the code. svn path=/trunk/; revision=17362
2006-02-19- Use lua 5.1Luis Ontanon1-9/+1
- Compress *_register() functions svn path=/trunk/; revision=17354
2006-02-17- pass the tvb too to tap packet callbacksLuis Ontanon1-0/+3
- Dumper (an interface to Wiretap dumpers) svn path=/trunk/; revision=17328
2006-02-15Protect The tree and The tvb from being used outside their scopeLuis Ontanon1-2/+4
svn path=/trunk/; revision=17307
2006-02-15- protect column, columns and pinfo from dereferencing invalid data saved by ↵Luis Ontanon1-1/+2
the user. - columns live for less than a packet's time, use ep_alloc not g_malloc - tvbranges are ephemeral too doc/ is to remain as a placeholder for upcoming docs. lualib/ is to be deleted (if needed it should go in trunk) but it appears that once I added if I do not check it in I cannot delete it. svn path=/trunk/; revision=17305
2006-02-14- fix a sure crash after an error in lua code lua_tap_draw.Luis Ontanon1-0/+2
- make sure no reference to a Tvb in lua is used after the lua dissector has returned. svn path=/trunk/; revision=17296
2006-02-13- disable printLuis Ontanon1-33/+140
- add a log facility to lua (so far just prints to stderr) - add settings to disable lua even if installed, to load or not to load user scripts when superuser - create a default /usr/local/share/ethereal/init.lua that blocks all the io/system calls when running as superuser svn path=/trunk/; revision=17290
2006-02-08* DissectorTable.add does not allow to add lua protocols that don't have a ↵Luis Ontanon1-28/+20
dissector. * ProtoFiled.uint checks the base to be a valid value to avoid an assertion in proto.c while registering the field array * save one lua table lookup by using a reference to the dissectors table instead of looking for it by name * set data_hanlde's value to avoid a crash while invoking it. * make the TvbRange of Tree:add_item really optional. svn path=/trunk/; revision=17220
2006-02-08Changed how files are loaded.Luis Ontanon1-39/+67
load $ETH/init.lua if it exists if we are not runninig on special privileges load $USER/init.lua and then all the files given with cmd line option -X lua_script:file.lua svn path=/trunk/; revision=17210
2006-02-07I Noticed a crash when registering a tap with filter during handoff (that's ↵Luis Ontanon1-25/+9
when I had lua starting) trying to see if I could move dfilter_init() before protocol registration I discovered register_final_registration_routine() neat! Lua protocols won't need a handoff routine anymore!! svn path=/trunk/; revision=17191
2006-02-06+ gui_enabled()Luis Ontanon1-3/+17
* make the gui routines call-able since the first line of the script svn path=/trunk/; revision=17190
2006-02-06Lua uses the simple dialogLuis Ontanon1-0/+4
svn path=/trunk/; revision=17173
2006-02-05* move all the tap functions to lua_tapLuis Ontanon1-138/+1
* change the way taps work (docs coming) * add an at_close method to the textwindow that allows the user to set a callback function to be called when the window is closed svn path=/trunk/; revision=17166
2006-02-05Allow lua to register menu itemsLuis Ontanon1-0/+4
svn path=/trunk/; revision=17162
2006-02-04Give lua a minimal gui.Luis Ontanon1-0/+15
svn path=/trunk/; revision=17150
2006-02-03* packet-lua.hLuis Ontanon1-14/+28
* add a shiftC() function to every class for extracting values from the stack * lua_pinfo.c * fix pinfo.dst pinfo.dl_dst pinfo.dl_src pinfo.net_dst pinfo.net_src * lua_tree.c * ProtoTree_add_item_any() changed to use TvbRanges, a more handy way to give it optional arguments * lua_tvb.c * get ByteArray up and running * create TvbRange class and use it to access the tvb (this class takes care of checking bounds so that exceptions are not thrown) svn path=/trunk/; revision=17146
2006-01-29* packet-lua.hLuis Ontanon1-7/+11
* add an isXxx() declaration * packet-lua.c * move the dissectors, handoffs and inits tables to the registry * lua_proto.c * new_protocol is now called Protocol * move the dissectors, handoffs and inits tables to the registry svn path=/trunk/; revision=17117
2006-01-28* packet-lua.hLuis Ontanon1-93/+199
* SubTreeType (ett) was renamed as SubTree * lua_tap.c - change the way the taps register (still to be finished so I won't comment) * lua_tree.c * SubTree(ett) moved here, now it autoregisters all subtrees created at once. The user neither does need to create a SubTreeArray(eliminated) anymore nor to register it. * lua_proto.c * SubTree moved out from here its "global" variables are used by lua_tree.c . * SubTreeArray was eliminated (now ett's "autoregister") * Created usertypes for - Pref a preference - Prefs all preferences of one protocol So far they are transparent to the user. * Proto has become a pseudo-table instead of a method based (registration in nicer) * packet-lua.c * runtime errors go where they are meant to: - errors in dissector code go to the tree (a-la malformed) - errors in registration/handoff/init use reporte_failure() * no more Lua code to be compiled at runtime svn path=/trunk/; revision=17110
2006-01-26* we need not to register the interesting fields via a tap its registration ↵Luis Ontanon1-7/+47
should be transparent to the user. - as of now I'm using a "boring" tap (NULL packet_cb) with a filter containing all the registered ones * Lua code in init_lua() is not to be compiled anymore (I did) svn path=/trunk/; revision=17108
2006-01-26 * lua_tree.cLuis Ontanon1-23/+76
* protect proto_item_add_* calls with a TRY CATCH to avoid the Lua state getting corrupted * new ProtoItem:add_expert_info() call * lua_proto.c * protect call_dissector() and dissector_try_*() calls with TRY CATCH to avoid the Lua state getting corrupted * ValueString makes no sense, get rid of it we'll use Lua's associative arrays instead * lua_tvb.c * while creating a tvb from a ByteArray copy the ByteArray's data and set the tvb's free_cb * check bounds before calling tvb_*() to avoid a longjmp breaking Lua * do not leak the string in Tvb_tostring() * new Tvb:get_ipv4() call * new Tvb:get_eth() call * packet-lua.[ch] * export lua_tvb and lua_malformed to other modules being the current tvb and the protocol_id of malformed * convert some Lua to C * do not register ValueString (eliminated) svn path=/trunk/; revision=17106
2006-01-25One step at a timeLuis Ontanon1-0/+6
several fixes and additions svn path=/trunk/; revision=17103
2006-01-25Avoid crashing when given an object of the wrong usertypeLuis Ontanon1-1/+52
format_time() format_date() report_failure() svn path=/trunk/; revision=17097
2006-01-24an Address class, changed the names of some classes, modified pinfo to be a ↵Luis Ontanon1-27/+12
table pinfo.src = Address.ip("www.xxx.com") pinfo.col.info = "A special packet" if (pinfo.src_port == 2) then pinfo.col.protocol = "STRANGE" end svn path=/trunk/; revision=17096
2006-01-23Add lua-5.0.2Luis Ontanon1-2566/+18
Split packet-lua.c Changes aren't tested. It should compile ok. Makefile.nmake still missing. svn path=/trunk/; revision=17086
2006-01-21Another iteration, new things aren't tested yet.Luis Ontanon1-233/+1000
Update README, to have a description of the classes svn path=/trunk/; revision=17067
2006-01-20Add the commit message as READMEJörg Mayer1-1/+1
svn propset svn:keywords Id * svn propset svn:eol-style native * Todo: svn propset svn:ignore . Because I don't know what to ignore svn path=/trunk/; revision=17059
2006-01-20Starts to work so I check it in.Luis Ontanon1-0/+1977
This is an interface to the Lua programming language. http://www.lua.org I've already wrote a simple dissector that calls another dissectors. soon It will be able to register a tap and do something more. I did not checkin changes to the Makefiles so in order to use it you must change the makefiles. Other than that to get it to work you need to download lua-5.0.2.tar.gz into the plugin directory, uncompress it, cd to it and call make. the interface is buggy and far from finished, time will help on this. svn path=/trunk/; revision=17057