Commit graph

281 commits

Author SHA1 Message Date
Donald Sharp 01841ed3a7 pimd: Add finer grain return codes for configuration
When PIM handles some MSDP commands, a repeated command
was causing a CMD_WARNING_CONFIG_FAILED.  This should
be a CMD_WARNING.  Fix the code to allow vtysh to handle
this appropriately.

Ticket: CM-19053
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-01-03 09:06:44 -05:00
Donald Sharp 9993f22cb1 pimd: When doing a RPF for a route, note when we fail the lookup
When we ask PIM to do a CLI search of a random (S,G) if the
(S,G) has no RPF due to no route, let the user know about
the issue instead of crashing.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-30 13:29:14 -04:00
Donald Sharp 5b8d8894f8 Merge pull request #1298 from opensourcerouting/iface-rb-tree
Use rb-trees to store interfaces instead of linked-lists
2017-10-16 12:00:38 -04:00
Renato Westphal eafc51b47b Merge pull request #1316 from donaldsharp/high_stuff
High stuff
2017-10-10 14:51:02 -03:00
Donald Sharp be1d57fc40 pimd: Fix uninited idx for argv_find
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-10 12:31:32 -04:00
Renato Westphal 451fda4f9a *: use the FOR_ALL_INTERFACES abstraction from babeld
This improves code readability and also future-proofs our codebase
against new changes in the data structure used to store interfaces.

The FOR_ALL_INTERFACES_ADDRESSES macro was also moved to lib/ but
for now only babeld is using it.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-10-10 09:05:46 -03:00
Renato Westphal f4e14fdba7 *: use rb-trees to store interfaces instead of sorted linked-lists
This is an important optimization for users running FRR on systems with
a large number of interfaces (e.g. thousands of tunnels). Red-black
trees scale much better than sorted linked-lists and also store the
elements in an ordered way (contrary to hash tables).

This is a big patch but the interesting bits are all in lib/if.[ch].

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-10-10 09:05:02 -03:00
Donald Sharp 5fe58e3d62 pimd: Cleanup deep nesting in pim_cmd.c
Cleanup some deep nesting in pim_cmd.c so that functions
look easier on the eyes.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-09 10:57:42 -04:00
Donald Sharp 48f41fe829 pimd: Display RPF address as part of json output
When displaying the 'show ip pim upstream' command.
Display proper information about the RPF address
choosen.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-09 10:56:54 -04:00
Donald Sharp 513c846203 pimd: Fix multicast boundary command
1) Fix missing newlines
2) Write the correct cli out.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-05 10:31:59 -04:00
Donald Sharp 45b7b09283 pimd: Add 'show ip mroute fill' command
When displaying the mroute table, add ability to fill
in all the missing data that for human eyes can be assumed.
This will allow people using grep over the command
can get more information.

sharpd@robot ~> sudo vtysh -c "show ip mroute fill"
Source          Group           Proto  Input      Output     TTL  Uptime
*               229.1.1.1       STATIC dum0       enp3s0     1    00:11:07 Default-IP-Routing-Table
*               229.1.1.1       STATIC dum0       virbr0     1    00:01:47 Default-IP-Routing-Table
sharpd@robot ~>

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-09-28 08:05:20 -04:00
Quentin Young b0f525a84c
pimd: add support for boundaries
Adds the ability to filter PIM Joins & IGMP reports on an interface.
Enabling a multicast boundary on an interface for a particular group
will prevent the interface from appearing in the group's OIL.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-09-26 13:00:52 -04:00
Philippe Guibert 5c4dc90307 Merge pull request #1069 from donaldsharp/rfc_plist
PIM: allow overlapping group ranges for prefix-list and static RP's
2017-09-26 17:33:29 +02:00
Quentin Young 21b3e44eb4
pimd: fix some null pointer derefs in cli
If pim/igmp is not enabled on an interface, the ->info pointer will be
null. Need to check that before dereferencing it.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-09-22 17:27:20 -04:00
Renato Westphal a2addae8fe *: use clang's 'ForEachMacros' format style option
This fixes the broken indentation of several foreach loops throughout
the code.

From clang's documentation[1]:
  ForEachMacros: A vector of macros that should be interpreted as foreach
  loops instead of as function calls.

[1] http://clang.llvm.org/docs/ClangFormatStyleOptions.html

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-09-15 14:53:46 -03:00
Donald Sharp 37664928bd pimd: Allow igmp join messages to return more detailed errors
Start the conversion of pim configuration commands to use
the ferr side channel to allow more detailed information
to be returned to cli commands.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-09-14 11:17:32 -04:00
Donald Sharp 3d225d48f0 pimd: Add new 'debug pim nht rp' command
All the rp debugs were a mish-mash of TRACE or ZEBRA,
but the reality they were all focused on handling NHT
issues associated with the RP's.  So let's create
a new debug 'debug pim nht rp' if you are having
issues with RP's.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-09-14 11:17:28 -04:00
Donald Sharp 89b680829e pimd: Add ability to lookup RP group by table.
This feature does this:

Add the ability to store the non-prefix static RP
entries into a table.  Then to lookup the G to
find the RP in that table, finding the longest
prefix match across both prefix-lists and
static RP's.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-31 10:30:19 -04:00
Donald Sharp e691f179b6 pimd: Cleanup a variety of SA issues
1) Error check return from setsockopt and sockets
2) Check return codes for str2prefix
3) Clean up some potential NULL References

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-24 20:34:28 -04:00
Donald Sharp c206937b91 pimd: Cleanup S,GRPt prune handling on Mroute Loss
1) Clean up display of S,GRPt prune state to be more meaningful
2) Upon receipt of a S,GRPt prune make sure we transition to
   the correct state
3) Upon loss of a S,GRPt prune make sure we transition to
   the correct state as well as immediately send a *,G
   join upstream to propagate the loss of the prune.
4) Removal of a weird S,G state being installed upon
   loss of a S,G RPt prune.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-24 10:01:50 -04:00
Donald Sharp 87f6dc504d *: Add 'show debugging' command from vtysh
Allow vtysh to query every daemon about its
debugging status in one go.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-21 07:23:59 -04:00
Jafar Al-Gharaibeh fd178a6a04 Merge pull request #1001 from dwalton76/pimd-CMD-WARNING
pimd: "No Path to RP address specified" should exit 0
2017-08-18 00:15:37 -05:00
Daniel Walton c6e7b95248 pimd: "No Path to RP address specified" should exit 0
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>

This could happen if routing isn't up yet but the command did take so we
should exit 0 here.  Testing:

root@cel-redxp-10[frr-dwalton76]# vtysh -c 'conf t' -c' ip pim rp
11.11.11.11'
% No Path to RP address specified: 11.11.11.11
root@cel-redxp-10[frr-dwalton76]# echo $?
0
root@cel-redxp-10[frr-dwalton76]#
2017-08-17 15:04:25 +00:00
David Lamparter c9974c7995 Merge pull request #984 from donaldsharp/debugging
Some Small Pim Issues
2017-08-16 19:18:31 +02:00
Donald Sharp 47bf9e213a pimd: Add 'show ip msdp vrf all sa ...' command
Allow the ability to iterate over all vrfs.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-15 16:37:13 -04:00
Donald Sharp 15507b63e6 pimd: Rename duplicate JSON key
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-15 10:31:09 -04:00
Donald Sharp 2243bb17bd pimd: Allow user to specify ip address for 'no ip pim use-source'
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-15 10:16:51 -04:00
Chirag Shah 2fd8de7d96 pimd: Fix pim bfd config order dependecny
Upon frr restart vtysh replays pim bfd configuration
cli before pim sm command, this results in failure
of pim bfd config on the VIF as it is not pim enabled yet.
Inside pim bfd configuration, call to create PIM vif
handler if it is not created yet.
no ip pim bfd, if pim is not enabled display warning and return.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2017-08-13 17:28:11 -07:00
Quentin Young 9643e2c75b
pimd: some pim cli fixes
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-08-07 12:42:05 -04:00
Donald Sharp cc14df1391 pimd: Add ip pim rp keep-alive-time X
Ticket: CM-17134
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-02 08:17:36 -04:00
Donald Sharp ad7b74c4f7 pimd: Convert to using a RB tree for the pim_ifp ifchannel_list
This patch does two things:
1) Converts the pim_ifp->ifchannel_list to a pim_ifp->ifchannel_rb
2) Removes the hashing to use the RB RB_FIND instead.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-02 07:44:00 -04:00
Donald Sharp 86b473a7e8 pimd: Rename pim_ifp->pim_ifchannel_list
Remove the redundant information in pim_ifp->pim_ifchannel_list
just call it pim_ifp->ifchannel_list

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-02 07:44:00 -04:00
Donald Sharp 1a8a3da8c2 pimd: Remove almost duplicate pim->ifchannel_list
The pim->ifchannel_list can be duplicated by iterating
over each vrf and then over each pim_ifp->pim_ifchannel_list
Since list handling is taking allot of time at scale
convert over to using this value.

Additionally clean up pim_cmd.c to have helper functions
to handle the actual encoding of data for output.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-02 07:44:00 -04:00
Quentin Young 07a2935559 pimd: fix show ip msdp... NPD when vrf unknown
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-07-28 08:11:28 -04:00
Donald Sharp 19b807ca17 pimd: Allow the keepalive time to be per vrf.
Allow the keepalive period to be per vrf.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-28 08:03:50 -04:00
Donald Sharp f5da2cc2d8 pimd: Use JSON_STR
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-25 08:19:57 -04:00
Donald Sharp bd4d05c577 pimd: Fix missing docstring in 'no debug pim trace detail'
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:52:57 -04:00
Donald Sharp 5c3aac90d9 pimd: Fix 'show ip mroute vrf all count' crash
'show ip mroute vrf all count' crashes currently

This commit fixes that issue

Ticket: CM-17052
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:52:57 -04:00
Donald Sharp a25de56b58 pimd: Add 'vrf all' commands where needed
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:52:55 -04:00
Donald Sharp 5cef40fcb7 pimd: Fixup NHT debugging to be a bit more coherent
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:41 -04:00
Donald Sharp 40f1f31be6 pimd: Add debug pim nht command
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:41 -04:00
Donald Sharp 64c8653095 pimd: Put 'struct pim_instance *' as the first function parameter
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:41 -04:00
Donald Sharp b283a4ca38 pimd: Add 'show ip mroute vrf all [json]' command
Add the ability to dump all the vrf's associated
with pim.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:40 -04:00
Chirag Shah 96ceedc7a2 pimd: display down ports show ip pim interface
In show ip pim interface and  show ip pim interface <intf>
display State "down" pim enabled interfaces.

Ticket:CM-16809
Reviewed By:CCR-6398
Testing Done:
show ip pim interface
Interface  State          Address  PIM Nbrs           PIM DR  FHR IfChannels
br1           up          2.0.1.1         0            local    0          0
lo            up          6.0.0.1         0            local    0          0
pimreg        up          0.0.0.0         0            local    0          0
swp1        down          6.0.1.1         0            local    0          0
swp2          up          6.0.2.1         1            local    0          0

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2017-07-24 13:51:40 -04:00
Donald Sharp 20a7e5fd85 pimd: Fixup PIM to handle vrf autocompletion
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:40 -04:00
Donald Sharp 9853a7a5b1 pimd: Fix ambiguous command
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:40 -04:00
Donald Sharp 6e89ed94f8 pimd: Convert code to handle vrf autocompletion
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:40 -04:00
Donald Sharp 200e2fe4d1 pimd: Fix msdp show command
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:39 -04:00
Donald Sharp 56243c3a4a pimd: Fix 'show ip pim state...' vrf changes
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:39 -04:00
Donald Sharp 5f40dadaf0 pimd: Fix help string
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-07-24 13:51:39 -04:00