Commit Graph

132 Commits

Author SHA1 Message Date
Gerald Combs 3f765b3ef9 Add a CF_FUNC macro for casting BASE_CUSTOM functions.
Add a CF_FUNC macro to match VALS, TFS, etc. This should help us to avoid
the following warning:

    warning: ISO C forbids initialization between function pointer and 'void *' [-Wpedantic]

We could start adding DIAG_OFF+DIAG_ON everywhere but this seems to be
more consistent with the other macros in proto.h. Update each instance
of BASE_CUSTOM to use CF_FUNC.

Adjust a dummy variable name generated by asn2wrs.py that was triggering
an invalid error in checkhf.pl.

Fix an encoding arguement in packet-elasticsearch.c found by
fix-encoding-args.pl.

Change-Id: Id0e75076c2d71736639d486f47b87bab84e07d22
Reviewed-on: https://code.wireshark.org/review/7150
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-02-18 00:05:38 +00:00
Michael Mann 64a7bac641 tvb_bytes_to_ep_str -> tvb_bytes_to_str
Change-Id: I79c613cbdd8dc939dd4c29ebc477fb6eefd5bfc4
Reviewed-on: https://code.wireshark.org/review/6371
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-07 18:16:23 +00:00
Michael Mann 1d598bbff7 Replace ip6_to_str and ip6_guint8_to_str with address_to_str and tvb_ip_to_str.
Change-Id: I1d258923a7a63539ec8456d3e306bca5016a1e4b
Reviewed-on: https://code.wireshark.org/review/6060
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-28 14:09:27 +00:00
Michael Mann 3d3f97320b Replace ip_to_str with [ep_]address_to_str and tvb_ip_to_str.
Change-Id: I40d0c8253743183aecef252040b7dd6742ae5c71
Reviewed-on: https://code.wireshark.org/review/5934
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-26 21:17:10 +00:00
Martin Mathieson 86ed26f0b8 Deleting unnecessary #includes from dissectors.
Third batch (packet-icmpv6.c -> packet-mac-lte.c).

Will look at cleaning up and committing script afterwards.

Change-Id: Ib91e36ad200db01c3000605f6a7a21125b96a640
Reviewed-on: https://code.wireshark.org/review/6018
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-12-23 14:44:28 +00:00
Bill Meier b5d7b7ab6e Cleanup use of #includes in non-generated epan/dissector/*.c
Specifically:
- Set packet.h to be the first wireshark #include after
   config.h and "system" #includes.
   packet.h added as an #include in some cases when missing.
- Remove some #includes included (directly/indirectly) in
   packet.h. E.g., glib.h.
   (Done only for those files including packet.h).
- As needed, move "system" #includes to be after config.h and
   before wireshark #includes.
- Rework various #include file specifications for consistency.
- Misc.

Change-Id: Ifaa1a14b50b69fbad38ea4838a49dfe595c54c95
Reviewed-on: https://code.wireshark.org/review/5923
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-21 05:46:22 +00:00
Bill Meier 64cb5104d6 Change ENC_NA to ENC_BIG_ENDIAN for all fetches of integral type fields.
Change-Id: Ia4f5735c61eedcbe8354eabd5da05d02e167f25e
Reviewed-on: https://code.wireshark.org/review/5734
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-12 15:33:36 +00:00
Alexis La Goutte 82bb3630de LLDP: Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
Change-Id: I8c750ed9ad775b9be9d12050d200d7f1b4ddb86e
Reviewed-on: https://code.wireshark.org/review/5365
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-11-17 18:53:42 +00:00
Guy Harris 0be9e7d3da 0.0 is a double, 0.0f is a float.
Change-Id: I882bbda2c579cfd7a1b96ce190541262193405e0
Reviewed-on: https://code.wireshark.org/review/5320
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-11-15 03:38:20 +00:00
Gregor Miernik 3275ba2653 LLDP: Dissector for Hytec specific extensions added
It provides dissection of objects with additional neighbor and link information
defined by Hytec (pcap example available on wiki.wireshark.org/HYTEC).
Also OUI of "Hytec Geraetebau GmbH" added.

Change-Id: I92119e46fd5f4c4b385ac3df3170a4766fe056b7
Reviewed-on: https://code.wireshark.org/review/5107
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-11-15 03:19:17 +00:00
Bill Meier 24d50bc290 Adjust indentation to match editor modelines; Do other minor whitespace changes.
Change-Id: Ic020b2c92db5d14a2be9dc4d35aef4514b8b0353
Reviewed-on: https://code.wireshark.org/review/4502
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-06 17:12:33 +00:00
Alexis La Goutte 5377deeef8 LLDP: Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
Change-Id: I616e57c84c5721213ee12a41b63595547ab15f72
Reviewed-on: https://code.wireshark.org/review/4465
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-10-04 21:27:44 +00:00
Alexis La Goutte 39c51be8ce LLDP: TIA Network Policy Unknown Policy Flag Decode is not correct
Wrong length for field...

Bug:10512
Change-Id: I416a34d5f50cc0e842612a084c95d885eea68ef1
Reviewed-on: https://code.wireshark.org/review/4377
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Evan Huus <eapache@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-10-01 08:06:17 +00:00
Bill Meier 18d72987cb Do encoding-arg changes (all benign)
For:
- FT_BYTES: Always use just ENC_NA
- integral/floating (other than FT_[U]INT8): Do ENC_NA --> ENC_BIG_ENDIAN

Also:
- FT_UINT... --> FT_UINT8 in a few cases (to match proto_tree_add_item...)
- Change one case of incorrect '||' to '|'

Change-Id: I427e0e61618ff8faf55691c8a695930f67d455b0
Reviewed-on: https://code.wireshark.org/review/4184
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-09-19 01:38:08 +00:00
Alexis La Goutte 005a49453b Fix warning: no previous prototype for ... [-Wmissing-prototypes]
Add static before function

Change-Id: Ia34e4786d6181c7849094dd0c27445b29dd89f10
Reviewed-on: https://code.wireshark.org/review/3695
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-08-18 12:21:30 +00:00
Michael Mann d68d0e88b4 Eliminate proto_tree_add_text from some dissectors.
Other minor cleanup while in the neighborhood.

Change-Id: If73a029f564219782c313d4154c24c7ce7458b52
Reviewed-on: https://code.wireshark.org/review/3574
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-08-14 04:21:05 +00:00
Michael Mann dd63ae2b8c proto_tree_add_subtree[_format]
Change-Id: Id00f456479415adf0a219af6c9a2108d4b3642d0
Reviewed-on: https://code.wireshark.org/review/2702
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-29 21:18:04 +00:00
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