Commit graph

60 commits

Author SHA1 Message Date
Evan Huus
a6415ece0a Rename a couple of to_str functions to have ep_ in the name. This makes it
obvious that the returned string is ephemeral, and opens up the original names
in the API for versions that take a wmem pool (and thus can work in any scope).

svn path=/trunk/; revision=54249
2013-12-19 15:49:09 +00:00
Michael Mann
9b7fb8a811 Create the ability to have packet scoped "proto" data. Bug 9470 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9470)
I'm not sold on the name or module the proto_data functions live in, but I believe the function arguments are solid and gives us the most flexibility for the future.  And search/replace of a function name is easy enough to do.

The big driving force for getting this in sooner rather than later is the saved memory on ethernet packets (and IP packets soon), that used to have file_scope() proto data when all it needed was packet_scope() data (technically packet_info->pool scoped), strictly for Decode As.

All dissectors that use p_add_proto_data() only for Decode As functionality have been converted to using packet_scope().  All other dissectors were converted to using file_scope() which was the original scope for "proto" data.

svn path=/trunk/; revision=53520
2013-11-23 02:20:13 +00:00
Bill Meier
76d4b43a29 Minor whitespace, formatting & etc changes.
svn path=/trunk/; revision=52588
2013-10-13 18:14:59 +00:00
Michael Mann
e6f1bd9056 Convert several proto_tree_add_bytes_format calls to proto_tree_add_bytes_format_value.
svn path=/trunk/; revision=52272
2013-09-29 18:19:29 +00:00
Evan Huus
58a9f5cb1e More wmem.
svn path=/trunk/; revision=51968
2013-09-12 12:37:27 +00:00
Michael Mann
9e3f9b449f expert_add_info_format_text -> expert_add_info_format
svn path=/trunk/; revision=51852
2013-09-09 00:44:09 +00:00
Jakub Zawadzki
5fa2a99087 Keep result of [new_]register_dissector in some dissectors.
svn path=/trunk/; revision=51156
2013-08-05 18:09:43 +00:00
Michael Mann
f42e5bc9c0 Remove check_col() and the occasional tree.
This leaves just the Pidl dissectors remaining for removal of check_col() in the dissectors directory.  A small handful of check_col() calls remain outside of the dissectors.

svn path=/trunk/; revision=49941
2013-06-14 19:46:54 +00:00
Michael Mann
45658e1cbd first batch of dissectors to use the new expert info API.
svn path=/trunk/; revision=49560
2013-05-24 18:02:54 +00:00
Anders Broman
85a8e304dd Add the posibillity to use a key for per-packet-data.
svn path=/trunk/; revision=49259
2013-05-12 18:11:02 +00:00
Martin Mathieson
b18ab24f49 Don't report duplicate use of IP address twice when dissecting a
gratuitous ARP request.

svn path=/trunk/; revision=48962
2013-04-22 12:08:42 +00:00
Evan Huus
37600a157b Rename value string (and similar) functions to use a consistent pattern. This
was done using textual search+replace, not anything syntax-aware, so presumably
it got most comments as well (except where there were typos).

Use a consistent coding style, and make proper use of the WS_DLL_* defines.

Group the functions appropriately in the header.

I ended up getting rid of most of the explanatory comments since many of them
duplicated what was in the value_string.c file (and were out of sync with the
recent updates I made to those in r48633). Presumably most of the comments
should be in the .h file not the .c file, but there's enough churn ahead that
it's not worth fixing yet.

Part of https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8467

svn path=/trunk/; revision=48634
2013-03-29 00:26:23 +00:00
Anders Broman
04766017df - [-Wmissing-prototypes]
- explicit casts.

svn path=/trunk/; revision=48282
2013-03-13 21:14:20 +00:00
Michael Mann
8856e1a03a convert proto_tree_add_text to proto_tree_add_item and expert_add_info_format for packet-dhcpv6.c and packet-dhcp-failover.c
"Refactor" value_string in ARP dissector

svn path=/trunk/; revision=45535
2012-10-14 15:27:52 +00:00
Jeff Morriss
2552c750e5 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45017
2012-09-20 02:03:38 +00:00
Chris Maynard
c7b5c1eabb Add a fall-through comment to appease Coverity and resolve CID 714131: Missing break in switch.
svn path=/trunk/; revision=44264
2012-08-04 18:45:57 +00:00
Guy Harris
307e13d9f2 Move the list of AX.25 protocol IDs to epan/ax25_pids.h. Use it in
packet-ax25.c and packet-arp.c.

Add an "ax25.pid" dissector table for those protocol IDs, use it in the
AX.25 dissector, and have dissectors register in that table with their
protocol IDs.

Get rid of some unneeded includes.

Clean up some "AX25"s in user-visible strings - say "AX.25" instead.

Clean up some indentation.

svn path=/trunk/; revision=44235
2012-08-03 01:58:12 +00:00
Jörg Mayer
262c6c664a Fix:
/home/jmayer/work/wireshark/svn/trunk/epan/dissectors/packet-arp.c:1239:42: error: variable ‘tha_val’ set but not used [-Werror=unused-but-set-variable]
/home/jmayer/work/wireshark/svn/trunk/epan/dissectors/packet-arp.c:1239:22: error: variable ‘sha_val’ set but not used [-Werror=unused-but-set-variable]


svn path=/trunk/; revision=44213
2012-08-02 18:12:59 +00:00
Guy Harris
86bf808c15 From Richard Stearn: IP-over-AX.25 and AX.25 ARP.
svn path=/trunk/; revision=44212
2012-08-02 17:48:18 +00:00
Anders Broman
8d6b6f58d6 From Deepti Ragha:
Additions to the ARP dissector as per the IANA specifications for ARP

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

svn path=/trunk/; revision=42895
2012-05-29 08:00:35 +00:00
Bill Meier
72bf183742 Do indentation cleanup (e.g., 4-space tabs => spaces)
Reformat a few long lines.

svn path=/trunk/; revision=42213
2012-04-23 17:50:02 +00:00
Martin Mathieson
ca86948d72 Fix reporting of duplicate IP addresses by creating a hash table of
results when first visited.

svn path=/trunk/; revision=40928
2012-02-08 11:48:02 +00:00
Guy Harris
c32a5e7d8b As we're no longer checking whether we're constructing the Info column,
we can't bail out early on dissection merely because we're not
constructing the protocol tree, as that would mean we wouldn't construct
the Info column unless we're constructing a protocol tree.

Clean up indentation.

svn path=/trunk/; revision=39821
2011-11-13 22:44:51 +00:00
Anders Broman
4b952c1324 Get rid of check_col, while at it set ENC.
svn path=/trunk/; revision=39146
2011-09-26 08:25:18 +00:00
Stig Bjørlykke
1bb94ef56d Added a FALLTHRU comment to avoid a missing break warning.
Coverity 437.

svn path=/trunk/; revision=36605
2011-04-12 20:03:21 +00:00
Jeff Morriss
be81bc949a Rename arphrdaddr_to_str() to tvb_arphrdaddr_to_str() and make it take a pointer a TVB
and an offset instead of (generally) a pointer into a TVB.

svn path=/trunk/; revision=35913
2011-02-11 03:33:11 +00:00
Guy Harris
a8bc4a0d13 Rename the routines that handle dissector tables with unsigned integer
keys to have _uint in their names, to match the routines that handle
dissector tables with string keys.  (Using _port can confuse people into
thinking they're intended solely for use with TCP/UDP/etc. ports when,
in fact, they work better for things such as Ethernet types, where the
binding of particular values to particular protocols are a lot
stronger.)

svn path=/trunk/; revision=35224
2010-12-20 05:35:29 +00:00
Stephen Fisher
b4addc04fe The ARP hardware type and operation code are listed with the IANA in decimal notation, not hex.
svn path=/trunk/; revision=33898
2010-08-23 23:09:32 +00:00
Stig Bjørlykke
31c67f8a03 Added some ARP options from RFC 5494.
svn path=/trunk/; revision=33568
2010-07-18 16:01:11 +00:00
Stephen Fisher
b665a515a8 Generated fields should not highlight any bytes in the packet bytes pane.
This is especially true in this case because the indication that an arp
packet is gratuitous is determined with the following code, which checks
multiple fields:

  if (((ar_op == ARPOP_REQUEST) || (ar_op == ARPOP_REPLY)) && (memcmp(spa_val, tpa_val, ar_pln) == 0))
    is_gratuitous = TRUE;
  else
    is_gratuitous = FALSE;


svn path=/trunk/; revision=31229
2009-12-10 22:35:09 +00:00
Kovarththanan Rajaratnam
0a5b014cec Don't guard col_clear with col_check
svn path=/trunk/; revision=29344
2009-08-09 07:36:13 +00:00
Kovarththanan Rajaratnam
e971354a54 Don't guard col_set_str (COL_PROTOCOL) with col_check
svn path=/trunk/; revision=29340
2009-08-09 06:26:46 +00:00
Jörg Mayer
61d5b442f4 Add filterable generated item arp.isgratuitous. Inspired
by question on wireshark-users ML by
wireshark.20090520@tozer.org.uk

svn path=/trunk/; revision=28436
2009-05-21 05:15:03 +00:00
Bill Meier
5aa5576a55 The convention is to use TFS(...) when specifying a true_false_string with an FT_BOOLEAN field;
Also: use the global true_false_string tfs_yes_no  in place of a static local string.

svn path=/trunk/; revision=28320
2009-05-08 22:18:14 +00:00
Bill Meier
808a4e2c3c Define certain fcns as static (if not used externally).
Also: whiule we're at it: 
 - fix hf[] blurbs as appropriate to use NULL;
 - fix some indentation

svn path=/trunk/; revision=27890
2009-03-29 22:16:26 +00:00
Bill Meier
09d097e7a7 #include <conversation.h> not req'd ....
svn path=/trunk/; revision=27389
2009-02-06 20:33:53 +00:00
Jaap Keuter
5f96568834 Update ARP hardware types from http://www.iana.org/assignments/arp-parameters/
svn path=/trunk/; revision=27120
2008-12-27 14:30:46 +00:00
Gerald Combs
6d04f793f0 Back out r27047 and r27053.
svn path=/trunk/; revision=27062
2008-12-19 17:39:52 +00:00
Gerald Combs
fc71188963 Update calls to proto_tree_add_bytes_format to reflect r27047.
svn path=/trunk/; revision=27053
2008-12-18 20:19:49 +00:00
Guy Harris
aa7dfb40e0 A MAC address is a sequence of 6 8-bit unsigned values (guint8), not a
sequence of 6 ASCII characters (gchar).

svn path=/trunk/; revision=25395
2008-05-30 00:01:24 +00:00
Martin Mathieson
ee8673b457 Also show duplicate IP address in info column.
svn path=/trunk/; revision=23983
2008-01-02 10:35:20 +00:00
Gerald Combs
7a3bc302d9 Fix some casts.
svn path=/trunk/; revision=23930
2007-12-20 17:34:39 +00:00
Martin Mathieson
2346d8280c Report duplicate IP addresses based on observed ARP requests & responses.
Turned on by default (otherwise no-one will find it).

svn path=/trunk/; revision=23923
2007-12-19 10:49:22 +00:00
Sebastien Tandel
68ad2f4b9b fix MacOSX gcc-3.3 warnings about unused tfs/value_string variables
most have been tagged unused (few have been deleted if dissector has not been
modified since a long time)

move packet-ssl-utils.c to DISSECTOR_SRC


svn path=/trunk/; revision=21431
2007-04-14 14:01:53 +00:00
Ulf Lamping
db963eeb59 fix some more warnings
svn path=/trunk/; revision=21143
2007-03-23 01:55:29 +00:00
Jeff Morriss
62596bffb3 Fix bug 552:
http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=552

by enforcing that header fields have names of length > 0.  This should fix
the display of those fields and also make them filterable (which was the
subject of the bug).  Abbreviations are (still) optional: if they are empty
then the field is not filterable.

Update README.developer with this information.

Add header field names in several dissectors where they were missing.

In packet-arp.c give "packet-storm-detected" a name (as above) but also set it
as _GENERATED.

Also remove trailing white space from all the files checked in.

svn path=/trunk/; revision=21018
2007-03-11 06:16:00 +00:00
Jaap Keuter
8899c8f747 From Roger Gottsponer:
During troubleshooting an ARP problem, I found an issue with wireshark
to properly recognise Gratuitous ARP packets. Gratuitous ARP packets
can be made with ARP request or ARP reply packets.

svn path=/trunk/; revision=19731
2006-10-29 19:14:31 +00:00
Martin Mathieson
cb5116c5b2 Add an expert item for detecting ARP request packet storms. The time period and number of requests needed are configurable. I've turned the preference to do the detection off, because I'm not sure what might be sensible defaults for the other fields...
svn path=/trunk/; revision=19628
2006-10-20 14:20:22 +00:00
Ronnie Sahlberg
feab79e328 change a whole bunch of ethereal into wireshark
svn path=/trunk/; revision=18196
2006-05-21 04:49:01 +00:00
Ronnie Sahlberg
2cd5614407 replace a strcpy with g_snprintf so it will not show up in grep strcpy *.c
svn path=/trunk/; revision=16236
2005-10-16 00:33:00 +00:00