Commit Graph

378 Commits

Author SHA1 Message Date
Michael Mann ee208c8dcc Add support for RELATIVE-OID ASN.1 type. Bug 9192 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9192)
From Ed Beroset.

svn path=/trunk/; revision=52393
2013-10-06 02:31:10 +00:00
Michael Mann 12dd69e0b6 Remove check_col.
svn path=/trunk/; revision=52316
2013-10-01 15:14:59 +00:00
Pascal Quantin 102c452bcb More emem -> wmem conversion:
- tvb_get_g_stringz()/tvb_get_ephemeral_stringz()/tvb_get_seasonal_stringz() -> tvb_get_stringz()
- tvb_get_g_stringz_enc()/tvb_get_ephemeral_stringz_enc() -> tvb_get_stringz_enc()
- tvb_get_ephemeral_unicode_stringz() -> tvb_get_unicode_stringz()
- tvb_bcd_dig_to_ep_str() -> tvb_bcd_dig_to_wmem_packet_str()
- update docs accordingly

svn path=/trunk/; revision=52180
2013-09-22 20:04:35 +00:00
Pascal Quantin a0c53ffaa1 emem -> wmem conversion:
- ep_tvb_get_bits() -> wmem_packet_tvb_get_bits()
- tvb_g_memdup()/ep_tvb_memdup() -> tvb_memdup()
- tvb_fake_unicode()/tvb_get_ephemeral_faked_unicode() -> tvb_get_faked_unicode()
- tvb_get_g_string()/tvb_get_ephemeral_string()/tvb_get_seasonal_string() -> tvb_get_string()
- tvb_get_g_unicode_string()/tvb_get_ephemeral_unicode_string() -> tvb_get_unicode_string()
- tvb_get_ephemeral_string_enc() -> tvb_get_string_enc()
- update docs accordingly

svn path=/trunk/; revision=52172
2013-09-22 15:50:55 +00:00
Evan Huus 6df83e8078 Add _g_ to the names of functions that allocate glib memory. This is a bit more
explicit, and frees up the "generic" names (like tvb_memdup) for new signatures
that take the appropriate wmem pool.

Majority of the conversion done with sed.

svn path=/trunk/; revision=52164
2013-09-21 17:04:41 +00:00
Jörg Mayer f348cd5678 Explicit inclusion of emem.h
svn path=/trunk/; revision=52000
2013-09-13 08:49:38 +00:00
Stig Bjørlykke c0d7a95f4e From Robert G. Jakabosky via bug 5575:
Fix module registration.  Must use lua_call() when calling luaopen_*()

svn path=/trunk/; revision=51965
2013-09-12 11:34:13 +00:00
Stig Bjørlykke db96634f08 Enable Lua ldap, smb and smb2 taps
svn path=/trunk/; revision=51928
2013-09-10 11:18:41 +00:00
Stig Bjørlykke 152a9c5982 Added TreeItem prepend_text().
svn path=/trunk/; revision=51924
2013-09-10 10:35:30 +00:00
Stig Bjørlykke 860856b424 Fixed some NSTime error texts.
svn path=/trunk/; revision=51922
2013-09-10 10:27:47 +00:00
Stig Bjørlykke 8bde188792 Fixed FieldInfo documentation.
svn path=/trunk/; revision=51920
2013-09-10 10:07:40 +00:00
Stig Bjørlykke 408b498a12 Return ByteArray as "value" for FieldInfo's with type FT_NONE (which has data).
This fixes bug 5201.

svn path=/trunk/; revision=51903
2013-09-09 21:42:49 +00:00
Stig Bjørlykke f8624cef20 Initialize all tvb values in FieldInfo_get_range.
This fixes bug 5200.

svn path=/trunk/; revision=51899
2013-09-09 21:20:26 +00:00
Stig Bjørlykke f74bd06ecf Removed return value from ByteArray append and prepend, as this did push
the same ByteArray twice (and thus calling the GC twice).
This should fix bug 4461.

Changed ByteArray concat to create a new array to be returned.

svn path=/trunk/; revision=51872
2013-09-09 17:49:22 +00:00
Stig Bjørlykke 9c3487a569 Added DissectorTable_set and DissectorTable_remove_all to simplify changing
registered port numbers in PROTO.prefs_changed.

Now we only need this code in Lua plugins having port numbers prefs:

PROTO.prefs.ports = Pref.range ("Ports", 0, "Port numbers", 65535)

PROTO.prefs_changed()
  local udp_table = DissectorTable.get ("udp.port")
  udp_table:set (PROTO.prefs.ports, PROTO)
end

svn path=/trunk/; revision=51860
2013-09-09 05:45:24 +00:00
Michael Mann 1b009df749 Couldn't quite figure out how to make the expert items in proto.c and the LUA API filterable (suggestions welcome!), but I wanted to start forcing dissectors to use the filterable expert API (nothing like compile errors to force change!). I created expert_add_info_format_internal (original expert_add_info_format) and used it as a placeholder for proto.c/LUA API until a solution is created. The "new" expert_add_info_format will be the "old" expert_add_info_format_text, and I'll slowly do the search/replace.
For those with dissectors outside the source tree, please see tools/convert_expert_add_info_format.pl for help with the conversion.  Please do not use expert_add_info_format_internal, as it's support time will be very short lived.

svn path=/trunk/; revision=51844
2013-09-08 19:32:10 +00:00
Evan Huus 9507f56495 Fix lua docstring causing the buildbot's documentation step to fail.
svn path=/trunk/; revision=51828
2013-09-07 22:00:02 +00:00
Stig Bjørlykke 6a4364bb40 Added pinfo.can_desegment to lua script.
This fixes bug 5205.

svn path=/trunk/; revision=51824
2013-09-07 18:04:35 +00:00
Stig Bjørlykke 7d3d67407c Added support for a "prefs_change" function in Lua scripts, which is called
when the preferences for the dissector are changed.

This is not a 100% correct implementation at the time because the
prefs_changed function in all Lua plugins will be called whenever
a preference in a single Lua plugin is changed.

svn path=/trunk/; revision=51818
2013-09-07 11:27:38 +00:00
Stig Bjørlykke a8638eec90 Added support for integer range in DissectorTable_add and DissectorTable_remove.
This was requested in bug 6762.

svn path=/trunk/; revision=51817
2013-09-07 11:07:18 +00:00
Stig Bjørlykke 452bfe4ce0 A small documentation fix for DissectorTable_remove.
svn path=/trunk/; revision=51816
2013-09-07 11:01:52 +00:00
Stig Bjørlykke 6b93b0e1dc Added syntax and range checks for Lua Prefs.range default values.
Fixed some small memory leakages.

svn path=/trunk/; revision=51815
2013-09-07 10:56:52 +00:00
Stig Bjørlykke f9f29d0307 Make the Lua dissector "init" routine work again.
svn path=/trunk/; revision=51805
2013-09-06 22:22:27 +00:00
Stig Bjørlykke 5f35d91ace Added TvbRange strsize().
svn path=/trunk/; revision=51470
2013-08-22 11:58:32 +00:00
Guy Harris 5dcd6daba7 Get rid of -Wshadow warning - I guess we're including something that
gets <getopt.h>, so we get the optarg global.

svn path=/trunk/; revision=51346
2013-08-14 00:35:27 +00:00
Guy Harris 14fe8951b7 Use 4-space indentation consistently.
svn path=/trunk/; revision=51345
2013-08-14 00:33:36 +00:00
Stig Bjørlykke a31a88b142 Show the Lua plugin being loaded in the splash screen.
svn path=/trunk/; revision=51335
2013-08-13 10:38:30 +00:00
Jakub Zawadzki 9cfac1227d Replace hfinfo pointer to same_name_prev, with same_name_prev_id.
svn path=/trunk/; revision=51175
2013-08-06 20:53:47 +00:00
Michael Mann 81f3faf1e8 Completely remove support for proto_item_set_expert_flags.
svn path=/trunk/; revision=51144
2013-08-05 02:25:45 +00:00
Jakub Zawadzki 08eb36b5af Remove fdata->opt_comment, add pkt_comment to pinfo
Original (read from file) comments can be accessed by pkthdr->opt_comment
Keep user comments in seperated BST, add new method for epan session to get it.

svn path=/trunk/; revision=51090
2013-08-01 20:59:38 +00:00
Stig Bjørlykke 0f13e3c95d Add support for 64 bit value string in Lua.
Lua cannot store a 64 bit integer with full precision, which is used
for keys in tables, so this is not a 100% solution.  But it will probably
be good enough for value strings, and it is better to have some support
than no support.

svn path=/trunk/; revision=50988
2013-07-28 20:59:59 +00:00
Jakub Zawadzki c702e92121 Replace relative timestamp with reference frame number. Saves 16B per frame.
svn path=/trunk/; revision=50772
2013-07-21 23:07:33 +00:00
Jakub Zawadzki 5d52e16734 Add helper function to epan_session which can be used to get absolute timestamp of given frame.
Remove ->prev_cap, for testing purpose also replace ->prev_dis with number of previously displayed frame number.

This patch reduce size of frame_data by 8B (amd64)
This is what (I think) was suggested by Guy in comment 13 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5821#c13)

svn path=/trunk/; revision=50765
2013-07-21 20:48:30 +00:00
Jeff Morriss 54bb2e7a5c Move report_err.{h,c} from epan into wsutil: there's nothing epan-specific there and moving it avoids having to recompile the file for use in editcap and capinfos (which don't link against libwireshark).
svn path=/trunk/; revision=50598
2013-07-15 02:48:26 +00:00
Stig Bjørlykke ca9c78088b Document that ProtoField INT64 and UINT64 does not support value string.
svn path=/trunk/; revision=50484
2013-07-10 16:51:54 +00:00
Stig Bjørlykke 5289c9564d Use luaL_optnumber for ProtoField mask, to avoid a signed cast.
This fixes bug 5734.

svn path=/trunk/; revision=50483
2013-07-10 16:33:30 +00:00
Jeff Morriss a441793cba Move a couple of time-related modules into wsutil.
A bunch of files didn't really need to include these header files so remove
the include line rather than changing it.

svn path=/trunk/; revision=50154
2013-06-25 22:02:20 +00:00
Chris Maynard ce088c334d makefile.nmake -> Makefile.nmake and minor whitespace (spaces -> tabs) changes.
svn path=/trunk/; revision=50140
2013-06-25 15:32:49 +00:00
Luis Ontanon 48260bd93b wslua: Adda a wtap_encaps name to replace wtap which is too generic.
svn path=/trunk/; revision=49617
2013-05-29 15:52:25 +00:00
Jeff Morriss dc7772cce2 Fix what looks to be a typo in definition of wtap_encaps.
svn path=/trunk/; revision=49609
2013-05-29 13:03:52 +00:00
Luis Ontanon 5c595ef825 fix for bug 7465
add a wiretap file type table to init.lua


svn path=/trunk/; revision=49608
2013-05-29 06:50:28 +00:00
Jeff Morriss c2ced4a2ab Don't try to open <home>/.wireshark on Windows: Wireshark hasn't written to
that directory since 2001 and reading from that directory was only left in for
backwards compatibility with versions prior to r4702.  I think it's now safe
to remove that backwards compatibility.

This eliminates the last argument of get_persconffile_path().

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8437

svn path=/trunk/; revision=48797
2013-04-09 02:48:03 +00:00
Guy Harris d517ab3698 In the Lua dumper code, don't bother checking whether the encapsulation
is supported before trying to open for writing - the attempt to open for
writing will do the check for you.  Instead, check for specific errors
if the attempt to open for writing fails, and use somewhat more specific
error messages for certain error codes.  (We should perhaps check for
even more error codes in those cases.)

That gets rid of all external calls to wtap_dump_can_write_encap(), so
remove it from wtap.h and make it static.

svn path=/trunk/; revision=48691
2013-04-01 21:39:28 +00:00
Guy Harris 001a6eb165 Squelch some "casting away constness" warnings.
svn path=/trunk/; revision=48542
2013-03-24 23:49:22 +00:00
Evan Huus 6ad3aeb3d9 From Hadriel Kaplan and myself via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8496
Iterate backwards through the linked list of identically-named fields in the lua
bindings since the list is, in fact, created backwards by
proto_register_field_init(). There is some question about whether that is
actually intended, but the rest of the code seems to assume it's normal so we
will too. It was possibly a performance consideration, though that's not
well-documented if so.

Either way, this is the simplest and safest method of fixing the issue with the
lua bindings. See the bug for more analysis.

svn path=/trunk/; revision=48495
2013-03-23 02:53:41 +00:00
Stig Bjørlykke 7d7bf98a8e Added TvbRange uncompress().
svn path=/trunk/; revision=48422
2013-03-19 17:15:27 +00:00
Anders Broman 27744ecc2d From beroset:
remove C++ incompatibilities 
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416

svn path=/trunk/; revision=48337
2013-03-16 08:12:29 +00:00
Stig Bjørlykke 187a884cea Update Lua BitOp to version 1.0.2
svn path=/trunk/; revision=48316
2013-03-15 15:15:00 +00:00
Anders Broman e022d129bd From beroset:
made implicit casts explicit and changed a number of fields and function return values from base_display_e to unsigned because the enum was not a comprehensive list of all possible values

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416

svn path=/trunk/; revision=48289
2013-03-14 06:45:55 +00:00
Jaap Keuter 827eb58b04 From David Arnold:
Replace use of INCLUDES with AM_CPPFLAGS in all Makefiles to placate recent autotools.

svn path=/trunk/; revision=48261
2013-03-12 06:53:39 +00:00