summaryrefslogtreecommitdiff
path: root/pimd/pim_cmd_common.c
AgeCommit message (Collapse)Author
2025-01-27pimd: Close AutoRP socket when not neededNathan Bahr
Don't leave the socket open if we are not enabled for discovery or announcements. Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2024-12-13pimd: Clean up pim RPF/NHT show commandsNathan Bahr
Moved `show ip rpf A.B.C.D` command here from zebra, deprecated and aliased to `show ip pim nexthop-lookup`. Allow group to be optional in the lookup command. Only validate group if source is ANY. Documented setting source via RP if not provided. Added new output if ANY source + group lookup is performed and no RP is found for the group. Updated output to include souce and group for lookup. Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2024-12-13pimd: Refactor pim NHTNathan Bahr
Refactor the next hop tracking in PIM to fully support the configured RPF lookup mode. Moved many NHT related functions to pim_nht.h/c NHT now tracks both MRIB and URIB tables and makes nexthop decisions based on the configured lookup mode. Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2024-11-19pimd: Implement autorp mapping agent CLINathan Bahr
Also exposes BSR cand_addrsel methods for use in AutoRP. Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2024-09-27pimd: fix autorp CLI bugsBarry A. Trent
Signed-off-by: Barry A. Trent <barry.trent@atcorp.com>
2024-09-24pimd,yang: Implement AutoRP CLI and NB config pathNathan Bahr
New CLI commands added: router pim [vrf NAME] autorp discovery autorp announce RP-ADDR [GROUP | group-list PREFIX-LIST] autorp announce {scope (1-255) | interval (1-65535) | holdtime (0-65535)} autorp discovery Enables Auto RP discovery for learning dynamic RP information using the AutoRP protocol. autorp announce RP-ADDR [GROUP | group-list PREFIX-LIST] Enable announcements of a candidate RP with the given group range, or prefix list of group ranges, to an AutoRP mapping agent. autorp announce {scope (1-255) | interval (1-65535) | holdtime (0-65535)} Configure the parameters of the AutoRP announcement messages. The scope sets the packet TTL. The interval sets the time between TX of announcements. The holdtime sets the hold time in the message, the time the mapping agent should wait before invalidating the candidate RP information. debug pim autorp Enable debug logging of the AutoRP protocol show ip pim [vrf NAME] autorp [json] Show details of the AutoRP protocol. To view learned RP info, use the existing command 'show ip pim rp-info' Extend pim yang for new configuration: augment /frr-rt:routing/frr-rt:control-plane-protocols/frr-rt:control-plane-protocol/frr-pim:pim/frr-pim:address-family: +--rw rp +--rw auto-rp +--rw discovery-enabled? boolean +--rw announce-scope? uint8 +--rw announce-interval? uint16 +--rw announce-holdtime? uint16 +--rw candidate-rp-list* [rp-address] +--rw rp-address inet:ip-address +--rw (group-or-prefix-list)? +--:(group) | +--rw group? frr-route-types:ip-multicast-group-prefix +--:(prefix-list) +--rw prefix-list? plist-ref Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2024-09-20pimd: add igmp proxy cli and yang configurationBarry A. Trent
Signed-off-by: Barry A. Trent <barry.trent@atcorp.com>
2024-09-13pimd: use vty_jsonJafar Al-Gharaibeh
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2024-09-09pimd: candidate BSR/RP show commands, move under ip pim bsrJafar Al-Gharaibeh
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2024-09-09pimd: Candidate-BSR supportJafar Al-Gharaibeh
Signed-off-by: David Lamparter <equinox@opensourcerouting.org> Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2024-09-09pimd: Candidate-RP supportJafar Al-Gharaibeh
Signed-off-by: David Lamparter <equinox@opensourcerouting.org> Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2024-09-01*: Create termtable specific temp memoryDonald Sharp
When trying to track down a MTYPE_TMP memory leak it's harder to search for it when you happen to have some usage of ttable_dump. Let's just give it it's own memory type so that we can avoid confusion in the future. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-07-22pimd: fix compile warningsJafar Al-Gharaibeh
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2024-07-16pimd, lib, vtysh: Added new 'router pim[6] [vrf NAME]' config nodeNathan Bahr
Moved all existing global/vrf PIM config to the new subnode. Existing configuration updated to be hidden and deprecated. Both versions of configuration still work together. Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2024-04-26pimd: fix crash unconfiguring rp keepalive timerVijayalaxmi Basavaraj
pimd crashs while unconfigure of rp ka timer as we are trying to access a yand dnode(suppress timer) which does not exist at the moment. User just configured rp keepalive timer and not suppress timer, the yang dnode would not be present. Instead of directly accessing yang_dnode_get_unit16, first check the yang node exist using the xpath. Ticket: #3874971 Testing: Before: ------ tor-11(config)# no ip pim rp keep-alive-timer 3000 vtysh: error reading from pimd: Success (0)Warning: closing connection to pimd because of an I/O error! Broadcast message from root@tor-11 (somewhere) (Mon Apr 22 17:29:12 2024): cumulus-core: Running cl-support for core files "pimd.25467.1713806952.core" After: ----- tor-11(config)# no ip pim rp keep-alive-timer 3000 tor-11(config)# Signed-off-by: Donald Sharp <sharpd@nvidia.com> Signed-off-by: Vijayalaxmi Basavaraj <vbasavaraj@nvidia.com>
2024-01-23lib: remove leaf-list xpath hack from northboundIgor Ryzhov
Currently, when editing a leaf-list, `nb_candidate_edit` expects to receive it's xpath without a predicate and the value in a separate argument, and then creates the full xpath. This hack is complicated, because it depends on the operation and on the caller being a backend or not. Instead, let's require to always include the predicate in a leaf-list xpath. Update all the usages in the code accordingly. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-04*: Remove sys/ioctl.h from zebra.hDonald Sharp
Practically no-one uses this and ioctls are pretty much wrappered. Further wrappering could make this even better. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-11-29lib: all: remove './' from xpath 22% speedupChristian Hopps
fixes #8299 Signed-off-by: Christian Hopps <chopps@labn.net>
2023-11-21*: Let's use the native IFNAMSIZ instead of INTERFACE_NAMSIZDonald Sharp
INTERFACE_NAMSIZ is just a redefine of IFNAMSIZ and IFNAMSIZ is the standard for interface name length on all platforms that FRR currently compiles on. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-09-19pimd: Use a better name for oil_parentDonald Sharp
Use oil_incoming_vif instead of oil_parent. I had to go look this up as that I failed to remember that the linux kernel calls this parent for some bizarre reason. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-07-21pimd: Convert usage of pim_addr_dump to %pFXhDonald Sharp
pim_addr_dump would dump the group data as a v4 or v6 address let's just convert to our internal printf handler. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-07-10pimd, pim6d: Added pimEnabled field in "show ip pim nexthop json" cliSarita Patra
The cli "show ip pim nexthop json" gives the RPF information. However it doesn't give PIM enable status on the nexthop interface. Added pimEnabled field in this clis, this will tell if PIM is enabled or not on the nexthop interface. Example: frr# show ip pim nexthop Number of registered addresses: 1 Address Interface Nexthop 108.0.0.2 ens224 108.0.0.2 frr# show ip pim nexthop json { "108.0.0.2":{ "address":"108.0.0.2", "nexthops":[ { "interface":"ens224", "pimEnabled":true, "nexthop":"108.0.0.2" } ] } } frr# configure terminal frr(config)# int ens224 frr(config-if)# no ip pim frr(config-if)# end frr# show ip pim nexthop json { "108.0.0.2":{ "address":"108.0.0.2", "nexthops":[ { "interface":"ens224", "pimEnabled":false, "nexthop":"108.0.0.2" } ] } } Signed-off-by: Sarita Patra <saritap@vmware.com>
2023-06-07pim6d: "show ipv6 pim state" not displaying when OIL is emptySarita Patra
Problem: ------- The cli "show ipv6 pim state" is not displaying when outgoing interface list is empty. This is fixed now. Before Fix: ---------- frr# show ipv6 pim state json { "ffaa::5":{ "1100::10":{ "ens224":{ }, "installed":1, "isRpt":false, "refCount":1, "oilListSize":0, "oilRescan":0, "lastUsed":0, "packetCount":40, "byteCount":3080, "wrongInterface":1 } } } frr# show ipv6 pim state Codes: J -> Pim Join, I -> MLD Report, S -> Source, * -> Inherited from (*,G), V -> VxLAN, M -> Muted Active Source Group RPT IIF OIL After fix: --------- Case 1: - "show ipv6 pim state" output for 1 mroute with 1 oil. frr# show ipv6 pim state Codes: J -> Pim Join, I -> MLD Report, S -> Source, * -> Inherited from (*,G), V -> VxLAN, M -> Muted Active Source Group RPT IIF OIL 1 1100::10 ffaa::5 n ens224 ens256( J ) Case 2: - "show ipv6 pim state" output for 1 mroute with multiple oil. frr# show ipv6 pim state Codes: J -> Pim Join, I -> MLD Report, S -> Source, * -> Inherited from (*,G), V -> VxLAN, M -> Muted Active Source Group RPT IIF OIL 1 1100::10 ffaa::5 n ens224 ens192( J ) ens256( J ) Case 3: - "show ipv6 pim state" output for 1 mroute with no oil frr# show ipv6 pim state Codes: J -> Pim Join, I -> MLD Report, S -> Source, * -> Inherited from (*,G), V -> VxLAN, M -> Muted Active Source Group RPT IIF OIL 1 1100::10 ffaa::5 n ens224 Case 4: - "show ipv6 pim state" output for multiple mroute with multiple oil frr# show ipv6 pim state Codes: J -> Pim Join, I -> MLD Report, S -> Source, * -> Inherited from (*,G), V -> VxLAN, M -> Muted Active Source Group RPT IIF OIL 1 * ff05::2 y ens224 pim6reg(I ) ens192(I ) 1 * ffaa::5 y ens224 pim6reg(I ) ens192(I ) Issue: #13070 Signed-off-by: Sarita Patra <saritap@vmware.com>
2023-05-28pimd: When doing json output do not output non-json stringsDonald Sharp
When entering some show commands that use json in pimd when the interface cannot be found do not output non-json format in that case. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-02-24pimd,pim6d: Modify pim_neighbor_find() APISarita Patra
Modify pim_neighbor_find() API to find the neighbor in neighbor secondary list. Signed-off-by: Sarita Patra <saritap@vmware.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-02-01Merge pull request #12713 from opensourcerouting/fix/json_naming_deprecationDonald Sharp
*: Drop deprecated incorrect JSON fields with wrong naming
2023-01-31*: Drop deprecated incorrect JSON fields with wrong namingDonatas Abraitis
Deprecation cycle already passed. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-01-27*: fix non-const northbound XPath format stringsDavid Lamparter
Passing a pre-formatted buffer in these places needs a `"%s"` in front so it doesn't get formatted twice. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-11-30Merge pull request #12325 from AbhishekNR/ttable_pim_nexthopDonatas Abraitis
pimd, pim6d: Using ttable for displaying "show ip/ipv6 pim nexthop" command output
2022-11-24pim6d: Fix RpAddress in "show ipv6 pim bsm-database"Sarita Patra
The fix for issue #12089 was reverted while resolving conflict for PR https://github.com/FRRouting/frr/pull/11600/. Signed-off-by: Sarita Patra <saritap@vmware.com>
2022-11-23pimd, pim6d: Using ttable for displaying "show ip/ipv6 pim bsrp-info" ↵Abhishek N R
command output Fixes: #11246 Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-11-22pimd, pim6d: Using ttable for displaying "show ip/ipv6 pim nexthop" command ↵Abhishek N R
output Before: R4(config)# do show ipv6 pim nexthop Number of registered addresses: 6 Address Interface Nexthop --------------------------------------------- 3700:1234:1234:1234:1234:1234:1234:1234 ens161 fe80::250:56ff:feb7:d8d5 5101::10 ens224.51 5101::10 3300::5555 ens161 fe80::250:56ff:feb7:d8d5 4400::1 ens161 fe80::250:56ff:feb7:d8d5 1020::10 ens257 1020::10 3000::1 ens192.4010 fe80::250:56ff:feb7:493b 3000::1 ens193.4015 fe80::250:56ff:feb7:b12a After: frr# show ipv6 pim nexthop Number of registered addresses: 2 Address Interface Nexthop --------------------------------------------- 105::105 lo 105::105 12::1 ens192 fe80::250:56ff:feb7:38de Issue: #11246 Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-10-21Merge pull request #12094 from patrasar/pimv6_rp_linklocalDonatas Abraitis
pimd, pim6d: Don't configure link-local, Multicast, Unspecified address as RP
2022-10-20pimd, pim6d: Don't configure link-local, Multicast, Unspecified address as RPSarita Patra
Problem: ======= frr(config)# do show ipv6 pim interface Interface State Address PIM Nbrs PIM DR FHR IfChannels ens192 up fe80::250:56ff:feb7:3619 0 local 0 1 Configure ens192 interface link-local address as RP. frr(config)# ipv6 pim rp fe80::250:56ff:feb7:3619 No Path to RP address specified: fe80::250:56ff:feb7:3619 frr(config)# do show ipv6 pim rp-info RP address group/prefix-list OIF I am RP Source Group-Type fe80::250:56ff:feb7:3619 ff00::/8 Unknown yes Static ASM Fix: === RP should not be link-local, multicast and unspecified address. Signed-off-by: Sarita Patra <saritap@vmware.com>
2022-10-20pimd: Move "show ip pim bsm-database" cmd to DEFPYSarita Patra
Added common pim_show_bsm_db_helper to suppport both PIM and PIMV6. pim_show_bsm_db is moved to pim_cmd_common.c file. Signed-off-by: Sarita Patra <saritap@vmware.com>
2022-10-20pimd: Move "show ip pim bsrp-info [vrf] [json]" cmd to DEFPYSarita Patra
Added pim_show_group_rp_mappings_info_helper to suppport both PIM and PIMV6. pim_show_group_rp_mappings_info() is moved to pim_cmd_common.c file. Signed-off-by: Sarita Patra <saritap@vmware.com>
2022-10-20pimd: Add vrf optional parameter in "show ip pim bsr" cmdSarita Patra
Added common API pim_show_bsr_helper to suppport both PIM and PIMV6. pim_show_bsr() is moved to pim_cmd_common.c file. Signed-off-by: Sarita Patra <saritap@vmware.com>
2022-10-20pim6d: Add [no] ipv6 pim unicast-bsm" commandSarita Patra
Introduced common api pim_process_unicast_bsm_cmd, pim_process_no_unicast_bsm_cmd which will process both "[no] ip pim unicast-bsm" command and "[no] ipv6 pim unicast-bsm" command. Signed-off-by: Sarita Patra <saritap@vmware.com>
2022-10-20pim6d: Add [no] ipv6 pim bsm" commandSarita Patra
Introduced common api pim_process_bsm_cmd, pim_process_no_bsm_cmd which will process both "[no] ip pim bsm" command and "[no] ipv6 pim bsm" command. Signed-off-by: Sarita Patra <saritap@vmware.com>
2022-09-21Merge pull request #11802 from AbhishekNR/ttable_pim_stateDonatas Abraitis
pimd, pim6d: Using ttable for displaying "show ip/ipv6 pim state" command output.
2022-09-19pimd, pim6d: Using ttable for displaying "show ip/ipv6 pim local-membership" ↵Abhishek N R
command output Before: frr# sh ipv6 pim local-membership Interface Address Source Group Membership ens224 fe80::250:56ff:feb7:9091 * ff08::1 NOINFO After: frr# sh ipv6 pim local-membership Interface Address Source Group Membership ens224 fe80::250:56ff:feb7:9091 * ff08::1 NOINFO Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-09-19pimd, pim6d: Using ttable for displaying "show ip/ipv6 pim neighbor" command ↵Abhishek N R
output. Before: frr# show ipv6 pim neighbor Interface Neighbor Uptime Holdtime DR Pri ens192 fe80::250:56ff:feb7:38de 00:10:47 00:01:28 1 ens224 fe80::250:56ff:feb7:4bad 00:10:47 00:01:28 1 After: frr# sh ipv6 pim neighbor Interface Neighbor Uptime Holdtime DR Pri ens192 fe80::250:56ff:feb7:38de 00:00:12 00:01:32 1 ens224 fe80::250:56ff:feb7:4bad 00:00:12 00:01:32 1 Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-09-19pimd, pim6d: Using ttable for displaying "show ip/ipv6 pim join" command outputAbhishek N R
Before: frr# sh ipv6 pim join Interface Address Source Group State Uptime Expire Prune ens224 fe80::250:56ff:feb7:9091 * ff08::1 JOIN 00:16:31 03:28 --:-- After: frr# show ipv6 pim join Interface Address Source Group State Uptime Expire Prune ens224 fe80::250:56ff:feb7:9091 * ff08::1 JOIN 00:00:51 03:27 --:-- Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-09-16pimd, pim6d: Using ttable for displaying "show ip/ipv6 pim state" command ↵Abhishek N R
output. Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-08-30pim6d: Fix the Code for MLD in the show pim state commandMobashshera Rasool
show ip pim state should show IGMP Report while show ipv6 pim state should show MLD Report. Output After Fix: frr# do sh ip pim state Codes: J -> Pim Join, I -> IGMP Report, S -> Source, * -> Inherited from (*,G), V -> VxLAN, M -> Muted Active Source Group RPT IIF OIL frr# do sh ipv6 pim state Codes: J -> Pim Join, I -> MLD Report, S -> Source, * -> Inherited from (*,G), V -> VxLAN, M -> Muted Active Source Group RPT IIF OIL frr# Issue: #11249 Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-08-29pimd, pim6d: deleting the memory malloced for json.Abhishek N R
Problem Statement: ================= 2022-08-18 04:57:32,376 - ERROR: Found memory leak in daemon pimd 2022-08-18 04:57:32,377 - ERROR: ==12100== 18,978 (144 direct, 18,834 indirect) bytes in 2 blocks are definitely lost in loss record 45 of 45 2022-08-18 04:57:32,377 - ERROR: ==12100== at 0x4C31FAC: calloc (vg_replace_malloc.c:762) 2022-08-18 04:57:32,377 - ERROR: ==12100== by 0x532F51F: json_object_new_object (in /lib/x86_64-linux-gnu/libjson-c.so.3.0.1) 2022-08-18 04:57:32,377 - ERROR: ==12100== by 0x128B5C: pim_show_interfaces (pim_cmd_common.c:3395) 2022-08-18 04:57:32,377 - ERROR: ==12100== by 0x15A86B: show_ip_pim_interface_magic (pim_cmd.c:3127) 2022-08-18 04:57:32,377 - ERROR: ==12100== by 0x15A86B: show_ip_pim_interface (pim_cmd_clippy.c:324) 2022-08-18 04:57:32,377 - ERROR: ==12100== by 0x4E672B2: cmd_execute_command_real.isra.2 (command.c:1005) 2022-08-18 04:57:32,377 - ERROR: ==12100== by 0x4E696FE: cmd_execute_command (command.c:1064) 2022-08-18 04:57:32,377 - ERROR: ==12100== by 0x4E698F1: cmd_execute (command.c:1227) 2022-08-18 04:57:32,377 - ERROR: ==12100== by 0x4EBC814: vty_command (vty.c:530) 2022-08-18 04:57:32,377 - ERROR: ==12100== by 0x4EBC9EF: vty_execute (vty.c:1295) 2022-08-18 04:57:32,377 - ERROR: ==12100== by 0x4EBF1F7: vtysh_read (vty.c:2142) 2022-08-18 04:57:32,377 - ERROR: ==12100== by 0x4EB739B: thread_call (thread.c:1692) 2022-08-18 04:57:32,377 - ERROR: ==12100== by 0x4E85B17: frr_run (libfrr.c:1068) 2022-08-18 04:57:32,377 - ERROR: ==12100== Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-08-24pimd, pim6d: Using ttable for displaying "show ip|ipv6 pim jp-agg" CLISai Gomathi N
Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2022-08-24pimd, pim6d: Using ttable for displaying "show ip|ipv6 pim channel" CLISai Gomathi N
Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2022-08-18Merge pull request #11830 from AbhishekNR/unused_varDonald Sharp
pimd, pim6d: Removing unused parameter