Commit Graph

715 Commits

Author SHA1 Message Date
Pooja Jagadeesh Doijode
5519cabe4c pimd: Option to get IGMP groups and sources for a particular interface
1. Added interface name, group address and detail option to existing
   "show ip igmp groups" so that user can retrieve all the groups
   or a particular group for an interface. Detail option shows the source
   information for the group. With that, the show command
   looks like:

   "show ip igmp [vrf NAME$vrf_name] groups [INTERFACE$ifname [GROUP$grp_str]] [detail$detail] [json$json]"

2. Changed pim_cmd_lookup_vrf() to return empty JSON if VRF is not present

3. Changed "detail" option to print non pretty JSON

4. Added interface name and group address to existing
   "show ip igmp sources" so that user can retrieve all the sources for
   all the groups or, all the sorces for a particular group for an
   interface. With that, the show command looks like:

   "show ip igmp [vrf NAME$vrf_name] sourcess [INTERFACE$ifname [GROUP$grp_str]] [json$json]"

Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>
2023-04-11 11:00:39 -07: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
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
David Lamparter
89cb86aeb0 build, vtysh: extract vtysh commands from .xref
Rather than running selected source files through the preprocessor and a
bunch of perl regex'ing to get the list of all DEFUNs, use the data
collected in frr.xref.

This not only eliminates issues we've been having with preprocessor
failures due to nonexistent header files, but is also much faster.
Where extract.pl would take 5s, this now finishes in 0.2s.  And since
this is a non-parallelizable build step towards the end of the build
(dependent on a lot of other things being done already), the speedup is
actually noticeable.

Also files containing CLI no longer need to be listed in `vtysh_scan`
since the .xref data covers everything.  `#ifndef VTYSH_EXTRACT_PL`
checks are equally obsolete.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-10-26 17:12:34 +01: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
Donald Sharp
e3e3d729c4
Merge pull request #12066 from opensourcerouting/cleanup-cli-xref
*: clean up various CLI-related bits
2022-10-13 13:47:04 -04:00
Donatas Abraitis
69c736ec06
Merge pull request #12074 from donaldsharp/lib_debugs
*: Create and use infrastructure to show debugs in lib
2022-10-12 10:38:21 +03:00
Sarita Patra
7e371efb85 pim6d: Fix RpAddress in "show ipv6 pim bsm-database"
RpAddress is showing wrong value in
"show ipv6 pim bsm-database" cli. This is fixed now.

Issue: #12089

Signed-off-by: Sarita Patra <saritap@vmware.com>
2022-10-10 22:10:43 -07:00
Donald Sharp
cf00164b69 *: Create and use infrastructure to show debugs in lib
There are lib debugs being set but never show up in
`show debug` commands because there was no way to show
that they were being used.  Add a bit of infrastructure
to allow this and then use it for `debug route-map`

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-10-07 12:39:05 -04:00
David Lamparter
a0dfca37b5 *: fix some malformed CLI docstrings
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-10-06 15:39:56 +02:00
Sai Gomathi N
d891fa78e4 pimd, pim6d: Changing IGMP to GM in debug macros
Changing
PIM_DO_DEBUG_IGMP_EVENTS to PIM_DO_DEBUG_GM_EVENTS
PIM_DO_DEBUG_IGMP_PACKETS to PIM_DO_DEBUG_GM_PACKETS
PIM_DO_DEBUG_IGMP_TRACE to PIM_DO_DEBUG_GM_TRACE
PIM_DO_DEBUG_IGMP_TRACE_DETAIL to PIM_DO_DEBUG_GM_TRACE_DETAIL
PIM_DONT_DEBUG_IGMP_EVENTS to PIM_DONT_DEBUG_GM_EVENTS
PIM_DONT_DEBUG_IGMP_PACKETS to PIM_DONT_DEBUG_GM_PACKETS
PIM_DONT_DEBUG_IGMP_TRACE to PIM_DONT_DEBUG_GM_TRACE
PIM_DONT_DEBUG_IGMP_TRACE_DETAIL to PIM_DONT_DEBUG_GM_TRACE_DETAIL
PIM_MASK_IGMP_EVENTS to PIM_MASK_GM_EVENTS
PIM_MASK_IGMP_PACKETS to PIM_MASK_GM_PACKETS
PIM_MASK_IGMP_TRACE to PIM_MASK_GM_TRACE
PIM_MASK_IGMP_TRACE_DETAIL to PIM_MASK_GM_TRACE_DETAIL
to be used for both IGMP and MLD debugs.

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2022-09-06 00:15:38 -07:00
Sai Gomathi N
8934215f65 pimd: Modifying member of pim_instance to accomodate IPv6 changes
Modifying igmp_group_count of struct pim_instance
to gm_group_count which is to be used for both IGMP and MLD.

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2022-08-26 01:14:08 -07:00
Donald Sharp
bddd6bb95e pimd: vrf may be NULL from pim_cmd_lookup_vrf
The call into pim_cmd_lookup_vrf may be NULL
and dereferencing it before ensuring that the
vrf pointer is non-NULL is a good way to crash.

A crash can be initiated in pim:

eva# show ip msdp vrf NOEXIST mesh-group
vtysh: error reading from pimd: Permission denied (13)Warning: closing connection to pimd because of an I/O error!
eva# 2022/08/15 11:47:38 [PHJDC-499N2][EC 100663314] STARVATION: task vtysh_rl_read (560b77f76de6) ran for 16777ms (cpu time 0ms)

eva#

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-08-15 15:45:05 -04: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
David Lamparter
1004137bf3
Merge pull request #11598 from patrasar/pim_get_instance 2022-07-13 16:54:39 +02: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
David Lamparter
cefb7247f0 pimd: fix unaligned accesses
These are in packed structs at weird offsets (e.g. 2 bytes), and as such
need a memcpy to get them into proper alignment.

It'd be even better if the pimd code used proper de/serialization, but
let's get this improved one step at a time.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-07-12 12:48:04 +02:00
David Lamparter
bc0e6b1993
Merge pull request #10592 from patrasar/master_pimv6_bsm 2022-07-08 10:46:35 +02:00
sarita patra
7b56b13fc7 pim6d: Adjust pim_show_bsm_db for IPV6
Signed-off-by: sarita patra <saritap@vmware.com>
2022-07-07 10:56:45 -07:00
sarita patra
1407e40fc8 pim6d: add pimv6 support for bsmmsg_rpinfo
Signed-off-by: sarita patra <saritap@vmware.com>
2022-07-07 10:56:45 -07:00
sarita patra
1ae87bdd38 pim6d: add pimv6 support for bsm_hdr
Signed-off-by: sarita patra <saritap@vmware.com>
2022-07-07 10:56:45 -07:00
sarita patra
11e1593f9f pim6d: Add pim_addr rp_addr in bsm_rpinfo
Signed-off-by: sarita patra <saritap@vmware.com>
2022-07-07 10:56:43 -07:00
sarita patra
e309769ae7 pim6d: modify in_addr current_bsr to pim_addr current_bsr
Signed-off-by: sarita patra <saritap@vmware.com>
2022-07-07 07:51:33 -07:00
Sarita Patra
215d10a104 pimd: Fix description for "clear ip mroute" cmd
Signed-off-by: Sarita Patra <saritap@vmware.com>
2022-07-07 06:06:06 -07:00
Donatas Abraitis
7650a8d638
Merge pull request #9307 from SaiGomathiN/sai-nht
pimd: json support for nexthop
2022-07-06 12:32:48 +03:00
Sai Gomathi N
fc19632faa pimd, pim6d: Adding json support for show ipv6 nexthop
Moving the reusable code of pim_show_nexthop apis to common file
pim_cmd_common.c file and adding the json support for show ipv6 pim nexthop

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2022-06-30 04:09:14 -07:00
nsaigomathi
573a01ba19 pimd: json support for nexthop
Problems Identified:
show ip pim nexthop cli didn't have json extension and
show ip pim vrf all upstream have improper json format

Description:
show ip pim nexthop command shows the nexthops that are being used.
Added json support for the command.
show ip pim vrf all upstream displays upstream information for all vrfs about a S,G mroute.
Formatted the json structure for this command.

Signed-off-by: nsaigomathi <nsaigomathi@vmware.com>
2022-06-30 03:22:19 -07:00
Sai Gomathi N
229a20e2ad pimd: Modifying member of pim_instance to accomodate IPv6 changes
Modifying igmp_watermark_limit of struct pim_instance
to gm_watermark_limit which is to be used for both IGMP and MLD.

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2022-06-30 01:49:54 -07:00
Mobashshera Rasool
52770b79a8 pimd: Change to DEFPY and make the api common
For show ip pim interface traffic cli, doing the below changes
1. Changing DEFUN to DEFPY
2. Move the whole code to a common api and modify it so that can
be reused for pimv6.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-06-12 21:24:01 -07:00
Mobashshera Rasool
36cec27cd9 pim6d: Moving show apis to common file
Moving pim_show_interface_traffic and pim_show_interface_traffic_single
to pim_cmd_common.c from pim_cmd.c to make it common to
pimd and pim6d.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-06-12 21:17:54 -07:00
Donald Sharp
db28205528
Merge pull request #11385 from AbhishekNR/show_cli
pimd, pim6d: Moving reusable code to common api for show CLI's.
2022-06-12 08:06:01 -04:00
Donald Sharp
769cdf5654
Merge pull request #11387 from SaiGomathiN/pimshow
pimd, pim6d: Moving the reusable code to common api for PIM show CLIs
2022-06-12 08:00:01 -04:00
Sai Gomathi N
94c691ba40 pim6d: Moving the reusable code of pim_show_join cli
Moving the common lines of pim_show_join_vrf and pim_show_join_vrf_all cli
in pim_cmd.c and pim6_cmd.c to pim_cmd_common.c file

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2022-06-09 22:43:52 -07:00
Donald Sharp
a64543e3e8 pimd: Show interface traffic even if interface is currently down
the `show ip pim interface [x] traffic` command was deciding
to skip display of interfaces if they happened to be down at
that moment.  This of course does not make a bunch of sense
to limit the output for a interface that may have sent data
in the past.

This fixes this test crash:
rnode = <lib.topogen.TopoRouter object at 0x7fc755be3880>, dut = 'c1', input_dict = {'c1': {'c1-l1-eth2': ['helloTx', 'helloRx']}}, output_dict = {'c1': {}}

    def show_pim_intf_traffic(rnode, dut, input_dict, output_dict):
        show_pim_intf_traffic_json = run_frr_cmd(
            rnode, "show ip pim interface traffic json", isjson=True
        )

        output_dict[dut] = {}
        for intf, data in input_dict[dut].items():
>           interface_json = show_pim_intf_traffic_json[intf]
E           KeyError: 'c1-l1-eth2'

/home/sharpd/frr8/tests/topotests/lib/pim.py:1496: KeyError

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-09 10:29:04 -04:00
Abhishek N R
789d0ec4de pim6d: Moving reusable code to common api for "show mroute summary" command
Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-06-09 04:53:12 -07:00
Abhishek N R
1c1077c200 pim6d: Moving reusable code to common api for "show ip/ipv6 mroute count" command
Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-06-09 04:43:28 -07:00
Abhishek N R
4f1f8ff9aa pim6d: Moving reusable code to common api for "show ip/ipv6 mroute" command
Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-06-09 04:27:20 -07:00
Sai Gomathi N
fe7eaf4065 pim6d: Moving the common lines of pim_show_nexthop_lookup cli
Moving the common lines of pim_show_nexthop_lookup cli
in pim_cmd.c and pim6_cmd.c to pim_cmd_common.c file

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2022-06-09 04:22:42 -07:00
Abhishek N R
334d2f8c3d pim6d: Moving reusable code to common api for "show ip/ipv6 multicast count" command
Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-06-09 04:04:14 -07:00
Abhishek N R
8e15c9aa06 pim6d: Moving reusable code to common api for "show ip/ipv6 multicast" command
Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-06-09 03:51:41 -07:00
Abhishek N R
e7c01c6769 pim6d: Moving reusable code to common api for "show pim state" command
Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-06-09 03:29:02 -07:00
Sai Gomathi N
cefa37cf41 pim6d: Moving the common lines of pim_show_nexthop cli
Moving the common lines of pim_show_nexthop cli
in pim_cmd.c and pim6_cmd.c to pim_cmd_common.c file

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2022-06-09 03:23:28 -07:00
Abhishek N R
c630970866 pim6d: Moving reusable code to common api for "show pim upstream rpf" command
Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-06-09 03:10:21 -07:00
Abhishek N R
622da92f35 pim6d: Moving reusable code to common api for "show pim upstream join desired" command
Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-06-09 02:57:49 -07:00
Abhishek N R
9aa0569d6e pim6d: Moving reusable code to common api for "show pim upstream" command
Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-06-09 02:40:21 -07:00