Re: [Wireshark-dev] Add-on Lua code for file system operations?

2014-02-08 Thread Tony Trinh
> > *Hadrial Kaplan wrote:* The problem is if you write a plugin for others to use, requiring them to > compile code is a high bar to expect. So if it's more than just another > pure lua lib which doesn't need c-code to be compiled, as a file/dir > accessor would need, it's tough. :( > I agree

Re: [Wireshark-dev] Add-on Lua code for file system operations?

2014-02-08 Thread Tony Trinh
> > *Guy Harris wrote:* > ... > Should we either bundle the LuaFileSystem stuff, at least on platforms > where we bundle Lua with Wireshark rather than relying on the OS to have it > as a package (I guess the packager could make the appropriate Wireshark > package depend on the LuaFileSystem packag

Re: [Wireshark-dev] accessing multiple occurrences of the same field with lua

2013-03-06 Thread Tony Trinh
On Wed, Mar 6, 2013 at 7:02 AM, Cristian Constantin < const.cr...@googlemail.com> wrote: > hi! > > some protocols are structured in chunks which have the same structure > but differ in content. > > examples: > > - diameter (avps) > - sigtran suite (parameters) > - sctp (data chunks) > > how to acc

Re: [Wireshark-dev] Lua converting a UINT64 to hex

2012-11-19 Thread Tony Trinh
On Mon, Nov 19, 2012 at 7:46 PM, Tony Trinh wrote: > On Mon, Nov 19, 2012 at 7:42 PM, Tony Trinh wrote: > >> In your code, the variable "data" is actually a list of instances of the >> field in the packet (each represented by a FieldInfo object). To get the >>

Re: [Wireshark-dev] Lua converting a UINT64 to hex

2012-11-19 Thread Tony Trinh
On Mon, Nov 19, 2012 at 7:42 PM, Tony Trinh wrote: > In your code, the variable "data" is actually a list of instances of the > field in the packet (each represented by a FieldInfo object). To get the > values, you'll need to iterate the list: > > for _,fieldinfo i

Re: [Wireshark-dev] Lua converting a UINT64 to hex

2012-11-19 Thread Tony Trinh
On Mon, Nov 19, 2012 at 10:07 AM, Zadik, Maayan wrote: > Hi all, > I'm trying to create a validation script on my protocol dissector. > My dissector is written in C and the validation script is obviously in Lua. > > I have this field that is 64bits long. I'm trying to read it in my Lua script > lo

Re: [Wireshark-dev] FeatureReq: GoToFrame Lua API call

2012-10-26 Thread Tony Trinh
On Wed, Oct 24, 2012 at 4:51 AM, Márton Cserbák wrote: > Hi All, > > I got to writing to you following the instructions on > http://wiki.wireshark.org/WishList. > > Currently I am developing a VoIP media plane analyzer tool in Lua for > Wireshark, and it would be nice, if it would be possible to

Re: [Wireshark-dev] GUI functionality from plugins

2012-09-19 Thread Tony Trinh
On Wed, Sep 19, 2012 at 2:22 PM, David Ameiss wrote: > For us, the critical item is cfile, to allow re-tapping captures. That sounds like the job of retap_packets [1]. Does that not work for you? [1] http://anonsvn.wireshark.org/viewvc/trunk/epan/funnel.h?revision=45009&view=markup#l77

Re: [Wireshark-dev] DND crash through all versions?

2012-09-03 Thread Tony Trinh
On Mon, Sep 3, 2012 at 5:50 PM, Jaap Keuter wrote: > Anyone knows what strstr() does with a NULL for a haystack? As far as I > can tell it's unspecified. I think you're right. "Undefined/unspecified behavior" usually means a segfault from my experience. This is true for strstr() in OSX ML. str

Re: [Wireshark-dev] Lua linkage with CMake

2012-08-24 Thread Tony Trinh
It's possible that ${wireshark-src}/cmake/modules/FindLUA.cmake is not properly detecting Lua 5.2 on your system. Check the path defined by LUA_LIBRARY (and check LUA_INCLUDE_DIR while you're at it), using these commands: $ cd ${wireshark-src} $ cmake -LA | grep LUA The output should look s

Re: [Wireshark-dev] Missing link

2012-07-14 Thread Tony Trinh
The link should be: http://www.wireshark.org/docs/wsdg_html_chunked/ChSrcContribute.html#ChSrcSend On Sat, Jul 14, 2012 at 3:47 AM, Helge Kruse wrote: > Hello, > > on the page > http://www.wireshark.org/**develop.htmlis > a link to the "Developer's Guid

Re: [Wireshark-dev] Infrastructure for plugins (including Lua-based ones) to add their own menus

2012-07-12 Thread Tony Trinh
On Thu, Jul 12, 2012 at 9:36 AM, Richard Sharpe wrote: > >> > >> 2. A single menu for plugins, with each plugin getting its own section. > >> > > > > Hmm. I don't understand the advantage of this approach over the current > > solution. Can you clarify with an example? > > My thought here is that

Re: [Wireshark-dev] Infrastructure for plugins (including Lua-based ones) to add their own menus

2012-07-12 Thread Tony Trinh
On Tue, Jul 10, 2012 at 10:06 AM, Richard Sharpe < realrichardsha...@gmail.com> wrote: > Hi folks, > > In a previous email I raised the issue of givin Lua plugins the > ability to declare their own menus, not just menu items on existing > menus. Indeed, I would like to go further and to expose fac

Re: [Wireshark-dev] Adding a new menu in the MenuBar

2012-07-08 Thread Tony Trinh
On Mon, Jul 9, 2012 at 1:01 AM, Richard Sharpe wrote: > Hi folks, > > I would like to add a new menu in the Menubar, like "Menubar/Blah" and > place it before help, and after the tools menu (and probably before > Internals). > > I would like to do it from Lua. > > I think I can see how to do this,

Re: [Wireshark-dev] My LUA menu items turn up in the wrong place

2012-07-08 Thread Tony Trinh
The Analysis menu is the default destination when the passed-in menu index is nil (i.e., MENU_TOOLS_UNSORTED, in your case, evaluates to nil). The menu IDs (along with other useful variables) are defined in init.lua, so it's likely that init.lua wasn't loaded (because Wireshark couldn't find it in

Re: [Wireshark-dev] Can I hook menu/GUI functions with LUA?

2012-07-08 Thread Tony Trinh
On Sun, Jul 8, 2012 at 2:36 AM, Richard Sharpe wrote: > Well, Tony, I want to invoke the function bound to existing buttons > and menu items in the GUI but also to hook them so I can add > functionality. > > I want to receive control in my extension functions when certain > buttons or menu items a

Re: [Wireshark-dev] Can I hook menu/GUI functions with LUA?

2012-07-07 Thread Tony Trinh
Actually, my answer assumes you were asking if you can use WSLua to invoke an existing menu (e.g., open the dialog from "Statistics > Conversations"). Is this assumption correct? What exactly are you trying to accomplish? On Sun, Jul 8, 2012 at 2:22 AM, Tony Trinh wrote: > No,

Re: [Wireshark-dev] Can I hook menu/GUI functions with LUA?

2012-07-07 Thread Tony Trinh
No, WSLua API won't help you there. It might be possible to use a 3rd-party Lua library via WSLua to do something gross like send menu-navigating key-presses (or window messages) to the Wireshark window, but it's probably easier to implement a WSLua binding for this (file an enhancement request at

Re: [Wireshark-dev] Plugins, stat menus, and 1.8.0

2012-06-28 Thread Tony Trinh
On Thu, Jun 28, 2012 at 5:57 PM, Jeff Morriss wrote: > I had to change a bunch of stuff: > > http://anonsvn.wireshark.org/**viewvc/viewvc.cgi?view=rev&**revision=41591 > > to get the Lua scripts stuff working again (and I thou

Re: [Wireshark-dev] Lua: condition on protocol preference

2012-06-05 Thread Tony Trinh
On Tue, Jun 5, 2012 at 3:19 PM, Joerg Mayer wrote: > Just to make sure I understand you correctly: You have a Wireshark > dissector > that uses the normal Wireshark preferences infrastructure and you have a > Lua > program that needs to know about these preferences. > If that is correct, then you

Re: [Wireshark-dev] LUA plugin search path

2012-04-18 Thread Tony Trinh
Wireshark Lua initialization searches all directories recursively in its search path for *.lua files. If your client puts his network drive in this search path, then it seems logical that Wireshark *should* look there. Perhaps there should be a preference option to disable this (to prevent unintent

Re: [Wireshark-dev] Top 3 patches to review ;)

2012-02-06 Thread Tony Trinh
My opinion for 5575 is "not [yet]" (clarification and cleanup needed, especially for patch 7448 ). On Sun, Feb 5, 2012 at 10:34 AM, Anders Broman wrote: > Hi, > I'd like to hear t

Re: [Wireshark-dev] [Wireshark-commits] rev 40644: /trunk/epan/dissectors/ /trunk/epan/dissectors/: packet-pgm.c

2012-01-23 Thread Tony Trinh
On Mon, Jan 23, 2012 at 4:56 PM, Maynard, Chris < christopher.mayn...@gtech.com> wrote: > > > From: wireshark-dev-boun...@wireshark.org [mailto: > wireshark-dev-boun...@wireshark.org] On Behalf Of Tony Trinh > > Sent: Monday, January 23, 2012 4:46 PM > > To: Develo

Re: [Wireshark-dev] [Wireshark-commits] rev 40644: /trunk/epan/dissectors/ /trunk/epan/dissectors/: packet-pgm.c

2012-01-23 Thread Tony Trinh
On Mon, Jan 23, 2012 at 4:12 PM, Maynard, Chris < christopher.mayn...@gtech.com> wrote: > > I guess I can use notepad++ from now on for this type of editing, but if > you've got any ideas as to how to get it work under cygwin, that would be > appreciated. > Thanks. > - Chris > > I think I know wha

Re: [Wireshark-dev] [Wireshark-commits] rev 40644: /trunk/epan/dissectors/ /trunk/epan/dissectors/: packet-pgm.c

2012-01-23 Thread Tony Trinh
On Mon, Jan 23, 2012 at 3:08 PM, Maynard, Chris < christopher.mayn...@gtech.com> wrote: > > Now it displays as follows for me: > ? > > In Windows 7, I can copy paste *Роман Донченко* into plain-old Notepad, and it shows correctly to my surprise. Interestingly, if I copy that

Re: [Wireshark-dev] Registering a bug with Wireshark

2012-01-16 Thread Tony Trinh
Create an account by following the directions at https://bugs.wireshark.org/bugzilla/createaccount.cgi. On Mon, Jan 16, 2012 at 8:07 AM, Nitin Kalra wrote: > Hi Wireshark, > > I have found an issue with a packet which I am capturing through > Wireshark, for this I’m trying to register a bug.

Re: [Wireshark-dev] running a lua function via tshark

2012-01-15 Thread Tony Trinh
On Sun, Jan 15, 2012 at 11:04 AM, Maayan Zadik < maay...@designartnetworks.com> wrote: > I have a lua script range_check.lua > > It has a function range_check(), which checks the ranges of the fields of > each packet in a pcap file, and it is registered to the menu > “MENU_TOOLS_UNSORTED” > >

Re: [Wireshark-dev] Getting a pcap filename from a Lua script

2012-01-15 Thread Tony Trinh
On Sun, Jan 15, 2012 at 6:34 AM, Maayan Zadik wrote: > ** > > Is there a way to retrieve the capture file name from inside the Lua > script, that way I can name the log: “_log”? > > > Someone asked about this a few months a

Re: [Wireshark-dev] Looking for a Wireshark Plugin Tool Developer?

2011-11-11 Thread Tony Trinh
Hi Jason, I'm interested. Can you provide more details about the requirements? Can it be a Lua-based dissector? Or must it be C? Thanks, Tony On Thu, Nov 10, 2011 at 12:07 PM, Jason Saham wrote: > I am looking for a consultant that can help us develop some Wireshark > plugins that can read ou

Re: [Wireshark-dev] Ordinary LUA dissector.

2011-11-03 Thread Tony Trinh
On Fri, Nov 4, 2011 at 12:16 AM, Robert G. Jakabosky wrote: > Here is a Lua dissector that I wrote, it could be used as another example. > http://opensimulator.org/wiki/LLUDP_Dissector > > It is released under the BSD license. > I think that violates the GPL, according to http://wiki.wireshark.or

Re: [Wireshark-dev] [Wireshark-commits] rev 39422: /trunk/gtk/ /trunk/gtk/: main_menubar.c

2011-10-14 Thread Tony Trinh
On Fri, Oct 14, 2011 at 3:50 PM, Guy Harris wrote: > > On Oct 14, 2011, at 8:37 AM, Tony Trinh wrote: > > > Actually, the valid #define for Lua code throughout Wireshark is > HAVE_LUA_5_1 (not HAVE_LUA). HAVE_LUA works in Windows but not other OS's > (such as OSX). &

Re: [Wireshark-dev] [Wireshark-commits] rev 39422: /trunk/gtk/ /trunk/gtk/: main_menubar.c

2011-10-14 Thread Tony Trinh
Hi Martin/Anders, Actually, the valid #define for Lua code throughout Wireshark is HAVE_LUA_5_1 (not HAVE_LUA). HAVE_LUA works in Windows but not other OS's (such as OSX). But I do like HAVE_LUA better than a version-specific name because I imagine these names will have to be updated upon switchin

Re: [Wireshark-dev] Complete the switch to UIManager driven menubar?

2011-10-13 Thread Tony Trinh
I've fixed the support for Lua menus, as described in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6405. Please review. Thanks, Tony On Tue, Aug 23, 2011 at 3:03 PM, Anders Broman wrote: > Stephen Fisher skrev 2011-08-23 19:58: > >> On Tue, Aug 23, 2011 at 10:19:26AM +0200, Anders Broman

Re: [Wireshark-dev] Replace TRUE/FALSE with proper ENC_* in proto_tree_add_item() using a script.

2011-10-04 Thread Tony Trinh
> > One thing I don't quite understand: In a number of the dissectors why do > proto_tree_add_item() encoding parameters for hf items with type FT_STRING > have ENC_ASCII *and* ENC_LITTLE_ENDIAN|ENC_BIG_**ENDIAN ? > Shouldn't this be ENC_ASCII | ENC_NA in this case ? The comment for ENC_NA: /*

Re: [Wireshark-dev] wspython building and running

2011-09-29 Thread Tony Trinh
1. Probably. I'd also try http://ask.wireshark.org and http://stackoverflow.com. 2. I believe it's maintained in the sense that reported bugs about wspython are tracked (and fixed). Not many people ask about wspython (perhaps because there aren't many users due to lack of documentation). Have you

Re: [Wireshark-dev] can I generate windows-used plugin on Linux?

2011-08-23 Thread Tony Trinh
It should be possible to cross-compile a DLL from a Linux box, based on: http://ricardo.ecn.wfu.edu/~cottrell/cross-gtk/ 2011/8/23 John x > Hi, folks, > > I developed wireshark plugin for Linux (which is .so). I am wondering > whether I can generate plugin for windows(which is .dll) from Linux

[Wireshark-dev] bugzilla OS list

2011-08-21 Thread Tony Trinh
Can someone please add "Mac OS X 10.7" to the OS list in Bugzilla? Thanks. ___ Sent via:Wireshark-dev mailing list Archives:http://www.wireshark.org/lists/wireshark-dev Unsubscribe: https://wireshark.org/mailman/optio

Re: [Wireshark-dev] [Wireshark-commits] rev 38304: /trunk/epan/dissectors/ /trunk/epan/dissectors/: packet-snmp.c

2011-08-04 Thread Tony Trinh
Isn't Python also necessary for the Wireshark Python API? (It's disabled by default, unlike the Lua API.) ___ Sent via:Wireshark-dev mailing list Archives:http://www.wireshark.org/lists/wireshark-dev Unsubscribe: https

Re: [Wireshark-dev] thsark crashes with lua script

2011-07-23 Thread Tony Trinh
The problem is with LuaSocket or with the way you're using it. The backtrace shows that the segfault is occurring in LuaSocket (in core.so). Look at your references to socket.core and at LuaSocket's core.c code. If that fails you, ask stackoverflow.com.

[Wireshark-dev] CMake weirdness

2011-07-16 Thread Tony Trinh
For dev builds, I typically use a local output directory for install by specifying `--prefix=$PWD/build` or setting the equivalent CMake config. The strange this is the CMake binaries can't find the libraries at startup: $ ./wireshark dyld: Library not loaded: libwireshark.dylib Referenced from:

Re: [Wireshark-dev] Procedure to compile wireshark dissector on linux

2011-07-11 Thread Tony Trinh
I like the CMake build better (easier to use and 'pretty') except for the verbose output, which is masochistically enabled by default. There's a commentthat suggests the verboseness was meant to be temporary:

Re: [Wireshark-dev] Unable to reach www.wireshark.org

2011-07-06 Thread Tony Trinh
That's an interesting theory. My browser (Firefox) indeed has IPv6 enabled by default while my network is IPv4 only. If that's really the problem, why doesn't the awful delay *always* occur for any site I go to? ___ Sent via:

Re: [Wireshark-dev] Unable to reach www.wireshark.org

2011-07-06 Thread Tony Trinh
I also occasionally get connection problems to ask.wireshark.org (and I recall it happening before the 30th). Sometimes, the connection is painfully slow, where I'm waiting more than a minute for the main page to even open. I don't think this intermittent lag is related to my connection because I'v

Re: [Wireshark-dev] How to build on MACOS

2011-06-19 Thread Tony Trinh
XCode 3.x is free while 4 is not. You need to register with Apple to download 3.x. See the link below for more info. http://guide.macports.org/chunked/installing.xcode.html I'm also a big fan of MacPorts (which is more current than Fink). __

Re: [Wireshark-dev] Wireshark lua (wslua) and bit fields - how to do it?

2010-10-28 Thread Tony Trinh
That's interesting. I've verified in Wireshark 1.4.0 that the Boolean proto field can be masked (yields "True" only if the masked value is nonzero; "False" otherwise). If you can't get that type to work, make it an integer instead and use value-string maps as shown in the example Lua below: -- va

Re: [Wireshark-dev] Wireshark lua (wslua) and bit fields - how to do it?

2010-10-25 Thread Tony Trinh
No problem. I think I can better help you if you outlined the spec for the 64-bit field and told me what exactly you wanted to do with it, but I'll try to help based on what you've told me so far... Currently, masking a uint64 does not work (at least I couldn't do it on my machine). You can only

Re: [Wireshark-dev] Wireshark lua (wslua) and bit fields - how to do it?

2010-10-23 Thread Tony Trinh
The shred_rd field should be defined with a mask, so that it's automatically masked and shifted. I'm assuming it's a bit that represents "read only". The Lua below lets you filter with "shred.rd == true": -- read-only at bit 1 fields.shred_rd = ProtoField.bool("shred.rd", "Read only", base.DEC, n