tcpdump  4.99.1
About: tcpdump is a tool for network monitoring and data acquisition.
  Fossies Dox: tcpdump-4.99.1.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

print-ldp.c File Reference
#include "netdissect-stdinc.h"
#include "netdissect.h"
#include "extract.h"
#include "addrtoname.h"
#include "l2vpn.h"
#include "af.h"
Include dependency graph for print-ldp.c:

Go to the source code of this file.

Data Structures

struct  ldp_common_header
 
struct  ldp_msg_header
 

Macros

#define LDP_VERSION   1
 
#define LDP_MASK_MSG_TYPE(x)   ((x)&0x7fff)
 
#define LDP_MASK_U_BIT(x)   ((x)&0x8000)
 
#define LDP_MSG_NOTIF   0x0001
 
#define LDP_MSG_HELLO   0x0100
 
#define LDP_MSG_INIT   0x0200
 
#define LDP_MSG_KEEPALIVE   0x0201
 
#define LDP_MSG_ADDRESS   0x0300
 
#define LDP_MSG_ADDRESS_WITHDRAW   0x0301
 
#define LDP_MSG_LABEL_MAPPING   0x0400
 
#define LDP_MSG_LABEL_REQUEST   0x0401
 
#define LDP_MSG_LABEL_WITHDRAW   0x0402
 
#define LDP_MSG_LABEL_RELEASE   0x0403
 
#define LDP_MSG_LABEL_ABORT_REQUEST   0x0404
 
#define LDP_VENDOR_PRIVATE_MIN   0x3e00
 
#define LDP_VENDOR_PRIVATE_MAX   0x3eff
 
#define LDP_EXPERIMENTAL_MIN   0x3f00
 
#define LDP_EXPERIMENTAL_MAX   0x3fff
 
#define LDP_MASK_TLV_TYPE(x)   ((x)&0x3fff)
 
#define LDP_MASK_F_BIT(x)   ((x)&0x4000)
 
#define LDP_TLV_FEC   0x0100
 
#define LDP_TLV_ADDRESS_LIST   0x0101
 
#define LDP_TLV_ADDRESS_LIST_AFNUM_LEN   2
 
#define LDP_TLV_HOP_COUNT   0x0103
 
#define LDP_TLV_PATH_VECTOR   0x0104
 
#define LDP_TLV_GENERIC_LABEL   0x0200
 
#define LDP_TLV_ATM_LABEL   0x0201
 
#define LDP_TLV_FR_LABEL   0x0202
 
#define LDP_TLV_STATUS   0x0300
 
#define LDP_TLV_EXTD_STATUS   0x0301
 
#define LDP_TLV_RETURNED_PDU   0x0302
 
#define LDP_TLV_RETURNED_MSG   0x0303
 
#define LDP_TLV_COMMON_HELLO   0x0400
 
#define LDP_TLV_IPV4_TRANSPORT_ADDR   0x0401
 
#define LDP_TLV_CONFIG_SEQ_NUMBER   0x0402
 
#define LDP_TLV_IPV6_TRANSPORT_ADDR   0x0403
 
#define LDP_TLV_COMMON_SESSION   0x0500
 
#define LDP_TLV_ATM_SESSION_PARM   0x0501
 
#define LDP_TLV_FR_SESSION_PARM   0x0502
 
#define LDP_TLV_FT_SESSION   0x0503
 
#define LDP_TLV_LABEL_REQUEST_MSG_ID   0x0600
 
#define LDP_TLV_MTU   0x0601 /* rfc 3988 */
 
#define LDP_FEC_WILDCARD   0x01
 
#define LDP_FEC_PREFIX   0x02
 
#define LDP_FEC_HOSTADDRESS   0x03
 
#define LDP_FEC_MARTINI_VC   0x80
 
#define LDP_FEC_MARTINI_IFPARM_MTU   0x01
 
#define LDP_FEC_MARTINI_IFPARM_DESC   0x03
 
#define LDP_FEC_MARTINI_IFPARM_VCCV   0x0c
 
#define TLV_TCHECK(minlen)
 

Functions

static u_int ldp_pdu_print (netdissect_options *, const u_char *)
 
static u_int ldp_tlv_print (netdissect_options *ndo, const u_char *tptr, u_int msg_tlen)
 
void ldp_print (netdissect_options *ndo, const u_char *pptr, u_int len)
 

Variables

static const struct tok ldp_msg_values []
 
static const struct tok ldp_tlv_values []
 
static const struct tok ldp_fec_values []
 
static const struct tok ldp_fec_martini_ifparm_values []
 
static const struct tok ldp_fec_martini_ifparm_vccv_cc_values []
 
static const struct tok ldp_fec_martini_ifparm_vccv_cv_values []
 

Macro Definition Documentation

◆ LDP_EXPERIMENTAL_MAX

#define LDP_EXPERIMENTAL_MAX   0x3fff

Definition at line 105 of file print-ldp.c.

◆ LDP_EXPERIMENTAL_MIN

#define LDP_EXPERIMENTAL_MIN   0x3f00

Definition at line 104 of file print-ldp.c.

◆ LDP_FEC_HOSTADDRESS

#define LDP_FEC_HOSTADDRESS   0x03

Definition at line 175 of file print-ldp.c.

◆ LDP_FEC_MARTINI_IFPARM_DESC

#define LDP_FEC_MARTINI_IFPARM_DESC   0x03

Definition at line 188 of file print-ldp.c.

◆ LDP_FEC_MARTINI_IFPARM_MTU

#define LDP_FEC_MARTINI_IFPARM_MTU   0x01

Definition at line 187 of file print-ldp.c.

◆ LDP_FEC_MARTINI_IFPARM_VCCV

#define LDP_FEC_MARTINI_IFPARM_VCCV   0x0c

Definition at line 189 of file print-ldp.c.

◆ LDP_FEC_MARTINI_VC

#define LDP_FEC_MARTINI_VC   0x80

Definition at line 177 of file print-ldp.c.

◆ LDP_FEC_PREFIX

#define LDP_FEC_PREFIX   0x02

Definition at line 174 of file print-ldp.c.

◆ LDP_FEC_WILDCARD

#define LDP_FEC_WILDCARD   0x01

Definition at line 173 of file print-ldp.c.

◆ LDP_MASK_F_BIT

#define LDP_MASK_F_BIT (   x)    ((x)&0x4000)

Definition at line 123 of file print-ldp.c.

◆ LDP_MASK_MSG_TYPE

#define LDP_MASK_MSG_TYPE (   x)    ((x)&0x7fff)

Definition at line 87 of file print-ldp.c.

◆ LDP_MASK_TLV_TYPE

#define LDP_MASK_TLV_TYPE (   x)    ((x)&0x3fff)

Definition at line 122 of file print-ldp.c.

◆ LDP_MASK_U_BIT

#define LDP_MASK_U_BIT (   x)    ((x)&0x8000)

Definition at line 88 of file print-ldp.c.

◆ LDP_MSG_ADDRESS

#define LDP_MSG_ADDRESS   0x0300

Definition at line 94 of file print-ldp.c.

◆ LDP_MSG_ADDRESS_WITHDRAW

#define LDP_MSG_ADDRESS_WITHDRAW   0x0301

Definition at line 95 of file print-ldp.c.

◆ LDP_MSG_HELLO

#define LDP_MSG_HELLO   0x0100

Definition at line 91 of file print-ldp.c.

◆ LDP_MSG_INIT

#define LDP_MSG_INIT   0x0200

Definition at line 92 of file print-ldp.c.

◆ LDP_MSG_KEEPALIVE

#define LDP_MSG_KEEPALIVE   0x0201

Definition at line 93 of file print-ldp.c.

◆ LDP_MSG_LABEL_ABORT_REQUEST

#define LDP_MSG_LABEL_ABORT_REQUEST   0x0404

Definition at line 100 of file print-ldp.c.

◆ LDP_MSG_LABEL_MAPPING

#define LDP_MSG_LABEL_MAPPING   0x0400

Definition at line 96 of file print-ldp.c.

◆ LDP_MSG_LABEL_RELEASE

#define LDP_MSG_LABEL_RELEASE   0x0403

Definition at line 99 of file print-ldp.c.

◆ LDP_MSG_LABEL_REQUEST

#define LDP_MSG_LABEL_REQUEST   0x0401

Definition at line 97 of file print-ldp.c.

◆ LDP_MSG_LABEL_WITHDRAW

#define LDP_MSG_LABEL_WITHDRAW   0x0402

Definition at line 98 of file print-ldp.c.

◆ LDP_MSG_NOTIF

#define LDP_MSG_NOTIF   0x0001

Definition at line 90 of file print-ldp.c.

◆ LDP_TLV_ADDRESS_LIST

#define LDP_TLV_ADDRESS_LIST   0x0101

Definition at line 126 of file print-ldp.c.

◆ LDP_TLV_ADDRESS_LIST_AFNUM_LEN

#define LDP_TLV_ADDRESS_LIST_AFNUM_LEN   2

Definition at line 127 of file print-ldp.c.

◆ LDP_TLV_ATM_LABEL

#define LDP_TLV_ATM_LABEL   0x0201

Definition at line 131 of file print-ldp.c.

◆ LDP_TLV_ATM_SESSION_PARM

#define LDP_TLV_ATM_SESSION_PARM   0x0501

Definition at line 142 of file print-ldp.c.

◆ LDP_TLV_COMMON_HELLO

#define LDP_TLV_COMMON_HELLO   0x0400

Definition at line 137 of file print-ldp.c.

◆ LDP_TLV_COMMON_SESSION

#define LDP_TLV_COMMON_SESSION   0x0500

Definition at line 141 of file print-ldp.c.

◆ LDP_TLV_CONFIG_SEQ_NUMBER

#define LDP_TLV_CONFIG_SEQ_NUMBER   0x0402

Definition at line 139 of file print-ldp.c.

◆ LDP_TLV_EXTD_STATUS

#define LDP_TLV_EXTD_STATUS   0x0301

Definition at line 134 of file print-ldp.c.

◆ LDP_TLV_FEC

#define LDP_TLV_FEC   0x0100

Definition at line 125 of file print-ldp.c.

◆ LDP_TLV_FR_LABEL

#define LDP_TLV_FR_LABEL   0x0202

Definition at line 132 of file print-ldp.c.

◆ LDP_TLV_FR_SESSION_PARM

#define LDP_TLV_FR_SESSION_PARM   0x0502

Definition at line 143 of file print-ldp.c.

◆ LDP_TLV_FT_SESSION

#define LDP_TLV_FT_SESSION   0x0503

Definition at line 144 of file print-ldp.c.

◆ LDP_TLV_GENERIC_LABEL

#define LDP_TLV_GENERIC_LABEL   0x0200

Definition at line 130 of file print-ldp.c.

◆ LDP_TLV_HOP_COUNT

#define LDP_TLV_HOP_COUNT   0x0103

Definition at line 128 of file print-ldp.c.

◆ LDP_TLV_IPV4_TRANSPORT_ADDR

#define LDP_TLV_IPV4_TRANSPORT_ADDR   0x0401

Definition at line 138 of file print-ldp.c.

◆ LDP_TLV_IPV6_TRANSPORT_ADDR

#define LDP_TLV_IPV6_TRANSPORT_ADDR   0x0403

Definition at line 140 of file print-ldp.c.

◆ LDP_TLV_LABEL_REQUEST_MSG_ID

#define LDP_TLV_LABEL_REQUEST_MSG_ID   0x0600

Definition at line 145 of file print-ldp.c.

◆ LDP_TLV_MTU

#define LDP_TLV_MTU   0x0601 /* rfc 3988 */

Definition at line 146 of file print-ldp.c.

◆ LDP_TLV_PATH_VECTOR

#define LDP_TLV_PATH_VECTOR   0x0104

Definition at line 129 of file print-ldp.c.

◆ LDP_TLV_RETURNED_MSG

#define LDP_TLV_RETURNED_MSG   0x0303

Definition at line 136 of file print-ldp.c.

◆ LDP_TLV_RETURNED_PDU

#define LDP_TLV_RETURNED_PDU   0x0302

Definition at line 135 of file print-ldp.c.

◆ LDP_TLV_STATUS

#define LDP_TLV_STATUS   0x0300

Definition at line 133 of file print-ldp.c.

◆ LDP_VENDOR_PRIVATE_MAX

#define LDP_VENDOR_PRIVATE_MAX   0x3eff

Definition at line 103 of file print-ldp.c.

◆ LDP_VENDOR_PRIVATE_MIN

#define LDP_VENDOR_PRIVATE_MIN   0x3e00

Definition at line 102 of file print-ldp.c.

◆ LDP_VERSION

#define LDP_VERSION   1

Definition at line 55 of file print-ldp.c.

◆ TLV_TCHECK

#define TLV_TCHECK (   minlen)
Value:
if (tlv_tlen < minlen) { \
ND_PRINT(" [tlv length %u < %u]", tlv_tlen, minlen); \
nd_print_invalid(ndo); \
goto invalid; \
}

Definition at line 233 of file print-ldp.c.

Function Documentation

◆ ldp_pdu_print()

◆ ldp_print()

void ldp_print ( netdissect_options ndo,
const u_char *  pptr,
u_int  len 
)

Definition at line 548 of file print-ldp.c.

References ldp_pdu_print(), ND_PRINT, nd_print_invalid(), and netdissect_options::ndo_protocol.

Referenced by tcp_print(), and udp_print().

◆ ldp_tlv_print()

Variable Documentation

◆ ldp_fec_martini_ifparm_values

const struct tok ldp_fec_martini_ifparm_values[]
static
Initial value:
= {
{ 0x01 , "MTU" },
{ 0x03 , "Description" },
{ 0x0c , "VCCV" },
{ 0, NULL}
}

Definition at line 1 of file print-ldp.c.

Referenced by ldp_tlv_print().

◆ ldp_fec_martini_ifparm_vccv_cc_values

const struct tok ldp_fec_martini_ifparm_vccv_cc_values[]
static
Initial value:
= {
{ 0x01, "PWE3 control word" },
{ 0x02, "MPLS Router Alert Label" },
{ 0x04, "MPLS inner label TTL = 1" },
{ 0, NULL}
}

Definition at line 1 of file print-ldp.c.

Referenced by ldp_tlv_print().

◆ ldp_fec_martini_ifparm_vccv_cv_values

const struct tok ldp_fec_martini_ifparm_vccv_cv_values[]
static
Initial value:
= {
{ 0x01, "ICMP Ping" },
{ 0x02, "LSP Ping" },
{ 0x04, "BFD" },
{ 0, NULL}
}

Definition at line 1 of file print-ldp.c.

Referenced by ldp_tlv_print().

◆ ldp_fec_values

const struct tok ldp_fec_values[]
static
Initial value:
= {
{ 0x01 , "Wildcard" },
{ 0x02 , "Prefix" },
{ 0x03 , "Host address" },
{ 0x80 , "Martini VC" },
{ 0, NULL}
}

Definition at line 1 of file print-ldp.c.

Referenced by ldp_tlv_print().

◆ ldp_msg_values

const struct tok ldp_msg_values[]
static
Initial value:
= {
{ 0x0001 , "Notification" },
{ 0x0100 , "Hello" },
{ 0x0200 , "Initialization" },
{ 0x0201 , "Keepalive" },
{ 0x0300 , "Address" },
{ 0x0301 , "Address Withdraw" },
{ 0x0400 , "Label Mapping" },
{ 0x0401 , "Label Request" },
{ 0x0402 , "Label Withdraw" },
{ 0x0403 , "Label Release" },
{ 0x0404 , "Label Abort Request" },
{ 0, NULL}
}

Definition at line 1 of file print-ldp.c.

Referenced by ldp_pdu_print().

◆ ldp_tlv_values

const struct tok ldp_tlv_values[]
static
Initial value:
= {
{ 0x0100 , "FEC" },
{ 0x0101 , "Address List" },
{ 0x0103 , "Hop Count" },
{ 0x0104 , "Path Vector" },
{ 0x0200 , "Generic Label" },
{ 0x0201 , "ATM Label" },
{ 0x0202 , "Frame-Relay Label" },
{ 0x0300 , "Status" },
{ 0x0301 , "Extended Status" },
{ 0x0302 , "Returned PDU" },
{ 0x0303 , "Returned Message" },
{ 0x0400 , "Common Hello Parameters" },
{ 0x0401 , "IPv4 Transport Address" },
{ 0x0402 , "Configuration Sequence Number" },
{ 0x0403 , "IPv6 Transport Address" },
{ 0x0500 , "Common Session Parameters" },
{ 0x0501 , "ATM Session Parameters" },
{ 0x0502 , "Frame-Relay Session Parameters" },
{ 0x0503 , "Fault-Tolerant Session Parameters" },
{ 0x0600 , "Label Request Message ID" },
{ 0x0601 , "MTU" },
{ 0, NULL}
}

Definition at line 1 of file print-ldp.c.

Referenced by ldp_tlv_print().