]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
7 years agopimd: Refactor RP code and start the ability to handle ranges
Donald Sharp [Fri, 5 Aug 2016 13:07:46 +0000 (09:07 -0400)]
pimd: Refactor RP code and start the ability to handle ranges

Refactor the qpim_rp into pim_rp.c so that the global data
is protected.  This will allow us to easily add the group
ranges.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix some null register issues
Donald Sharp [Thu, 4 Aug 2016 16:58:47 +0000 (12:58 -0400)]
pimd: Fix some null register issues

The Null register bit was not properly being set and
the total length was wrong as well.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix join_desired for (*,G) states
Donald Sharp [Thu, 4 Aug 2016 16:06:58 +0000 (12:06 -0400)]
pimd: Fix join_desired for (*,G) states

When we are evaluating if we have a inherited_olist, include
the *,G state in determing what to do.

Additionally when we receive a join or prune of *,G
do the right thing.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Was removing the wrong channel.
Donald Sharp [Thu, 4 Aug 2016 15:44:11 +0000 (11:44 -0400)]
pimd: Was removing the wrong channel.

When receiving a prune (*,G), we were removing
from the wrong channel.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Enable WrongVif and WRWHOLEVIF callbacks.
Donald Sharp [Thu, 4 Aug 2016 15:09:30 +0000 (11:09 -0400)]
pimd: Enable WrongVif and WRWHOLEVIF callbacks.

Turn on Wrong Vif and Whole packet wrong vif callbacks.

Signed-off-by: Donald Sharp <sharpd@cumuusnetworks.com>
7 years agopimd: Fix broken build
Donald Sharp [Thu, 4 Aug 2016 00:57:47 +0000 (20:57 -0400)]
pimd: Fix broken build

I missed 2 instances of the conversion from struct prefix
to struct prefix_sg

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agozebra: Remove unused variable.
Donald Sharp [Wed, 3 Aug 2016 23:53:42 +0000 (19:53 -0400)]
zebra: Remove unused variable.

Remove the rtnh variable since it is unused.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agolib, pimd: Fix borked up prefix code
Donald Sharp [Tue, 2 Aug 2016 08:38:11 +0000 (04:38 -0400)]
lib, pimd: Fix borked up prefix code

Fix the struct prefix to be an actual struct prefix_sg.
This cleans up a bunch of code to make it look nicer.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Add rs_timer display
Donald Sharp [Wed, 3 Aug 2016 18:40:10 +0000 (14:40 -0400)]
pimd: Add rs_timer display

For the 'show ip pim upstream' command addd the RSTimer to the display

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix upstream state machine.
Donald Sharp [Wed, 3 Aug 2016 15:34:38 +0000 (11:34 -0400)]
pimd: Fix upstream state machine.

RFC 4601 4.5.7:
Joined
      The downstream state machines and local membership information
      indicate that the router should join the shortest-path tree for
      this (S,G).

The code has a upstream state that is in 'J' state already
due to a S,G multicast packet received on an incoming
interface.  This packet has been forwarded to the RP.
The RP sees this and immediately sends a join towards
the S,G.

The code as originally written assumed that you could
not transition from a J state to a J state.  This is not
true.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Change packet debug to pim register specific debug
Donald Sharp [Wed, 3 Aug 2016 15:32:15 +0000 (11:32 -0400)]
pimd: Change packet debug to pim register specific debug

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Add ability to debug pim Register packets
Donald Sharp [Wed, 3 Aug 2016 01:44:29 +0000 (21:44 -0400)]
pimd: Add ability to debug pim Register packets

Allow the user to specify the ability to debug
pim register packets.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Remove Wrong PIMREG ifchannel state
Donald Sharp [Tue, 2 Aug 2016 18:14:54 +0000 (14:14 -0400)]
pimd: Remove Wrong PIMREG ifchannel state

The PIMREG ifchannel state is an evolutionary dead-end.
I should not have introduced this code.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Make the NOCACHE just set the regiface to the coil
Donald Sharp [Tue, 2 Aug 2016 17:12:31 +0000 (13:12 -0400)]
pimd: Make the NOCACHE just set the regiface to the coil

When we receive a NOCACHE upcall, add the pimreg interface
to the oil so that we can receive the data.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Send join when a S,G is pruned
Donald Sharp [Tue, 2 Aug 2016 15:39:16 +0000 (11:39 -0400)]
pimd: Send join when a S,G is pruned

When a *,G is received, and we have S,G that is in a
non-joined state, Send the join to the S,G.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Add upstream children finding
Donald Sharp [Tue, 2 Aug 2016 15:21:49 +0000 (11:21 -0400)]
pimd: Add upstream children finding

When we receive a *,g find all S,G that
are related and set pointer appropriately

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Add Local Genid to 'show ip pim hello'
Donald Sharp [Tue, 2 Aug 2016 13:58:14 +0000 (09:58 -0400)]
pimd: Add Local Genid to 'show ip pim hello'

Display the local idea of what the Genid is

Ticket: CM-11980
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Allow the kernel to forward encap'ed packets for us
Donald Sharp [Tue, 2 Aug 2016 13:21:51 +0000 (09:21 -0400)]
pimd: Allow the kernel to forward encap'ed packets for us

When we get a pim register allow the kernel to forward the
saved packets.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: igmpv3.c was causing prune/join messages to be sent
Donald Sharp [Mon, 1 Aug 2016 17:06:35 +0000 (13:06 -0400)]
pimd: igmpv3.c was causing prune/join messages to be sent

We were erroneously sending a prune *,G immediately followed
by a join *,G under certain situations

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: change from ifchannels to oil's
Donald Sharp [Mon, 1 Aug 2016 16:29:58 +0000 (12:29 -0400)]
pimd: change from ifchannels to oil's

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: More macro fallout fix.
Donald Sharp [Mon, 1 Aug 2016 13:09:47 +0000 (09:09 -0400)]
pimd: More macro fallout fix.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix pim_macro downstream_jpstate
Donald Sharp [Mon, 1 Aug 2016 12:29:00 +0000 (08:29 -0400)]
pimd: Fix pim_macro downstream_jpstate

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Create storage for a raw socket.
Donald Sharp [Sat, 30 Jul 2016 01:20:19 +0000 (21:20 -0400)]
pimd: Create storage for a raw socket.

Each interface needs the ability to send raw packets
at the RP.  Create the data structure to do so.
Further commits will create the socket as necessary
and send the packet.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix DownstreamJPState(S,G,I) check.
Donald Sharp [Sat, 30 Jul 2016 01:02:17 +0000 (21:02 -0400)]
pimd: Fix DownstreamJPState(S,G,I) check.

Fix the
DownStreamJPState(S,G,I) and
DownStreamJPState(*,G,I) macros.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Allow ifchannel S,G's to know their *,G parent
Donald Sharp [Thu, 28 Jul 2016 16:21:31 +0000 (12:21 -0400)]
pimd: Allow ifchannel S,G's to know their *,G parent

Given a S,G ifchannel, create a parent pointer for any
*,G state for that interface.  When removing a *,G
remove S,G pointers.

We need to think about the case where their is a *,G
but no S,G for a interface when we are determing.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: pim_str_sg_dump can't be called 2 times in the same debug
Donald Sharp [Thu, 28 Jul 2016 07:08:03 +0000 (03:08 -0400)]
pimd: pim_str_sg_dump can't be called 2 times in the same debug

When we call pim_str_sg_dump we cannot call the variable twice
for the same debug.  This fixes this issue in the 2 places it
was borked.

Ticket: CM-12045
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix *,g pruning
Donald Sharp [Thu, 28 Jul 2016 06:46:36 +0000 (02:46 -0400)]
pimd: Fix *,g pruning

We were not properly handling the receipt of prune *,g messages.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Infrastructure to forward packet down (*,G) tree
Donald Sharp [Thu, 28 Jul 2016 02:19:08 +0000 (22:19 -0400)]
pimd: Infrastructure to forward packet down (*,G) tree

When a register is received, forward the packet as appropriate.
This is the infrastructure to make this happen.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Create raw socket for register packets to be forwarded.
Donald Sharp [Thu, 28 Jul 2016 01:17:54 +0000 (21:17 -0400)]
pimd: Create raw socket for register packets to be forwarded.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Create pim_socket_bind
Donald Sharp [Thu, 28 Jul 2016 00:13:16 +0000 (20:13 -0400)]
pimd: Create pim_socket_bind

Allow a socket to be bound to a specified
interface.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Revamp send of join/prune to actually set bits right.
Donald Sharp [Wed, 27 Jul 2016 20:33:41 +0000 (16:33 -0400)]
pimd: Revamp send of join/prune to actually set bits right.

When a *,G report is sent, the RPT and WC bits
are set as well as the source is the RP address
for the group.

If this routers idea of the RP for this group is
different than the idea of the RP from the sender
than that particular *,G can be dropped.

Ticket: CM-12031
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Start abstraction for WC and RPT bits
Donald Sharp [Wed, 27 Jul 2016 19:27:52 +0000 (15:27 -0400)]
pimd: Start abstraction for WC and RPT bits

Start the abstraction of the WC and RPT bits
so we can send the data as appropriate.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fixup pim_oil interface to be a bit more consistent.
Donald Sharp [Wed, 27 Jul 2016 19:39:28 +0000 (15:39 -0400)]
pimd: Fixup pim_oil interface to be a bit more consistent.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Find the parent on newly created upstream's
Donald Sharp [Sun, 24 Jul 2016 05:15:09 +0000 (01:15 -0400)]
pimd:  Find the parent on newly created upstream's

When we create a new upstream data structure find the parent.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Make kernel upcalls PIM_DEBUG_MROUTE
Donald Sharp [Sat, 23 Jul 2016 23:54:51 +0000 (19:54 -0400)]
pimd: Make kernel upcalls PIM_DEBUG_MROUTE

The kernel upcalls for control messages should
be PIM_DEBUG_MROUTE instead of PIM_DEBUG_PIM_TRACE

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix Join/Prune logging
Donald Sharp [Sat, 23 Jul 2016 23:18:19 +0000 (19:18 -0400)]
pimd: Fix Join/Prune logging

For some reason Join/Prune debugs were being
turned on by trace not by the 'debug pim packets join'
command.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Add some 'show debug pim' output
Donald Sharp [Wed, 27 Jul 2016 01:00:09 +0000 (21:00 -0400)]
pimd: Add some 'show debug pim' output

Add some missing 'show debug pim' output so that I can
see what I think I'm debugging.

In general the pim debugs need another round of fixing.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Some bug fixes for the register receive code path
Donald Sharp [Sat, 23 Jul 2016 16:30:41 +0000 (12:30 -0400)]
pimd: Some bug fixes for the register receive code path

When we receive a register receive handle it a bit
better.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Allow (*,G) joins to join a (s,g) that pre-exists
Donald Sharp [Sat, 23 Jul 2016 10:01:55 +0000 (06:01 -0400)]
pimd: Allow (*,G) joins to join a (s,g) that pre-exists

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Add code to handle the inheritance for (s,g)
Donald Sharp [Sat, 23 Jul 2016 09:36:44 +0000 (05:36 -0400)]
pimd: Add code to handle the inheritance for (s,g)

Add code to handle the inheritance and to send the
join upstream as appropriate.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Remove unnecessary QuaggaId
Donald Sharp [Sat, 23 Jul 2016 08:12:05 +0000 (04:12 -0400)]
pimd: Remove unnecessary QuaggaId

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: start fix of inherited_olist
Donald Sharp [Sat, 23 Jul 2016 07:47:15 +0000 (03:47 -0400)]
pimd: start fix of inherited_olist

We were not correctly determing the inherited olist and
applying it to the s,g.

Start the work to do this.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Stop leaving pim_register_recv early
Donald Sharp [Sat, 23 Jul 2016 07:36:25 +0000 (03:36 -0400)]
pimd: Stop leaving pim_register_recv early

When we received a pim_register_recv we were shortcutting
the algorithm to determine what to do when we receive
a register pim message.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix _find and switch_to_spt_desired.
Donald Sharp [Sat, 23 Jul 2016 07:33:53 +0000 (03:33 -0400)]
pimd: Fix _find and switch_to_spt_desired.

The pim_upstream_find function should not be finding a *,G
Find what is asked of it.

The switch_to_spt_desired should return true on the RP currently.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: pim_br switch to struct prefix
Donald Sharp [Sat, 23 Jul 2016 04:35:35 +0000 (00:35 -0400)]
pimd: pim_br switch to struct prefix

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: SwitchToSptDesired now uses struct prefix *sg.
Donald Sharp [Sat, 23 Jul 2016 04:06:55 +0000 (00:06 -0400)]
pimd: SwitchToSptDesired now uses struct prefix *sg.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: More conversion of struct prefix *sg
Donald Sharp [Sat, 23 Jul 2016 03:58:55 +0000 (23:58 -0400)]
pimd: More conversion of struct prefix *sg

Some more conversion to use struct prefix *sg in pim_ifchannel.c

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Convert pim_ifchannel_local_membership_del to struct prefix *sg
Donald Sharp [Sat, 23 Jul 2016 03:50:29 +0000 (23:50 -0400)]
pimd: Convert pim_ifchannel_local_membership_del to struct prefix *sg

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: convert pim_ifchannel_local_membership_add to use struct prefix sg
Donald Sharp [Sat, 23 Jul 2016 03:42:11 +0000 (23:42 -0400)]
pimd: convert pim_ifchannel_local_membership_add to use struct prefix sg

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Convert pim_ifchannel_prune to use struct prefix *sg
Donald Sharp [Sat, 23 Jul 2016 03:34:27 +0000 (23:34 -0400)]
pimd: Convert pim_ifchannel_prune to use struct prefix *sg

Convert the pim_ifchannel_prune function to use a struct
prefix *sg for the source group.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Convert pim_ifchannel_join_add to struct prefix *sg
Donald Sharp [Sat, 23 Jul 2016 03:28:13 +0000 (23:28 -0400)]
pimd: Convert pim_ifchannel_join_add to struct prefix *sg

Convert the pim_ifchannel_join_add to use a struct prefix *sg
instead of struct in_addr's.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: more source,group conversion to prefix sg
Donald Sharp [Sat, 23 Jul 2016 03:12:06 +0000 (23:12 -0400)]
pimd: more source,group conversion to prefix sg

Convert more of the code to pass around a 'struct prefix sg'
instead of individual struct addr's.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Refactor s,g information to struct prefix in pim_upstream.h
Donald Sharp [Fri, 22 Jul 2016 12:57:20 +0000 (08:57 -0400)]
pimd: Refactor s,g information to struct prefix in pim_upstream.h

This change allows us to pass the (s,g) state around as a prefix.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Convert ifchannel to using a prefix to store (s,g)
Donald Sharp [Fri, 22 Jul 2016 12:01:43 +0000 (08:01 -0400)]
pimd: Convert ifchannel to using a prefix to store (s,g)

Convert ifchannel to use a prefix to store (s,g) information.
Additionally create pim_str_sg_dump function to output
data when using debugs.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agolib: Setup prefix.h to allow it to store (s,g)
Donald Sharp [Fri, 22 Jul 2016 09:58:08 +0000 (05:58 -0400)]
lib: Setup prefix.h to allow it to store (s,g)

We need the ability to store the (s,g) in a struct prefix.
This will allow us to consolidate some duplicated code in
pimd as well as set us up to switch from a link list to a
table to store (s,g) state.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix join in register to use correct nexthop
Donald Sharp [Fri, 22 Jul 2016 14:19:32 +0000 (10:19 -0400)]
pimd: Fix join in register to use correct nexthop

pim was sending the join from the RP towards the FHR with
a address that was the source instead of the nexthop.  This join
was treated as a non-local and nothing was done with it.

Ticket: CM-11945
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Start switchover to using a PRUNE (S,G) for uninteresting streams
Donald Sharp [Fri, 22 Jul 2016 13:26:30 +0000 (09:26 -0400)]
pimd: Start switchover to using a PRUNE (S,G) for uninteresting streams

When we receive a register for a (S,G) that we have no interest in
prune it off and send the register stop.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agozebra: API to locate client structure based on protocol
vivek [Thu, 21 Jul 2016 15:50:17 +0000 (08:50 -0700)]
zebra: API to locate client structure based on protocol

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket:
Reviewed By: CCR-4968
Testing Done: Tested with subsequent patch(es)

7 years agopimd: Make pim_upstream_switch non static
Donald Sharp [Sat, 16 Jul 2016 12:27:24 +0000 (08:27 -0400)]
pimd: Make pim_upstream_switch non static

Allow pim_upstream_switch to be called from outside of pim_upstream.c
Also change the assert to an if test to just correctly stop the
timer.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: change string to JOINPRUNE
Donald Sharp [Sat, 16 Jul 2016 12:23:22 +0000 (08:23 -0400)]
pimd: change string to JOINPRUNE

Change the JP message string to JOINPRUNE.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Refactor pim message type to an enum
Donald Sharp [Sat, 16 Jul 2016 08:49:32 +0000 (04:49 -0400)]
pimd: Refactor pim message type to an enum

Change the pim message type to an enum and add the ability
to output a string based upon message type.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Use XCALLOC instead of XMALLOC
Donald Sharp [Sat, 16 Jul 2016 06:45:33 +0000 (02:45 -0400)]
pimd: Use XCALLOC instead of XMALLOC

Ensure that all data structures start out
as 0 filled.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix PACKETDUMP compile errors.
Donald Sharp [Fri, 15 Jul 2016 19:47:13 +0000 (15:47 -0400)]
pimd: Fix PACKETDUMP compile errors.

signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>

7 years agopimd: First Schwag at pim_register_stop
Donald Sharp [Fri, 15 Jul 2016 19:42:09 +0000 (15:42 -0400)]
pimd: First Schwag at pim_register_stop

Implement the pim_register_stop state machine.  There are still a few
bugs still but this is enough to get us rolling a bit more.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Refactor ifchannel creation.
Donald Sharp [Fri, 15 Jul 2016 15:03:15 +0000 (11:03 -0400)]
pimd: Refactor ifchannel creation.

Remove unnecessary function.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Remove unneeded function.
Donald Sharp [Fri, 15 Jul 2016 13:42:57 +0000 (09:42 -0400)]
pimd: Remove unneeded function.

Remove the prune_echo function as that it just took some
data and passed it into another function.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Properly initialize and delete t_rs_timer
Donald Sharp [Mon, 18 Jul 2016 13:52:45 +0000 (09:52 -0400)]
pimd: Properly initialize and delete t_rs_timer

Ensure that we properly initialize and stop the t_rs_timer.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Create register stop timer for DR
Donald Sharp [Mon, 18 Jul 2016 13:47:19 +0000 (09:47 -0400)]
pimd: Create register stop timer for DR

When a register stop is received, create the register stop
timer and associated state machine.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Add null_register bit to pim_register_send
Donald Sharp [Mon, 18 Jul 2016 00:18:33 +0000 (20:18 -0400)]
pimd: Add null_register bit to pim_register_send

When sending a pim register message to an RP, we need
the ability to set the null bit in the message.  This
adds the ability to do so.

Additionally we need to switch the ip_hdr to a const uint8_t *buf
because pim_register_send really shouldn't know or care about
the fact it's a 'struct ip'.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Add pim_channel_del_oif
Donald Sharp [Sun, 17 Jul 2016 23:51:56 +0000 (19:51 -0400)]
pimd: Add pim_channel_del_oif

For a given interface remove the interface from the list
of outgoing interfaces for a mroute and reinstall it
into the kernel.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: create pim_upstream_state2str
Donald Sharp [Sun, 17 Jul 2016 23:45:16 +0000 (19:45 -0400)]
pimd: create pim_upstream_state2str

Allow update of show command to understant all
pim upstream states.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix use of 0 for NULL
Donald Sharp [Thu, 14 Jul 2016 21:19:00 +0000 (17:19 -0400)]
pimd: Fix use of 0 for NULL

pimd uses allot of 0's to represent NULL.  Not a good
programming practice.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Add decision point to send register message
Donald Sharp [Thu, 14 Jul 2016 21:16:42 +0000 (17:16 -0400)]
pimd: Add decision point to send register message

When we receive a register stop we will have created a
timer for this.  As such if the t_rs_timer pointer will
be non-NULL at this point.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Refactor pim message receive
Donald Sharp [Thu, 14 Jul 2016 14:30:37 +0000 (10:30 -0400)]
pimd: Refactor pim message receive

We were using a variety of techniques to handle
incoming pim packets.  Refactor to use a switch
statement to handle the incoming packets.

Also add the ability to notice that we are getting
a register stop.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Send Register-Stop from RP
Donald Sharp [Thu, 14 Jul 2016 14:12:25 +0000 (10:12 -0400)]
pimd: Send Register-Stop from RP

The RP now has the ability to send a register stop message
to the originator of the packet in order to tell it to
stop encapsulating packets to the RP.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Set correct parameters to pim_register_stop_send
Donald Sharp [Thu, 14 Jul 2016 13:09:39 +0000 (09:09 -0400)]
pimd: Set correct parameters to pim_register_stop_send

Setup the pim_register_stop_send function to
take the correct parameters.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fixup some dead code
Donald Sharp [Thu, 14 Jul 2016 13:05:34 +0000 (09:05 -0400)]
pimd: Fixup some dead code

Remove some dead code.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Create pim_encode_addr_group
Donald Sharp [Wed, 13 Jul 2016 01:40:35 +0000 (21:40 -0400)]
pimd: Create pim_encode_addr_group

Create the ability to encode the group address in a message.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agolib: add grammar_sandbox to .gitignore
Quentin Young [Tue, 20 Dec 2016 06:39:37 +0000 (06:39 +0000)]
lib: add grammar_sandbox to .gitignore

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agoMerge pull request #22 from qlyoung/fix-do-tab
Quentin Young [Mon, 19 Dec 2016 22:35:03 +0000 (17:35 -0500)]
Merge pull request #22 from qlyoung/fix-do-tab

lib: fix crash when tab-completing `do ...` commands

7 years agolib: fix crash when tab-completing `do ...` commands
Quentin Young [Sun, 18 Dec 2016 05:14:55 +0000 (05:14 +0000)]
lib: fix crash when tab-completing `do ...` commands

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agoMerge pull request #6 from opensourcerouting/dev/osr/vty_pending
Donald Sharp [Fri, 16 Dec 2016 20:52:47 +0000 (15:52 -0500)]
Merge pull request #6 from opensourcerouting/dev/osr/vty_pending

parser: accept non-words as first tokens & numbers as word tokens

7 years agoMerge pull request #5 from freerangerouting/dev/osr/fixes_plus_vty_keywords
Donald Sharp [Fri, 16 Dec 2016 20:12:34 +0000 (15:12 -0500)]
Merge pull request #5 from freerangerouting/dev/osr/fixes_plus_vty_keywords

Merge branch 'dev/osr/fixes_plus_vty_keywords'

7 years agolib: parser: remove startnode & sentence_root
David Lamparter [Wed, 23 Nov 2016 18:20:15 +0000 (19:20 +0100)]
lib: parser: remove startnode & sentence_root

This removes an artificial restriction for the first token in a
command's graph to be a WORD_TKN.  The intention seems to be to prohibit
empty paths through a command, and to restrict "explosion" of choices in
the root node.

The better approach to the former is to check for an empty path after
the definition is parsed.  The latter will happen anyway, by duplication
of the command, which just makes it worse...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: parser: accept number-only word tokens
David Lamparter [Fri, 16 Dec 2016 19:43:26 +0000 (20:43 +0100)]
lib: parser: accept number-only word tokens

There seems to be no reason why numbers don't work as plain word tokens;
this is useful to have "number choices" or constants, e.g. <128|192|256>
for bit encryption lengths.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobuild: automake 1.12 to deal with flex & bison
David Lamparter [Fri, 16 Dec 2016 16:33:31 +0000 (17:33 +0100)]
build: automake 1.12 to deal with flex & bison

bison conditionally writes its output to different files based on the
filenames specified in the source code.  This could be disabled,
however...  flex changes its output filenames when "prefix" is
specified.  And ylwrap from <1.11 doesn't understand how to handle the
header file...

...so this requires automake 1.12 which can deal with this properly.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: parser: move allowrepeat to cmd_token
David Lamparter [Fri, 16 Dec 2016 16:19:37 +0000 (17:19 +0100)]
lib: parser: move allowrepeat to cmd_token

struct graph_node isn't quite the right place to control matcher
behaviour.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobgpd: shuffle qobj_init()
David Lamparter [Fri, 16 Dec 2016 07:12:54 +0000 (08:12 +0100)]
bgpd: shuffle qobj_init()

bgp_master_init is called first thing in main(), so we need to wedge a
qobj_init() call in there...  this needs some improvement...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: parser: reorder bison incarnations
David Lamparter [Fri, 16 Dec 2016 01:10:48 +0000 (02:10 +0100)]
lib: parser: reorder bison incarnations

This shuffles the code blocks in command_parser.y to match file output
order, then adjusts things to make the include handling less messy.

(also dropped unused DECIMAL_STRLEN_MAX define.)

This should hopefully fix the build on NetBSD 6.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobuild: check flex >= 2.5.20 is available
David Lamparter [Fri, 16 Dec 2016 00:24:53 +0000 (01:24 +0100)]
build: check flex >= 2.5.20 is available

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobuild: fix bison < 3.0 compatibility
David Lamparter [Thu, 15 Dec 2016 23:37:52 +0000 (00:37 +0100)]
build: fix bison < 3.0 compatibility

bison-2.7.x really wants "foo" for api.prefix while bison-3.0.x really
wants {foo} ... great.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agotests: fix mis-fixed format string
David Lamparter [Thu, 15 Dec 2016 23:14:55 +0000 (00:14 +0100)]
tests: fix mis-fixed format string

PRIu64 is "u", we need "x", so PRIx64...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Cc: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agotests: fix exit <> return mix-up in dejagnu
David Lamparter [Thu, 15 Dec 2016 23:09:46 +0000 (00:09 +0100)]
tests: fix exit <> return mix-up in dejagnu

exit 0 exits the entire testrunner... Oops.
Also, "unresolved" breaks too many things, so make this a pass.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agotests: add missing qobj_init() call
David Lamparter [Thu, 15 Dec 2016 23:01:20 +0000 (00:01 +0100)]
tests: add missing qobj_init() call

This was SEGV'ing the test in bgp_master_init() since QOBJ_REG was used
without qobj_init() being called first.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agotests: adjust testcli ref output to new argv rules
David Lamparter [Thu, 15 Dec 2016 22:20:04 +0000 (23:20 +0100)]
tests: adjust testcli ref output to new argv rules

Now that we have keyword argument support in the matcher again, this
needs to be updated because argv[] will be 1:1 user input without
mangling or reordering.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: parser: fix SEGV when Tab hits non-WORD_TKN
David Lamparter [Thu, 15 Dec 2016 22:53:02 +0000 (23:53 +0100)]
lib: parser: fix SEGV when Tab hits non-WORD_TKN

If <Tab> processing finds that there is only 1 candidate, but that
candidate is not a WORD_TKN that we can tab-complete on, the status
would remain at CMD_COMPLETE_FULL_MATCH, but the resulting list of
possible completions is empty.

This then SEGVs in lib/vty.c where it tries to access the first element
of the list, assuming FULL_MATCH always has 1 element there...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Cc: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agolib: parser: support keyword arguments
David Lamparter [Fri, 18 Nov 2016 14:56:18 +0000 (15:56 +0100)]
lib: parser: support keyword arguments

This re-adds "{foo WORD|bar WORD}" keyword-argument support to the CLI
parser.  Note that token graphs may now contain loops for this purpose;
therefore the matching functions retain a history of already-matched
tokens.  Each token can thus only be consumed once.

And then LINE... gets its special treatment with allowrepeat.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: parser: refresh grammar_sandbox
David Lamparter [Wed, 23 Nov 2016 10:58:13 +0000 (11:58 +0100)]
lib: parser: refresh grammar_sandbox

This makes grammar_sandbox a workable tool again, updating it for the
recent changes.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoMerge branch 'dev/osr/vty_index'
David Lamparter [Thu, 15 Dec 2016 20:34:53 +0000 (21:34 +0100)]
Merge branch 'dev/osr/vty_index'

Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agozebra_mpls. Set best lsp nhlfe to null on deletion
Fredi Raspall [Wed, 30 Nov 2016 18:15:07 +0000 (19:15 +0100)]
zebra_mpls. Set best lsp nhlfe to null on deletion

When a nhlfe was deleted and it happened to be the best,
lsp->best_nhlfe was not updated causing lsp_process() to see
an inexistent nhlfe.
Fix: set lsp->best_nhlfe to null on deletion.