Commit Graph

336 Commits

Author SHA1 Message Date
Alexis La Goutte a5b6103942 BGP: Fix dissection of BGP ADD-PATH capability
not limited to len = 4 (can be a multiple of 4)

Bug: 13521
Change-Id: I668dbff6d8a7b0a4260da31393bb70d2c5431455
Reviewed-on: https://code.wireshark.org/review/20705
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-03-26 07:15:31 +00:00
IWASE Yusuke 3ddaa5ebc9 BGP: Decode Route Distinguisher in VPN Flow Specification
RFC5575 says Route Distinguisher is inserted between "length" and "NLRI
value" fields when the BGP NLRI type is VPNv4 Flow Spec (AFI=1,
SAFI=134) and this is the same for VPNv6 and L2VPN.

This patch fixes the BGP dissector to decode the missing Route
Distinguisher field in Flow Spec NLRI decoder.

Change-Id: Ib45d96bb399b80be69ca70ea552d2c07b07a9782
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Reviewed-on: https://code.wireshark.org/review/20653
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-03-24 04:35:48 +00:00
Simon Zhong af79cf1700 BGP: Fix incorrect desegment_len value.
Change-Id: I9a8f0b6877ce15f1e4672dd9dc884571de6f7f7e
Reviewed-on: https://code.wireshark.org/review/20510
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-03-22 05:04:21 +00:00
Simon Zhong 9ea5b08da6 BGP: Update Transitive Four-Octet AS-Specific Extended Community Sub-Types and remove duplicate marcos.
Change-Id: I87454ea95bc64a39e4e60ba374e9cafb574e744c
Reviewed-on: https://code.wireshark.org/review/20501
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>
2017-03-12 08:50:38 +00:00
Stig Bjørlykke f8abec1f37 bgp: Avoid divide by zero
Bug: 13476
Change-Id: I399df46c9d5f6d0d464ecc9cf8d44eddf709f7dc
Reviewed-on: https://code.wireshark.org/review/20499
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-03-11 23:57:56 +00:00
Simon Zhong 5b9879806d BGP: Fix the issue that SAFI 72 (BGP-LS-VPN) was not decoded.
Change-Id: I2aef41458c89975dddea4d8bb6355bb7aabd1cad
Reviewed-on: https://code.wireshark.org/review/20488
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-03-11 09:23:16 +00:00
Alexis La Goutte 43f2177d7c BGP: fix this statement may fall through [-Werror=implicit-fallthrough=] found by gcc7
Change-Id: I7cb6f73efb1e37eba977dc6912041d5969989696
Reviewed-on: https://code.wireshark.org/review/20399
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-03-06 01:50:38 +00:00
Alexis La Goutte 351e8924d3 BGP: Update some draft to final RFC
draft-ietf-idr-aigp -> RFC7311
draft-ietf-idr-ls-distribution -> RFC7752
draft-ietf-idr-large-community -> RFC8092

Change-Id: Ia05809ed88514f3a0c221af2aaea779f24be99e7
Reviewed-on: https://code.wireshark.org/review/20187
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-02-19 21:20:45 +00:00
Alexis La Goutte 9ce32f995c BGP: add Deprecated BGP Path Attribute (RFC 8093)
Change-Id: I18f01f8c989a8d25a168761f22b4cf6e2b51bf18
Reviewed-on: https://code.wireshark.org/review/20182
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-02-19 21:19:53 +00:00
Arjen Zonneveld 4a1150acdd Also show BGP Shutdown communication on admin reset
Shutdown communication is now also allowed on Admin Reset NOTIFICATION messages:
https://tools.ietf.org/rfcdiff?url2=draft-ietf-idr-shutdown-04.txt

Change-Id: I6450d3d5de5aef4bd709ba2b211ca717784b00a7
Reviewed-on: https://code.wireshark.org/review/19886
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2017-01-31 17:13:35 +00:00
Alexis La Goutte d4e3975ee7 BGP: Fix Dead Store (Dead assignement/Dead increment) Warning found by Clang
Change-Id: I0569326140c88a6dd2d7e2b8819c9f5323a98670
Reviewed-on: https://code.wireshark.org/review/19810
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-01-31 06:45:38 +00:00
Guy Harris 11574208e7 Clean up EVPN NLRIs dissection.
Do the NLRI length checks in the switch cases for each route type, and
do them for *all* route types, rather than throwing a random check in
for one particular route type.

There is no need to fail up front for unknown route types; at least
dissect the type and length, and fail in the switch statement.

Dissect the route descriptor in each of the switch cases, after the
length check, rather than doing it up front.

Add a comment noting where the prefix route type comes from.

Change-Id: Iae26ecd467d4b36dbcf52e7998bd2881405281aa
Reviewed-on: https://code.wireshark.org/review/19774
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-01-25 03:42:42 +00:00
Guy Harris 2e01a94028 That field is a route type, not an address family identifier.
Change-Id: I547dd12479b9634d8176eca9fd2ae6c9e1f87981
Reviewed-on: https://code.wireshark.org/review/19772
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-01-25 01:30:27 +00:00
Guy Harris 61de3e581f Clean up and update list of RFCs and I-Ds supported.
Change-Id: Ided8496b1d57a7906c805bca4ed848903d553721
Reviewed-on: https://code.wireshark.org/review/19771
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-01-25 00:51:23 +00:00
Guy Harris 7c014c044e Update comment, clean up identation.
Change-Id: I30812657e3fa5dc21e64ed2fb7605e5f2a36ab03
Reviewed-on: https://code.wireshark.org/review/19770
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-01-25 00:40:55 +00:00
Guy Harris 7cd6906056 Rename tvb_new_subset() to tvb_new_subset_length_caplen().
This emphasizes that there is no such thing as *the* routine to
construct a subset tvbuff; you need to choose one of
tvb_new_subset_remaining() (if you want a new tvbuff that contains
everything past a certain point in an existing tvbuff),
tvb_new_subset_length() (if you want a subset that contains everything
past a certain point, for some number of bytes, in an existing tvbuff),
and tvb_new_subset_length_caplen() (for all other cases).

Many of the calls to tvb_new_subset_length_caplen() should really be
calling one of the other routines; that's the next step.  (This also
makes it easier to find the calls that need fixing.)

Change-Id: Ieb3d676d8cda535451c119487d7cd3b559221f2b
Reviewed-on: https://code.wireshark.org/review/19597
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-01-10 06:19:37 +00:00
Arjen Zonneveld 79babc6f22 Add BGP dissector support for draft-ietf-idr-shutdown-01
Parse the communication bits of a BGP Cease NOTIFICATION:

Border Gateway Protocol - NOTIFICATION Message
    Marker: ffffffffffffffffffffffffffffffff
    Length: 146
    Type: NOTIFICATION Message (3)
    Major error Code: Cease (6)
    Minor error Code (Cease): Administratively Shutdown (2)
    BGP Shutdown Communication Length: 124
    Shutdown Communication: NTT will perform maintenance on this router. This is tracked in TICKET-1-24824294. Contact noc@ntt.net for more information.

Draft at https://tools.ietf.org/html/draft-ietf-idr-shutdown-01, sample
file taken from from http://instituut.net/~job/shutdown.pcap

Change-Id: I2ab633883cc69e560ff79cb6239e02fcffd71e10
Reviewed-on: https://code.wireshark.org/review/19144
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-12-13 08:59:30 +00:00
Dario Lombardo 4a3a6b1bbb bgp: remove dead code (CID 1158699).
Change-Id: Ib7f766819bb81858fa0c3a0b49fe39de7123bf6d
Reviewed-on: https://code.wireshark.org/review/18908
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-11-21 22:49:21 +00:00
Uli Heilmeier de5580a8ff BGP: Fix length in decode_prefix4()
When decode_prefix4() gets called with more prefixes the length of
proto_tree_add_subtree_format() should not be the total length.

As the "Withdrawn route" part was the only one where decode_prefix4() has
been called with a tlen not equal 0 we can eliminate the tlen parameter.

Bug: 13146
Change-Id: I708dec2cecbed6054b60190104b82c72d54e8037
Reviewed-on: https://code.wireshark.org/review/18852
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: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-11-17 06:49:57 +00:00
Arjen Zonneveld 021c79bdf7 Add BGP dissector support for draft-heitz-idr-large-community-04
Parses large communities as specified in https://tools.ietf.org/html/draft-heitz-idr-large-community-04
        Path Attribute - LARGE_COMMUNITY: 65536:1:1 65536:1:2 65536:1:3
            Flags: 0xc0, Optional, Transitive: Optional, Transitive, Complete
                1... .... = Optional: Optional
                .1.. .... = Transitive: Transitive
                ..0. .... = Partial: Complete
                ...0 .... = Length: Regular length
            Type Code: LARGE_COMMUNITY (32)
            Length: 36
            Large communities: 65536:1:1
                Global Administrator: 65536
                Local Data Part 1: 1
                Local Data Part 2: 1
            Large communities: 65536:1:2
                Global Administrator: 65536
                Local Data Part 1: 1
                Local Data Part 2: 2
            Large communities: 65536:1:3
                Global Administrator: 65536
                Local Data Part 1: 1
                Local Data Part 2: 3

Bug: 13083
Change-Id: I8db0601f621ceb6fb2e170ed9bfc2747091495ee
Reviewed-on: https://code.wireshark.org/review/18172
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-11-02 00:35:52 +00:00
Alexis La Goutte 9796e811f5 BGP: fix bgp.ls.tlv.link_protection_type_value is not of an FT_{U}INTn type]
Bug: 13021
Change-Id: I3464c7af61323efb25dd89655865d536aeae6e59
Reviewed-on: https://code.wireshark.org/review/18261
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-18 13:49:57 +00:00
Guy Harris 40e43f7a13 Note the registry for the bgp_l2vpn_encaps values.
Change-Id: Id8ccf81c08d84124e1d7361ce6e87080fa6b440d
Reviewed-on: https://code.wireshark.org/review/18128
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-10-09 07:10:21 +00:00
Michael Mann 268841f3e0 Combine Decode As and port preferences for tcp.port dissector table.
This patch introduces new APIs to allow dissectors to have a preference for
a (TCP) port, but the underlying data is actually part of Decode As functionality.
For now the APIs are intentionally separate from the regular APIs that register a
dissector within a dissector table.  It may be possible to eventually combine the
two so that all dissectors that register with a dissector table have an opportunity
to "automatically" have a preference to adjust the "table value" through the
preferences dialog.

The tcp.port dissector table was used as the guinea pig.  This will eventually be
expanded to other dissector tables as well (most notably UDP ports).  Some
dissectors that "shared" a TCP/UDP port preference were also converted. It also
removed the need for some preference callback functions (mostly when the callback
function was the proto_reg_handoff function) so there is cleanup around that.

Dissectors that has a port preference whose default was 0 were switched to using
the dissector_add_for_decode_as_with_preference API rather than dissector_add_uint_with_preference

Also added comments for TCP ports used that aren't IANA registered.

Change-Id: I99604f95d426ad345f4b494598d94178b886eb67
Reviewed-on: https://code.wireshark.org/review/17724
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-08 02:44:53 +00:00
Peter Palúch 0850c1f1db BGP: Support for Cost, EIGRP and OSPF extended communities
Bug: 12891
Change-Id: I70ed7f8a08122c559128b8df4d65e03be8201e1a
Reviewed-on: https://code.wireshark.org/review/17683
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Palúch <Peter.Paluch@fri.uniza.sk>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-09-26 05:00:28 +00:00
Peter Palúch f01190ca90 Reworked dissection of BGP Extended Community attributes
This patch contains a partial rewrite of the BGP dissector for Extended
Communities.  The changes were primarily motivated by my dissatisfaction
with the generally unreadable way in which the types, names and values of
BGP Extended Communities were displayed in Wireshark GUI.  The rewrite
provides a hopefully more readable and eye-pleasing way of displaying the
extended communities.  I have also corrected numerous other flaws with the
Extended Community dissector I stumbled across.

In particular, the changes encompass the following:

1.) The Type octet of an Extended Community is now analyzed including its
Authority and Transitivity bits.  These were not dissected before.

2.) Dissection for EVPN Extended Community was improved.  The original
implementation blindly assumed that there is just a single subtype and
decoded the community ignoring the actual subtype.

3.) I have removed the hf_bgp_ext_com_value_unknown16 and ..._unknown32.
The current code uses a different approach to display values of unrecognized
communities, and for recognized communities, there are no "unknown"
subfields.

4.) Removed a couple of variables declared at the
dissect_bgp_update_ext_com() level.  These stored the result of a
tvb_get_...() call but the value was used only once.  I have replaced them
with the direct use of tvb_get_...()

5.) Moved duplicate code to add the Type value into the community_tree from
each branch in the switch(com_type_high_byte) out of it and placed it before
the switch().

6.) Reworked the style in which individual communities are displayed.  Each
community item (collapsed) is now displayed using the following label
format:

Community name: Values [Generic community type]

Examples:

Route Target: 1:1 [Transitive 2-Octet AS-Specific]
Unknown subtype 0x01: 0x8081 0x0000 0x2800 [Non-Transitive Opaque]
Unknown type 0x88 subtype 0x00: 0x0000 0x0000 0x0000 [Unknown community]

6.) To keep the filter names more consistent, changed names of selected filters:

bgp.ext_com.type_high -> bgp.ext_com.type
bgp.ext_com.type_low -> bgp.ext_com.stype_unknown

In particular, I do not want to call the subtype as bgp.ext_com.type_low
because that filter applied only to unrecognized subtypes even though its
name would suggest to users that they can filter any community based on it.

7.) Numerous corrections in text labels, names and labels that have been
incorrect or incomplete.

Bug: 12794
Change-Id: I9653dbbc8a8f85d0cd2753dd12fd537f0a604cf3
Reviewed-on: https://code.wireshark.org/review/17377
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-09-02 19:59:30 +00:00
Alexis La Goutte d0e4e5259f BGP: Add no supported AFI/SAFI (Cisco) Open Message Error
Bug:12601
Change-Id: I555ee8097ea81e1afa8f2f5b2aba8fce60742016
Reviewed-on: https://code.wireshark.org/review/17107
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-08-18 02:16:32 +00:00
Dario Lombardo f0befede8b bgp: remove dead code (CID 1228878).
afi can take only one of the 2 above values, according to the
check at the beginning of the function.

Change-Id: I6652a5c64b4fbc8d2e907afb3b4f66d187ff9745
Reviewed-on: https://code.wireshark.org/review/17011
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-08-12 11:36:51 +00:00
Alexis La Goutte d860d5a74b BGP: Fix Dead Store (Dead assignement/Dead increment) Warning found by Clang
Change-Id: Iaec85cbe8fbced461a56f55f8813506054356369
Reviewed-on: https://code.wireshark.org/review/16688
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-07-26 11:31:02 +00:00
Matt Texier d3ce757de0 MP-BGP dissector: Fix EVPN route type 5 decoding
Route type 5 do have optional fields that was not properly decoded (MPLS labels)

Bug: 12631
Change-Id: I12d61ef170d4e0f6e6d2c7bf25f149db84c186d7
Reviewed-on: https://code.wireshark.org/review/16576
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>
2016-07-26 04:02:03 +00:00
Alexis La Goutte f2584b230a BGP: Add support of Vendor Capability 131 (Multisession Cisco)
Issue reported by Garri Djavadyan

Change-Id: I6dd4bd20d82a3f2cb8aa45f740f72d33e33053da
Ping-Bug:12604
Reviewed-on: https://code.wireshark.org/review/16374
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-07-10 21:32:48 +00:00
Alexis La Goutte 393207582f BGP: Add (Cisco) for "Vendor" Cisco capability
* Route Refresh Cisco capability (128)
* ORF Cisco capability (130)

Issue reported by Garri Djavadyan

Bug: 12605
Change-Id: Icb19cd6a75315e5af4772dd7833a5b762bdd7ff4
Reviewed-on: https://code.wireshark.org/review/16373
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-07-10 21:32:06 +00:00
Dario Lombardo 1eea415a52 bgp: add return check (CID 1354417).
Change-Id: Id8be1d5f6346686087d747167ec44df2b88dd35e
Reviewed-on: https://code.wireshark.org/review/16304
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Dario Lombardo <lomato@gmail.com>
2016-07-05 21:39:18 +00:00
Matt Texier 1f28e683f9 BGP: Fixed an side effect of length coding on offset
Bug: 12568
Change-Id: Ibf063293041d749664f6e6ecd2455024ea3fd4ed
Reviewed-on: https://code.wireshark.org/review/16237
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-07-02 14:15:17 +00:00
Matt Texier e55eaf573b BGP dissector: Fixing NLRI length for flow spec NLRI
Bug: 12568
Change-Id: Id2b89c2d133865771e21acf3ee224f57ac9d262b
Reviewed-on: https://code.wireshark.org/review/16203
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-06-30 05:39:44 +00:00
Jim Young 4b66b32fb3 Resolve false positive ERROR: NO ARRAY found in ei array entries
The enhanced checkhf.pl in https://code.wireshark.org/review/#/c/15717/
validates ei items in addition to href items.   This patch addresses the
false positive ERRORS reported by the enhanced checkhf.pl for a "cosmetic"
issue (missing space after { in ei array entries).

Change-Id: I87876ce2cfa4b0e11cb22f457bd9ab025d939e5c
Reviewed-on: https://code.wireshark.org/review/15739
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-06-05 22:31:37 +00:00
Alexis La Goutte 46dd8a0aa4 BGP : Add Virtual-Network Identifier Extended Community
From draft-drao-bgp-l3vpn-virtual-network-overlays

Change-Id: I0a0137b6a8b8fbb4b4efd6f5e08eba5ed6d7a9d6
Reviewed-on: https://code.wireshark.org/review/15477
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-05-18 14:32:52 +00:00
Francesco Fondelli 1c862d2584 BGP-LS: fix Prefix-SID parsing, add SR-Capabilities and SR-Algorithm
dissection.

- 20 *rightmost* bits of the 'SID/Label' field represent
  a MPLS label (Adjacency-SID already fixed).
- Add support for SR-Capabilities (TLV 1034) and SR-Algorithm
  (TLV 1035) dissection (draft-gredler-idr-bgp-ls-segment-routing-ext-01).

Change-Id: Ib02137f1c41c4a201afee5d61cf2b6bf88d59991
Signed-off-by: Francesco Fondelli <francesco.fondelli@gmail.com>
Reviewed-on: https://code.wireshark.org/review/15306
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-05-10 13:47:07 +00:00
Uli Heilmeier 48b807a364 BGP: Fix detection of additional path
When additional path index are in use there must be more remaining data bytes.
Therefore we return only 1 when the len is greater 1.

Bug has been reported by Garri.

Bug: 12240
Change-Id: Ia24311dcedc450e4208df875bc254c9744dec5dd
Reviewed-on: https://code.wireshark.org/review/14396
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-08 17:43:43 +00:00
Francesco Fondelli 5d00f39d10 BGP-LS: Protocol-ID aware Prefix/Adj Flags dissection
BGP-LS is just a collector of IGP link state information. Some
fields are encoded "as-is" from the IGP, hence in order to dissect
them properly we must be aware of their origin, e.g. IS-IS or OSPF.
So, *before* dissecting LINK_STATE attributes we must get the
'Protocol-ID' field that is present in the MP_[UN]REACH_NLRI
attribute. The tricky thing is that there is no strict order for path
attributes on the wire, hence we have to keep track of 1) the
'Protocol-ID' from the MP_[UN]REACH_NLRI and 2) the offset/len of
the LINK_STATE attribute. We store them in per-packet proto_data and
once we got both we are ready for the LINK_STATE attribute dissection.

Change-Id: Ibe2b7f5c9039ad63a72f3f9fb8a9c33c0be44ed0
Signed-off-by: Francesco Fondelli <francesco.fondelli@gmail.com>
Reviewed-on: https://code.wireshark.org/review/13970
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: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-02-23 13:08:38 +00:00
Francesco Fondelli ec70af4b6a BGP-LS: fix Adjacency-SID parsing
if length is set to 7 then the 20 *rightmost* bits of
the 'SID/Label/Index' field represent a MPLS label.

Change-Id: If196af244549b75a80de11c1d8e11507e9a6ce58
Signed-off-by: Francesco Fondelli <francesco.fondelli@gmail.com>
Reviewed-on: https://code.wireshark.org/review/13848
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-02-10 07:34:06 +00:00
Francesco Fondelli dfc9f0b038 BGP-LS: fix 'TE Default Metric TLV' and 'IGP Metric TLV' length
parsing

Change-Id: I55d0b435ae1b12e14a20dd9ea18ba05188b0e378
Signed-off-by: Francesco Fondelli <francesco.fondelli@gmail.com>
Reviewed-on: https://code.wireshark.org/review/13666
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-02-02 22:59:24 +00:00
Francesco Fondelli c7798d608c BGP: Link-State extensions for Segment Routing as per
draft-gredler-idr-bgp-ls-segment-routing-ext-01

Bug: 12060
Change-Id: I53c837ac5c195bdee716a48d8494633b663e751d
Signed-off-by: Francesco Fondelli <francesco.fondelli@gmail.com>
Reviewed-on: https://code.wireshark.org/review/13579
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-02-01 17:48:45 +00:00
Peter Wu bf0f5a982b Use result of register_dissector
Assign result of `register_dissector(..., func, proto)` to FOO_handle
and remove `FOO_handle = create_dissector_handle(func, proto)`.

Found by looking for files named packet-FOO.c having the above
create_dissector_handle pattern. Some files (with different dissect
routines for the two functions) remain unchanged.

Change-Id: Ifbed8202c6dbc63a1dae9acc03313980ffbbbb90
Reviewed-on: https://code.wireshark.org/review/13247
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-01-13 11:36:29 +00:00
moshekaplan cd7026951b Fix a lot of typos and misspellings
Change-Id: I8512cfa1d424f82a873a0e0e1d22c7b075fdd7f3
Reviewed-on: https://code.wireshark.org/review/13069
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-01-08 20:04:56 +00:00
Guy Harris 32f9f92487 Rename ipv4_addr and ipv6_addr to indicate their full contents.
They're not just addresses, they also include a mask length for IPv4 and
a prefix length for IPv6.  Rename them appropriately.

Rename the old ipv4_addr_and_mask() and ipv6_addr_and_mask() to reflect
that 1) they fetch data from a tvbuff and 2) *don't* fetch the mask
length or prefix length, those lengths are passed as arguments to
indicate how many bytes worth of address to fetch.

Change-Id: I4cad5a186ad7bfcb60022a91dbe8bc8479e6471f
Reviewed-on: https://code.wireshark.org/review/13035
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-04 00:03:34 +00:00
Stig Bjørlykke e1ed7598ee Removed local definitions of offsetof().
The offsetof() macro is an ANSI C library feature.

Change-Id: I2ac91b0b4c94c6f6baf14133b076fdc5ed2e182b
Reviewed-on: https://code.wireshark.org/review/12707
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-12-18 05:49:45 +00:00
Alexis La Goutte 9c47cb4254 Fix Recurring check found by PVS Studio (V571)
packet-ncp2222.inc: The 'ncp_rec->func == 0x59' condition was already verified in line 7300.
packet-bgp: The 'nlri_len < 21' condition was already verified in line 3879
packet-rtp.c: The 'p_conv_data' condition was already verified in line 1460

Change-Id: I65299718b26454596e3f25665d413a17a99e4ce0
Reviewed-on: https://code.wireshark.org/review/12341
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-12-11 05:13:54 +00:00
Michael Mann 31a54708f4 new_register_dissector -> register_dissector for dissector directory.
Change-Id: Ie39ef054a4a942687bd079f3a4d8c2cc55d5f22c
Reviewed-on: https://code.wireshark.org/review/12485
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-09 12:38:06 +00:00
Michael Mann 443a7ed259 new_create_dissector_handle -> create_dissector_handle for dissector directory.
Some of the ASN.1 dissectors still generate a new_create_dissector_handle from the tool itself, so leave those for now.

Change-Id: Ic6e5803b1444d7ac24070949f5fd557909a5641f
Reviewed-on: https://code.wireshark.org/review/12484
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-09 12:37:36 +00:00
Matt Texier d0cde7b8e2 BGP: fix some issue
Fixing ESI Label extended community
Fixing PMSI label field decoding on 20 bits
Fixing inclusive multicast Ethernet tag route
Fixing Ethernet segment route

Bug: 11650
Change-Id: Ifadcc3099f681a5c9480d1ccdd50b29ef4c0069f
Reviewed-on: https://code.wireshark.org/review/12430
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-05 12:04:24 +00:00
Matt Texier 6ffac79751 Adding RFC5512 extended community
BGP: add the ability to decode Opaque extented community and in particular tunnel type

Change-Id: Ife53a267a2311397123a4e670924c673904bccbd
Ping-Bug: 11650
Reviewed-on: https://code.wireshark.org/review/12076
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-24 00:29:47 +00:00
Michael Mann 2bbbb4879c register_dissector -> new_register_dissector
Change-Id: Ic368dd8e83cf39e0c934da0ae2744778e2d54ce6
Reviewed-on: https://code.wireshark.org/review/12050
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-11-23 13:09:55 +00:00
Matt Texier 84ab0e43f3 BGP: Add dissection of ESI NLRI (EVPN) RFC7432
Ping-Bug: 11650
Change-Id: I1e6418afe1d02da9f30c429c0220932d74344b8d
Reviewed-on: https://code.wireshark.org/review/11775
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-18 00:29:45 +00:00
Guy Harris ff9f9fc431 Don't include "file.h" if you don't need it.
It ends up dragging in libwireshark headers, which programs not linking
with libwireshark shouldn't do.  In particular, including
<epan/address.h> causes some functions that refer to libwireshark
functions to be defined if the compiler doesn't handle "static inline"
the way GCC does, and you end up requiring libwireshark even though you
shouldn't require it.

Move plurality() to wsutil/str_util.h, so that non-libwireshark code can
get it without include epan/packet.h.  Fix includes as necessary.

Change-Id: Ie4819719da4c2b349f61445112aa419e99b977d3
Reviewed-on: https://code.wireshark.org/review/11545
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-11-04 08:46:30 +00:00
Jeff Morriss 7f591e4c07 Clean up more unnecessary use of the 'volatile' key word.
Change-Id: I3e72fddc6ed380780d7e2e1c8df87e580138188d
Reviewed-on: https://code.wireshark.org/review/11271
Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-26 11:28:41 +00:00
Gerald Combs 86fe2be4dc Use address functions instead of ADDRESS macros in asn1 and epan
Replace CMP_ADDRESS, COPY_ADDRESS, et al with their lower-case
equivalents in the asn1 and epan directories.

Change-Id: I4043b0931d4353d60cffbd829e30269eb8d08cf4
Reviewed-on: https://code.wireshark.org/review/11200
Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-22 11:45:56 +00:00
João Valverde a643d14187 Change proto_tree_add_ipv6() to take a struct e_in6_addr pointer
tvb_get_ipv6() takes a struct e_in6_addr *, use that here too.

Change-Id: Id8b368daa05c151a61d4bc01dc88c00da13e9c88
Reviewed-on: https://code.wireshark.org/review/10953
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: Balint Reczey <balint@balintreczey.hu>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-10-14 12:18:00 +00:00
Alexis La Goutte cc1c23a980 BGP: Add BGP-Extended Message Capability
From draft-ietf-idr-bgp-extended-messages
Update BGP Capability Codes to 2015-09-30

Change-Id: I2f3b44ad8ad7a9e5444cdfbfb22bf7d0538ffbfc
Reviewed-on: https://code.wireshark.org/review/10826
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-07 02:43:46 +00:00
Alexis La Goutte 2de799fb8d BGP: Update BGP Capability List
from IANA capability-codes 2015-07-23
* draft-ietf-idr-bgp-enhanced-route-refresh => RFC7313
* Add CP-ORF (RFC7543)
* Add FQDN draft-walton-bgp-hostname-capability

Change-Id: I9de73be9eca1ed2456d4a15150b040454eb01add
Reviewed-on: https://code.wireshark.org/review/10442
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-09-08 11:15:12 +00:00
guydavies ad46641eae BGP: Fix typo
Change-Id: I2d33af7da22fee543d08624d06ca8880472f3586
Reviewed-on: https://code.wireshark.org/review/10377
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-09-04 10:31:03 +00:00
Pyeole faaa6f2a34 BGP: fixed incorrect NLRI decoding
Bug: 11308 
Change-Id: I967b9596edad1e3656e139d0ca3a0e3c389d80ea
Reviewed-on: https://code.wireshark.org/review/10308
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-08-30 13:48:31 +00:00
Pascal Quantin 9223567993 BGP: fix an infinite loop when finding an invalid length in EVPN NLRI Route Type 5 option
Bug: 11256
Change-Id: I6fb037d8a3b8b0f22ebea6d08f69fb8afeed90f9
Reviewed-on: https://code.wireshark.org/review/8835
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-06-08 10:04:04 +00:00
Alexis La Goutte a36f6c58ca BGP: MP (UN)REACH NLRI SAFI is 1 octet long
Break when remove proto_tree_add_text (g1307c2255f)

Change-Id: Id5512424180b4834c20fa5416499fc939c06d1ea
Reviewed-on: https://code.wireshark.org/review/8774
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-06-05 11:28:14 +00:00
Matthieu Texier be8a7c3750 BGP: Add EVPN draft-rabadan-l2vpn-evpn-prefix-advertisement support
Bug: 11252
Change-Id: I125e3075125451d2cbeac6cc183977e73040887f
Reviewed-on: https://code.wireshark.org/review/8767
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-06-05 10:33:14 +00:00
Alexis La Goutte a461e23d0e BGP: remove proto_tree_add_text call
Part7
Fix last proto_tree_add_text (use expert info)

Change-Id: I9c4c053e5fc94f57608c7ee8355e6e16f8af6bd1
Reviewed-on: https://code.wireshark.org/review/8697
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-05-30 11:42:32 +00:00
Alexis La Goutte 392d3a5002 BGP: remove proto_tree_add_text call
Part6
Update SAFNUM_TUNNEL

Change-Id: I4a3486f3fd12a624caa11e4ab424b26081b5b9ab
Reviewed-on: https://code.wireshark.org/review/8696
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-05-30 11:33:24 +00:00
Alexis La Goutte 2d40489497 BGP: remove proto_tree_add_text call
Part 5
Update SAFNUM_LAB_VPNUNIMULC/SAFNUM_LAB_VPNMULCAST/SAFNUM_LAB_VPNUNIMULC
Simplify code but no tested on real pcap

Change-Id: I02fc1bc8d4b406f34918130d1eb24d514c24385c
Reviewed-on: https://code.wireshark.org/review/8695
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-05-30 11:28:11 +00:00
Alexis La Goutte c2bad0cec4 BGP: Remove proto_tree_add_text call
Part 4
Update BGP Type TUNNEL_ENCAPS_ATTR

Change-Id: Ib166cf42e4eee3513f4c2f64e18eb5de2ed4acf2
Reviewed-on: https://code.wireshark.org/review/8694
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-05-30 05:55:51 +00:00
Alexis La Goutte 1307c2255f BGP: Remove proto_tree_add_text call
Part 3
Update BGP Type MP REACH NLRI, MP UNREACH NLRI and SAFI_SPECIFIC_ATTR

Change-Id: I28bc1385cf75b99739946e91d52c4d654ba525d3
Reviewed-on: https://code.wireshark.org/review/8693
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-05-30 05:53:27 +00:00
Alexis La Goutte cff7bcd90b BGP: Remove proto_tree_add_text call
Part 2
Update VPLS-BGP and BGP-AD

Change-Id: I6a311bfc69d9666be6f83e38042745162701aaac
Reviewed-on: https://code.wireshark.org/review/8485
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-05-19 11:50:00 +00:00
Alexis La Goutte 87bfae7ec4 BGP: Remove proto_tree_add_text call
Part 1

Change-Id: Icbc73690370eba07e77b35d2815346f1d5a44347
Reviewed-on: https://code.wireshark.org/review/8386
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-05-11 14:25:28 +00:00
Michael Mann aeb9827e4a Convert proto_tree_add_boolean to proto_tree_add_bitmask_[value|value_with_flags|list]
Part 1 of a few

Change-Id: I413f23dfa92da5488ca8a7f62ca0738b25004635
Reviewed-on: https://code.wireshark.org/review/8117
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-04-18 16:32:27 +00:00
AndersBroman 05c0152370 Replcae deprecated API tvb_length with tvb_reported_length or tvb_captured
length.

Change-Id: Id42f3409a32e202528d350f7afde7376e411fc51
Reviewed-on: https://code.wireshark.org/review/8076
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-04-15 15:22:42 +00:00
Ebben Aries 23c6a0f97f [bmp] Support for decoding of BGP Peer Distinguisher
re-utilize decode_bgp_rd() logic from packet-bgp

Change-Id: I588a58e0b2f7da5d3c9b86b28abb9c5b29e0dc8f
Reviewed-on: https://code.wireshark.org/review/7537
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-03-05 15:39:48 +00:00
Ebben Aries a6c44c2402 [bmp] Adding dissector for BGP Monitoring Protocol
* Support per draft-ietf-grow-bmp-07

Change-Id: Iadb833157e7832077429c048e28e9814da29e2c6
Reviewed-on: https://code.wireshark.org/review/7192
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-02-19 18:36:53 +00:00
Alexis La Goutte b41065e223 BGP: EVPN - Route Type 4 - "Invalid length of IP Address" - "Expert Info" shows a false error
Wrong offset (14 -> 20) to get IP Address Legnth

Issue Reported by Rui
Bug: 10873

Change-Id: Ib7aa80ac78028a2c8d548f4030278166be9ed0cc
Reviewed-on: https://code.wireshark.org/review/6657
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-01-19 20:34:21 +00:00
Alexis La Goutte 9fd507827e BGP: fix field bgp.evpn.nlri.mpls_ls is not of type FT_STRING, FT_STRINGZ, or FT_STRINGZPAD
Change-Id: Ida14611dee9eb01e1eab13a96c15ab3d759ed1cd
Reviewed-on: https://code.wireshark.org/review/6656
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-01-19 20:33:39 +00:00
Michael Mann 20414ebf4b Replace some ep_alloc and ep_alloc0 with its wmem equivalent.
These cases were pretty easy to identify.  Also replaced some comments that referenced ep_alloced memory, when it's now in fact wmem_alloced.

Change-Id: I07d2f390a9c0b34aa2956880476755d1acf5db0a
Reviewed-on: https://code.wireshark.org/review/6392
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>
2015-01-08 07:24:15 +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
Ebben Aries a3d946ce56 BGP : Simple typo fix for BGP Attribute
Change-Id: I793eed5c7d63c82e13847c8a6c8fd6def3025b8c
Reviewed-on: https://code.wireshark.org/review/6158
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Tested-by: Hadriel Kaplan <hadrielk@yahoo.com>
2014-12-31 08:03:25 +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
Pascal Quantin ea6a5780c5 Try to fix compilation broken by g3d3f973
Change-Id: I26833e9a4f7557b5824effaff16b38d2c4367772
Reviewed-on: https://code.wireshark.org/review/6059
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-12-26 21:50:24 +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 596669f921 First batch of unincludes. Last attempt...
Change-Id: I3681462aeb98ca62ed3ec5eb226b2553317391a9
Reviewed-on: https://code.wireshark.org/review/5997
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-12-22 21:03:13 +00:00
Ebben Aries 859360a6c4 BGP : Update BGP-LS Attribute + Display NEXT_HOP
From IANA page: http://www.iana.org/assignments/bgp-parameters/bgp-parameters.xhtml

Change-Id: Ibc85dccee94aa69306c88b48d680e48fede08f2e
Reviewed-on: https://code.wireshark.org/review/5965
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-22 02:58:55 +00:00
Guy Harris c30aa115fe Register the ORFEntry IP address as an IPv4 address.
We're adding it with proto_tree_add_ipv4(), so that it's displayed as,
and can be tested as, an IPv4 address.  That means that the field for it
must be of type FT_IPv4, *even though it's calculated from an 8-bit
prefix value* - you can't make it an FT_UINT8.

Change-Id: I7d668fb2a707cdda4ad228afcbdcaf47ee6cba1b
Reviewed-on: https://code.wireshark.org/review/5960
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-21 23:36:04 +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 f412c9a01a Use ENC_BIG_ENDIAN when fetching FT_U?INT8 fields ...
(for some dissectors which fetch all other integral fields using
   ENC_BIG_ENDIAN).

Change-Id: Ic18e3172aad76af12b12d6732c88497be22aed56
Reviewed-on: https://code.wireshark.org/review/5748
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-13 18:45:56 +00:00
Yann Lejeune 0ef1aef2df BGP: add support of RFC6368 - Internal BGP as the Provider/Customer Edge
Protocol for BGP/MPLS IP Virtual Private Networks (VPNs).

Bug: 10762
Change-Id: Ifbe2af639ee5a2d96ec3546708060cadcc349df2
Reviewed-on: https://code.wireshark.org/review/5664
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-12-11 13:55:22 +00:00
Yann Lejeune 9036f09335 BGP: extract the bgp path attribute dissection to a dedicated function.
Change-Id: I228f1402007d8570bfdeb0105ce5e89c48357481
Reviewed-on: https://code.wireshark.org/review/5721
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-12-11 13:55:13 +00:00
Michael Mann e050ad27a4 Eliminate some proto_tree_add_text in packet-bgp.c
Change-Id: I05fabe9786125e2167fe4010733f61000d0e7914
Reviewed-on: https://code.wireshark.org/review/5670
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Matthieu Texier <matthieu@texier.tv>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-12-10 08:50:27 +00:00
Bill Meier c681091a2a Fix instances of duplicate display-filter-names with incompatible types.
Change-Id: I3b5afb8a59f6443624708b9fecfdcbe93dad59ef
Note: Some of the filters, when/if used, could have caused Wireshark crashes.
Reviewed-on: https://code.wireshark.org/review/5575
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-02 22:40:26 +00:00
Matthieu Texier f260f9aa2d BGP: Incorrect decoding AS numbers when mixed AS size
Fix AS Path Heuristic

Issue reported by Jon

Bug: 10742
Change-Id: Ie5e4108bd93464a2d1076dcc4f322171ea8e68cb
Reviewed-on: https://code.wireshark.org/review/5564
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-12-02 09:38:39 +00:00
Yann Lejeune 05c1aa2231 BGP: fix dissection of BGP community tag
The offset used for BGP community tag dissection is a wrong one.

Bug: 10746
Change-Id: I1d1d443568bb97a0b3b95a312762ac0a3102326a
Reviewed-on: https://code.wireshark.org/review/5562
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-12-01 18:57:36 +00:00
Bill Meier c28f280c1d Fix a number of dup hf[] filter-names probably resulting from cut/paste errs.
Change-Id: I9242300b2ace3155c1506b584a90f073100a305e
Reviewed-on: https://code.wireshark.org/review/5512
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-11-26 23:27:31 +00:00
Michael Mann a2c2f872f4 Remove the use of pinfo->private_data from dissectors that just save it to restore it.
Change-Id: I13197cc48068bb35ee12a7023cfe5f76bbc4e264
Reviewed-on: https://code.wireshark.org/review/5486
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-11-26 16:20:59 +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
Michael Mann 3df42e79a5 proto_tree_add_text cleanup
Create filters (expert and hf_) that have the "most bang for the buck" (ie have many instances for a single filter)

Change-Id: I61995e41c5b298df77e084e65cdf30ebe95da1e6
Reviewed-on: https://code.wireshark.org/review/4086
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-09-12 05:51:11 +00:00
Matthieu Texier d127b57311 BPG : issue with BGP AS path heuristic (AS_CONFED_SET)
Add also a expert info when unable determine ASN length (2 or 4 bytes)



Bug: 10399
Change-Id: I24978e29e24f38c2e01e4b953a5a51496f0cf5a6
Reviewed-on: https://code.wireshark.org/review/3831
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-08-25 15:00:12 +00:00
Evan Huus fade4b4d97 Fix another (valid) complaint from the mac buildbot
What mystical new compiler upgrade is this?

Change-Id: I89b3bfb53b9a19bbfb1cc8339d38cdc4a4652c62
Reviewed-on: https://code.wireshark.org/review/3347
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-08-02 02:14:12 +00:00
Alexis La Goutte fbc1a9af14 Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
Change-Id: I847c7217b520a5f7ec581e6170fe3dc77c628e96
Reviewed-on: https://code.wireshark.org/review/3322
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-08-01 18:02:20 +00:00
Matthieu Texier 4a1bd421c4 Bug 10302 - BGP attribute AIGP (draft-ietf-idr-aigp) not decoded - Fix
Change-Id: Ib8b3c5666932777218e33b74cca33b791c883fc9
Reviewed-on: https://code.wireshark.org/review/3226
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-29 01:45:56 +00:00
Matthieu Texier e95083d264 Support of draft-ietf-idr-flow-spec-v6 and some cosmetic improvments
Change-Id: Ieaf23c84d67ccdfdcb167afb382c86797bc1cd2b
Reviewed-on: https://code.wireshark.org/review/3006
Reviewed-by: Evan Huus <eapache@gmail.com>
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-18 05:34:39 +00:00
Michael Mann 188aa9a80e convert to proto_tree_add_subtree[_format]
Change-Id: Ib60ca75b7da8cfa21cfe2999c9b9448a02c332df
Reviewed-on: https://code.wireshark.org/review/2560
Tested-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-22 21:07:16 +00:00
Michael Mann daa70feddc Revert "Fixup: tvb_ensure_length_remaining -> tvb_ensure_captured_length_remaining"
See https://www.wireshark.org/lists/wireshark-dev/201406/msg00131.html

This reverts commit 021e7afc9f.

Change-Id: I0640eabce5ce8c4ff3a88ebf848b499f8bb8ed2f
Reviewed-on: https://code.wireshark.org/review/2429
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-19 17:23:41 +00:00
Dario Lombardo 021e7afc9f Fixup: tvb_ensure_length_remaining -> tvb_ensure_captured_length_remaining
Change-Id: I0228f3b6b7067bc0ce51f9d359f99fd18feb2b66
Reviewed-on: https://code.wireshark.org/review/2378
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-18 14:20:32 +00:00
Matthieu Texier e9e4277f2a Add support of RFC 6514 PMSI bgp attribute and tunnel ID decoding
Change-Id: Ia170002fb5af5f6548595688956cc01ec4a72298
Reviewed-on: https://code.wireshark.org/review/960
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-04-14 16:44:50 +00:00
Bill Meier 4fbcfc1289 (Benign) Don't use "address-of" operator on arg of VALS() (not that it makes any actual difference)..
Change-Id: I0766d0f130648aaa5a58d9f4062fa24e898cbdc3
Reviewed-on: https://code.wireshark.org/review/545
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Tested-by: Bill Meier <wmeier@newsguy.com>
2014-03-07 05:03:41 +00:00
Bill Meier 7a4702d9d8 Ue TFS & VALS macros for certain 'fieldconvert' fields.
Change-Id: I8d7468e62d5de99eb68b554134be71b17d1b87c8
Reviewed-on: https://code.wireshark.org/review/525
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Tested-by: Bill Meier <wmeier@newsguy.com>
2014-03-06 03:19:41 +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
Michael Pergament 2da9162402 Enhance BGP Dissector
Add 
* BGP MPLS Based Ethernet VPN dissector (draft-ietf-l2vpn-evpn-05)
* PMSI Tunnel Attribut dissector (RFC6514)

Change-Id: I02caa67fc371bbc9666f343e20fa678e8b029a59
Reviewed-on: https://code.wireshark.org/review/296
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-02-25 20:12:13 +00:00
Alexis La Goutte b7bd4ff7ae Fix -Wunused-const-variable found by Clang
Change-Id: I57cfafea0e3110553ef03a34baad217f8109942d
Reviewed-on: https://code.wireshark.org/review/320
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-02-24 20:42:44 +00:00
Alexis La Goutte e009dc9843 Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
Change-Id: Ic3a240a2e751700f653287dd84fe58016adab9e2
Reviewed-on: https://code.wireshark.org/review/297
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-02-21 20:49:35 +00:00
Matthieu Texier e1b265596b Moving custer list/cluster id attribut to items
Change-Id: If23c530b10c67613311aa8a8a1b1a8acf95f3c48
Reviewed-on: https://code.wireshark.org/review/294
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-02-21 16:56:02 +00:00
Matthieu Texier 64b474610c BGP : clean up of unused define and adding amount of ext-communities in community item
Change-Id: I55793e522d0bdaee0f19ca020a8ef0097f5fb5f1
Reviewed-on: https://code.wireshark.org/review/255
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-02-20 18:22:13 +00:00
Bill Meier 5a775b12c9 Fix incorrect definition and use of a val64_string which caused a crash.
Change-Id: Ib15ddef167c0e2af24938fc5bb68839eac65ca2c
Reviewed-on: https://code.wireshark.org/review/258
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Tested-by: Bill Meier <wmeier@newsguy.com>
2014-02-19 20:54:05 +00:00
Alexis La Goutte ff52d8b70f BGP : Update Capability Codes
From IANA page: http://www.iana.org/assignments/capability-codes/capability-codes.xhtml
Use decimal value (like iana page)
Fix Dynamic Capability value...

Change-Id: I9a6e672de840403943792b6ba4d913b186b1d09f
Reviewed-on: https://code.wireshark.org/review/243
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-02-17 22:25:09 +00:00
Alexis La Goutte 49abfc47cc Display the number of unknown BGP Path Attribut (use val_to_str)
Change-Id: I6aed8ee3a92cc08aebfef58372285bed5a62e8bd
Reviewed-on: https://code.wireshark.org/review/240
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-02-17 11:23:37 +00:00
Matthieu Texier 1eeb33a7b0 Redesign of BGP ext-com in a separate function, alignement with RFC and IANA, use of items instead of add_text
Change-Id: I4af2ee8e760aa80eeb28f71e93f8948ef5b26eb5
Reviewed-on: https://code.wireshark.org/review/95
Reviewed-by: Evan Huus <eapache@gmail.com>
Tested-by: Evan Huus <eapache@gmail.com>
2014-02-13 22:27:36 +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
Bill Meier 80b5c57713 Fix: value string specified as a BASE_VAL64_STRING in
an hf[] entry but defined as a 'value_string' intead of
 as a 'val64_string'.

Caused 'tshark -G values' to crash
 (and presumably would also cause a crash when the value-string
  is referenced in a dissection):

Introduced in svn #54728

(Note: There's still another 'tshark -G values' crash to to found & fixed)


svn path=/trunk/; revision=54983
2014-01-27 17:20:44 +00:00
Guy Harris 7ef949bc39 No reason for decode_bgp_rd()'s return value to be non-const, so make it
const.

svn path=/trunk/; revision=54734
2014-01-13 22:38:56 +00:00
Alexis La Goutte 10345a6b2e From Miroslav Miklus via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9504 Enhance BGP dissector : bgp-ls dissector (draft-ietf-idr-ls-distribution-04)
BGPTYPE_LINK_STATE_ATTR is temporarily set to 99, would need change when IANA allocate a Path Attribute value for BGP-LS

From me :
* Fix indent
* fix arg encoding (via encoding-args tools)

svn path=/trunk/; revision=54728
2014-01-13 22:24:32 +00:00
Jakub Zawadzki deb2b236f2 Add missing includes
svn path=/trunk/; revision=54332
2013-12-21 17:23:17 +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
Alexis La Goutte 50989f30a3 From Matt Texier
Enhance BGP Dissector : Communities

Use proto_tree_add_item

From me
Missing space for well known community

svn path=/trunk/; revision=53783
2013-12-04 15:13:24 +00:00
Alexis La Goutte 785ebdc13c From Matt Texier Enhance BGP Dissector : AS_PATH
Full rewrite of BGP AS_PATH attribut using items and a clearer (and documentated !) heuristic

From me
Fix indent

svn path=/trunk/; revision=53419
2013-11-18 22:02:50 +00:00
Jakub Zawadzki ae59b09443 Add missing includes in order to remove exceptions.h from proto.h (next commit).
svn path=/trunk/; revision=53230
2013-11-10 15:59:37 +00:00
Pascal Quantin 6cedc2c336 Convert a few more dissectors to wmem
svn path=/trunk/; revision=51991
2013-09-12 22:03:31 +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
Alexis La Goutte 90e273cb91 Enhance BGP Update
Step 4 : Convert proto_tree_add_text calls to proto_tree_add_item and use new name of RFC4271 (  Withdrawn Routes Length ...)

svn path=/trunk/; revision=51184
2013-08-07 12:05:23 +00:00
Alexis La Goutte 8da9a76650 From Matt Texier
Enhance BGP Dissector

Step 3 :Variable consistency and renaming, adding RFC and draft as comments (Preperation for next enhance...)

From me :
Fix some typo/whitespace
Make checkhf happy...

Signed-off-by: Alexis La Goutte <alexis.lagoutte@gmail.com>

svn path=/trunk/; revision=51182
2013-08-07 12:04:04 +00:00
Alexis La Goutte f15a20c9f0 Enhance BGP Update (Path Attribute)
Step 2 ! Make Path Attribute field filterable...

svn path=/trunk/; revision=50918
2013-07-26 16:26:29 +00:00
Alexis La Goutte 54fc4025e6 Enhance BGP Update
First step ! Remove ugly double switch(bgpa_type)... (use proto_item_append_text)

svn path=/trunk/; revision=50917
2013-07-26 16:26:21 +00:00
Alexis La Goutte c44977663a From Matt Texier via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8691 Improvement of previous support of RFC5575 BGP flow spec
From me
* Enhance and fix some display tree stuff
* Add Matt to AUTHORS

svn path=/trunk/; revision=50534
2013-07-12 13:55:29 +00:00
Michael Mann 6b3ac2d952 Batch of filterable expert infos.
svn path=/trunk/; revision=50454
2013-07-09 01:18:52 +00:00
Alexis La Goutte 8e4e4a3d76 From report of Alexander Okonnikov and Patch of Matt Texier via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8802 Incorrect decoding of Layer2 Info Extended Community
Within BGP Update message for BGP VPLS (RFC 4761) some parts of Extended Community "Layer2 Info" are incorrectly decoded:

1. Encapsulation - Unknown (0x13). Per RFC 4761 encap type 0x13 is "VPLS" (clause 3.2.4);

2. Control Flags - per RFC 4761 (clause 3.2.4) two least-significant bits (6 and 7) are defined as:
"C" (bit 6, Control Word): value 1 - Control Word is required - and value 0 - Control Word is not required; decoding is correct (at least for value 0);
"S" (bit 7, Sequence delivery): value 1 - Sequence delivery is required - and value 0 - Sequence delivery is not required; decoding is incorrect, because for value 0 (sequence delivery is not required) you provide description that "Sequence delivery  is required".

Also, there is description (at the same string) "F Flag (reserved) set. IETF document draft-ietf-l2vpn-vpls-multihoming (clause 3.3.1) updates RFC 4761 and defines two additional bits within Control Flags byte - D (bit 0, "Down") and F (bit 2, "Flush"). You provide description that "F Flag (reserved) set" when this flag actually is not set (value 0). Furthermore, you don't provide description about status of flag D (in attached dump in the first packet flag D is set and unset in the second packet).

svn path=/trunk/; revision=50085
2013-06-20 20:17:25 +00:00
Martin Kaiser 27598e20a2 fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8806
assign the return values of decode_...() functions to a signed int
check for negative return values

svn path=/trunk/; revision=49963
2013-06-16 15:29:14 +00:00
Michael Mann e1b7a26463 Adding support of BGP flow spec RFC 5575.
From Matt Texier, bug 8691 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8691)

svn path=/trunk/; revision=49914
2013-06-13 02:35:23 +00:00
Michael Mann 2d37ec3cb0 Batch of filterable expert infos.
svn path=/trunk/; revision=49853
2013-06-09 03:28:05 +00:00
Jaap Keuter 97136126bc Typo's. That is all.
svn path=/trunk/; revision=48685
2013-04-01 15:29:49 +00:00
Anders Broman b539916835 [-Wmissing-prototypes]
explicit casts.

svn path=/trunk/; revision=48293
2013-03-14 07:37:13 +00:00
Alexis La Goutte 1d74daaec3 Remove unused bgp_route_refresh struct
svn path=/trunk/; revision=48278
2013-03-13 15:02:17 +00:00
Guy Harris 6b629c4d92 Move show_exception() and show_reported_bounds_error() to
epan/show_exception.c, as it's used outside
epan/dissectors/packet-frame.c.  Update their callers to include
<epan/show_exception.h> to get their declaration.

Add a CATCH_NONFATAL_ERRORS macro that catches all exceptions that, if
there's more stuff in the packet to dissect after the dissector call
that threw the exception, doesn't mean you shouldn't go ahead and
dissect that stuff.  Use it in all those cases, including ones where
BoundsError was inappropriately being caught (you want those passed up
to the top level, so that the packet is reported as having been cut
short in the capture process).

Add a CATCH_BOUNDS_ERRORS macro that catches all exceptions that
correspond to running past the end of the data for a tvbuff; use it
rather than explicitly catching those exceptions individually, and
rather than just catching all exceptions (the only place that
DissectorError should be caught, for example, is at the top level, so
dissector bugs show up in the protocol tree).

Don't catch and then immediately rethrow exceptions without doing
anything else; just let the exceptions go up to the final catcher.

Use show_exception() to report non-fatal errors, rather than doing it
yourself.
 
If a dissector is called from Lua, catch all non-fatal errors and use
show_exception() to report them rather than catching only
ReportedBoundsError and adding a proto_malformed item.

Don't catch exceptions when constructing a trailer tvbuff in
packet-ieee8023.c - just construct it after the payload has been
dissected, and let whatever exceptions that throws be handled at the top
level.

Avoid some TRY/CATCH/ENDTRY cases by using checks such as
tvb_bytes_exist() before even looking in the tvbuff.

svn path=/trunk/; revision=47924
2013-02-27 22:43:54 +00:00
Alexis La Goutte 2e8cb1c5cd Enhance BGP ORF (Make field filterable)
svn path=/trunk/; revision=46508
2012-12-11 23:24:02 +00:00
Jeff Morriss 0266cceef3 Make all enum_val_t's const.
svn path=/trunk/; revision=46292
2012-11-29 20:15:37 +00:00
Alexis La Goutte 7c59618e8d From Olivier Benghozi via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7734
Enhance Route Refresh Capability : Add draft-ietf-idr-bgp-enhanced-route-refresh-02

Not yet support new NOTIFICATION error code : ROUTE-REFRESH Message Error (Value To Be Defined)

From me :
* Make some Route Refresh fields filterable 

svn path=/trunk/; revision=45217
2012-09-30 10:38:37 +00:00
Alexis La Goutte cd519e450c From Olivier Benghozi via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7734
BGP bad decoding for Graceful Restart Capability with only helper support

BGP Capability in OPEN message: Graceful restart capability (64).

So when the length of the capability value is smaller that 6 (6 meaning full
support of GR capa, with significants elements and at least one AFI/SAFI), the
code interprets it as erroneous.

However,as described in RFC4724: " When a sender of this capability does not
include any <AFI, SAFI> in the capability, it means that the sender is not
capable of preserving its forwarding state during BGP restart, but supports
procedures for the Receiving Speaker (as defined in Section 4.2 of this
document). In that case, the value of the Restart Time field advertised by the
sender is irrelevant".

So, length of exactly 2 is valid but has to be interpreted with a particular
meaning.

In the dissector code, a length of 2 should be a special case for this capa,
decoding as "Graceful Restart helper mode only" or something like that, and
maybe also displaying an expert message if the Restart flag is not 0 in this
case, since here it's not expected to be possible.

svn path=/trunk/; revision=45216
2012-09-30 10:05:18 +00:00
Michael Mann 65ef9e9d6b replaced decode_numeric_bitfield calls with filterable item or removed it if it didn't mathematically do anything.
svn path=/trunk/; revision=45166
2012-09-27 04:36:40 +00:00
Michael Mann 4f9707469d replaced decode_boolean_bitfield calls with itemized filters
added tfs_no_yes to tfs.[ch]

svn path=/trunk/; revision=45115
2012-09-25 01:00:41 +00:00