Wireshark  2.9.0-477-g68ec514b
The Wireshark network protocol analyzer
packet-mpls.h
1 /* packet-mpls.h
2  * Declarations of exported routines from MPLS dissector
3  * Author: Carlos Pignataro <cpignata@cisco.com>
4  * Copyright 2005, cisco Systems, Inc.
5  *
6  * (c) Copyright 2006, _FF_ Francesco Fondelli <francesco.fondelli@gmail.com>
7  * added MPLS OAM support, ITU-T Y.1711
8  * (c) Copyright 2011, Shobhank Sharma <ssharma5@ncsu.edu>
9  * added MPLS Generic Associated Channel as per RFC 5586
10  *
11  * Wireshark - Network traffic analyzer
12  * By Gerald Combs <gerald@wireshark.org>
13  * Copyright 1998 Gerald Combs
14  *
15  * SPDX-License-Identifier: GPL-2.0-or-later
16  */
17 
18 #ifndef PACKET_MPLS_H
19 #define PACKET_MPLS_H
20 
21 /* Special labels in MPLS */
22 enum {
23  MPLS_LABEL_IP4_EXPLICIT_NULL = 0,
24  MPLS_LABEL_ROUTER_ALERT,
25  MPLS_LABEL_IP6_EXPLICIT_NULL,
26  MPLS_LABEL_IMPLICIT_NULL,
27  MPLS_LABEL_ELI = 7,
28  MPLS_LABEL_GACH = 13, /* aka GAL */
29  MPLS_LABEL_OAM_ALERT = 14,
30  MPLS_LABEL_MAX_RESERVED = 15,
31  MPLS_LABEL_INVALID = -1
32 };
33 
34 /* As per RFC 5885 */
35 #define PW_ACH_TYPE_BFD 0x0007
36 /* As per RFC 6374 */
37 #define PW_ACH_TYPE_DLM 0x000A
38 #define PW_ACH_TYPE_ILM 0x000B
39 #define PW_ACH_TYPE_DM 0x000C
40 #define PW_ACH_TYPE_DLM_DM 0x000D
41 #define PW_ACH_TYPE_ILM_DM 0x000E
42 /* As per RFC 4385 clause 6 */
43 #define PW_ACH_TYPE_IPV4 0x0021
44 /* As per RFC 6428 Section 3.3 */
45 #define PW_ACH_TYPE_BFD_CC 0x0022
46 #define PW_ACH_TYPE_BFD_CV 0x0023
47 /* As per RFC 6378 */
48 #define PW_ACH_TYPE_PSC 0x0024
49 /* As per RFC 6426 Section 7.4 */
50 #define PW_ACH_TYPE_ONDEMAND_CV 0x0025
51 /* As per RFC 6478 */
52 #define PW_ACH_TYPE_PW_OAM 0x0027
53 /* As per RFC 7769 */
54 #define PW_ACH_TYPE_MAC 0x0028
55 /* As per RFC 4385 clause 6 */
56 #define PW_ACH_TYPE_IPV6 0x0057
57 /* As per RFC 6427 */
58 #define PW_ACH_TYPE_MPLSTP_FM 0x0058
59 
60 
61 /* MPLS over UDP http://tools.ietf.org/html/draft-ietf-mpls-in-udp-11,
62  * udp destination port as defined in
63  * http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=6635
64  */
65 #define UDP_PORT_MPLS_OVER_UDP 6635
66 
67 /*
68  * FF: private data passed from the MPLS dissector to subdissectors
69  * (data parameter).
70  */
71 struct mplsinfo {
72  guint32 label; /* last mpls label in label stack */
73  guint8 exp; /* former EXP bits of last mpls shim in stack */
74  guint8 bos; /* BOS bit of last mpls shim in stack */
75  guint8 ttl; /* TTL bits of last mpls shim in stack */
76 };
77 
78 extern const value_string special_labels[];
79 extern void decode_mpls_label(tvbuff_t *tvb, int offset,
80  guint32 *label, guint8 *exp,
81  guint8 *bos, guint8 *ttl);
82 
83 extern gboolean dissect_try_cw_first_nibble(tvbuff_t *tvb, packet_info *pinfo,
84  proto_tree *tree );
85 
86 #endif
Definition: packet_info.h:44
Definition: packet-mpls.h:71
Definition: tvbuff-int.h:35
Definition: value_string.h:24
Definition: proto.h:759