Commit Graph

85 Commits

Author SHA1 Message Date
Michael Mann 71c02b20eb Create FT_FCWWN field type.
Also, convert the "string" hf_ entries that used tvb_fcwwn_to_str as a string to use proto_tree_add_item with FT_FCWWN type.

Change-Id: I4ca77870499fd8239584a70874998b5d194a7167
Reviewed-on: https://code.wireshark.org/review/6036
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-28 20:05:29 +00:00
Guy Harris cb16dff992 Get rid of more tvb_get_nstringz* calls.
Add an FT_STRINGZPAD type, for null-padded strings (typically
fixed-length fields, where the string can be up to the length of the
field, and is null-padded if it's shorter than that), and use it.  Use
IS_FT_STRING() in more cases, so that less code needs to know what types
are string types.

Add a tvb_get_stringzpad() routine, which gets null-padded strings.
Currently, it does the same thing that tvb_get_string_enc() does, but
that might change if we don't store string values as null-terminated
strings.

Change-Id: I46f56e130de8f419a19b56ded914e24cc7518a66
Reviewed-on: https://code.wireshark.org/review/1082
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-04-12 22:27:22 +00:00
Guy Harris 2b5fc4efdc The encoding of a string is *not* part of its type.
So get rid of the commented-out FT_UCS2_LE; that would be handled as an
FT_STRING, FT_UINT_STRING, or FT_STRINGZ with an encoding of
ENC_UCS_2|ENC_LITTLE_ENDIAN.

Change-Id: I828fc1ed49843a503ec70e6adaf6dadd256df407
Reviewed-on: https://code.wireshark.org/review/996
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-04-07 23:14:29 +00:00
Alexis La Goutte 296591399f Remove all $Id$ from top of file
(Using sed : sed -i '/^ \* \$Id\$/,+1 d')

Fix manually some typo (in export_object_dicom.c and crc16-plain.c)

Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8
Reviewed-on: https://code.wireshark.org/review/497
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-04 14:27:33 +00:00
Hadriel Kaplan 7f074364b6 Fix bug 9790: Lua: wslua allows duplicate field registration
As discussed in bug 3513 and 9709, one can register more than one new ProtoFields for
the same field name. Of course C-code can do that too, and does a LOT apparently, but
if they're not similar ftypes then things can get scrweed up in display filters.

So this change prevents duplicate field registration of dissimilar ftypes. The
similarity is based on the discussion on the mailing list, and the listing in
README.developer has been updated to refelect that as well.

Also, this change adds a testscript for Proto/ProtoFields.

Change-Id: I43bd323f785245941a21289647332a19adec2a9d
Reviewed-on: https://code.wireshark.org/review/285
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-02-21 20:57:43 +00:00
Guy Harris 61867d0b2f Eliminate fvalue_set() in favor of routines that take arguments
appropriate for particular FT_ types.  This lets us do some more type
checking and lets us use const pointers when appropriate.

Constify a bunch of stuff, and don't cast away constness.

svn path=/trunk/; revision=54811
2014-01-15 01:05:03 +00:00
Michael Mann 7ec4582b4f Add FT_SYSTEM_ID type and convert the dissectors that use print_system_id with FT_BYTES to now use FT_SYSTEM_ID type.
svn path=/trunk/; revision=54383
2013-12-23 15:18:48 +00:00
Guy Harris 409dd075c6 Replace fvalue_ftype() with a fvalue_type_ftenum() routine that returns
the ftenum_t for the fvalue's ftype, rather than a pointer to the ftype
(which isn't all that useful except as a handle, unless you import the
internal header).

Have fvalue_to_string_repr() return NULL, rather than failing, if the
fvalue's ftype has no val_to_string_repr method.

This lets us not include the ftypes internal header in
ui/cli/tap-diameter-avp.c.

svn path=/trunk/; revision=53290
2013-11-12 22:06:00 +00:00
Jakub Zawadzki 12d1509aa1 Move struct _ftype_t + callback typedefs + free macro to ftypes-int.h
svn path=/trunk/; revision=53223
2013-11-10 13:14:09 +00:00
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
Jörg Mayer 1e762e315d Remove epan.h from ftypes.h, address.h and tpg.h,
add it to proto.h as it contains macros that require emem.h

svn path=/trunk/; revision=52001
2013-09-13 09:13:09 +00:00
Michael Mann a87f47c02c Make many items filterable for Vines dissectors.
Add support for FT_VINES type.

svn path=/trunk/; revision=50962
2013-07-28 00:07:49 +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
Evan Huus 122b7cb6df Remove the emem slab feature (sl_* functions) completely, replacing it with
glib memory slices.

- We weren't doing anything with the emem slab that couldn't be done with glib
  slices.
- Removes a fair bit of code as well as one debugging environment variable.
- Glib slices are much cache-friendlier and are multi-threading friendly (if
  we ever go there).
- Allows glib to actually return slices to the OS on occasion. The emem slab
  would hold onto its memory forever which resulted in a great deal of wasted
  memory after closing a large file.

svn path=/trunk/; revision=48218
2013-03-09 20:02:19 +00:00
Anders Broman 7ad305365f type drange -> drange_t
explicit casts.

svn path=/trunk/; revision=48083
2013-03-05 06:16:45 +00:00
Balint Reczey 1ebdb2e521 Export libwireshark symbols using WS_DLL_PUBLIC define
Also remove old WS_VAR_IMPORT define and related Makefile magic
everywhere in the project.

svn path=/trunk/; revision=47992
2013-03-01 23:53:11 +00:00
Evan Huus 21b5dc0107 Make the buffer argument to FvalueToStringRepr functions volatile
and use that to fix a -Wclobbered error that bleeding-edge GCC throws
on tvbuff types.

Also remove a variable that looked like it was being used to hide the error
before GCC got clever.

svn path=/trunk/; revision=47153
2013-01-18 19:27:31 +00:00
Jakub Zawadzki 8909d38842 When comparing fvalue_t we don't modify them, make arguments const.
svn path=/trunk/; revision=45948
2012-11-06 13:28:59 +00:00
Gerald Combs 44cb77d8de Handle double-clicks in the tree.
svn path=/trunk/; revision=44592
2012-08-19 23:52:08 +00:00
Guy Harris 835111692f From Richard Stearn: support for AX.25, including support for
LINKTYPE_AX25.

svn path=/trunk/; revision=44211
2012-08-02 16:54:43 +00:00
Jakub Zawadzki bf81b42e1e Update Free Software Foundation address.
(COPYING will be updated in next commit)

svn path=/trunk/; revision=43536
2012-06-28 22:56:06 +00:00
Anders Broman d785c79f88 From Jakub Zawadzki :
Add support for prefix in IPv6 address filter.
 
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5538

svn path=/trunk/; revision=38916
2011-09-07 11:03:47 +00:00
Stig Bjørlykke 5603cef9f2 Remove support for libpcre, we use GRegex in GLib.
svn path=/trunk/; revision=38683
2011-08-23 09:25:06 +00:00
Gerald Combs 49b92440de More GLIB_CHECK_VERSION cleanups. Update the minimum GLib/GTK+ versions
in README.devloper. Remove g_gnuc.h since it's no longer needed. Remove
tvbuff_init(), tvbuff_cleanup(), reassemble_init(), and
reassemble_cleanup() since they were only used for older GLib versions
which didn't support GSlices. Assume we always support the "matches"
operator.

svn path=/trunk/; revision=37978
2011-07-11 20:32:19 +00:00
Guy Harris 053c583fda Add some additional routine variants that handle string encodings, and
make FT_STRING and FT_UINT_STRING handle string encodings.

Get rid of FT_EBCDIC in favor of FT_STRING with ENC_EBCDIC.

Add some URLs for DRDA.

Clean up some stuff in TN3270 and TN5250, including using ENC_ values
for proto_tree_add_item().

svn path=/trunk/; revision=37909
2011-07-05 23:59:23 +00:00
Jakub Zawadzki 17f6352c2e Convert SLAB_-s, to sl_-API.
svn path=/trunk/; revision=37030
2011-05-09 12:52:55 +00:00
Alexis La Goutte 7d317e553b Add FT_EUI64 Field Type
* Remove proto_tree_add_eui64 function from 802.15.4 Dissector 
* Replace print_eui64/print_eui64 by eui64_to_str/get_eui64_name
* Update Documentation (README.dev)
* Add new function in libwireshark.def
* Support of encoding for tvb_eui64_to_str
* Use FT_EUI64 for ICMPv6, CAPWAP, Zbee ... dissector

svn path=/trunk/; revision=37015
2011-05-08 10:23:53 +00:00
Bill Meier 7130d39b06 (Trivial) Fix a typo & some indentation
svn path=/trunk/; revision=32724
2010-05-08 16:12:29 +00:00
Gerald Combs 7c0dc5d7e7 If we don't have PCRE and we do have GLib >= 2.14, use GRegexes for the
"matches" operator.

svn path=/trunk/; revision=31302
2009-12-18 01:15:08 +00:00
Kovarththanan Rajaratnam 56b8d36e03 Introduce a few FT_XXX lengths defines and use those instead of hard coding constants
svn path=/trunk/; revision=29846
2009-09-10 18:22:33 +00:00
Kovarththanan Rajaratnam 48069c2b01 Use the correct type, that is GByteArray instead of GString. The reason why this 'worked' before (on non-64bit platforms that is):
struct _GString
{
  gchar  *str;
  gsize len;    
  gsize allocated_len;
};

And:

struct _GArray
{
  gchar *data;
  guint len;
};

We only accessed the first two fields of the GString struct.

svn path=/trunk/; revision=29841
2009-09-10 14:37:09 +00:00
Kovarththanan Rajaratnam aaa6d87cf0 Remove unused field
svn path=/trunk/; revision=29840
2009-09-10 13:52:36 +00:00
Balint Reczey 41723a5ef2 Signal error on field values that cannot be safely represented as strings instead of crashing.
This fixes bug 2845.

svn path=/trunk/; revision=26749
2008-11-11 13:32:51 +00:00
Anders Broman 09a741cb17 Add FT_INT64 to IS_FT_INT and FT_UINT_64 to IS_FT_UINT.
svn path=/trunk/; revision=25623
2008-06-28 17:23:07 +00:00
Stephen Fisher 849e628334 Introduce a new field type called FT_EBCDIC. This field works the same as
FT_STRING, except that it converts the data from the packet from EBCDIC
to ASCII for display in Wireshark.


svn path=/trunk/; revision=23503
2007-11-19 21:27:01 +00:00
Martin Mathieson 997e5415f9 Add separate union entries to fvalue.value for signed and unsigned
32-bit numbers.  Separate signed and unsigned accessors have been
added and used where appropriate.

Definitely not for 0.99.5.

svn path=/trunk/; revision=20472
2007-01-18 11:02:26 +00:00
Ronnie Sahlberg 8fc740a53e hmm
best to revert this for a while.



revert all changes from previous patch.



svn path=/trunk/; revision=20195
2006-12-22 09:01:12 +00:00
Ronnie Sahlberg 8433f6d589 change some slab allocated memory into ep/emem allocated structures instead.
this primarily removes code and simplifies (==eliminates) the need to track the data that is allocated and should potentially be slightly faster than a slab allocator.
however these functions are called A LOT so there might be a performance hit when using emem with full debugging canary values and all the bells and whistles activated.


this change also makes any future attempt to parallellize dissection of frames easier if we just make the ep allocator allocate from a threads specific ep pool.
(something we would have to do anyway to make ep allocations multithreaded)



this works in all my tests so far but needs more test coverage.



svn path=/trunk/; revision=20194
2006-12-22 08:35:43 +00:00
Gerald Combs f7e38bd5e6 Change ETH_VAR_IMPORT to WS_VAR_IMPORT. Try to fix a duplicate variable
definition in the Catapult DCT2000 code.

svn path=/trunk/; revision=18524
2006-06-20 18:30:54 +00:00
Gerald Combs b15974d094 libethereal -> libwireshark. idl2eth -> idl2wrs. There are a _lot_ of
changes here.  It compiles OK on OS X, but hasn't been tested anywhere else.

svn path=/trunk/; revision=18260
2006-05-31 00:23:01 +00:00
Ronnie Sahlberg 89f022b12b name change
svn path=/trunk/; revision=18197
2006-05-21 05:12:17 +00:00
Gilbert Ramirez e3899ed4a4 Add infrastructure for display filter functions.
Add upper() and lower() display filter functions for string fields.

svn path=/trunk/; revision=18071
2006-05-02 14:26:17 +00:00
Tomas Kukosa 923855bb20 new FT_GUID handling - big/little endian supported
svn path=/trunk/; revision=17566
2006-03-10 11:58:22 +00:00
Tomas Kukosa dcae7d303f new field type FT_OID for OBJECT IDENTIFIERs
svn path=/trunk/; revision=16652
2005-12-02 13:16:58 +00:00
Jörg Mayer 23486b484e Fix lots of warnings of type:
ftypes.c:257: warning: passing argument 1 of 'logfunc' discards
                        qualifiers from pointer target type
by changing 'char*' -> 'const char*'

svn path=/trunk/; revision=15009
2005-07-23 06:19:08 +00:00
Tomas Kukosa bab34b522b new field type FT_GUID
svn path=/trunk/; revision=14845
2005-07-04 13:04:53 +00:00
Lars Roland ea67e4cfab Add functions to the old and the new plugin api for the MATE Plugin.
svn path=/trunk/; revision=12715
2004-12-11 00:13:27 +00:00
Jörg Mayer 54e0e363a9 Get rid of warnings about shadowed variables (code was ok)
svn path=/trunk/; revision=12171
2004-10-01 12:31:52 +00:00
Guy Harris c68f62210f Add "tvb_get_ntoh64()" and "tvb_get_letoh64()" routines to fetch 64-bit
integers.

Make FT_INT64 and FT_UINT64 add numerical values, rather than byte-array
values, to the protocol tree, and add routines to add specified 64-bit
integer values to the protocol tree.

Use those routines in the RSVP dissector.

svn path=/trunk/; revision=11796
2004-08-22 00:31:58 +00:00
Guy Harris 8a8b883450 Set the svn:eol-style property on all text files to "native", so that
they have LF at the end of the line on UN*X and CR/LF on Windows;
hopefully this means that if a CR/LF version is checked in on Windows,
the CRs will be stripped so that they show up only when checked out on
Windows, not on UN*X.

svn path=/trunk/; revision=11400
2004-07-18 00:24:25 +00:00