Commit graph

115 commits

Author SHA1 Message Date
Anish Bhatt
0b245a4cf8 Use the same offset += rtnValue logic for all TLV types, instead of a special case for chassis, port & ttl.
I've avoided using any mathematical checks even though tlv type vals increase linearly just in case they change in the future.

Change-Id: I0ec7021df5b91543e12edf9ba8d9c4ac44ecb11c
Signed-off-by: Anish Bhatt <anish@chelsio.com>
Reviewed-on: https://code.wireshark.org/review/2193
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-19 18:22:44 +00:00
Anish Bhatt
4a60a30462 Rename temp variables to a more human readable form
Change-Id: Idafe97df6be71d885203e2e3426fdb6a133862c4
Signed-off-by: Anish Bhatt <anish@chelsio.com>
Reviewed-on: https://code.wireshark.org/review/2140
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-11 17:42:25 +00:00
Anish Bhatt
508d16b037 Use offset instead of tempOffset, return offset instead of calculating (len + n) where possible
Change-Id: I91ef4ec59698903cb2a7be00e7e0ece478fc26a8
Signed-off-by: Anish Bhatt <anish@chelsio.com>
Reviewed-on: https://code.wireshark.org/review/2139
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-11 17:41:22 +00:00
Anish Bhatt
d8a21c8f8e Use expert info for Invalid length/type where possible, other minor fixes
Change-Id: I4a0421bf918439261f31f4bfc2cb5519b38f1711
Signed-off-by: Anish Bhatt <anish@chelsio.com>
Reviewed-on: https://code.wireshark.org/review/2118
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-11 12:05:21 +00:00
Anish Bhatt
3fcd016029 Fix bug in dissect_lldp_port_id, support all port id subtypes
Change-Id: I8b44e0d55701ba5d583e3e734e19d4d2aa024b25
Reviewed-on: https://code.wireshark.org/review/2049
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-11 00:58:10 +00:00
Anish Bhatt
9516675ca7 Add modelines
Change-Id: Ib8e157e2744198eaa1a5a69732bd8e977b146026
Signed-off-by: Anish Bhatt <anish@chelsio.com>
Reviewed-on: https://code.wireshark.org/review/2089
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-09 23:58:36 +00:00
Anish Bhatt
f33ead5479 remove all checks for if (tree)
Change-Id: I82617c0a396fdf42735ba39a5ed266a3f5240854
Signed-off-by: Anish Bhatt <anish@chelsio.com>
Reviewed-on: https://code.wireshark.org/review/2048
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-06-09 10:47:11 +00:00
Michael Mann
73217d9f3f tvb_new_subset -> tvb_new_subset_length when length parameters are equal.
tvb_new_subset -> tvb_new_subset_remaining it appears that's what the intention is.

Change-Id: I2334bbf3f10475b3c22391392fc8b6864454de2d
Reviewed-on: https://code.wireshark.org/review/1999
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-06-07 15:41:07 +00:00
Anish Bhatt
b69642db30 Misc lldp cleanup.
I'm cheating a bit here, hf_media_loc_long & hf_media_loc_lat need a 5byte bitmask, but the bitmask field in hf is restricted to guint32

Change-Id: I7e044fc680bb947973e437fc66057488a8deee67
Signed-off-by: Anish Bhatt <anish@chelsio.com>
Reviewed-on: https://code.wireshark.org/review/2012
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-06 23:42:31 +00:00
Anish Bhatt
65abca673f LLDP-MED Cleanup
Co-ordinate based LCI is untested, as the sample capture does not have this, could not find one anywhere.

Change-Id: Id0b52c234d6a36ee430ab9a7265bcd84f151c80c
Signed-off-by: Anish Bhatt <anish@chelsio.com>
Reviewed-on: https://code.wireshark.org/review/1929
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-06-06 10:17:30 +00:00
Anish Bhatt
de9efa1cb9 LLDP : Fix bug in mdi_power_source hf.
While it compiles fine, hits an assert in add_string :
failed assertion "hfinfo->type == FT_STRING || hfinfo->type == FT_STRINGZ || hfinfo->type == FT_STRINGZPAD"

Fix takes care of this issue, but seems like we're losing the bitmask info here, is there a better way to do this ?

Change-Id: I7156d734f4b058113730d5dfbf6498e801c36770
Signed-off-by: Anish Bhatt <anish@chelsio.com>
Reviewed-on: https://code.wireshark.org/review/1915
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-06-03 06:20:53 +00:00
Guy Harris
d55bb723e2 Just have one value_string table for OUIs.
While we're at it, get rid of duplicate #defines for some OUIs, sort the
OUI #defines, and fix some routine names.

Change-Id: I8f4e5408b44896c3629a0014299b060ebc15bab6
Reviewed-on: https://code.wireshark.org/review/1906
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-01 09:19:40 +00:00
Anish Bhatt
482e6a6510 LLDP Cleanup : 802.1 Qbg TLV
Change-Id: Ibdea530928d1bd98cb353ad8d7d938f739aa693f
Signed-off-by: Anish Bhatt <anish@chelsio.com>
Reviewed-on: https://code.wireshark.org/review/1830
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-05-28 05:54:53 +00:00
Alexis La Goutte
19c1989cfa Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
Change-Id: Ie97c65c1a995881eb400a44f17a493494f97d9dd
Reviewed-on: https://code.wireshark.org/review/1722
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-22 13:52:46 +00:00
Anish Bhatt
db4abb64ea LLDP Cleanup : 802.3 TLV
Change-Id: Iac1740e7e1895388de3ef3c103ef6e60cc688d9e
Signed-off-by: Anish Bhatt <anish@chelsio.com>
Reviewed-on: https://code.wireshark.org/review/1720
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-22 07:13:39 +00:00
Anish Bhatt
7e4b8a1497 Fix error in dcbx feature TLV dissection. Willing and Error bits were flipped
Change-Id: Ia6d727909816b86c48232685adca653700f071d9
Signed-off-by: Anish Bhatt <anish@chelsio.com>
Reviewed-on: https://code.wireshark.org/review/1705
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-05-20 18:36:34 +00:00
Alexis La Goutte
c32fb055ca Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
Change-Id: Ieac2f4a288f6ed084f2ea83ad409e217168065b2
Reviewed-on: https://code.wireshark.org/review/1621
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-13 08:45:51 +00:00
Anish Bhatt
fb1e251723 LLDP cleanup : Management Address TLV
Change-Id: I324fdd0482a9740f24e74688bd17d768fc37f60c
Signed-off-by: Anish Bhatt <anish@chelsio.com>
Reviewed-on: https://code.wireshark.org/review/1620
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-13 06:27:14 +00:00
Anish Bhatt
e46d1447be Small fix to how number of traffic classes is displayed for ETS.
Used proto_tree_add_uint_format_valu instead of append_text

Change-Id: I6d3d6049655c0573b66249ce93ea850c15b1cb7b
Signed-off-by: Anish Bhatt <anish@chelsio.com>
Reviewed-on: https://code.wireshark.org/review/1522
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-05-08 15:02:23 +00:00
Anish Bhatt
9b7830114f Further LLDP dissection cleanup
Change-Id: I75f4ed401f63e993a2aefa1c289fd48fa00b46e2
Signed-off-by: Anish Bhatt <anish@chelsio.com>
Reviewed-on: https://code.wireshark.org/review/1528
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-07 04:32:15 +00:00
Alexis La Goutte
d73fc0b294 Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
Change-Id: Ib4bbf1fa048cde14baf10bd31342b3c75e10b544
Reviewed-on: https://code.wireshark.org/review/1534
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-06 19:27:23 +00:00
Anish Bhatt
a915de5295 Fix build failures caused by lldp cleanup
Change-Id: I4d4aeb71720f02e4a6f4a8e5f803fd63dc7aed81
Signed-off-by: Anish Bhatt <anish@chelsio.com>
Reviewed-on: https://code.wireshark.org/review/1524
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-06 07:58:36 +00:00
Anish Bhatt
209f82a501 Cleanup LLDP dissection, convert add_text to tree items.
Just started on this, more changes incoming

Change-Id: Idc88442f382cea1f29f05edb991b920488cfc113
Signed-off-by: Anish Bhatt <anish@chelsio.com>
Reviewed-on: https://code.wireshark.org/review/1502
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-06 06:48:07 +00:00
Alexis La Goutte
a394d448f4 LLDP: Remove packet-lldp.h
Change-Id: If6d1fd1b7961f975447db43f616e016f70ca5cb8
Reviewed-on: https://code.wireshark.org/review/1473
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-05-02 21:36:07 +00:00
Anish Bhatt
b5120cd965 Add support for Logical Link Down TLV.
TLV is 1 octet long, and only MSB holds info with 7 unused bits

Change-Id: Ic1f5ce1b774bb7439cd2a23bc9bfb44f7dc25888
Signed-off-by: Anish Bhatt <anish@chelsio.com>
Reviewed-on: https://code.wireshark.org/review/1450
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-05-02 05:48:06 +00:00
Anish Bhatt
8f2e234add Add support for Congestion Notification TLVs (802.1Qau)
I don't have sample captures for this, but the TLV layout is pretty simple and only contains two 1 octet bitmaps

Change-Id: Ibd7db7f40187904bbbf348c2cb89a5494cd46aab
Signed-off-by: Anish Bhatt <anish@chelsio.com>
Reviewed-on: https://code.wireshark.org/review/1427
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-29 06:01:00 +00:00
Anish Bhatt
ec205458b1 Fix checkAPIs warnings in packet-lldp.c. repoted_length() used instead of captured_length() as is seems more logical
Change-Id: I02860d5c45e3fd794d9f99e2d382bc02ae886b36
Signed-off-by: Anish Bhatt <anish@chelsio.com>
Reviewed-on: https://code.wireshark.org/review/1422
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-04-28 22:23:01 +00:00
Anish Bhatt
eadaa0c50f This block of defines was always changed when I was retabbing my additions, this change fixes the tabs
Change-Id: I10e260a68cadf18d1aca10c7f037d45d311b6477
Signed-off-by: Anish Bhatt <anish@chelsio.com>
Reviewed-on: https://code.wireshark.org/review/1418
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-04-28 22:15:44 +00:00
Anish Bhatt
3765e99a07 With the use of tvb_reported_length_remaining(), there is no need to calculate consumedLen anymore
Change-Id: I8f4c32012061d3bff5e4efb80dfce8d82f7400df
Signed-off-by: Anish Bhatt <anish@chelsio.com>
Reviewed-on: https://code.wireshark.org/review/1417
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-28 20:49:21 +00:00
Alexis La Goutte
a203bbbd5b Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
Change-Id: I349a5aa7248979aa32eda9f853fd660dc01bdd08
Reviewed-on: https://code.wireshark.org/review/1407
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-04-28 08:34:12 +00:00
Anish Bhatt
581cdcee10 Add Support for IEEE DCBx (8021az)
Sample captures attached at https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=10055

Closed-bug:10055
Change-Id: Ib10e8d2a8aecdcf488eb174ed76a259433528f4a
Signed-off-by: Anish Bhatt <anish@chelsio.com>
Reviewed-on: https://code.wireshark.org/review/1403
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-04-28 08:32:12 +00:00
Michael Mann
0cfd4eb4a1 Add support for DCBX cee/cin protocol
CEE Spec here : http://www.ieee802.org/1/files/public/docs2008/az-wadekar-dcbx-capability-exchange-discovery-protocol-1108-v1.01.pdf

From a wireshark POV, CIN is the same as CEE with a different OUI subtype, and one less supported TLV.

bug:10039
Change-Id: I5aa4f1be2ecc43ecad6e86633231e6e39695af6e
Reviewed-on: https://code.wireshark.org/review/1330
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-04-28 00:13:27 +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
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
Guy Harris
30129013b0 Use proto_tree_add_item() in cases where we don't actually look at the
value.

svn path=/trunk/; revision=54243
2013-12-19 02:41:27 +00:00
Evan Huus
a2bb473ead Fix what appears to be a misuse of pointers in the LLDP dissector as caught by
Alexis's ASAN fuzzing. Pass the address of a guid on the stack, not the address
of a pointer to a guid which doesn't actually point to anything...

svn path=/trunk/; revision=54203
2013-12-17 22:38:40 +00:00
Jakub Zawadzki
1053e722ed Fix warnings
svn path=/trunk/; revision=54089
2013-12-14 12:45:57 +00:00
Jeff Morriss
31267e5a21 From Wido Kelling via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9176 :
Fix decoding of the Auto-Negotiation bits in LLDP (they were off by one).

svn path=/trunk/; revision=52199
2013-09-24 01:12:44 +00:00
Pascal Quantin
9486a3d974 More wmem conversion (leaving uat related functions aside)
svn path=/trunk/; revision=52055
2013-09-15 13:46:13 +00:00
Michael Mann
b38ee917b1 Convert proto_tree_add_uint_format to proto_tree_add_uint_format_value if hf_ field name is the first part of the formatted string. This was done with a perl script on the dissectors directory (packet-*.c), followed by manual inspection of the output. The manual inspection yielded a few cases that really should have been proto_tree_add_uint or proto_tree_add_item, so I updated them accordingly.
The script didn't catch as many as I would have liked, but it's a start.

The most common (ab)use of proto_tree_add_uint_format was for appending strings to CRC/checksum values to note good or bad CRC/checksum.

svn path=/trunk/; revision=52045
2013-09-15 01:48:30 +00:00
Alexis La Goutte
5e7d5b950c Fix indent (Mix of tab and space...) => use tab
svn path=/trunk/; revision=51686
2013-09-02 23:16:29 +00:00
Alexis La Goutte
9bf5e05205 Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=51664
2013-09-02 23:12:31 +00:00
Michael Mann
de68fd6eea Removed check_col() and the occasional tree.
svn path=/trunk/; revision=49938
2013-06-14 17:49:53 +00:00
Martin Kaiser
0e2f874a24 From Wido Kelling
updated Port3 status values to conform to IEC 61158
added decoding of some more values

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

svn path=/trunk/; revision=46075
2012-11-18 17:52:55 +00:00
Jaap Keuter
184e5102b0 Fix for bug 7757:
When subtype is unknown show whole subtype contents as bytes.

svn path=/trunk/; revision=45962
2012-11-07 21:10:21 +00:00
Anders Broman
df1fe6422e Assign a default value to temp_tree;
svn path=/trunk/; revision=45871
2012-11-02 11:15:29 +00:00
Anders Broman
4d83f6f557 packet-ssl.c add a cast to build on Win64
pccket-lldp.c #if 0 out not used variables.

svn path=/trunk/; revision=45870
2012-11-02 10:04:38 +00:00
Anders Broman
a43acbd8c3 From Wido Kelling:
updated the TLVs for Profinet IEC 61158
updated the MRP decoding
wrong formattype changed to avoid fault in unknown subtype (atatched capture)

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

svn path=/trunk/; revision=45868
2012-11-02 09:30:27 +00:00
Michael Mann
97c808c75c replaced decode_boolean_bitfield calls with itemized filters
svn path=/trunk/; revision=45152
2012-09-26 18:10:29 +00:00
Chris Maynard
6b3b90bde7 Fixup vlan_flags bug introduced with r45054
svn path=/trunk/; revision=45055
2012-09-22 18:47:11 +00:00