Commit Graph

57 Commits

Author SHA1 Message Date
Michael Mann 553da37446 Create BASE_DOT, BASE_DASH, and BASE_SEMICOLON types for the FT_BYTES field type.
These "bases" will put a ".", "-", or ":" respectively between hexidecimal bytes in the field in packet view and display filter.  FT_BYTES with BASE_NONE will have no separator in the packet view, but continue to have the ':' as a separator in the display filter.

Converted the "string" hf_ entries that used tvb_fc_to_str as a string to use proto_tree_add_item with FT_BYTES/BASE_DOT type.

Converted applicable tvb_bytes_to_ep_str_punct() calls to use the new BASE values.

Change-Id: I2442185bb314d04a3ff2ba57883652ecd738b5f9
Reviewed-on: https://code.wireshark.org/review/6098
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-04 16:32:03 +00:00
Guy Harris e6fcff1eb6 Use g_ascii_isalnum() rather than isalnum().
That way, we don't have to worry about casting the argument (which, in
one place, was done wrong - casting to int preserves the sign-extension
done with signed chars), and don't have to worry about a locale in which
particular 8-bit byte values are considered alphanumeric characters.

Change-Id: I129b4bfdad70ade4ab6e0a1d2c13d59ae9e6f524
Reviewed-on: https://code.wireshark.org/review/4751
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-16 23:46:58 +00:00
Guy Harris b720f08f36 Don't use __func__, use G_STRFUNC.
Not all compilers we use support __func__.

Change-Id: I61194e1073c87e67f821e14698ea21b73d63983c
Reviewed-on: https://code.wireshark.org/review/3071
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-16 00:23:51 +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
Gilbert Ramirez 4cc694839d Fix all -fstrict-alias warnings found by gcc 4.1.2
The majority of the fixes are for calls to uat_new(). Instead of
having each caller cast its private data to (void**), we use void*
in the uat_new() API itself. Inside uat_new(), we cast the void*
to void**.

Some dissectors use val64_string arrays, so a VALS64() macro was
added for those, to avoid using VALS(), which is useful only for
value_string arrays.

packet-mq.c was changed because dissect_nt_sid() requires
a char**, not a guint**. All other callers of dissect_nt_sid() use
char*'s (and take the address of it) for their local storage. So,
this was changed to follow the other practices.

A confusion between gint and absolute_time_display_e in packet-time.c
was cleared up.

The ugliest fix is the addition of ip6_guint8_to_str(), for exactly
one caller. The caller uses one type of ip6 address byte array,
while ip6_to_str() expects another. This new function is in place
until the various address implementations can be consolidated.

Add VALS64() to the developer documentation.

Change-Id: If93ff5c6c8c7cc3c9510d7fb78fa9108e4552805
Reviewed-on: https://code.wireshark.org/review/48
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-02-03 09:26:10 +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
Evan Huus 95f484a91e Add a very small hack to make the UAT update callback error string freeable, and
convert all existing UAT update callbacks to use glib memory instead of
ephemeral memory for that string.

UAT code paths are entirely distinct from packet dissection, so using ephemeral
memory was the wrong choice, because there was no guarantees about when it would
be freed.

The move away from emem still needs to be propogated deeper into the UAT code
itself at some point.

Net effect: remove another bunch of emem calls from dissectors, where replacing
with wmem would have caused assertions.

svn path=/trunk/; revision=52854
2013-10-25 22:14:25 +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
Martin Mathieson 608ad7b5b6 Add a comment about how it would nice for display filter macro fields
to use auto-completion, but that it won't work because the string
contains the $1, etc placeholders...

svn path=/trunk/; revision=50038
2013-06-19 17:11:55 +00:00
Anders Broman 81e80f2c0b From beroset:
remove C++ incompatibilities 
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416

svn path=/trunk/; revision=48355
2013-03-17 16:48:47 +00:00
Michael Mann 86d690880f replace "unsigned" datatype with "guint". Some mpeg files needed "unsigned int" instead.
bugs 7825-7827 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7825)

svn path=/trunk/; revision=46928
2013-01-04 05:22:43 +00:00
Guy Harris 8ed7a73e22 Fix a bunch of warnings.
Cast away some implicit 64-bit-to-32-bit conversion errors due to use of
sizeof.

Cast away some implicit 64-bit-to-32-bit conversion errors due to use of
strtol() and strtoul().

Change some data types to avoid those implicit conversion warnings.

When assigning a constant to a float, make sure the constant isn't a
double, by appending "f" to the constant.

Constify a bunch of variables, parameters, and return values to
eliminate warnings due to strings being given const qualifiers.  Cast
away those warnings in some cases where an API we don't control forces
us to do so.

Enable a bunch of additional warnings by default.  Note why at least
some of the other warnings aren't enabled.

randpkt.c and text2pcap.c are used to build programs, so they don't need
to be in EXTRA_DIST.

If the user specifies --enable-warnings-as-errors, add -Werror *even if
the user specified --enable-extra-gcc-flags; assume they know what
they're doing and are willing to have the compile fail due to the extra
GCC warnings being treated as errors.

svn path=/trunk/; revision=46748
2012-12-26 05:57:06 +00:00
Jeff Morriss 3729335973 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45016
2012-09-20 01:48:30 +00:00
Guy Harris 659cf0527a UATs could be put into "categories". The categories were defined only
implicitly by the #define name and string they were defined to; not all
UATs neatly fit into any of the categories, so some of them were put
into categories that weren't obviously correct for them, and one - the
display filter macro UAT - wasn't put into any category at all (which
caused crashes when editing them, as the GUI code that handled UAT
changes from a dialog assumed the category field was non-null).

The category was, in practice, used only to decide, in the
aforementioned GUI code, whether the packet summary pane needed to be
updated or not.  It also offered no option of "don't update the packet
summary pane *and* don't redissect anything", which is what would be
appropriate for the display filter macro UAT.

Replace the category with a set of fields indicating what the UAT
affects; we currently offer "dissection", which applies to most UATs
(any UAT in libwireshark presumably affects dissection at a minimum) and
"the set of named fields that exist".  Changing any UAT that affects
dissection requires a redissection; changing any UAT that affects the
set of named fields that exist requires a redissection *and* rebuilding
the packet summary pane.

Perhaps we also need "filtering", so that if you change a display filter
macro, we re-filter, in case the display is currently filtered with a
display filter that uses a macro that changed.

svn path=/trunk/; revision=43603
2012-07-08 01:00:46 +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 345b48d1ea Try to squelch warnings
svn path=/trunk/; revision=43019
2012-06-03 09:26:15 +00:00
Anders Broman 4cbb31e99c Try to squelch warnings
svn path=/trunk/; revision=43002
2012-06-02 15:52:42 +00:00
Guy Harris 70a8b27948 Get rid of the depth argument to dfilter_macro_apply(); have an internal
routine that does all the work and that takes a depth argumen, and an
external routine that calls that internal routine with a depth argument
of 0.  The depth is only of use internally, to avoid infinite recursion.

When recursing with that routine, pass depth+1 as the depth value,
rather than passing depth and incrementing it afterwards; the latter
doesn't prevent infinite recursion.  (Thanks and a tip of the hat to
Clang Cat for catching this.)

Squelch some other (harmless) warnings from Clang Cat.

Clean up indentation.

svn path=/trunk/; revision=39838
2011-11-15 04:26:38 +00:00
Stig Bjørlykke 8443bbbf75 Replace all strerror() with g_strerror().
Remove our local strerror implementation.
Mark strerror as locale unsafe API.

This fixes bug 5715.

svn path=/trunk/; revision=37812
2011-06-28 09:00:11 +00:00
Guy Harris 71b71d920e Oops, wrong pointer comparison.
svn path=/trunk/; revision=35976
2011-02-17 08:39:41 +00:00
Guy Harris 8eb8623b15 OK, let's try a couple more explicit checks against NULL, to see whether
that de-confuses Microsoft's code analyzer.

svn path=/trunk/; revision=35975
2011-02-17 08:15:05 +00:00
Guy Harris 17d4d51b7d Make the third argument to a UAT copy callback a size_t (not that any of
the callbacks we have use that argument - is it really needed?).

svn path=/trunk/; revision=34694
2010-10-29 21:11:33 +00:00
Stig Bjørlykke 4382dcffad Call dfilter_macro_uat->post_update_cb instead of using cfile.
svn path=/trunk/; revision=34012
2010-08-30 09:31:52 +00:00
Stig Bjørlykke 835a43312f Always update the display filter when changing a display filter macro
and when changing profile.  Not sure why I have to invalidate cfile.dfilter
in macro_update(), because this will be done in macros_post_update(),
but unless this we get a crash when renaming a macro...

This is a fix for bug 5002.

svn path=/trunk/; revision=34011
2010-08-30 08:47:26 +00:00
Stig Bjørlykke 2f8830b4d0 From LEGO via bug 3459:
Add a callback to UAT to be called after the table has being updated,
use it to renew the snmp_ue_cache.

svn path=/trunk/; revision=32112
2010-03-04 12:50:18 +00:00
Kovarththanan Rajaratnam 083729e02c Add PTREE_FINFO and use PITEM_FINFO when possible.
svn path=/trunk/; revision=29355
2009-08-09 17:57:31 +00:00
Guy Harris ad33ca6c2f Clean up some 64-bit issues.
svn path=/trunk/; revision=28117
2009-04-22 03:07:37 +00:00
Guy Harris 4ab2ca8891 Constify some items to squelch some compiler warnings in the Windows
buildbot; based on a patch from Chris Maynard, with some additional
changes to squelch GCC warnings on UN*X.

svn path=/trunk/; revision=28093
2009-04-20 18:34:06 +00:00
Stig Bjørlykke 62f60df6b4 From Jakub Zawadzki (bug 3331):
g_free() is NULL safe, so we don't need check against it.

svn path=/trunk/; revision=27718
2009-03-13 22:06:48 +00:00
Guy Harris 5742ede54c Add an additional "title" attribute for UAT fields; that's what's
displayed to the user.

svn path=/trunk/; revision=27462
2009-02-16 04:10:06 +00:00
Jaap Keuter 0fde67dd54 From Andrew Narver:
Currently, if you call proto_tree_free on anything other than the root node of a tree 
the tree will get left in an inconsistent state.  This is because the parent is left pointing 
to the newly freed child.

The traversal code is updated, the parent node update is currently disabled since 
freeing is done for the complete tree only at this time, so there is no need to keep 
the parent node consistent.

svn path=/trunk/; revision=26466
2008-10-15 20:02:15 +00:00
Jeff Morriss a5cee04fad Move the file utility functions from wiretap to libwsutil so that
libwireshark (and the plugins using those functions) do not depend on
wiretap on Windows.

While doing that, rename the eth_* functions to ws_*.

svn path=/trunk/; revision=25354
2008-05-22 15:46:27 +00:00
Bill Meier fe5c2d9820 g_string_sprintf --> g_string_printf and g_string_sprintfa --> g_string_append_printf
svn path=/trunk/; revision=25276
2008-05-11 18:33:49 +00:00
Stig Bjørlykke fdc980e79d Added an option to uat_new() to set if configuration shall be saved in the
selected profile.

Don't save SMI Paths and SMI Modules in the profiles because reloading
currently doesn't work (bug 2309).

svn path=/trunk/; revision=24580
2008-03-06 22:13:24 +00:00
Sake Blok 173fe99eb5 Fix for bug 2068 from Jim Young:
After a new display filter macro (dfmacro) has been defined, the first attempt
to use the dfmacro will result in a crash of Wireshark when the closing "}"
character is entered into the "Filter:" text entry field.


svn path=/trunk/; revision=23969
2007-12-29 09:12:29 +00:00
Jeff Morriss 53489c8f5d A few more s/fopen/eth_fopen/
svn path=/trunk/; revision=23207
2007-10-16 15:58:25 +00:00
Bill Meier 0534c6982c macro_name_chk: return valid error string for fail return when empty macro name field;
fixes bug #1813

svn path=/trunk/; revision=22767
2007-09-02 12:37:24 +00:00
Luis Ontanon 9865b6346f As per Ulf's request add ${proto.field} macros that will use the value of the given field has in the last selected packet.
svn path=/trunk/; revision=22427
2007-07-30 23:32:47 +00:00
Guy Harris fad7133f81 Fix yet more casts of ctype.h macro arguments - and fix some cases where
we were passing an uncasted "char" to those macros.

svn path=/trunk/; revision=22306
2007-07-14 00:37:01 +00:00
Luis Ontanon 2b9b4cdc14 Terminate the strings of the various parts and advance the write pointer.
svn path=/trunk/; revision=21805
2007-05-16 17:35:07 +00:00
Gerald Combs 5713fbc9b9 Handle cases where our macro doesn't have any arguments. We should
probably provide feedback to the user, but at least we don't crash now.
Fixes Coverity CID 232.

svn path=/trunk/; revision=21664
2007-05-03 16:11:18 +00:00
Guy Harris 0be322bad8 Try to squelch an alignment warning (we put "int"s into the array, so we
know the pointer's aligned appropriately for an array of "int"s).

svn path=/trunk/; revision=21552
2007-04-24 06:43:01 +00:00
Guy Harris 1bc049906a Add some GCC warnings to the standard set, and add some others to the
--enable-extra-gcc-checks set.

If we turn on -pedantic, try turning on -Wno-long-long as well, so that
it's not *so* pedantic that it rejects the 64-bit integral data types
that we explicitly require.

Constify a bunch of stuff, and make some other changes, to get rid of
warnings.

Clean up some indentation.

svn path=/trunk/; revision=21526
2007-04-23 10:59:26 +00:00
Stephen Fisher fa57c8fc44 Fix some Solaris buildbot warnings
svn path=/trunk/; revision=21423
2007-04-13 23:32:21 +00:00
Stephen Fisher 6625e7503f Fix warnings on Linux/gcc 4.1.1
svn path=/trunk/; revision=21330
2007-04-03 21:17:13 +00:00
Sebastien Tandel c136927420 revert back (void*) -> (void**) which will stop free-warning compilation with
gcc-4.1.2


svn path=/trunk/; revision=21282
2007-03-30 12:04:40 +00:00
Sebastien Tandel 8405f21ea2 strict aliasing warnings fix : replace (void**) by (void*)
svn path=/trunk/; revision=21274
2007-03-29 22:58:02 +00:00
Luis Ontanon b26c1c4ca2 Add a description of UAT fields, and have it as a tooltip in the New/Edit Dialog.
svn path=/trunk/; revision=20797
2007-02-12 19:57:41 +00:00
Luis Ontanon 7c57c05ed5 * Add a Submenu (/Views/User Tables) where UATs can be accessed.
* Remove macros_dlg, the DFMacros UAT goes in the menu with all the rest
* in packet-user_encap.c WTAP_ENCAP=XXX has become useless information for the user leave just the DLT#



svn path=/trunk/; revision=20753
2007-02-09 03:11:14 +00:00
Luis Ontanon 2006fac500 * Add a category param to the uat.
* UATify SNMP Users


svn path=/trunk/; revision=20736
2007-02-07 14:54:35 +00:00