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-bgp.c File Reference
#include "netdissect-stdinc.h"
#include <stdio.h>
#include <string.h>
#include "netdissect.h"
#include "addrtoname.h"
#include "extract.h"
#include "af.h"
#include "l2vpn.h"
Include dependency graph for print-bgp.c:

Go to the source code of this file.

Data Structures

struct  bgp
 
struct  bgp_open
 
struct  bgp_opt
 
struct  bgp_notification
 
struct  bgp_route_refresh
 

Macros

#define BGP_SIZE   19 /* unaligned */
 
#define BGP_OPEN   1
 
#define BGP_UPDATE   2
 
#define BGP_NOTIFICATION   3
 
#define BGP_KEEPALIVE   4
 
#define BGP_ROUTE_REFRESH   5
 
#define BGP_OPEN_SIZE   29 /* unaligned */
 
#define BGP_OPT_SIZE   2 /* some compilers may pad to 4 bytes */
 
#define BGP_CAP_HEADER_SIZE   2 /* some compilers may pad to 4 bytes */
 
#define BGP_NOTIFICATION_SIZE   21 /* unaligned */
 
#define BGP_ROUTE_REFRESH_SIZE   23
 
#define bgp_attr_lenlen(flags, p)    (((flags) & 0x10) ? 2U : 1U)
 
#define bgp_attr_len(flags, p)    (((flags) & 0x10) ? GET_BE_U_2(p) : GET_U_1(p))
 
#define BGPTYPE_ORIGIN   1
 
#define BGPTYPE_AS_PATH   2
 
#define BGPTYPE_NEXT_HOP   3
 
#define BGPTYPE_MULTI_EXIT_DISC   4
 
#define BGPTYPE_LOCAL_PREF   5
 
#define BGPTYPE_ATOMIC_AGGREGATE   6
 
#define BGPTYPE_AGGREGATOR   7
 
#define BGPTYPE_COMMUNITIES   8 /* RFC1997 */
 
#define BGPTYPE_ORIGINATOR_ID   9 /* RFC4456 */
 
#define BGPTYPE_CLUSTER_LIST   10 /* RFC4456 */
 
#define BGPTYPE_DPA   11 /* deprecated, draft-ietf-idr-bgp-dpa */
 
#define BGPTYPE_ADVERTISERS   12 /* deprecated RFC1863 */
 
#define BGPTYPE_RCID_PATH   13 /* deprecated RFC1863 */
 
#define BGPTYPE_MP_REACH_NLRI   14 /* RFC4760 */
 
#define BGPTYPE_MP_UNREACH_NLRI   15 /* RFC4760 */
 
#define BGPTYPE_EXTD_COMMUNITIES   16 /* RFC4360 */
 
#define BGPTYPE_AS4_PATH   17 /* RFC6793 */
 
#define BGPTYPE_AGGREGATOR4   18 /* RFC6793 */
 
#define BGPTYPE_PMSI_TUNNEL   22 /* RFC6514 */
 
#define BGPTYPE_TUNNEL_ENCAP   23 /* RFC5512 */
 
#define BGPTYPE_TRAFFIC_ENG   24 /* RFC5543 */
 
#define BGPTYPE_IPV6_EXTD_COMMUNITIES   25 /* RFC5701 */
 
#define BGPTYPE_AIGP   26 /* RFC7311 */
 
#define BGPTYPE_PE_DISTINGUISHER_LABEL   27 /* RFC6514 */
 
#define BGPTYPE_ENTROPY_LABEL   28 /* RFC6790 */
 
#define BGPTYPE_LARGE_COMMUNITY   32 /* draft-ietf-idr-large-community-05 */
 
#define BGPTYPE_ATTR_SET   128 /* RFC6368 */
 
#define BGP_MP_NLRI_MINSIZE   3 /* End of RIB Marker detection */
 
#define BGP_AS_SET   1
 
#define BGP_AS_SEQUENCE   2
 
#define BGP_CONFED_AS_SEQUENCE   3 /* draft-ietf-idr-rfc3065bis-01 */
 
#define BGP_CONFED_AS_SET   4 /* draft-ietf-idr-rfc3065bis-01 */
 
#define BGP_AS_SEG_TYPE_MIN   BGP_AS_SET
 
#define BGP_AS_SEG_TYPE_MAX   BGP_CONFED_AS_SET
 
#define BGP_OPT_AUTH   1
 
#define BGP_OPT_CAP   2
 
#define BGP_CAPCODE_MP   1 /* RFC2858 */
 
#define BGP_CAPCODE_RR   2 /* RFC2918 */
 
#define BGP_CAPCODE_ORF   3 /* RFC5291 */
 
#define BGP_CAPCODE_MR   4 /* RFC3107 */
 
#define BGP_CAPCODE_EXT_NH   5 /* RFC5549 */
 
#define BGP_CAPCODE_ML   8 /* RFC8277 */
 
#define BGP_CAPCODE_RESTART   64 /* RFC4724 */
 
#define BGP_CAPCODE_AS_NEW   65 /* RFC6793 */
 
#define BGP_CAPCODE_DYN_CAP   67 /* draft-ietf-idr-dynamic-cap */
 
#define BGP_CAPCODE_MULTISESS   68 /* draft-ietf-idr-bgp-multisession */
 
#define BGP_CAPCODE_ADD_PATH   69 /* RFC7911 */
 
#define BGP_CAPCODE_ENH_RR   70 /* draft-keyur-bgp-enhanced-route-refresh */
 
#define BGP_CAPCODE_LLGR   71 /* draft-uttaro-idr-bgp-persistence-05 */
 
#define BGP_CAPCODE_RR_CISCO   128
 
#define BGP_NOTIFY_MAJOR_MSG   1
 
#define BGP_NOTIFY_MAJOR_OPEN   2
 
#define BGP_NOTIFY_MAJOR_UPDATE   3
 
#define BGP_NOTIFY_MAJOR_HOLDTIME   4
 
#define BGP_NOTIFY_MAJOR_FSM   5
 
#define BGP_NOTIFY_MAJOR_CEASE   6
 
#define BGP_NOTIFY_MAJOR_CAP   7
 
#define BGP_NOTIFY_MINOR_CEASE_MAXPRFX   1
 
#define BGP_NOTIFY_MINOR_CEASE_SHUT   2
 
#define BGP_NOTIFY_MINOR_CEASE_RESET   4
 
#define BGP_NOTIFY_MINOR_CEASE_ADMIN_SHUTDOWN_LEN   128
 
#define BGP_PMSI_TUNNEL_RSVP_P2MP   1
 
#define BGP_PMSI_TUNNEL_LDP_P2MP   2
 
#define BGP_PMSI_TUNNEL_PIM_SSM   3
 
#define BGP_PMSI_TUNNEL_PIM_SM   4
 
#define BGP_PMSI_TUNNEL_PIM_BIDIR   5
 
#define BGP_PMSI_TUNNEL_INGRESS   6
 
#define BGP_PMSI_TUNNEL_LDP_MP2MP   7
 
#define BGP_AIGP_TLV   1
 
#define SAFNUM_RES   0
 
#define SAFNUM_UNICAST   1
 
#define SAFNUM_MULTICAST   2
 
#define SAFNUM_UNIMULTICAST   3 /* deprecated now */
 
#define SAFNUM_LABUNICAST   4
 
#define SAFNUM_MULTICAST_VPN   5
 
#define SAFNUM_TUNNEL   64
 
#define SAFNUM_VPLS   65
 
#define SAFNUM_MDT   66
 
#define SAFNUM_EVPN   70
 
#define SAFNUM_VPNUNICAST   128
 
#define SAFNUM_VPNMULTICAST   129
 
#define SAFNUM_VPNUNIMULTICAST   130 /* deprecated now */
 
#define SAFNUM_RT_ROUTING_INFO   132
 
#define BGP_VPN_RD_LEN   8
 
#define BGP_COMMUNITY_NO_EXPORT   0xffffff01
 
#define BGP_COMMUNITY_NO_ADVERT   0xffffff02
 
#define BGP_COMMUNITY_NO_EXPORT_SUBCONFED   0xffffff03
 
#define BGP_EXT_COM_RT_0   0x0002 /* Route Target,Format AS(2bytes):AN(4bytes) */
 
#define BGP_EXT_COM_RT_1   0x0102 /* Route Target,Format IP address:AN(2bytes) */
 
#define BGP_EXT_COM_RT_2   0x0202 /* Route Target,Format AN(4bytes):local(2bytes) */
 
#define BGP_EXT_COM_RO_0   0x0003 /* Route Origin,Format AS(2bytes):AN(4bytes) */
 
#define BGP_EXT_COM_RO_1   0x0103 /* Route Origin,Format IP address:AN(2bytes) */
 
#define BGP_EXT_COM_RO_2   0x0203 /* Route Origin,Format AN(4bytes):local(2bytes) */
 
#define BGP_EXT_COM_LINKBAND   0x4004 /* Link Bandwidth,Format AS(2B):Bandwidth(4B) */
 
#define BGP_EXT_COM_VPN_ORIGIN   0x0005 /* OSPF Domain ID / VPN of Origin - draft-rosen-vpns-ospf-bgp-mpls */
 
#define BGP_EXT_COM_VPN_ORIGIN2   0x0105 /* duplicate - keep for backwards compatibility */
 
#define BGP_EXT_COM_VPN_ORIGIN3   0x0205 /* duplicate - keep for backwards compatibility */
 
#define BGP_EXT_COM_VPN_ORIGIN4   0x8005 /* duplicate - keep for backwards compatibility */
 
#define BGP_EXT_COM_OSPF_RTYPE   0x0306 /* OSPF Route Type,Format Area(4B):RouteType(1B):Options(1B) */
 
#define BGP_EXT_COM_OSPF_RTYPE2   0x8000 /* duplicate - keep for backwards compatibility */
 
#define BGP_EXT_COM_ENCAP   0x030c /* rfc5512 */
 
#define BGP_EXT_COM_OSPF_RID   0x0107 /* OSPF Router ID,Format RouterID(4B):Unused(2B) */
 
#define BGP_EXT_COM_OSPF_RID2   0x8001 /* duplicate - keep for backwards compatibility */
 
#define BGP_EXT_COM_L2INFO   0x800a /* draft-kompella-ppvpn-l2vpn */
 
#define BGP_EXT_COM_SOURCE_AS   0x0009 /* RFC-ietf-l3vpn-2547bis-mcast-bgp-08.txt */
 
#define BGP_EXT_COM_VRF_RT_IMP   0x010b /* RFC-ietf-l3vpn-2547bis-mcast-bgp-08.txt */
 
#define BGP_EXT_COM_L2VPN_RT_0   0x000a /* L2VPN Identifier,Format AS(2bytes):AN(4bytes) */
 
#define BGP_EXT_COM_L2VPN_RT_1   0xF10a /* L2VPN Identifier,Format IP address:AN(2bytes) */
 
#define BGP_EXT_COM_EIGRP_GEN   0x8800
 
#define BGP_EXT_COM_EIGRP_METRIC_AS_DELAY   0x8801
 
#define BGP_EXT_COM_EIGRP_METRIC_REL_NH_BW   0x8802
 
#define BGP_EXT_COM_EIGRP_METRIC_LOAD_MTU   0x8803
 
#define BGP_EXT_COM_EIGRP_EXT_REMAS_REMID   0x8804
 
#define BGP_EXT_COM_EIGRP_EXT_REMPROTO_REMMETRIC   0x8805
 
#define BGP_ENCAP_TUNNEL_L2TPV3_IP   1
 
#define BGP_ENCAP_TUNNEL_GRE   2
 
#define BGP_ENCAP_TUNNEL_TRANSMIT   3
 
#define BGP_ENCAP_TUNNEL_IPSEC   4
 
#define BGP_ENCAP_TUNNEL_IP_IPSEC   5
 
#define BGP_ENCAP_TUNNEL_MPLS_IP   6
 
#define BGP_ENCAP_TUNNEL_IP_IP   7
 
#define BGP_ENCAP_TUNNEL_VXLAN   8
 
#define BGP_ENCAP_TUNNEL_NVGRE   9
 
#define BGP_ENCAP_TUNNEL_MPLS   10
 
#define BGP_ENCAP_TUNNEL_MPLS_GRE   11
 
#define BGP_ENCAP_TUNNEL_VXLAN_GPE   12
 
#define BGP_ENCAP_TUNNEL_MPLS_UDP   13
 
#define BGP_ENCAP_TUNNEL_IPV6   14
 
#define BGP_ENCAP_TUNNEL_SR_TE   15
 
#define BGP_ENCAP_TUNNEL_BARE   16
 
#define BGP_ENCAP_TUNNEL_SR   17
 
#define BGP_OSPF_RTYPE_RTR   1 /* OSPF Router LSA */
 
#define BGP_OSPF_RTYPE_NET   2 /* OSPF Network LSA */
 
#define BGP_OSPF_RTYPE_SUM   3 /* OSPF Summary LSA */
 
#define BGP_OSPF_RTYPE_EXT   5 /* OSPF External LSA, note that ASBR doesn't apply to MPLS-VPN */
 
#define BGP_OSPF_RTYPE_NSSA   7 /* OSPF NSSA External*/
 
#define BGP_OSPF_RTYPE_SHAM   129 /* OSPF-MPLS-VPN Sham link */
 
#define BGP_OSPF_RTYPE_METRIC_TYPE   0x1 /* LSB of RTYPE Options Field */
 
#define AS_STR_SIZE   sizeof("xxxxx.xxxxx")
 
#define ITEMCHECK(minlen)   if (itemlen < minlen) goto badtlv;
 
#define MDT_VPN_NLRI_LEN   16
 
#define BGP_MULTICAST_VPN_ROUTE_TYPE_INTRA_AS_I_PMSI   1
 
#define BGP_MULTICAST_VPN_ROUTE_TYPE_INTER_AS_I_PMSI   2
 
#define BGP_MULTICAST_VPN_ROUTE_TYPE_S_PMSI   3
 
#define BGP_MULTICAST_VPN_ROUTE_TYPE_INTRA_AS_SEG_LEAF   4
 
#define BGP_MULTICAST_VPN_ROUTE_TYPE_SOURCE_ACTIVE   5
 
#define BGP_MULTICAST_VPN_ROUTE_TYPE_SHARED_TREE_JOIN   6
 
#define BGP_MULTICAST_VPN_ROUTE_TYPE_SOURCE_TREE_JOIN   7
 
#define UPDATE_BUF_BUFLEN(buf, buflen, stringlen)
 

Functions

static char * as_printf (netdissect_options *ndo, char *str, size_t size, u_int asnum)
 
int decode_prefix4 (netdissect_options *ndo, const u_char *pptr, u_int itemlen, char *buf, size_t buflen)
 
static int decode_labeled_prefix4 (netdissect_options *ndo, const u_char *pptr, u_int itemlen, char *buf, size_t buflen)
 
static char * bgp_vpn_ip_print (netdissect_options *ndo, const u_char *pptr, u_int addr_length)
 
static u_int bgp_vpn_sg_print (netdissect_options *ndo, const u_char *pptr, char *buf, size_t buflen)
 
const char * bgp_vpn_rd_print (netdissect_options *ndo, const u_char *pptr)
 
static void bgp_extended_community_print (netdissect_options *ndo, const u_char *pptr)
 
static char * bgp_rt_prefix_print (netdissect_options *ndo, const u_char *pptr, u_int plen)
 
static int decode_rt_routing_info (netdissect_options *ndo, const u_char *pptr)
 
static int decode_labeled_vpn_prefix4 (netdissect_options *ndo, const u_char *pptr, char *buf, size_t buflen)
 
static int decode_mdt_vpn_nlri (netdissect_options *ndo, const u_char *pptr, char *buf, size_t buflen)
 
static int decode_multicast_vpn (netdissect_options *ndo, const u_char *pptr, char *buf, size_t buflen)
 
static int decode_labeled_vpn_l2 (netdissect_options *ndo, const u_char *pptr, char *buf, size_t buflen)
 
int decode_prefix6 (netdissect_options *ndo, const u_char *pd, u_int itemlen, char *buf, size_t buflen)
 
static int decode_labeled_prefix6 (netdissect_options *ndo, const u_char *pptr, u_int itemlen, char *buf, size_t buflen)
 
static int decode_labeled_vpn_prefix6 (netdissect_options *ndo, const u_char *pptr, char *buf, size_t buflen)
 
static int decode_clnp_prefix (netdissect_options *ndo, const u_char *pptr, char *buf, size_t buflen)
 
static int decode_labeled_vpn_clnp_prefix (netdissect_options *ndo, const u_char *pptr, char *buf, size_t buflen)
 
static u_int bgp_attr_get_as_size (netdissect_options *ndo, uint8_t bgpa_type, const u_char *pptr, u_int len)
 
static int check_add_path (netdissect_options *ndo, const u_char *pptr, u_int length, u_int max_prefix_length)
 
static int bgp_mp_af_print (netdissect_options *ndo, const u_char *tptr, u_int tlen, uint16_t *afp, uint8_t *safip)
 
static int bgp_nlri_print (netdissect_options *ndo, uint16_t af, uint8_t safi, const u_char *tptr, u_int len, char *buf, size_t buflen, int add_path4, int add_path6)
 
static int bgp_attr_print (netdissect_options *ndo, uint8_t atype, const u_char *pptr, u_int len, const unsigned attr_set_level)
 
static void bgp_capabilities_print (netdissect_options *ndo, const u_char *opt, u_int caps_len)
 
static void bgp_open_print (netdissect_options *ndo, const u_char *dat, u_int length)
 
static void bgp_update_print (netdissect_options *ndo, const u_char *dat, u_int length)
 
static void bgp_notification_print (netdissect_options *ndo, const u_char *dat, u_int length)
 
static void bgp_route_refresh_print (netdissect_options *ndo, const u_char *pptr, u_int len)
 
static int bgp_pdu_print (netdissect_options *ndo, const u_char *dat, u_int length)
 
void bgp_print (netdissect_options *ndo, const u_char *dat, u_int length)
 

Variables

static const struct tok bgp_msg_values []
 
static const struct tok bgp_attr_values []
 
static const struct tok bgp_as_path_segment_open_values []
 
static const struct tok bgp_as_path_segment_close_values []
 
static const struct tok bgp_opt_values []
 
static const struct tok bgp_capcode_values []
 
static const struct tok bgp_notify_major_values []
 
static const struct tok bgp_notify_minor_cease_values []
 
static const struct tok bgp_notify_minor_msg_values []
 
static const struct tok bgp_notify_minor_open_values []
 
static const struct tok bgp_notify_minor_update_values []
 
static const struct tok bgp_notify_minor_fsm_values []
 
static const struct tok bgp_notify_minor_cap_values []
 
static const struct tok bgp_origin_values []
 
static const struct tok bgp_pmsi_tunnel_values []
 
static const struct tok bgp_pmsi_flag_values []
 
static const struct tok bgp_aigp_values []
 
static const struct tok bgp_safi_values []
 
static const struct tok bgp_extd_comm_flag_values []
 
static const struct tok bgp_extd_comm_subtype_values []
 
static const struct tok bgp_extd_comm_encap_tunnel_values []
 
static const struct tok bgp_extd_comm_ospf_rtype_values []
 
static const struct tok bgp_add_path_recvsend []
 
static const struct tok bgp_multicast_vpn_route_type_values []
 

Macro Definition Documentation

◆ AS_STR_SIZE

#define AS_STR_SIZE   sizeof("xxxxx.xxxxx")

Definition at line 560 of file print-bgp.c.

◆ BGP_AIGP_TLV

#define BGP_AIGP_TLV   1

Definition at line 363 of file print-bgp.c.

◆ BGP_AS_SEG_TYPE_MAX

#define BGP_AS_SEG_TYPE_MAX   BGP_CONFED_AS_SET

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

◆ BGP_AS_SEG_TYPE_MIN

#define BGP_AS_SEG_TYPE_MIN   BGP_AS_SET

Definition at line 186 of file print-bgp.c.

◆ BGP_AS_SEQUENCE

#define BGP_AS_SEQUENCE   2

Definition at line 182 of file print-bgp.c.

◆ BGP_AS_SET

#define BGP_AS_SET   1

Definition at line 181 of file print-bgp.c.

◆ bgp_attr_len

#define bgp_attr_len (   flags,
 
)     (((flags) & 0x10) ? GET_BE_U_2(p) : GET_U_1(p))

Definition at line 116 of file print-bgp.c.

◆ bgp_attr_lenlen

#define bgp_attr_lenlen (   flags,
 
)     (((flags) & 0x10) ? 2U : 1U)

Definition at line 114 of file print-bgp.c.

◆ BGP_CAP_HEADER_SIZE

#define BGP_CAP_HEADER_SIZE   2 /* some compilers may pad to 4 bytes */

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

◆ BGP_CAPCODE_ADD_PATH

#define BGP_CAPCODE_ADD_PATH   69 /* RFC7911 */

Definition at line 224 of file print-bgp.c.

◆ BGP_CAPCODE_AS_NEW

#define BGP_CAPCODE_AS_NEW   65 /* RFC6793 */

Definition at line 221 of file print-bgp.c.

◆ BGP_CAPCODE_DYN_CAP

#define BGP_CAPCODE_DYN_CAP   67 /* draft-ietf-idr-dynamic-cap */

Definition at line 222 of file print-bgp.c.

◆ BGP_CAPCODE_ENH_RR

#define BGP_CAPCODE_ENH_RR   70 /* draft-keyur-bgp-enhanced-route-refresh */

Definition at line 225 of file print-bgp.c.

◆ BGP_CAPCODE_EXT_NH

#define BGP_CAPCODE_EXT_NH   5 /* RFC5549 */

Definition at line 218 of file print-bgp.c.

◆ BGP_CAPCODE_LLGR

#define BGP_CAPCODE_LLGR   71 /* draft-uttaro-idr-bgp-persistence-05 */

Definition at line 226 of file print-bgp.c.

◆ BGP_CAPCODE_ML

#define BGP_CAPCODE_ML   8 /* RFC8277 */

Definition at line 219 of file print-bgp.c.

◆ BGP_CAPCODE_MP

#define BGP_CAPCODE_MP   1 /* RFC2858 */

Definition at line 214 of file print-bgp.c.

◆ BGP_CAPCODE_MR

#define BGP_CAPCODE_MR   4 /* RFC3107 */

Definition at line 217 of file print-bgp.c.

◆ BGP_CAPCODE_MULTISESS

#define BGP_CAPCODE_MULTISESS   68 /* draft-ietf-idr-bgp-multisession */

Definition at line 223 of file print-bgp.c.

◆ BGP_CAPCODE_ORF

#define BGP_CAPCODE_ORF   3 /* RFC5291 */

Definition at line 216 of file print-bgp.c.

◆ BGP_CAPCODE_RESTART

#define BGP_CAPCODE_RESTART   64 /* RFC4724 */

Definition at line 220 of file print-bgp.c.

◆ BGP_CAPCODE_RR

#define BGP_CAPCODE_RR   2 /* RFC2918 */

Definition at line 215 of file print-bgp.c.

◆ BGP_CAPCODE_RR_CISCO

#define BGP_CAPCODE_RR_CISCO   128

Definition at line 227 of file print-bgp.c.

◆ BGP_COMMUNITY_NO_ADVERT

#define BGP_COMMUNITY_NO_ADVERT   0xffffff02

Definition at line 417 of file print-bgp.c.

◆ BGP_COMMUNITY_NO_EXPORT

#define BGP_COMMUNITY_NO_EXPORT   0xffffff01

Definition at line 416 of file print-bgp.c.

◆ BGP_COMMUNITY_NO_EXPORT_SUBCONFED

#define BGP_COMMUNITY_NO_EXPORT_SUBCONFED   0xffffff03

Definition at line 418 of file print-bgp.c.

◆ BGP_CONFED_AS_SEQUENCE

#define BGP_CONFED_AS_SEQUENCE   3 /* draft-ietf-idr-rfc3065bis-01 */

Definition at line 183 of file print-bgp.c.

◆ BGP_CONFED_AS_SET

#define BGP_CONFED_AS_SET   4 /* draft-ietf-idr-rfc3065bis-01 */

Definition at line 184 of file print-bgp.c.

◆ BGP_ENCAP_TUNNEL_BARE

#define BGP_ENCAP_TUNNEL_BARE   16

Definition at line 509 of file print-bgp.c.

◆ BGP_ENCAP_TUNNEL_GRE

#define BGP_ENCAP_TUNNEL_GRE   2

Definition at line 495 of file print-bgp.c.

◆ BGP_ENCAP_TUNNEL_IP_IP

#define BGP_ENCAP_TUNNEL_IP_IP   7

Definition at line 500 of file print-bgp.c.

◆ BGP_ENCAP_TUNNEL_IP_IPSEC

#define BGP_ENCAP_TUNNEL_IP_IPSEC   5

Definition at line 498 of file print-bgp.c.

◆ BGP_ENCAP_TUNNEL_IPSEC

#define BGP_ENCAP_TUNNEL_IPSEC   4

Definition at line 497 of file print-bgp.c.

◆ BGP_ENCAP_TUNNEL_IPV6

#define BGP_ENCAP_TUNNEL_IPV6   14

Definition at line 507 of file print-bgp.c.

◆ BGP_ENCAP_TUNNEL_L2TPV3_IP

#define BGP_ENCAP_TUNNEL_L2TPV3_IP   1

Definition at line 494 of file print-bgp.c.

◆ BGP_ENCAP_TUNNEL_MPLS

#define BGP_ENCAP_TUNNEL_MPLS   10

Definition at line 503 of file print-bgp.c.

◆ BGP_ENCAP_TUNNEL_MPLS_GRE

#define BGP_ENCAP_TUNNEL_MPLS_GRE   11

Definition at line 504 of file print-bgp.c.

◆ BGP_ENCAP_TUNNEL_MPLS_IP

#define BGP_ENCAP_TUNNEL_MPLS_IP   6

Definition at line 499 of file print-bgp.c.

◆ BGP_ENCAP_TUNNEL_MPLS_UDP

#define BGP_ENCAP_TUNNEL_MPLS_UDP   13

Definition at line 506 of file print-bgp.c.

◆ BGP_ENCAP_TUNNEL_NVGRE

#define BGP_ENCAP_TUNNEL_NVGRE   9

Definition at line 502 of file print-bgp.c.

◆ BGP_ENCAP_TUNNEL_SR

#define BGP_ENCAP_TUNNEL_SR   17

Definition at line 510 of file print-bgp.c.

◆ BGP_ENCAP_TUNNEL_SR_TE

#define BGP_ENCAP_TUNNEL_SR_TE   15

Definition at line 508 of file print-bgp.c.

◆ BGP_ENCAP_TUNNEL_TRANSMIT

#define BGP_ENCAP_TUNNEL_TRANSMIT   3

Definition at line 496 of file print-bgp.c.

◆ BGP_ENCAP_TUNNEL_VXLAN

#define BGP_ENCAP_TUNNEL_VXLAN   8

Definition at line 501 of file print-bgp.c.

◆ BGP_ENCAP_TUNNEL_VXLAN_GPE

#define BGP_ENCAP_TUNNEL_VXLAN_GPE   12

Definition at line 505 of file print-bgp.c.

◆ BGP_EXT_COM_EIGRP_EXT_REMAS_REMID

#define BGP_EXT_COM_EIGRP_EXT_REMAS_REMID   0x8804

Definition at line 453 of file print-bgp.c.

◆ BGP_EXT_COM_EIGRP_EXT_REMPROTO_REMMETRIC

#define BGP_EXT_COM_EIGRP_EXT_REMPROTO_REMMETRIC   0x8805

Definition at line 454 of file print-bgp.c.

◆ BGP_EXT_COM_EIGRP_GEN

#define BGP_EXT_COM_EIGRP_GEN   0x8800

Definition at line 449 of file print-bgp.c.

◆ BGP_EXT_COM_EIGRP_METRIC_AS_DELAY

#define BGP_EXT_COM_EIGRP_METRIC_AS_DELAY   0x8801

Definition at line 450 of file print-bgp.c.

◆ BGP_EXT_COM_EIGRP_METRIC_LOAD_MTU

#define BGP_EXT_COM_EIGRP_METRIC_LOAD_MTU   0x8803

Definition at line 452 of file print-bgp.c.

◆ BGP_EXT_COM_EIGRP_METRIC_REL_NH_BW

#define BGP_EXT_COM_EIGRP_METRIC_REL_NH_BW   0x8802

Definition at line 451 of file print-bgp.c.

◆ BGP_EXT_COM_ENCAP

#define BGP_EXT_COM_ENCAP   0x030c /* rfc5512 */

Definition at line 436 of file print-bgp.c.

◆ BGP_EXT_COM_L2INFO

#define BGP_EXT_COM_L2INFO   0x800a /* draft-kompella-ppvpn-l2vpn */

Definition at line 441 of file print-bgp.c.

◆ BGP_EXT_COM_L2VPN_RT_0

#define BGP_EXT_COM_L2VPN_RT_0   0x000a /* L2VPN Identifier,Format AS(2bytes):AN(4bytes) */

Definition at line 445 of file print-bgp.c.

◆ BGP_EXT_COM_L2VPN_RT_1

#define BGP_EXT_COM_L2VPN_RT_1   0xF10a /* L2VPN Identifier,Format IP address:AN(2bytes) */

Definition at line 446 of file print-bgp.c.

◆ BGP_EXT_COM_LINKBAND

#define BGP_EXT_COM_LINKBAND   0x4004 /* Link Bandwidth,Format AS(2B):Bandwidth(4B) */

Definition at line 427 of file print-bgp.c.

◆ BGP_EXT_COM_OSPF_RID

#define BGP_EXT_COM_OSPF_RID   0x0107 /* OSPF Router ID,Format RouterID(4B):Unused(2B) */

Definition at line 438 of file print-bgp.c.

◆ BGP_EXT_COM_OSPF_RID2

#define BGP_EXT_COM_OSPF_RID2   0x8001 /* duplicate - keep for backwards compatibility */

Definition at line 439 of file print-bgp.c.

◆ BGP_EXT_COM_OSPF_RTYPE

#define BGP_EXT_COM_OSPF_RTYPE   0x0306 /* OSPF Route Type,Format Area(4B):RouteType(1B):Options(1B) */

Definition at line 434 of file print-bgp.c.

◆ BGP_EXT_COM_OSPF_RTYPE2

#define BGP_EXT_COM_OSPF_RTYPE2   0x8000 /* duplicate - keep for backwards compatibility */

Definition at line 435 of file print-bgp.c.

◆ BGP_EXT_COM_RO_0

#define BGP_EXT_COM_RO_0   0x0003 /* Route Origin,Format AS(2bytes):AN(4bytes) */

Definition at line 424 of file print-bgp.c.

◆ BGP_EXT_COM_RO_1

#define BGP_EXT_COM_RO_1   0x0103 /* Route Origin,Format IP address:AN(2bytes) */

Definition at line 425 of file print-bgp.c.

◆ BGP_EXT_COM_RO_2

#define BGP_EXT_COM_RO_2   0x0203 /* Route Origin,Format AN(4bytes):local(2bytes) */

Definition at line 426 of file print-bgp.c.

◆ BGP_EXT_COM_RT_0

#define BGP_EXT_COM_RT_0   0x0002 /* Route Target,Format AS(2bytes):AN(4bytes) */

Definition at line 421 of file print-bgp.c.

◆ BGP_EXT_COM_RT_1

#define BGP_EXT_COM_RT_1   0x0102 /* Route Target,Format IP address:AN(2bytes) */

Definition at line 422 of file print-bgp.c.

◆ BGP_EXT_COM_RT_2

#define BGP_EXT_COM_RT_2   0x0202 /* Route Target,Format AN(4bytes):local(2bytes) */

Definition at line 423 of file print-bgp.c.

◆ BGP_EXT_COM_SOURCE_AS

#define BGP_EXT_COM_SOURCE_AS   0x0009 /* RFC-ietf-l3vpn-2547bis-mcast-bgp-08.txt */

Definition at line 443 of file print-bgp.c.

◆ BGP_EXT_COM_VPN_ORIGIN

#define BGP_EXT_COM_VPN_ORIGIN   0x0005 /* OSPF Domain ID / VPN of Origin - draft-rosen-vpns-ospf-bgp-mpls */

Definition at line 429 of file print-bgp.c.

◆ BGP_EXT_COM_VPN_ORIGIN2

#define BGP_EXT_COM_VPN_ORIGIN2   0x0105 /* duplicate - keep for backwards compatibility */

Definition at line 430 of file print-bgp.c.

◆ BGP_EXT_COM_VPN_ORIGIN3

#define BGP_EXT_COM_VPN_ORIGIN3   0x0205 /* duplicate - keep for backwards compatibility */

Definition at line 431 of file print-bgp.c.

◆ BGP_EXT_COM_VPN_ORIGIN4

#define BGP_EXT_COM_VPN_ORIGIN4   0x8005 /* duplicate - keep for backwards compatibility */

Definition at line 432 of file print-bgp.c.

◆ BGP_EXT_COM_VRF_RT_IMP

#define BGP_EXT_COM_VRF_RT_IMP   0x010b /* RFC-ietf-l3vpn-2547bis-mcast-bgp-08.txt */

Definition at line 444 of file print-bgp.c.

◆ BGP_KEEPALIVE

#define BGP_KEEPALIVE   4

Definition at line 62 of file print-bgp.c.

◆ BGP_MP_NLRI_MINSIZE

#define BGP_MP_NLRI_MINSIZE   3 /* End of RIB Marker detection */

Definition at line 147 of file print-bgp.c.

◆ BGP_MULTICAST_VPN_ROUTE_TYPE_INTER_AS_I_PMSI

#define BGP_MULTICAST_VPN_ROUTE_TYPE_INTER_AS_I_PMSI   2

Definition at line 1125 of file print-bgp.c.

◆ BGP_MULTICAST_VPN_ROUTE_TYPE_INTRA_AS_I_PMSI

#define BGP_MULTICAST_VPN_ROUTE_TYPE_INTRA_AS_I_PMSI   1

Definition at line 1124 of file print-bgp.c.

◆ BGP_MULTICAST_VPN_ROUTE_TYPE_INTRA_AS_SEG_LEAF

#define BGP_MULTICAST_VPN_ROUTE_TYPE_INTRA_AS_SEG_LEAF   4

Definition at line 1127 of file print-bgp.c.

◆ BGP_MULTICAST_VPN_ROUTE_TYPE_S_PMSI

#define BGP_MULTICAST_VPN_ROUTE_TYPE_S_PMSI   3

Definition at line 1126 of file print-bgp.c.

◆ BGP_MULTICAST_VPN_ROUTE_TYPE_SHARED_TREE_JOIN

#define BGP_MULTICAST_VPN_ROUTE_TYPE_SHARED_TREE_JOIN   6

Definition at line 1129 of file print-bgp.c.

◆ BGP_MULTICAST_VPN_ROUTE_TYPE_SOURCE_ACTIVE

#define BGP_MULTICAST_VPN_ROUTE_TYPE_SOURCE_ACTIVE   5

Definition at line 1128 of file print-bgp.c.

◆ BGP_MULTICAST_VPN_ROUTE_TYPE_SOURCE_TREE_JOIN

#define BGP_MULTICAST_VPN_ROUTE_TYPE_SOURCE_TREE_JOIN   7

Definition at line 1130 of file print-bgp.c.

◆ BGP_NOTIFICATION

#define BGP_NOTIFICATION   3

Definition at line 61 of file print-bgp.c.

◆ BGP_NOTIFICATION_SIZE

#define BGP_NOTIFICATION_SIZE   21 /* unaligned */

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

◆ BGP_NOTIFY_MAJOR_CAP

#define BGP_NOTIFY_MAJOR_CAP   7

Definition at line 253 of file print-bgp.c.

◆ BGP_NOTIFY_MAJOR_CEASE

#define BGP_NOTIFY_MAJOR_CEASE   6

Definition at line 252 of file print-bgp.c.

◆ BGP_NOTIFY_MAJOR_FSM

#define BGP_NOTIFY_MAJOR_FSM   5

Definition at line 251 of file print-bgp.c.

◆ BGP_NOTIFY_MAJOR_HOLDTIME

#define BGP_NOTIFY_MAJOR_HOLDTIME   4

Definition at line 250 of file print-bgp.c.

◆ BGP_NOTIFY_MAJOR_MSG

#define BGP_NOTIFY_MAJOR_MSG   1

Definition at line 247 of file print-bgp.c.

◆ BGP_NOTIFY_MAJOR_OPEN

#define BGP_NOTIFY_MAJOR_OPEN   2

Definition at line 248 of file print-bgp.c.

◆ BGP_NOTIFY_MAJOR_UPDATE

#define BGP_NOTIFY_MAJOR_UPDATE   3

Definition at line 249 of file print-bgp.c.

◆ BGP_NOTIFY_MINOR_CEASE_ADMIN_SHUTDOWN_LEN

#define BGP_NOTIFY_MINOR_CEASE_ADMIN_SHUTDOWN_LEN   128

Definition at line 271 of file print-bgp.c.

◆ BGP_NOTIFY_MINOR_CEASE_MAXPRFX

#define BGP_NOTIFY_MINOR_CEASE_MAXPRFX   1

Definition at line 267 of file print-bgp.c.

◆ BGP_NOTIFY_MINOR_CEASE_RESET

#define BGP_NOTIFY_MINOR_CEASE_RESET   4

Definition at line 270 of file print-bgp.c.

◆ BGP_NOTIFY_MINOR_CEASE_SHUT

#define BGP_NOTIFY_MINOR_CEASE_SHUT   2

Definition at line 269 of file print-bgp.c.

◆ BGP_OPEN

#define BGP_OPEN   1

Definition at line 59 of file print-bgp.c.

◆ BGP_OPEN_SIZE

#define BGP_OPEN_SIZE   29 /* unaligned */

Definition at line 85 of file print-bgp.c.

◆ BGP_OPT_AUTH

#define BGP_OPT_AUTH   1

Definition at line 205 of file print-bgp.c.

◆ BGP_OPT_CAP

#define BGP_OPT_CAP   2

Definition at line 206 of file print-bgp.c.

◆ BGP_OPT_SIZE

#define BGP_OPT_SIZE   2 /* some compilers may pad to 4 bytes */

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

◆ BGP_OSPF_RTYPE_EXT

#define BGP_OSPF_RTYPE_EXT   5 /* OSPF External LSA, note that ASBR doesn't apply to MPLS-VPN */

Definition at line 537 of file print-bgp.c.

◆ BGP_OSPF_RTYPE_METRIC_TYPE

#define BGP_OSPF_RTYPE_METRIC_TYPE   0x1 /* LSB of RTYPE Options Field */

Definition at line 540 of file print-bgp.c.

◆ BGP_OSPF_RTYPE_NET

#define BGP_OSPF_RTYPE_NET   2 /* OSPF Network LSA */

Definition at line 535 of file print-bgp.c.

◆ BGP_OSPF_RTYPE_NSSA

#define BGP_OSPF_RTYPE_NSSA   7 /* OSPF NSSA External*/

Definition at line 538 of file print-bgp.c.

◆ BGP_OSPF_RTYPE_RTR

#define BGP_OSPF_RTYPE_RTR   1 /* OSPF Router LSA */

Definition at line 534 of file print-bgp.c.

◆ BGP_OSPF_RTYPE_SHAM

#define BGP_OSPF_RTYPE_SHAM   129 /* OSPF-MPLS-VPN Sham link */

Definition at line 539 of file print-bgp.c.

◆ BGP_OSPF_RTYPE_SUM

#define BGP_OSPF_RTYPE_SUM   3 /* OSPF Summary LSA */

Definition at line 536 of file print-bgp.c.

◆ BGP_PMSI_TUNNEL_INGRESS

#define BGP_PMSI_TUNNEL_INGRESS   6

Definition at line 344 of file print-bgp.c.

◆ BGP_PMSI_TUNNEL_LDP_MP2MP

#define BGP_PMSI_TUNNEL_LDP_MP2MP   7

Definition at line 345 of file print-bgp.c.

◆ BGP_PMSI_TUNNEL_LDP_P2MP

#define BGP_PMSI_TUNNEL_LDP_P2MP   2

Definition at line 340 of file print-bgp.c.

◆ BGP_PMSI_TUNNEL_PIM_BIDIR

#define BGP_PMSI_TUNNEL_PIM_BIDIR   5

Definition at line 343 of file print-bgp.c.

◆ BGP_PMSI_TUNNEL_PIM_SM

#define BGP_PMSI_TUNNEL_PIM_SM   4

Definition at line 342 of file print-bgp.c.

◆ BGP_PMSI_TUNNEL_PIM_SSM

#define BGP_PMSI_TUNNEL_PIM_SSM   3

Definition at line 341 of file print-bgp.c.

◆ BGP_PMSI_TUNNEL_RSVP_P2MP

#define BGP_PMSI_TUNNEL_RSVP_P2MP   1

Definition at line 339 of file print-bgp.c.

◆ BGP_ROUTE_REFRESH

#define BGP_ROUTE_REFRESH   5

Definition at line 63 of file print-bgp.c.

◆ BGP_ROUTE_REFRESH_SIZE

#define BGP_ROUTE_REFRESH_SIZE   23

Definition at line 112 of file print-bgp.c.

◆ BGP_SIZE

#define BGP_SIZE   19 /* unaligned */

Definition at line 57 of file print-bgp.c.

◆ BGP_UPDATE

#define BGP_UPDATE   2

Definition at line 60 of file print-bgp.c.

◆ BGP_VPN_RD_LEN

#define BGP_VPN_RD_LEN   8

Definition at line 395 of file print-bgp.c.

◆ BGPTYPE_ADVERTISERS

#define BGPTYPE_ADVERTISERS   12 /* deprecated RFC1863 */

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

◆ BGPTYPE_AGGREGATOR

#define BGPTYPE_AGGREGATOR   7

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

◆ BGPTYPE_AGGREGATOR4

#define BGPTYPE_AGGREGATOR4   18 /* RFC6793 */

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

◆ BGPTYPE_AIGP

#define BGPTYPE_AIGP   26 /* RFC7311 */

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

◆ BGPTYPE_AS4_PATH

#define BGPTYPE_AS4_PATH   17 /* RFC6793 */

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

◆ BGPTYPE_AS_PATH

#define BGPTYPE_AS_PATH   2

Definition at line 120 of file print-bgp.c.

◆ BGPTYPE_ATOMIC_AGGREGATE

#define BGPTYPE_ATOMIC_AGGREGATE   6

Definition at line 124 of file print-bgp.c.

◆ BGPTYPE_ATTR_SET

#define BGPTYPE_ATTR_SET   128 /* RFC6368 */

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

◆ BGPTYPE_CLUSTER_LIST

#define BGPTYPE_CLUSTER_LIST   10 /* RFC4456 */

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

◆ BGPTYPE_COMMUNITIES

#define BGPTYPE_COMMUNITIES   8 /* RFC1997 */

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

◆ BGPTYPE_DPA

#define BGPTYPE_DPA   11 /* deprecated, draft-ietf-idr-bgp-dpa */

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

◆ BGPTYPE_ENTROPY_LABEL

#define BGPTYPE_ENTROPY_LABEL   28 /* RFC6790 */

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

◆ BGPTYPE_EXTD_COMMUNITIES

#define BGPTYPE_EXTD_COMMUNITIES   16 /* RFC4360 */

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

◆ BGPTYPE_IPV6_EXTD_COMMUNITIES

#define BGPTYPE_IPV6_EXTD_COMMUNITIES   25 /* RFC5701 */

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

◆ BGPTYPE_LARGE_COMMUNITY

#define BGPTYPE_LARGE_COMMUNITY   32 /* draft-ietf-idr-large-community-05 */

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

◆ BGPTYPE_LOCAL_PREF

#define BGPTYPE_LOCAL_PREF   5

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

◆ BGPTYPE_MP_REACH_NLRI

#define BGPTYPE_MP_REACH_NLRI   14 /* RFC4760 */

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

◆ BGPTYPE_MP_UNREACH_NLRI

#define BGPTYPE_MP_UNREACH_NLRI   15 /* RFC4760 */

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

◆ BGPTYPE_MULTI_EXIT_DISC

#define BGPTYPE_MULTI_EXIT_DISC   4

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

◆ BGPTYPE_NEXT_HOP

#define BGPTYPE_NEXT_HOP   3

Definition at line 121 of file print-bgp.c.

◆ BGPTYPE_ORIGIN

#define BGPTYPE_ORIGIN   1

Definition at line 119 of file print-bgp.c.

◆ BGPTYPE_ORIGINATOR_ID

#define BGPTYPE_ORIGINATOR_ID   9 /* RFC4456 */

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

◆ BGPTYPE_PE_DISTINGUISHER_LABEL

#define BGPTYPE_PE_DISTINGUISHER_LABEL   27 /* RFC6514 */

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

◆ BGPTYPE_PMSI_TUNNEL

#define BGPTYPE_PMSI_TUNNEL   22 /* RFC6514 */

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

◆ BGPTYPE_RCID_PATH

#define BGPTYPE_RCID_PATH   13 /* deprecated RFC1863 */

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

◆ BGPTYPE_TRAFFIC_ENG

#define BGPTYPE_TRAFFIC_ENG   24 /* RFC5543 */

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

◆ BGPTYPE_TUNNEL_ENCAP

#define BGPTYPE_TUNNEL_ENCAP   23 /* RFC5512 */

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

◆ ITEMCHECK

#define ITEMCHECK (   minlen)    if (itemlen < minlen) goto badtlv;

Definition at line 583 of file print-bgp.c.

◆ MDT_VPN_NLRI_LEN

#define MDT_VPN_NLRI_LEN   16

Definition at line 1091 of file print-bgp.c.

◆ SAFNUM_EVPN

#define SAFNUM_EVPN   70

Definition at line 386 of file print-bgp.c.

◆ SAFNUM_LABUNICAST

#define SAFNUM_LABUNICAST   4

Definition at line 376 of file print-bgp.c.

◆ SAFNUM_MDT

#define SAFNUM_MDT   66

Definition at line 384 of file print-bgp.c.

◆ SAFNUM_MULTICAST

#define SAFNUM_MULTICAST   2

Definition at line 373 of file print-bgp.c.

◆ SAFNUM_MULTICAST_VPN

#define SAFNUM_MULTICAST_VPN   5

Definition at line 378 of file print-bgp.c.

◆ SAFNUM_RES

#define SAFNUM_RES   0

Definition at line 371 of file print-bgp.c.

◆ SAFNUM_RT_ROUTING_INFO

#define SAFNUM_RT_ROUTING_INFO   132

Definition at line 393 of file print-bgp.c.

◆ SAFNUM_TUNNEL

#define SAFNUM_TUNNEL   64

Definition at line 380 of file print-bgp.c.

◆ SAFNUM_UNICAST

#define SAFNUM_UNICAST   1

Definition at line 372 of file print-bgp.c.

◆ SAFNUM_UNIMULTICAST

#define SAFNUM_UNIMULTICAST   3 /* deprecated now */

Definition at line 374 of file print-bgp.c.

◆ SAFNUM_VPLS

#define SAFNUM_VPLS   65

Definition at line 382 of file print-bgp.c.

◆ SAFNUM_VPNMULTICAST

#define SAFNUM_VPNMULTICAST   129

Definition at line 390 of file print-bgp.c.

◆ SAFNUM_VPNUNICAST

#define SAFNUM_VPNUNICAST   128

Definition at line 388 of file print-bgp.c.

◆ SAFNUM_VPNUNIMULTICAST

#define SAFNUM_VPNUNIMULTICAST   130 /* deprecated now */

Definition at line 391 of file print-bgp.c.

◆ UPDATE_BUF_BUFLEN

#define UPDATE_BUF_BUFLEN (   buf,
  buflen,
  stringlen 
)
Value:
if (stringlen<0) \
buflen=0; \
else if ((u_int)stringlen>buflen) \
buflen=0; \
else { \
buflen-=stringlen; \
buf+=stringlen; \
}
static uint32_t stringlen
Definition: smbutil.c:26

Definition at line 1244 of file print-bgp.c.

Function Documentation

◆ as_printf()

static char* as_printf ( netdissect_options ndo,
char *  str,
size_t  size,
u_int  asnum 
)
static

◆ bgp_attr_get_as_size()

static u_int bgp_attr_get_as_size ( netdissect_options ndo,
uint8_t  bgpa_type,
const u_char *  pptr,
u_int  len 
)
static

Definition at line 1539 of file print-bgp.c.

References BGP_AS_SEG_TYPE_MAX, BGP_AS_SEG_TYPE_MIN, BGPTYPE_AS4_PATH, and GET_U_1.

Referenced by bgp_attr_print().

◆ bgp_attr_print()

static int bgp_attr_print ( netdissect_options ndo,
uint8_t  atype,
const u_char *  pptr,
u_int  len,
const unsigned  attr_set_level 
)
static

Definition at line 1870 of file print-bgp.c.

References AFNUM_INET, AFNUM_INET6, AFNUM_L2VPN, AFNUM_NSAP, AFNUM_VPLS, as_printf(), AS_STR_SIZE, BGP_AIGP_TLV, bgp_aigp_values, bgp_as_path_segment_close_values, bgp_as_path_segment_open_values, bgp_attr_get_as_size(), bgp_attr_len, bgp_attr_lenlen, bgp_attr_values, BGP_COMMUNITY_NO_ADVERT, BGP_COMMUNITY_NO_EXPORT, BGP_COMMUNITY_NO_EXPORT_SUBCONFED, bgp_extd_comm_flag_values, bgp_extd_comm_subtype_values, bgp_extended_community_print(), bgp_mp_af_print(), BGP_MP_NLRI_MINSIZE, bgp_nlri_print(), bgp_origin_values, bgp_pmsi_flag_values, BGP_PMSI_TUNNEL_INGRESS, BGP_PMSI_TUNNEL_LDP_MP2MP, BGP_PMSI_TUNNEL_LDP_P2MP, BGP_PMSI_TUNNEL_PIM_BIDIR, BGP_PMSI_TUNNEL_PIM_SM, BGP_PMSI_TUNNEL_PIM_SSM, BGP_PMSI_TUNNEL_RSVP_P2MP, bgp_pmsi_tunnel_values, BGP_VPN_RD_LEN, bgp_vpn_rd_print(), BGPTYPE_AGGREGATOR, BGPTYPE_AGGREGATOR4, BGPTYPE_AIGP, BGPTYPE_AS4_PATH, BGPTYPE_AS_PATH, BGPTYPE_ATOMIC_AGGREGATE, BGPTYPE_ATTR_SET, BGPTYPE_CLUSTER_LIST, BGPTYPE_COMMUNITIES, BGPTYPE_EXTD_COMMUNITIES, BGPTYPE_LARGE_COMMUNITY, BGPTYPE_LOCAL_PREF, BGPTYPE_MP_REACH_NLRI, BGPTYPE_MP_UNREACH_NLRI, BGPTYPE_MULTI_EXIT_DISC, BGPTYPE_NEXT_HOP, BGPTYPE_ORIGIN, BGPTYPE_ORIGINATOR_ID, BGPTYPE_PMSI_TUNNEL, bittok2str(), check_add_path(), GET_BE_U_2, GET_BE_U_3, GET_BE_U_4, GET_BE_U_8, GET_IP6ADDR_STRING, GET_IPADDR_STRING, GET_ISONSAP_STRING, GET_U_1, ND_BYTES_BETWEEN, ND_PRINT, ND_TCHECK_1, ND_TCHECK_2, ND_TCHECK_3, ND_TCHECK_4, ND_TCHECK_5, ND_TCHECK_8, ND_TCHECK_LEN, netdissect_options::ndo_vflag, print_unknown_data(), SAFNUM_LABUNICAST, SAFNUM_MDT, SAFNUM_MULTICAST, SAFNUM_MULTICAST_VPN, SAFNUM_RT_ROUTING_INFO, SAFNUM_UNICAST, SAFNUM_UNIMULTICAST, SAFNUM_VPLS, SAFNUM_VPNMULTICAST, SAFNUM_VPNUNICAST, SAFNUM_VPNUNIMULTICAST, tok2str(), and tunnel_type.

Referenced by bgp_update_print().

◆ bgp_capabilities_print()

◆ bgp_extended_community_print()

◆ bgp_mp_af_print()

◆ bgp_nlri_print()

◆ bgp_notification_print()

◆ bgp_open_print()

◆ bgp_pdu_print()

◆ bgp_print()

◆ bgp_route_refresh_print()

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

◆ bgp_rt_prefix_print()

static char* bgp_rt_prefix_print ( netdissect_options ndo,
const u_char *  pptr,
u_int  plen 
)
static

◆ bgp_update_print()

static void bgp_update_print ( netdissect_options ndo,
const u_char *  dat,
u_int  length 
)
static

◆ bgp_vpn_ip_print()

static char* bgp_vpn_ip_print ( netdissect_options ndo,
const u_char *  pptr,
u_int  addr_length 
)
static

Definition at line 671 of file print-bgp.c.

References GET_IP6ADDR_STRING, GET_IPADDR_STRING, and snprintf().

Referenced by bgp_vpn_sg_print(), and decode_multicast_vpn().

◆ bgp_vpn_rd_print()

◆ bgp_vpn_sg_print()

static u_int bgp_vpn_sg_print ( netdissect_options ndo,
const u_char *  pptr,
char *  buf,
size_t  buflen 
)
static

Definition at line 715 of file print-bgp.c.

References bgp_vpn_ip_print(), GET_U_1, ND_TCHECK_LEN, and snprintf().

Referenced by decode_multicast_vpn().

◆ check_add_path()

static int check_add_path ( netdissect_options ndo,
const u_char *  pptr,
u_int  length,
u_int  max_prefix_length 
)
static

Definition at line 1593 of file print-bgp.c.

References GET_U_1, and ND_TTEST_1.

Referenced by bgp_attr_print(), and bgp_update_print().

◆ decode_clnp_prefix()

static int decode_clnp_prefix ( netdissect_options ndo,
const u_char *  pptr,
char *  buf,
size_t  buflen 
)
static

Definition at line 1472 of file print-bgp.c.

References GET_CPY_BYTES, GET_U_1, isonsap_string(), and snprintf().

Referenced by bgp_nlri_print().

◆ decode_labeled_prefix4()

static int decode_labeled_prefix4 ( netdissect_options ndo,
const u_char *  pptr,
u_int  itemlen,
char *  buf,
size_t  buflen 
)
static

Definition at line 613 of file print-bgp.c.

References GET_BE_U_3, GET_CPY_BYTES, GET_U_1, ipaddr_string(), ITEMCHECK, ND_TCHECK_4, and snprintf().

Referenced by bgp_nlri_print().

◆ decode_labeled_prefix6()

static int decode_labeled_prefix6 ( netdissect_options ndo,
const u_char *  pptr,
u_int  itemlen,
char *  buf,
size_t  buflen 
)
static

Definition at line 1394 of file print-bgp.c.

References GET_BE_U_3, GET_CPY_BYTES, GET_U_1, ip6addr_string(), ITEMCHECK, ND_TCHECK_4, and snprintf().

Referenced by bgp_nlri_print().

◆ decode_labeled_vpn_clnp_prefix()

static int decode_labeled_vpn_clnp_prefix ( netdissect_options ndo,
const u_char *  pptr,
char *  buf,
size_t  buflen 
)
static

Definition at line 1498 of file print-bgp.c.

References bgp_vpn_rd_print(), GET_BE_U_3, GET_CPY_BYTES, GET_U_1, isonsap_string(), and snprintf().

Referenced by bgp_nlri_print().

◆ decode_labeled_vpn_l2()

static int decode_labeled_vpn_l2 ( netdissect_options ndo,
const u_char *  pptr,
char *  buf,
size_t  buflen 
)
static

◆ decode_labeled_vpn_prefix4()

static int decode_labeled_vpn_prefix4 ( netdissect_options ndo,
const u_char *  pptr,
char *  buf,
size_t  buflen 
)
static

Definition at line 1048 of file print-bgp.c.

References bgp_vpn_rd_print(), GET_BE_U_3, GET_CPY_BYTES, GET_U_1, ipaddr_string(), and snprintf().

Referenced by bgp_nlri_print().

◆ decode_labeled_vpn_prefix6()

static int decode_labeled_vpn_prefix6 ( netdissect_options ndo,
const u_char *  pptr,
char *  buf,
size_t  buflen 
)
static

Definition at line 1438 of file print-bgp.c.

References bgp_vpn_rd_print(), GET_BE_U_3, GET_CPY_BYTES, GET_U_1, ip6addr_string(), and snprintf().

Referenced by bgp_nlri_print().

◆ decode_mdt_vpn_nlri()

static int decode_mdt_vpn_nlri ( netdissect_options ndo,
const u_char *  pptr,
char *  buf,
size_t  buflen 
)
static

Definition at line 1094 of file print-bgp.c.

Referenced by bgp_nlri_print().

◆ decode_multicast_vpn()

◆ decode_prefix4()

int decode_prefix4 ( netdissect_options ndo,
const u_char *  pptr,
u_int  itemlen,
char *  buf,
size_t  buflen 
)

Definition at line 586 of file print-bgp.c.

References GET_CPY_BYTES, GET_U_1, ipaddr_string(), ITEMCHECK, and snprintf().

Referenced by bgp_nlri_print(), bgp_update_print(), and ldp_tlv_print().

◆ decode_prefix6()

int decode_prefix6 ( netdissect_options ndo,
const u_char *  pd,
u_int  itemlen,
char *  buf,
size_t  buflen 
)

Definition at line 1366 of file print-bgp.c.

References GET_CPY_BYTES, GET_U_1, ip6addr_string(), ITEMCHECK, pd, and snprintf().

Referenced by bgp_nlri_print(), ldp_tlv_print(), and print_prefix().

◆ decode_rt_routing_info()

static int decode_rt_routing_info ( netdissect_options ndo,
const u_char *  pptr 
)
static

Definition at line 991 of file print-bgp.c.

References as_printf(), AS_STR_SIZE, bgp_rt_prefix_print(), GET_BE_U_4, GET_CPY_BYTES, GET_U_1, and ND_PRINT.

Referenced by bgp_nlri_print().

Variable Documentation

◆ bgp_add_path_recvsend

const struct tok bgp_add_path_recvsend[]
static
Initial value:
= {
{ 1, "Receive" },
{ 2, "Send" },
{ 3, "Both" },
{ 0, NULL },
}

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

Referenced by bgp_capabilities_print().

◆ bgp_aigp_values

const struct tok bgp_aigp_values[]
static
Initial value:
= {
{ 1 , "AIGP"},
{ 0, NULL}
}

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

Referenced by bgp_attr_print().

◆ bgp_as_path_segment_close_values

const struct tok bgp_as_path_segment_close_values[]
static
Initial value:
= {
{ 2 , ""},
{ 1 , "}"},
{ 3 , ")"},
{ 4 , "})"},
{ 0, NULL}
}

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

Referenced by bgp_attr_print().

◆ bgp_as_path_segment_open_values

const struct tok bgp_as_path_segment_open_values[]
static
Initial value:
= {
{ 2 , ""},
{ 1 , "{ "},
{ 3 , "( "},
{ 4 , "({ "},
{ 0, NULL}
}

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

Referenced by bgp_attr_print().

◆ bgp_attr_values

const struct tok bgp_attr_values[]
static

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

Referenced by bgp_attr_print(), and bgp_update_print().

◆ bgp_capcode_values

const struct tok bgp_capcode_values[]
static
Initial value:
= {
{ 1 , "Multiprotocol Extensions"},
{ 2 , "Route Refresh"},
{ 3 , "Cooperative Route Filtering"},
{ 4 , "Multiple Routes to a Destination"},
{ 5 , "Extended Next Hop Encoding"},
{ 8 , "Multiple Labels"},
{ 64 , "Graceful Restart"},
{ 65 , "32-Bit AS Number"},
{ 67 , "Dynamic Capability"},
{ 68 , "Multisession BGP"},
{ 69 , "Multiple Paths"},
{ 70 , "Enhanced Route Refresh"},
{ 71 , "Long-lived Graceful Restart"},
{ 128 , "Route Refresh (Cisco)"},
{ 0, NULL}
}

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

Referenced by bgp_capabilities_print().

◆ bgp_extd_comm_encap_tunnel_values

const struct tok bgp_extd_comm_encap_tunnel_values[]
static
Initial value:
= {
{ 1 , "L2TPv3 over IP"},
{ 2 , "GRE"},
{ 3 , "Transmit Tunnel"},
{ 4 , "IPsec"},
{ 5 , "IP in IP with IPsec"},
{ 6 , "MPLS in IP with IPsec"},
{ 7 , "IP in IP"},
{ 8 , "VXLAN"},
{ 9 , "NVGRE"},
{ 10 , "MPLS"},
{ 11 , "MPLS in GRE"},
{ 12 , "VXLAN GPE"},
{ 13 , "MPLS in UDP"},
{ 14 , "IPv6"},
{ 15 , "SR TE"},
{ 16 , "Bare"},
{ 17 , "SR"},
{ 0, NULL},
}

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

Referenced by bgp_extended_community_print().

◆ bgp_extd_comm_flag_values

const struct tok bgp_extd_comm_flag_values[]
static
Initial value:
= {
{ 0x8000, "vendor-specific"},
{ 0x4000, "non-transitive"},
{ 0, NULL},
}

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

Referenced by bgp_attr_print().

◆ bgp_extd_comm_ospf_rtype_values

const struct tok bgp_extd_comm_ospf_rtype_values[]
static
Initial value:
= {
{ 1 , "Router" },
{ 2 , "Network" },
{ 3 , "Summary" },
{ 5 , "External" },
{ 7 ,"NSSA External" },
{ 129 ,"MPLS-VPN Sham" },
{ 0, NULL },
}

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

Referenced by bgp_extended_community_print().

◆ bgp_extd_comm_subtype_values

const struct tok bgp_extd_comm_subtype_values[]
static
Initial value:
= {
{ 0x0002 , "target"},
{ 0x0102 , "target"},
{ 0x0202 , "target"},
{ 0x0003 , "origin"},
{ 0x0103 , "origin"},
{ 0x0203 , "origin"},
{ 0x4004 , "link-BW"},
{ 0x0005 , "ospf-domain"},
{ 0x0105 , "ospf-domain"},
{ 0x0205 , "ospf-domain"},
{ 0x8005 , "ospf-domain"},
{ 0x0306 , "ospf-route-type"},
{ 0x8000 , "ospf-route-type"},
{ 0x030c , "encapsulation"},
{ 0x0107 , "ospf-router-id"},
{ 0x8001 , "ospf-router-id"},
{ 0x800a , "layer2-info"},
{ 0x8800 , "eigrp-general-route (flag, tag)" },
{ 0x8801 , "eigrp-route-metric (AS, delay)" },
{ 0x8802 , "eigrp-route-metric (reliability, nexthop, bandwidth)" },
{ 0x8803 , "eigrp-route-metric (load, MTU)" },
{ 0x8804 , "eigrp-external-route (remote-AS, remote-ID)" },
{ 0x8805 , "eigrp-external-route (remote-proto, remote-metric)" },
{ 0x0009 , "source-AS" },
{ 0x010b , "vrf-route-import"},
{ 0x000a , "l2vpn-id"},
{ 0xF10a , "l2vpn-id"},
{ 0, NULL},
}

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

Referenced by bgp_attr_print().

◆ bgp_msg_values

const struct tok bgp_msg_values[]
static
Initial value:
= {
{ 1 , "Open"},
{ 2 , "Update"},
{ 3 , "Notification"},
{ 4 , "Keepalive"},
{ 5 , "Route Refresh"},
{ 0, NULL}
}

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

Referenced by bgp_pdu_print(), and bgp_print().

◆ bgp_multicast_vpn_route_type_values

const struct tok bgp_multicast_vpn_route_type_values[]
static
Initial value:
= {
{ 1 , "Intra-AS I-PMSI"},
{ 2 , "Inter-AS I-PMSI"},
{ 3 , "S-PMSI"},
{ 4 , "Intra-AS Segment-Leaf"},
{ 5 , "Source-Active"},
{ 6 , "Shared Tree Join"},
{ 7 , "Source Tree Join"},
{ 0, NULL}
}

Definition at line 1094 of file print-bgp.c.

Referenced by decode_multicast_vpn().

◆ bgp_notify_major_values

const struct tok bgp_notify_major_values[]
static
Initial value:
= {
{ 1 , "Message Header Error"},
{ 2 , "OPEN Message Error"},
{ 3 , "UPDATE Message Error"},
{ 4 ,"Hold Timer Expired"},
{ 5 , "Finite State Machine Error"},
{ 6 , "Cease"},
{ 7 , "Capability Message Error"},
{ 0, NULL}
}

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

Referenced by bgp_notification_print().

◆ bgp_notify_minor_cap_values

const struct tok bgp_notify_minor_cap_values[]
static
Initial value:
= {
{ 1, "Invalid Action Value" },
{ 2, "Invalid Capability Length" },
{ 3, "Malformed Capability Value" },
{ 4, "Unsupported Capability Code" },
{ 0, NULL }
}

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

Referenced by bgp_notification_print().

◆ bgp_notify_minor_cease_values

const struct tok bgp_notify_minor_cease_values[]
static
Initial value:
= {
{ 1 , "Maximum Number of Prefixes Reached"},
{ 2 , "Administrative Shutdown"},
{ 3, "Peer Unconfigured"},
{ 4 , "Administrative Reset"},
{ 5, "Connection Rejected"},
{ 6, "Other Configuration Change"},
{ 7, "Connection Collision Resolution"},
{ 0, NULL}
}

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

Referenced by bgp_notification_print().

◆ bgp_notify_minor_fsm_values

const struct tok bgp_notify_minor_fsm_values[]
static
Initial value:
= {
{ 0, "Unspecified Error"},
{ 1, "In OpenSent State"},
{ 2, "In OpenConfirm State"},
{ 3, "In Established State"},
{ 0, NULL }
}

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

Referenced by bgp_notification_print().

◆ bgp_notify_minor_msg_values

const struct tok bgp_notify_minor_msg_values[]
static
Initial value:
= {
{ 1, "Connection Not Synchronized"},
{ 2, "Bad Message Length"},
{ 3, "Bad Message Type"},
{ 0, NULL}
}

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

Referenced by bgp_notification_print().

◆ bgp_notify_minor_open_values

const struct tok bgp_notify_minor_open_values[]
static
Initial value:
= {
{ 1, "Unsupported Version Number"},
{ 2, "Bad Peer AS"},
{ 3, "Bad BGP Identifier"},
{ 4, "Unsupported Optional Parameter"},
{ 5, "Authentication Failure"},
{ 6, "Unacceptable Hold Time"},
{ 7, "Capability Message Error"},
{ 0, NULL}
}

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

Referenced by bgp_notification_print().

◆ bgp_notify_minor_update_values

const struct tok bgp_notify_minor_update_values[]
static
Initial value:
= {
{ 1, "Malformed Attribute List"},
{ 2, "Unrecognized Well-known Attribute"},
{ 3, "Missing Well-known Attribute"},
{ 4, "Attribute Flags Error"},
{ 5, "Attribute Length Error"},
{ 6, "Invalid ORIGIN Attribute"},
{ 7, "AS Routing Loop"},
{ 8, "Invalid NEXT_HOP Attribute"},
{ 9, "Optional Attribute Error"},
{ 10, "Invalid Network Field"},
{ 11, "Malformed AS_PATH"},
{ 0, NULL}
}

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

Referenced by bgp_notification_print().

◆ bgp_opt_values

const struct tok bgp_opt_values[]
static
Initial value:
= {
{ 1 , "Authentication Information"},
{ 2 , "Capabilities Advertisement"},
{ 0, NULL}
}

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

Referenced by bgp_open_print().

◆ bgp_origin_values

const struct tok bgp_origin_values[]
static
Initial value:
= {
{ 0, "IGP"},
{ 1, "EGP"},
{ 2, "Incomplete"},
{ 0, NULL}
}

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

Referenced by bgp_attr_print().

◆ bgp_pmsi_flag_values

const struct tok bgp_pmsi_flag_values[]
static
Initial value:
= {
{ 0x01, "Leaf Information required"},
{ 0, NULL}
}

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

Referenced by bgp_attr_print().

◆ bgp_pmsi_tunnel_values

const struct tok bgp_pmsi_tunnel_values[]
static
Initial value:
= {
{ 1 , "RSVP-TE P2MP LSP"},
{ 2 , "LDP P2MP LSP"},
{ 3 , "PIM-SSM Tree"},
{ 4 , "PIM-SM Tree"},
{ 5 , "PIM-Bidir Tree"},
{ 6 , "Ingress Replication"},
{ 7 , "LDP MP2MP LSP"},
{ 0, NULL}
}

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

Referenced by bgp_attr_print().

◆ bgp_safi_values

const struct tok bgp_safi_values[]
static
Initial value:
= {
{ 0 , "Reserved"},
{ 1 , "Unicast"},
{ 2 , "Multicast"},
{ 3 , "Unicast+Multicast"},
{ 4 , "labeled Unicast"},
{ 64 , "Tunnel"},
{ 65 , "VPLS"},
{ 66 , "MDT"},
{ 70 , "EVPN"},
{ 128 , "labeled VPN Unicast"},
{ 129 , "labeled VPN Multicast"},
{ 130 , "labeled VPN Unicast+Multicast"},
{ 132 , "Route Target Routing Information"},
{ 5 , "Multicast VPN"},
{ 0, NULL }
}

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

Referenced by bgp_capabilities_print(), bgp_mp_af_print(), bgp_notification_print(), and bgp_route_refresh_print().