summaryrefslogtreecommitdiff
path: root/bgpd/bgp_debug.h
AgeCommit message (Collapse)Author
2025-01-07bgpd: add debugging command for route aggregationEnke Chen
Add a new debugging command: debug bgp aggregate [prefix <A.B.C.D/M|X:X::X:X/M>] Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
2024-06-05bgpd: store number of labels with 8 bitsLouis Scalbert
8 bits are sufficient to store the number of labels because the current maximum is 2. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-04-29Merge pull request #15619 from opensourcerouting/fix/memory_optimizationsDonald Sharp
bgpd: Put BGP_DEBUG/CONF_BGP_DEBUG under ulikely() optimization
2024-04-17bgpd: cleanup references to debug bgp allow-martiansLouis Scalbert
The debug command was removed in 17e9298e47 ("bgpd: Remove 'debug bgp allow-martian'") Cleanup all references to the debug command. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-03-26bgpd: Put BGP_DEBUG/CONF_BGP_DEBUG under ulikely() optimizationDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-01-11bgpd: add hooks for displaying module debug messagesPhilippe Guibert
when a plugin is attached, some debugs may be attached to that plugin. For that, add one hook that is interacting with vty: a boolean indicates what the usage is for: either for impacting the 'show running-config', or for impacting the 'show debugging' command. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com> Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-01-09Merge pull request #15122 from opensourcerouting/fix/drop_packet_send_debugsDonald Sharp
bgpd: Change printing format show debugging for debug bgp updates
2024-01-09bgpd: Drop BGP_DEBUG_PACKET_SEND_DETAIL/BGP_DEBUG_PACKET_SEND constsDonatas Abraitis
Not used anywhere. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-01-07bgpd: Add `debug bgp updates detail` commandDonatas Abraitis
When filtering with `debug bgp updates in x.x.x.x prefix-list plist`, we want to filter out unnecessary messages like: ``` 127.0.0.1(Unknown) rcvd UPDATE wlen 0 attrlen 20 alen 5 ``` Such a line as above will be repeated for all the paths received and it's useless without knowing the prefix (because NLRIs are not parsed yet). But want to see only relevant ones: ``` 127.0.0.1(Unknown) rcvd UPDATE w/ attr: nexthop 127.0.0.1, origin i, path 65002 127.0.0.1(Unknown) rcvd 10.255.255.1/32 IPv4 unicast ``` With `debug bgp updates detail` we can combine this to something like: ``` 127.0.0.1(Unknown) rcvd UPDATE w/ attr: nexthop 127.0.0.1, origin i, path 65002 127.0.0.1(Unknown) rcvd UPDATE wlen 0 attrlen 20 alen 5 127.0.0.1(Unknown) rcvd 10.255.255.1/32 IPv4 unicast ``` Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-11-22bgpd: Optimize prefix-list lookup for debug messagesDonatas Abraitis
Pass prefix-list pointers at configuration time. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-11-22bgpd: Add an ability to filter UPDATEs using neighbor with prefix-listDonatas Abraitis
Before this patch we didn't have an option to filter debug UPDATE messages by specifying an arbitrary prefix, prefix-list or so. We had/have only an option to specify: ``` * debug bgp updates in 10.0.0.1 * debug bgp updates prefix 10.0.1.0/24 ``` Now adding: ``` * debug bgp updates <in|out> 10.0.0.1 prefix-list plist ``` CLI output: ``` r2# show debugging MGMT debugging status: Zebra debugging status: BGP debugging status: BGP updates debugging is on (inbound) for 192.168.2.6 with prefix-list debug Staticd debugging status r2# show running-config | include prefix-list debug debug bgp updates in 192.168.2.6 prefix-list debug r2# ``` Logs: ``` BGP: [PCFFM-WMARW] 192.168.2.3(r3) rcvd UPDATE wlen 0 attrlen 28 alen 5 BGP: [PCFFM-WMARW] 192.168.2.3(r3) rcvd UPDATE wlen 0 attrlen 28 alen 4 BGP: [PCFFM-WMARW] 192.168.2.3(r3) rcvd UPDATE wlen 0 attrlen 0 alen 0 BGP: [M59KS-A3ZXZ] bgp_update_receive: rcvd End-of-RIB for IPv4 Unicast from 192.168.2.3 in vrf default BGP: [PCFFM-WMARW] 192.168.2.4(r4) rcvd UPDATE wlen 0 attrlen 28 alen 5 BGP: [PCFFM-WMARW] 192.168.2.4(r4) rcvd UPDATE wlen 0 attrlen 28 alen 4 BGP: [PCFFM-WMARW] 192.168.2.4(r4) rcvd UPDATE wlen 0 attrlen 0 alen 0 BGP: [M59KS-A3ZXZ] bgp_update_receive: rcvd End-of-RIB for IPv4 Unicast from 192.168.2.4 in vrf default BGP: [PCFFM-WMARW] 192.168.1.1(r1) rcvd UPDATE wlen 0 attrlen 29 alen 5 BGP: [PCFFM-WMARW] 192.168.2.6(r6) rcvd UPDATE wlen 0 attrlen 28 alen 5 BGP: [XXWBM-V772F] 192.168.2.6(r6) rcvd UPDATE w/ attr: nexthop 192.168.2.6, origin ?, metric 0, path 65006 BGP: [YCKEM-GB33T] 192.168.2.6(r6) rcvd 172.16.16.254/32 IPv4 unicast <<<<<<<<<<<< BGP: [PCFFM-WMARW] 192.168.2.6(r6) rcvd UPDATE wlen 0 attrlen 28 alen 4 BGP: [PCFFM-WMARW] 192.168.2.6(r6) rcvd UPDATE wlen 0 attrlen 0 alen 0 BGP: [M59KS-A3ZXZ] bgp_update_receive: rcvd End-of-RIB for IPv4 Unicast from 192.168.2.6 in vrf default BGP: [PCFFM-WMARW] 192.168.2.5(r5) rcvd UPDATE wlen 0 attrlen 28 alen 5 BGP: [PCFFM-WMARW] 192.168.2.5(r5) rcvd UPDATE wlen 0 attrlen 28 alen 4 BGP: [PCFFM-WMARW] 192.168.2.5(r5) rcvd UPDATE wlen 0 attrlen 0 alen 0 BGP: [M59KS-A3ZXZ] bgp_update_receive: rcvd End-of-RIB for IPv4 Unicast from 192.168.2.5 in vrf default BGP: [PCFFM-WMARW] 192.168.1.1(r1) rcvd UPDATE wlen 0 attrlen 29 alen 5 BGP: [PCFFM-WMARW] 192.168.7.7(r7) rcvd UPDATE wlen 0 attrlen 0 alen 0 BGP: [M59KS-A3ZXZ] bgp_update_receive: rcvd End-of-RIB for IPv4 Unicast from 192.168.7.7 in vrf default ``` Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-10-10Revert "bgpd: add linkstate debug"Donald Sharp
This reverts commit de38eada9c0527758bca34984d2f018670d74c9a.
2023-09-18bgpd: add linkstate debugLouis Scalbert
Add the "debug bgp linkstate" command to display incoming link-states prefixes. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-02-09*: auto-convert to SPDX License IDsDavid Lamparter
Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-01-17Revert "bgpd: optimal router reflection cli and fsm changes"Donatas Abraitis
This reverts commit 70cd87ca02125616e9f61f97ab504248c935bd83. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-10-12bgpd: optimal router reflection cli and fsm changesMadhuri Kuruganti
Signed-off-by: Madhuri Kuruganti <maduri111@gmail.com>
2022-10-06bgpd: adding debug command for conditional advertisementMadhuri Kuruganti
Signed-off-by: Madhuri Kuruganti <maduri111@gmail.com>
2022-05-13bgpd: Make bgp_debug.[ch] take `const struct peer *` and return boolDonald Sharp
Several functions in bgp_debug.[ch] take a const struct peer * and also return a bool instead of an int. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-05-12bgpd: Align bgp_debug.h to our standardsDonald Sharp
bgp_debug.h has function declarations that are not properly aligned with our standard on how to do so. Fix. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-05-02bgpd: Implement CEASE/Hard Reset notificationDonatas Abraitis
Also, add N-Bit (Notification) flag for Graceful Restart. This is a preparation for RFC8538. More information: https://datatracker.ietf.org/doc/html/rfc8538 Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2021-06-07bgpd: Generate and advertise gateway IP overlay index with EVPN RT-5Ameya Dharkar
Gateway IP overlay index is generated for EVPN RT-5 when following CLI is configured. router bgp 100 vrf vrf-blue address-family l2vpn evpn advertise ipv4 unicast gateway-ip advertise ipv6 unicast gateway-ip BGP nexthop of the VRF IP/IPv6 route is set as the gateway IP of the corresponding EVPN RT-5 Signed-off-by: Ameya Dharkar <adharkar@vmware.com>
2021-03-23bgpd: add debug option for BFDRafael Zalamena
Add new BGP debug option to enable BFD related debugging messages. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-08-05bgpd: debug flags for MHAnuradha Karuppiah
Filters for MH debug logs Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-07-14Revert "Rpki Encapsulation"revert-5015-rpki_vrf_encapsulationQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-07-02bgpd: add hooks for displaying debug information of a pluginPhilippe Guibert
when a plugin is attached, some debugs may be attached to that plugin. For that, add one hook that is interacting with vty: a boolean indicates what the usage is for: either for impacting the 'show running-config', or for impacting the 'show debugging' command. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2020-06-23bgp: rename bgp_node to bgp_destDonald Sharp
This is the bulk part extracted from "bgpd: Convert from `struct bgp_node` to `struct bgp_dest`". It should not result in any functional change. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-03-26lib, bgpd: Another round of `struct const prefix` cleanupDonald Sharp
Cleanup another set of functions that need to respect the const'ness of a prefix. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-03-24bgpd: Make bgp_debug_bestpath take a `struct bgp_node`Donald Sharp
Defer the grabbing of the prefix for as long as is possible. This is a long term rework of how we access the `struct bgp_node` to only use accessor functions. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-03-23bgpd: Add some `const struct prefix` for a couple more functionsDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-03-21bgpd: Convert lots of int type functions to bool/voidDonatas Abraitis
Some were converted to bool, where true/false status is needed. Converted to void only those, where the return status was only false or true. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-01-23bgpd: Adding BGP GR Global & Per Neighbour FSM changesbisdhdh
* Added FSM for peer and global configuration for graceful restart * Added debug option BGP_GRACEFUL_RESTART for logs specific to graceful restart processing Signed-off-by: Biswajit Sadhu <sadhub@vmware.com>
2020-01-23bgpd: BGP Graceful Restart Per Neighbor(BGPN), DS & header files.bisdhdh
This pr contains all the header files changes for BGP GR per Neighbour(BGPN) feature. Signed-off-by: Biswajit Sadhu <sadhub@vmware.com>
2019-12-02*: generously apply constDavid Lamparter
const const const your boat, merrily down the stream... Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-09bgpd: Remove unused bgp_debug_count functionDonald Sharp
This function was not used anywhere, remove it from the system. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-04-30bgpd: add pbr error flag for pbr errorsPhilippe Guibert
Some errors messages were not guarded. now those log messages are guarded. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-04-30bgpd: add [no] debug bgp pbr vty commandPhilippe Guibert
This command is used to troubleshoot the routes that are installed inbgp pbr fib, before being injected in zebra. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-04-11bgpd: dynamic mpls label poolG. Paul Ziemba
MPLS label pool backed by allocations from the zebra label manager. A caller requests a label (e.g., in support of an "auto" label specification in the CLI) via lp_get(), supplying a unique ID and a callback function. The callback function is invoked at a later time with the unique ID and a label value to inform the requestor of the assigned label. Requestors may release their labels back to the pool via lp_release(). The label pool is stocked with labels allocated by the zebra label manager. The interaction with zebra is asynchronous so that bgpd is not blocked while awaiting a label allocation from zebra. The label pool implementation allows for bgpd operation before (or without) zebra, and gracefully handles loss and reconnection of zebra. Of course, before initial connection with zebra, no labels are assigned to requestors. If the zebra connection is lost and regained, callbacks to requestors will invalidate old assignments and then assign new labels. Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2018-03-30bgpd: introduce [no] debug bgp flowspecPhilippe Guibert
It is possible to enhance debug bgp flowspec feature by using vty command. This command, if enabled, will dump the match/set couple of information received on NLRI. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-03-27*: use C99 standard fixed-width integer typesQuentin Young
The following types are nonstandard: - u_char - u_short - u_int - u_long - u_int8_t - u_int16_t - u_int32_t Replace them with the C99 standard types: - uint8_t - unsigned short - unsigned int - unsigned long - uint8_t - uint16_t - uint32_t Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-03-14Merge branch 'master' into working/master/bgp-vpn-vrf-leakingpaulzlabn
2018-03-09bgpd: vpn-vrf route leakingG. Paul Ziemba
- add "debug bgp vpn label" CLI - improved debug messages for "debug bgp bestpath" - send vrf label to zebra after zebra informs bgpd of vrf_id - withdraw vrf_label from zebra if zebra informs bgpd that vrf_id is disabled Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2018-03-04bgpd: Fix warningsvivek
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
2018-02-09bgpd: ran indent.py on some files prior to bgp vpn-vrf leaking changesG. Paul Ziemba
Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2018-01-23bgpd: carry two MPLS labels in EVPN NLRIsMitesh Kanjariya
When doing symmetric routing, EVPN type-2 (MACIP) routes need to be advertised with two labels (VNIs) the first being the L2 VNI (identifying the VLAN) and the second being the L3 VNI (identifying the VRF). The receive processing needs to handle one or two labels too. Ticket: CM-18489 Review: CCR-6949 Testing: manual and bgp/evpn/mpls smoke Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
2017-07-17*: reindentreindent-master-afterwhitespace / reindent
indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-12bgpd: Debug logging updates for EVPNvivek
Ensure VNI and EVPN nexthops are logged in debug logs. Updates: "bgpd: labeled unicast processing" Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
2017-06-21*: simplify log message lookupQuentin Young
log.c provides functionality for associating a constant (typically a protocol constant) with a string and finding the string given the constant. However this is highly delicate code that is extremely prone to stack overflows and off-by-one's due to requiring the developer to always remember to update the array size constant and to do so correctly which, as shown by example, is never a good idea.b The original goal of this code was to try to implement lookups in O(1) time without a linear search through the message array. Since this code is used 99% of the time for debugs, it's worth the 5-6 additional cmp's worst case if it means we avoid explitable bugs due to oversights... Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-05-15*: make consistent & update GPLv2 file headersDavid Lamparter
The FSF's address changed, and we had a mixture of comment styles for the GPL file header. (The style with * at the beginning won out with 580 to 141 in existing files.) Note: I've intentionally left intact other "variations" of the copyright header, e.g. whether it says "Zebra", "Quagga", "FRR", or nothing. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-05-12bgpd: removed unused parameter from bgp_dump_attr()Renato Westphal
Originally we used the 'peer' parameter for this: if (peer_sort (peer) == BGP_PEER_IBGP) snprintf (buf + strlen (buf), size - strlen (buf), ", localpref %d", attr->local_pref); Now we have this: if (CHECK_FLAG (attr->flag, ATTR_FLAG_BIT (BGP_ATTR_LOCAL_PREF))) snprintf (buf + strlen (buf), size - strlen (buf), ", localpref %u", attr->local_pref); Remove the now useless 'peer' parameter. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-03-06bgpd: RX shutdown message in "show bgp neighbor"David Lamparter
Signed-off-by: Christian Franke <chris@opensourcerouting.org>