Commit Graph

138 Commits

Author SHA1 Message Date
Donald Sharp
06504bea79 pimd: When doing json output do not output non-json strings
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-05-28 07:37:25 -04:00
Sarita Patra
3dbf370ac0 pimd,pim6d: Modify pim_neighbor_find() API
Modify pim_neighbor_find() API to find the neighbor
in neighbor secondary list.

Signed-off-by: Sarita Patra <saritap@vmware.com>
2023-02-24 04:40:38 -08:00
David Lamparter
acddc0ed3c *: auto-convert to SPDX License IDs
Done with a combination of regex'ing and banging my head against a wall.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-02-09 14:09:11 +01:00
Donald Sharp
33303f08bf
Merge pull request #12713 from opensourcerouting/fix/json_naming_deprecation
*: Drop deprecated incorrect JSON fields with wrong naming
2023-02-01 15:39:18 -05:00
Donatas Abraitis
1ce23106eb *: Drop deprecated incorrect JSON fields with wrong naming
Deprecation cycle already passed.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-01-31 10:18:28 +02:00
David Lamparter
ae08de9f42 *: fix non-const northbound XPath format strings
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>
2023-01-27 12:01:20 +01:00
Donatas Abraitis
a677c44802
Merge pull request #12325 from AbhishekNR/ttable_pim_nexthop
pimd, pim6d: Using ttable for displaying "show ip/ipv6 pim nexthop" command output
2022-11-30 21:40:30 +02:00
Sarita Patra
5abe4eef2c pim6d: Fix RpAddress in "show ipv6 pim bsm-database"
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-24 22:43:15 -08:00
Abhishek N R
86fb444df6 pimd, pim6d: Using ttable for displaying "show ip/ipv6 pim bsrp-info" command output
Fixes: #11246

Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-11-23 23:56:33 -08:00
Abhishek N R
774d8ad38b pimd, pim6d: Using ttable for displaying "show ip/ipv6 pim nexthop" command output
Before:

R4(config)# do show ipv6 pim nexthop
Number of registered addresses: 6
Address         Interface        Nexthop
---------------------------------------------
3700🔢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-11-22 22:59:30 -08:00
Donatas Abraitis
e1a14d4700
Merge pull request #12094 from patrasar/pimv6_rp_linklocal
pimd, pim6d: Don't configure link-local, Multicast, Unspecified address as RP
2022-10-21 10:34:28 +03:00
Sarita Patra
aae2af98ca pimd, pim6d: Don't configure link-local, Multicast, Unspecified address as RP
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-20 02:37:28 -07:00
Sarita Patra
a0299f87cf pimd: Move "show ip pim bsm-database" cmd to DEFPY
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-20 01:07:48 -07:00
Sarita Patra
a07e7dfaee pimd: Move "show ip pim bsrp-info [vrf] [json]" cmd to DEFPY
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-20 01:07:48 -07:00
Sarita Patra
aaf46b1edc pimd: Add vrf optional parameter in "show ip pim bsr" cmd
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-20 01:07:48 -07:00
Sarita Patra
dfeda85c4b pim6d: Add [no] ipv6 pim unicast-bsm" command
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-20 01:07:46 -07:00
Sarita Patra
5e651c3699 pim6d: Add [no] ipv6 pim bsm" command
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-10-20 01:06:30 -07:00
Donatas Abraitis
383a873495
Merge pull request #11802 from AbhishekNR/ttable_pim_state
pimd, pim6d: Using ttable for displaying "show ip/ipv6 pim state" command output.
2022-09-21 11:00:40 +03:00
Abhishek N R
ad994e7a8a pimd, pim6d: Using ttable for displaying "show ip/ipv6 pim local-membership" 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-19 02:11:23 -07:00
Abhishek N R
c3cd01eb06 pimd, pim6d: Using ttable for displaying "show ip/ipv6 pim neighbor" command 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-19 02:11:13 -07:00
Abhishek N R
bae90f95d1 pimd, pim6d: Using ttable for displaying "show ip/ipv6 pim join" command output
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-19 02:03:24 -07:00
Abhishek N R
5eac8aa3fb pimd, pim6d: Using ttable for displaying "show ip/ipv6 pim state" command output.
Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-09-16 02:39:47 -07:00
Mobashshera Rasool
e73f7bf256 pim6d: Fix the Code for MLD in the show pim state command
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-30 03:13:42 -07:00
Abhishek N R
4cc5d80965 pimd, pim6d: deleting the memory malloced for json.
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-29 08:46:19 -07:00
Sai Gomathi N
d250853af7 pimd, pim6d: Using ttable for displaying "show ip|ipv6 pim jp-agg" CLI
Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2022-08-24 09:25:55 -07:00
Sai Gomathi N
7d11f1996e pimd, pim6d: Using ttable for displaying "show ip|ipv6 pim channel" CLI
Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2022-08-24 09:25:55 -07:00
Donald Sharp
e9c599ca72
Merge pull request #11830 from AbhishekNR/unused_var
pimd, pim6d: Removing unused parameter
2022-08-18 06:28:51 -04:00
Abhishek N R
38ec10a14a pimd, pim6d: Removing unused parameter
Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-08-17 23:12:09 -07:00
Abhishek N R
802ba0fb94 pimd, pim6d: Using ttable for displaying "show ip/ipv6 pim upstream-rpf" command output.
Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-08-16 09:12:10 -07:00
Abhishek N R
090f833975 pimd, pim6d: Using ttable for displaying "show ip/ipv6 pim upstream-join-desired" command output.
Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-08-16 09:12:10 -07:00
Abhishek N R
a8f7d5de6b pimd, pim6d: Using ttable for displaying "show ip/ipv6 pim upstream" command output.
Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-08-14 08:29:11 -07:00
Abhishek N R
0148e53f3b pimd, pim6d: Using ttable for displaying "show ip/ipv6 pim secondary" command output
Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-08-14 08:29:11 -07:00
Abhishek N R
1b6dbdcd1e pimd, pim6d: Using ttable for displaying "show ip/ipv6 pim rpf" command output.
Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-08-14 08:29:11 -07:00
Donald Sharp
23f85c8dad
Merge pull request #11778 from AbhishekNR/ttable_mroute
pimd, pim6d:  Using ttable for displaying output of show mroute commands
2022-08-11 08:32:32 -04:00
Abhishek N R
88e9f3a009 pimd, pim6d: Using ttable for displaying "show ip/ipv6 mroute count" command output.
Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-08-11 04:03:11 -07:00
Abhishek N R
cb990f3819 pimd, pim6d: Using ttable for displaying "show ip/ipv6 mroute" command output.
Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-08-10 09:05:40 -07:00
Abhishek N R
7f0dc57f8e pimd, pim6d: Using ttable for displaying "show ip/ipv6 multicast count" command.
Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-08-10 02:09:00 -07:00
Donatas Abraitis
8e2eb5935a
Merge pull request #11720 from SaiGomathiN/pimv6debugfix
pim6d: Add 'show debugging [pimv6]' CLI and some fixes
2022-08-08 10:11:38 +03:00
Donald Sharp
b993483876
Merge pull request #11636 from AbhishekNR/clear_cmd
pim6d: Implementing "clear ipv6 pim interface traffic" command.
2022-08-05 07:45:47 -04:00
Donald Sharp
ddfc81f3de
Merge pull request #11559 from patrasar/fix_clear_ipv6_mroute
pim6d: fix clear ipv6 mroute
2022-08-05 07:43:12 -04:00
Donald Sharp
f07b1a9fb4
Merge pull request #11716 from mobash-rasool/fixes2
pimd, pim6d: Send register msg via reg socket, solve FHR/RP same node issue
2022-08-04 22:06:49 -04:00
Sai Gomathi N
7d1b675857 pimd, pim6d: Using ttable for displaying
Using termtable for show ip|ipv6 pim interface
for dynamic space alignments

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2022-08-04 04:35:42 -07:00
Mobashshera Rasool
9461953914 pimd, pim6d: Send register msg via register socket
The problem here is when the same node is FHR as well as RP,
then the node keeps on sending the register packet.
Register-stop is not sent as well.

This problem has occurred because the RP is the same node
and there is no socket created on loopback interface, so the
packet is never send out and never received back on the same
node, so register recv could not be processed on the node and
hence no register-stop is sent.

Since register packets are unicast packets, its better to handle
the send of register packet via a separate register socket.
This fixes the problem mentioned above as well.

Fixes: #11331
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-08-04 00:49:10 -07:00
Sarita Patra
4459f499c4 pim6d: fix clear ipv6 mroute
Signed-off-by: Sarita Patra <saritap@vmware.com>
2022-08-03 07:47:36 -07:00
Sai Gomathi N
614b77fef5 pim6d: Change the show running commands for pimv6 debugs
Change the show running commands for bsm and vxlan pimv4 and pimv6
debug commands based on the address family.
Including bsm and vxlan in no debug pimv6 debug.

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2022-08-02 06:34:30 -07:00
Abhishek N R
8656814dac pim6d: Implementing "clear ipv6 pim interface traffic" command.
Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-08-01 22:08:40 -07:00
Abhishek N R
23db4cbd3d pim6d: Implementing "clear ipv6 pim interfaces" command.
Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-07-19 05:48:52 -07:00
Sarita Patra
af9c8e7666 pimd: Avoid unnecessary vrf lookup
In several places, we are getting the vrf structure using
vrf_lookup_by_name(). Again we are passing vrf->vrf_id to
pim_get_pim_instance() to get the pim_instance.

The API pim_get_pim_instance() again get the VRF structure using
vrf_lookup_by_id(). This is avoided in this PR.

Signed-off-by: Sarita Patra <saritap@vmware.com>
2022-07-12 06:09:04 -07:00
Mobashshera Rasool
e638968324 pimd: Correct the order of show json for interface traffic
"show ip pim interface traffic json" shows pruneTx first and then
pruneRx stats
where as
"show ip pim interface <ifname> json" shows pruneRx first and then
pruneTx stats.

Although the values are right but the display looks odd.

Making it same as other stats, first display Rx and then Tx.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-07-11 04:37:46 -07:00
sarita patra
b502add84f pimd: Adjust rpf_addr in show commands
Signed-off-by: sarita patra <saritap@vmware.com>
2022-07-06 02:56:42 -07:00