#include "bgpd/bgp_fsm.h"
#include "bgpd/bgp_updgrp.h"
#include "bgpd/bgp_vty.h"
+#include "bgpd/bgp_trace.h"
static void bmp_close(struct bmp *bmp);
static struct bmp_bgp *bmp_bgp_find(struct bgp *bgp);
struct bmp_targets *bt;
struct bmp *bmp;
+ frrtrace(3, frr_bgp, bmp_mirror_packet, peer, type, packet);
+
gettimeofday(&tv, NULL);
if (type == BGP_MSG_OPEN) {
struct stream *packet)
{
if (type == BGP_MSG_OPEN) {
+ frrtrace(2, frr_bgp, bmp_update_saved_open, peer, packet);
+
struct bmp_bgp_peer *bbpeer = bmp_bgp_peer_get(peer);
XFREE(MTYPE_BMP_OPEN, bbpeer->open_tx);
{
struct bmp_bgp *bmpbgp = bmp_bgp_find(peer->bgp);
+ frrtrace(1, frr_bgp, bmp_peer_status_changed, peer);
+
if (!bmpbgp)
return 0;
struct bmp_bgp *bmpbgp = bmp_bgp_find(peer->bgp);
struct bmp_bgp_peer *bbpeer;
+ frrtrace(1, frr_bgp, bmp_peer_backward_transition, peer);
+
if (!bmpbgp)
return 0;
iana_afi_t pkt_afi;
iana_safi_t pkt_safi;
+ frrtrace(3, frr_bgp, bmp_eor, afi, safi, flags);
+
s = stream_new(BGP_MAX_PACKET_SIZE);
/* Make BGP update packet. */
struct bmp_targets *bt;
struct bmp *bmp;
+ if (frrtrace_enabled(frr_bgp, bmp_process)) {
+ char pfxprint[PREFIX2STR_BUFFER];
+
+ prefix2str(&bn->p, pfxprint, sizeof(pfxprint));
+ frrtrace(5, frr_bgp, bmp_process, peer, pfxprint, afi, safi,
+ withdraw);
+ }
+
if (!bmpbgp)
return 0;
TRACEPOINT_LOGLEVEL(frr_bgp, output_filter, TRACE_INFO)
+/* BMP tracepoints */
+
+/* BMP mirrors a packet to all mirror-enabled targets */
+TRACEPOINT_EVENT(
+ frr_bgp,
+ bmp_mirror_packet,
+ TP_ARGS(struct peer *, peer, uint8_t, type, struct stream *, pkt),
+ TP_FIELDS(
+ ctf_string(peer, PEER_HOSTNAME(peer))
+ ctf_integer(uint8_t, type, type)
+ ctf_sequence_hex(uint8_t, packet, pkt->data, size_t,
+ STREAM_READABLE(pkt))
+ )
+)
+
+TRACEPOINT_LOGLEVEL(frr_bgp, bmp_mirror_packet, TRACE_INFO)
+
+
+/* BMP sends an EOR */
+TRACEPOINT_EVENT(
+ frr_bgp,
+ bmp_eor,
+ TP_ARGS(afi_t, afi, safi_t, safi, uint8_t, flags),
+ TP_FIELDS(
+ ctf_integer(afi_t, afi, afi)
+ ctf_integer(safi_t, safi, safi)
+ ctf_integer(uint8_t, flags, flags)
+ )
+)
+
+TRACEPOINT_LOGLEVEL(frr_bgp, bmp_eor, TRACE_INFO)
+
+
+/* BMP updates its copy of the last OPEN a peer sent */
+TRACEPOINT_EVENT(
+ frr_bgp,
+ bmp_update_saved_open,
+ TP_ARGS(struct peer *, peer, struct stream *, pkt),
+ TP_FIELDS(
+ ctf_string(peer, PEER_HOSTNAME(peer))
+ ctf_sequence_hex(uint8_t, packet, pkt->data, size_t,
+ STREAM_READABLE(pkt))
+ )
+)
+
+TRACEPOINT_LOGLEVEL(frr_bgp, bmp_update_saved_open, TRACE_DEBUG)
+
+
+/* BMP is notified of a peer status change internally */
+TRACEPOINT_EVENT(
+ frr_bgp,
+ bmp_peer_status_changed,
+ TP_ARGS(struct peer *, peer),
+ TP_FIELDS(
+ ctf_string(peer, PEER_HOSTNAME(peer))
+ )
+)
+
+TRACEPOINT_LOGLEVEL(frr_bgp, bmp_peer_status_changed, TRACE_DEBUG)
+
+
+/*
+ * BMP is notified that a peer has transitioned in the opposite direction of
+ * Established internally
+ */
+TRACEPOINT_EVENT(
+ frr_bgp,
+ bmp_peer_backward_transition,
+ TP_ARGS(struct peer *, peer),
+ TP_FIELDS(
+ ctf_string(peer, PEER_HOSTNAME(peer))
+ )
+)
+
+TRACEPOINT_LOGLEVEL(frr_bgp, bmp_peer_backward, TRACE_DEBUG)
+
+
+/*
+ * BMP is hooked for a route process
+ */
+TRACEPOINT_EVENT(
+ frr_bgp,
+ bmp_process,
+ TP_ARGS(struct peer *, peer, char *, pfx, afi_t,
+ afi, safi_t, safi, bool, withdraw),
+ TP_FIELDS(
+ ctf_string(peer, PEER_HOSTNAME(peer))
+ ctf_string(prefix, pfx)
+ ctf_integer(afi_t, afi, afi)
+ ctf_integer(safi_t, safi, safi)
+ ctf_integer(bool, withdraw, withdraw)
+ )
+)
+
+TRACEPOINT_LOGLEVEL(frr_bgp, bmp_process, TRACE_DEBUG)
+
/* clang-format on */
#include <lttng/tracepoint-event.h>