Wireshark  4.3.0
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 /* As per RFC 5718 */
34 #define PW_ACH_TYPE_MCC 0x0001
35 /* As per RFC 5718 */
36 #define PW_ACH_TYPE_SCC 0x0002
37 /* As per RFC 5885 */
38 #define PW_ACH_TYPE_BFD 0x0007
39 /* As per RFC 6374 */
40 #define PW_ACH_TYPE_DLM 0x000A
41 #define PW_ACH_TYPE_ILM 0x000B
42 #define PW_ACH_TYPE_DM 0x000C
43 #define PW_ACH_TYPE_DLM_DM 0x000D
44 #define PW_ACH_TYPE_ILM_DM 0x000E
45 /* As per RFC 4385 clause 6 */
46 #define PW_ACH_TYPE_IPV4 0x0021
47 /* As per RFC 6428 Section 3.3 */
48 #define PW_ACH_TYPE_BFD_CC 0x0022
49 #define PW_ACH_TYPE_BFD_CV 0x0023
50 /* As per RFC 6378 */
51 #define PW_ACH_TYPE_PSC 0x0024
52 /* As per RFC 6426 Section 7.4 */
53 #define PW_ACH_TYPE_ONDEMAND_CV 0x0025
54 /* As per RFC 6478 */
55 #define PW_ACH_TYPE_PW_OAM 0x0027
56 /* As per RFC 7769 */
57 #define PW_ACH_TYPE_MAC 0x0028
58 /* As per RFC 4385 clause 6 */
59 #define PW_ACH_TYPE_IPV6 0x0057
60 /* As per RFC 6427 */
61 #define PW_ACH_TYPE_MPLSTP_FM 0x0058
62 /* As per RFC 6671 */
63 #define PW_ACH_TYPE_MPLSTP_OAM 0x8902
64 
65 /* MPLS over UDP http://tools.ietf.org/html/draft-ietf-mpls-in-udp-11,
66  * udp destination port as defined in
67  * http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=6635
68  */
69 #define UDP_PORT_MPLS_OVER_UDP 6635
70 
71 /*
72  * FF: private data passed from the MPLS dissector to subdissectors
73  * (data parameter).
74  */
75 struct mplsinfo {
76  guint32 label; /* last mpls label in label stack */
77  guint8 exp; /* former EXP bits of last mpls shim in stack */
78  guint8 bos; /* BOS bit of last mpls shim in stack */
79  guint8 ttl; /* TTL bits of last mpls shim in stack */
80 };
81 
82 extern const value_string special_labels[];
83 extern void decode_mpls_label(tvbuff_t *tvb, int offset,
84  guint32 *label, guint8 *exp,
85  guint8 *bos, guint8 *ttl);
86 
87 extern gboolean dissect_try_cw_first_nibble(tvbuff_t *tvb, packet_info *pinfo,
88  proto_tree *tree );
89 
90 #endif
Definition: packet_info.h:44
Definition: proto.h:904
Definition: value_string.h:26
Definition: packet-mpls.h:75
Definition: tvbuff-int.h:35