Commit graph

81 commits

Author SHA1 Message Date
Daniel Walton 17b52be189 pimd: use JSON_C_TO_STRING_PRETTY everywhere
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-12-21 20:26:11 -05:00
Daniel Walton 72b39b9ec5 pimd: 'show ip pim state json' use JSON_C_TO_STRING_PRETTY
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>

Ticket: CM-11812
2016-12-21 20:26:11 -05:00
Daniel Walton 31a21c9cd1 pimd: initial "show ip pim state"
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>

Ticket: CM-11812

superm-redxp-05# show ip pim state

Source           Group            IIF    OIL
20.0.13.253      230.10.10.1      br1    swp1
20.0.13.253      230.20.20.1      br1
0.0.0.0          230.40.40.1      swp1   br1
0.0.0.0          230.42.42.1      swp1   br1
0.0.0.0          230.42.43.1      swp1   br1

superm-redxp-05#
superm-redxp-05# show ip pim state 20.0.13.253

Source           Group            IIF    OIL
20.0.13.253      230.10.10.1      br1    swp1
20.0.13.253      230.20.20.1      br1

superm-redxp-05# show ip pim state 20.0.13.253 230.10.10.1

Source           Group            IIF    OIL
20.0.13.253      230.10.10.1      br1    swp1

superm-redxp-05#
superm-redxp-05# show ip pim state 230.40.40.1

Source           Group            IIF    OIL
0.0.0.0          230.40.40.1      swp1   br1

superm-redxp-05# show ip pim state 230.40.40.1 json
{
  "230.40.40.1":{
    "0.0.0.0":{
      "swp1":{
        "br1":{
          "source":"0.0.0.0",
          "group":"230.40.40.1",
          "inboundInterface":"swp1",
          "outboundInterface":"br1"
        }
      }
    }
  }
}
superm-redxp-05#
2016-12-21 20:26:10 -05:00
Daniel Walton 9b91bb50f8 pimd: Added json to 'show ip igmp group'
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>

root@superm-redxp-05[quagga-pim]# vtysh -c 'show ip igmp group'
Interface Address         Group           Mode Timer    Srcs V Uptime
br1       20.0.13.1       230.40.40.1     EXCL 00:03:24    1 3 00:01:28
root@superm-redxp-05[quagga-pim]#
root@superm-redxp-05[quagga-pim]#
root@superm-redxp-05[quagga-pim]# vtysh -c 'show ip igmp group json' |
python -m json.tool
{
    "br1": {
        "230.40.40.1": {
            "group": "230.40.40.1",
            "mode": "EXCLUDE",
            "source": "20.0.13.1",
            "sourcesCount": 1,
            "timer": "00:03:23",
            "uptime": "00:01:30",
            "version": 3
        },
        "address": "20.0.13.1",
        "flagBroadcast": true,
        "flagMulticast": true,
        "index": 96,
        "lanDelayEnabled": true,
        "name": "br1",
        "state": "up"
    }
}
root@superm-redxp-05[quagga-pim]#
2016-12-21 20:26:10 -05:00
Donald Sharp eccf56d20e pimd: Fix 'show ip mroute count'
Add the lastused data.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:10 -05:00
Donald Sharp f59a8217d1 pimd: Fixup pim mroute output
Cleanup the 'show ip mroute' command to be a bit
more minimalistic.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:10 -05:00
Daniel Walton 91c6aec45f pimd: "show ip mroute" skips entries without an OIF
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>

The entry for 230.10.10.4 was not being displayed

root@superm-redxp-05[pimd]# ip mroute show
(20.0.13.253, 230.10.10.4)       Iif: br1
(20.0.13.253, 230.10.10.1)       Iif: br1        Oifs: swp1
root@superm-redxp-05[pimd]#

root@superm-redxp-05[pimd]#
root@superm-redxp-05[pimd]# vtysh -c 'show ip mroute'
Proto: I=IGMP P=PIM S=STATIC O=SOURCE

Source          Group           Proto Input iVifI Output oVifI TTL Uptime
20.0.13.253     230.10.10.1     P     br1       1 swp1       2   1 00:01:09
20.0.13.253     230.10.10.4     P     br1       1 none       0   0 --:--:--
root@superm-redxp-05[pimd]#
2016-12-21 20:26:10 -05:00
Daniel Walton b3fb2c27cd pimd: JSON support for "show ip mroute"
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>

Ticket: CM-12876

root@superm-redxp-05[pimd]# vtysh -c 'show ip mroute json' | pjson
{
  "230.10.10.1": {
    "20.0.13.253": {
      "br1": {
        "swp1": {
          "group": "230.10.10.1",
          "iVifI": 1,
          "inboundInterface": "br1",
          "oVifI": 2,
          "outboundInterface": "swp1",
          "protocolPim": true,
          "source": "20.0.13.253",
          "ttl": 1,
          "upTime": "00:02:37"
        }
      }
    }
  },
  "230.10.10.4": {
    "20.0.13.253": {
      "br1": {}
    }
  }
}
root@superm-redxp-05[pimd]#
2016-12-21 20:26:09 -05:00
Daniel Walton e775c0a432 pimd: json support for "show ip pim" commands
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>

Ticket: CM-12865
2016-12-21 20:26:09 -05:00
Daniel Walton 9c2df635f5 pimd: show ip pim int WORD, show ip pim nei WORD, show ip igmp int WORD
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>

Ticket: CM-11812
2016-12-21 20:26:09 -05:00
Daniel Walton a268493f6b pimd: show ip pim int WORD, show ip pim nei WORD, show ip igmp int WORD
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>

Ticket: CM-11812
2016-12-21 20:26:09 -05:00
Donald Sharp 63b8f7a35e pimd: Rework approach for needing nbrs
Pim sometimes needs the upstream rpf lookup to
only take into account if we have a nbr out
the selected interface or not.  Move
the code for this to a better spot so
we can make a more intelligent decision
here.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:09 -05:00
Daniel Walton 9bf3c63317 PIM: json support for "show ip pim" commands
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by:   Donald Sharp <sharpd@cumulusnetworks.com>

Ticket: CM-12865
2016-12-21 20:26:09 -05:00
Daniel Walton dfe43e25d8 PIM: prefix-list support for selecting RP
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by:   CCR-5173

Ticket: CM-12819
2016-12-21 20:26:09 -05:00
Donald Sharp 63c59d0c9a pimd: switch pim_rpf.h to use 'struct prefix' for address
mrib_nexthop_addr and rpf_addr should be 'struct prefix'
so that we can safely handle unnumbered data from a nexthop
lookup in zebra

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:08 -05:00
Donald Sharp e8e277d564 pimd: Allow larger range for KAT(S,G)
Allow the KAT(S,G) time be set to up to 60000
seconds.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:08 -05:00
Donald Sharp 284b4301e4 pimd: Track the # of times we ask for nexthp information
Keep an idea of how many times we are asking zebra
for nexthop information.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:07 -05:00
Donald Sharp 00d07c6fda pimd: Add "show ip pim rp-info" command
List the RP information we have configured.

Fix bug where we were not properly initializing some code

Ticket: CM-12617
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:07 -05:00
Donald Sharp f24405b1e8 pimd - Fix rpf lookup to what it was originally
I tried to be smart and skirt around rpf lookup if I knew
the incoming interface.  This turns out to be not necessarily
a good thing because we can easily have asymetrical routing.

This fix removes the attempt to cache the ifp we received
the incoming packet on and just lets the lookup work like
it should.

Additionally it removes the weird hardcoding of the rpf
interface from the register stuff.

Ticket: CM-12530
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>

reb
2016-12-21 20:26:07 -05:00
Donald Sharp c980295412 pimd: Modify pim_upstream_state2str for more usage
Just pass in the actual state to allow us to translate
the state to a string even if we don't have a upstream.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:06 -05:00
Donald Sharp 01408ede34 pimd: Allow rp to configure it's keep alive timer
Allow the end user to supply a RP based keep alive
timer.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:06 -05:00
Donald Sharp 4304f95c86 pimd: Allow keep alive timer configuration
Allow the user to specify the time to wait
for a keep alive to happen.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:06 -05:00
Donald Sharp 6c7197b142 pimd: Add 'debug mroute detail'
When there is allot of IGMP activity for the
kernel upcall that we are ignoring, just
ignore it for the moment as well.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:06 -05:00
Donald Sharp 05b0d0d0ec pimd: Properly isolate zlookup
The qpim_zclient_lookup was a global variable.
This is not needed.  Isolate appropriately

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:06 -05:00
Donald Sharp 2ecb76d375 pimd: Add the display of the Keep Alive Timer for upstream
Add the ability to see the Keep Alive timer for
upstream information.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:05 -05:00
Donald Sharp 36d6bd7d34 pimd: multiple rp commands
Allow the user to specify multiple rp commands.

'ip pim rp A.B.C.D'   -> translates to 'ip pim rp A.G.C.D 224.0.0.0/24'
ip pim rp A.B.C.D A.B.C.D/M
  First is the rp, second is the group with mask.

Groups and masks cannot be over each other except 224.0.0.0/24 which
is the fallback if used.

Ticket: CM-7860
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:05 -05:00
Donald Sharp 75a26779e8 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>
2016-12-21 20:26:05 -05:00
Donald Sharp 4ed0af7013 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>
2016-12-21 20:26:05 -05:00
Donald Sharp ad6ec47b81 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>
2016-12-21 20:26:05 -05:00
Donald Sharp 9add3b8812 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>
2016-12-21 20:26:04 -05:00
Donald Sharp 2a05c94c91 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>
2016-12-21 20:26:04 -05:00
Donald Sharp 13afbd05fd pimd: Create raw socket for register packets to be forwarded.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:04 -05:00
Donald Sharp 346cffe31e 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>
2016-12-21 20:26:04 -05:00
Donald Sharp 984c84f486 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>
2016-12-21 20:26:04 -05:00
Donald Sharp 7e0cff2f98 pimd: Remove unnecessary QuaggaId
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:03 -05:00
Donald Sharp 6928363995 pimd: convert pim_ifchannel_local_membership_add to use struct prefix sg
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:03 -05:00
Donald Sharp 05e451f828 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>
2016-12-21 20:26:03 -05:00
Donald Sharp 99064df9e3 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>
2016-12-21 20:26:02 -05:00
Donald Sharp d7259eac8b pimd: create pim_upstream_state2str
Allow update of show command to understant all
pim upstream states.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:02 -05:00
David Lamparter cdc2d76507 *: coccinelle-replace vty->index
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-12-09 17:36:25 +01:00
David Lamparter 0b84f29490 *: make DEFUN installations file-local
This moves all install_element calls into the file where the DEFUNs are
located.  This fixes several small related bugs:

- ospf6d wasn't installing a "no interface FOO" command
- zebra had a useless copy of "interface FOO"
- pimd's copy of "interface FOO" was not setting qobj_index, which means
  "description LINE" commands would fail with an error

The next commit will do the actual act of making "foo_cmd" static.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-12-01 17:25:56 +01:00
Quentin Young d7fa34c1bc all: Fix underfull doc strings, part 2
Add missing docstrings and separating \n.
Also eat some low-hanging refactoring fruit.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-11-08 01:46:04 +00:00
Quentin Young e52702f29d Merge branch 'cmaster-next' into vtysh-grammar
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>

Conflicts:
	bgpd/bgp_route.c
	bgpd/bgp_routemap.c
	bgpd/bgp_vty.c
	isisd/isis_redist.c
	isisd/isis_routemap.c
	isisd/isis_vty.c
	isisd/isisd.c
	lib/command.c
	lib/distribute.c
	lib/if.c
	lib/keychain.c
	lib/routemap.c
	lib/routemap.h
	ospf6d/ospf6_asbr.c
	ospf6d/ospf6_interface.c
	ospf6d/ospf6_neighbor.c
	ospf6d/ospf6_top.c
	ospf6d/ospf6_zebra.c
	ospf6d/ospf6d.c
	ospfd/ospf_routemap.c
	ospfd/ospf_vty.c
	ripd/rip_routemap.c
	ripngd/ripng_routemap.c
	vtysh/extract.pl.in
	vtysh/vtysh.c
	zebra/interface.c
	zebra/irdp_interface.c
	zebra/rt_netlink.c
	zebra/rtadv.c
	zebra/test_main.c
	zebra/zebra_routemap.c
	zebra/zebra_vty.c
2016-10-17 23:36:21 +00:00
Donald Sharp 0b1442e37b *: Consolidate all double VIEW_NODE and ENABLE_NODE's
If a command is put into the VIEW_NODE, it is going into the
ENABLE_NODE as well.  This is especially true for show commands.
As such if a command is in both consolidate it down to VIEW_NODE.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-10-07 21:05:06 -04:00
Daniel Walton 58749582a9 all: scrubbed some argc CHECK MEs
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-30 00:16:31 +00:00
Daniel Walton abddf07563 all: scrubbed some argc CHECK MEs
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-29 19:51:56 +00:00
Daniel Walton 67656e9b65 all: added CHECK ME for DEFUNs that look at argc
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-29 17:48:57 +00:00
Daniel Walton 80d3d26b36 pimd: removed undebug CHECK MEs
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-27 00:26:41 +00:00
Daniel Walton e961923c72 bgpd, etc: changed .LINE to LINE...
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-27 00:07:46 +00:00
Daniel Walton 9ccf14f739 Expand #defines in command strings
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-09-25 14:10:48 +00:00