Commit Graph

49 Commits

Author SHA1 Message Date
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
Guy Harris b7b80d94be Move a pile of protocol-related headers from the top-level source
directory to the epan directory.  Some of them should perhaps ultimately
be moved to epan/dissectors, if they pertain only to stuff exported by a
particular dissector.

Fix Gerald's e-mail address in files we're moving.

svn path=/trunk/; revision=15844
2005-09-17 00:02:31 +00:00
Guy Harris 346e5e211c The previous checkin for packet-isup.c was accidentally checked in along
with some unrelated changes; it got rid of some calls to get IPv4/IPv6
addresses and add them to the protocol tree, replacing them with
proto_tree_add_item() calls, and fixed up the length of one protocol
tree item.

Note that we have (at least) three count 'em three different routines
for dissecting/displaying NSAPs (there might be more - I might have
missed some), and suggest that we might want to reduce that to one.

Update the URL for ICP values for IPv{4,6} addresses inside NSAPs.

Fix the offset in the call to add the IPv6 address part of an NSAP
containing such an address, and the length in the call adding the DSP
for an NSAP containing an IPv4 address.

Fix up indentation a bit.

svn path=/trunk/; revision=15766
2005-09-12 07:44:11 +00:00
Guy Harris 25c4bc9379 Replace tvb_memcpy() calls that extract IPv4 addresses into a guint32,
and that extract IPv6 addresses into a "struct e_in6_addr", with
tvb_get_ipv4() and tvb_get_ipv6() calls - except for some that we
remove, by using proto_tree_add_item(), rather than replacing.

Have epan/tvbuff.h include epan/ipv6-utils.h, to define "struct
e_in6_addr" (not necessary to declare the tvbuff routines, but including
it there means "struct e_in6_addr" is guaranteed to be defined before
those declarations, so we don't get compiler complaints if we define it
*after* those declarations).

svn path=/trunk/; revision=15758
2005-09-11 21:25:37 +00:00
Ronnie Sahlberg 4c1b32d94d replace a whole bunch of silly rotating stating buffers with ep_alloc() calls
this should fix a whole number of display bugs when there are too many such pdus in a single frame for the silly buffers to handle before they wrap.



svn path=/trunk/; revision=15384
2005-08-17 09:25:04 +00:00
Jörg Mayer b8d33c4add Fix >2600 warnings by doing char -> const char changes.
Additionally in dissectors/packet-ansi_map.c:
        Flag unused parameters as such and remove dummy
        param = param;
        statements.

svn path=/trunk/; revision=15114
2005-07-27 07:57:01 +00:00
Guy Harris ab797734dd Get rid of the private "my_match_strval()" routine in many dissectors;
add a "match_strval_idx()" routine that does the same thing, and have
"match_strval()" call it.

Make those routines, and "val_to_str()", return a "const" pointer. 
Update dissectors as necessary to squelch compiler warnings produced by
that.

Use "val_to_str()" rather than using "match_strval()" and then, if the
result is null, substituting a specific string.  Clean up some other
"match_strval()"/"val_to_str()" usages.

Add a null pointer check in the NDPS dissector's "attribute_value()"
routine, as it's not clear that "global_attribute_name" won't be null at
that point.

Make some global variables in the AFS4INT dissector local.

Make some routines not used outside the module they're in static.

Make some tables "static const".

Clean up white space.

Fix Gerald's address in some files.

svn path=/trunk/; revision=14786
2005-06-26 19:56:52 +00:00
Jörg Mayer 326165db2b ncisco Alcoba:
Do not add target address if the packet is a Request. According to the RFC,
        target addresses in requests have no meaning


svn path=/trunk/; revision=13269
2005-02-03 22:52:20 +00:00
Guy Harris 1220516388 From Yaniv Kaul: add Ethernet address-to-name (or, at least, address-to-
vendor-name-and-next-three-bytes-in-hex) resolution for Ethernet/802.x
hardware addresses.

Move the ARP hardware types into a header file, for use by dissectors
other than the ARP dissector.

svn path=/trunk/; revision=12839
2004-12-26 22:26:02 +00:00
Guy Harris 3a583aeb59 From Albert Chin: rename resolv.{ch} to addr_resolv.{ch}, so that an
include of <resolv.h> in any system header file gets the system
<resolv.h> (needed for builds on Tru64 with GTK+ 1.2[.x]).

svn path=/trunk/; revision=11615
2004-08-06 19:57:49 +00:00
Gilbert Ramirez 669db206cb Move dissectors to epan/dissectors directory.
Also move ncp222.py, x11-fields, process-x11-fields.pl,
make-reg-dotc, and make-reg-dotc.py.

Adjust #include lines in files that include packet-*.h
files.

svn path=/trunk/; revision=11410
2004-07-18 18:06:47 +00:00