Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rpki Encapsulation #5015

Merged
merged 22 commits into from
Jul 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
7d177be
bgpd: notify user that pub key file may be overriden
pguibert6WIND Sep 5, 2019
bd32bb8
bgpd: remove double spaces with rpki running config & ssh
pguibert6WIND Sep 5, 2019
b5b9dca
bgpd: avoid crash when calling show rpki-table
pguibert6WIND Sep 5, 2019
f9dea02
bgpd: missing rpki retry-interval in show running-config
pguibert6WIND Sep 19, 2019
416d048
bgpd: missing rpki expire-interval in show running-config
pguibert6WIND Sep 19, 2019
f3517f5
bgpd: running-config rpki indicates only non default values
pguibert6WIND Sep 19, 2019
aa31aef
bgpd: add hooks for displaying debug information of a plugin
pguibert6WIND Sep 19, 2019
fed3793
bgpd: link rpki debug with bgp debugging hook
pguibert6WIND Sep 19, 2019
7434534
bgpd: encapsulate rpki attributes in a context
pguibert6WIND Sep 4, 2019
38bf60c
bgpd: suppress availability from rpki command under enable node
pguibert6WIND Sep 19, 2019
dde9d0e
lib, vtysh: bgp rpki constistent changes with rpki_node
pguibert6WIND Sep 20, 2019
157f6f4
bgpd: ability to remove rpki contexts from vty
pguibert6WIND Sep 19, 2019
0443072
bgpd: add a hook to inform a vrf is enabled/disabled
pguibert6WIND Oct 29, 2019
c06cad2
bgpd: use rtrlib callback for socket creation
pguibert6WIND Oct 29, 2019
2224b36
bgpd: rpki show commande equipped with vrfname parameter
pguibert6WIND Sep 19, 2019
4a42034
bgpd: duplicate config commands into rpki-vrf subnode
pguibert6WIND Sep 19, 2019
fd1be68
bgpd: add hook for running-config per vrf rpki config
pguibert6WIND Sep 19, 2019
1f8d139
bgpd: no rpki command available
pguibert6WIND Sep 19, 2019
0feaf64
bgpd: validation of bgp routes with rpki done on according vrf
pguibert6WIND Feb 3, 2020
9dcfdf2
bgpd: add vrf name on some logs from rpki
pguibert6WIND Feb 3, 2020
0ba6afa
doc: add rpki information for rpki per vrf commands
pguibert6WIND Sep 19, 2019
76ddd87
bgpd: change rtr_is_ integer to bool format
pguibert6WIND Jun 29, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion bgpd/bgp_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "memory.h"
#include "queue.h"
#include "filter.h"
#include "hook.h"

#include "bgpd/bgpd.h"
#include "bgpd/bgp_aspath.h"
Expand All @@ -47,6 +48,9 @@
#include "bgpd/bgp_vty.h"
#include "bgpd/bgp_flowspec.h"

DEFINE_HOOK(bgp_hook_config_write_debug, (struct vty *vty, bool running),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This particular commit is not very clear. Can you explain this a bit more ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rpki is a plugin.
so if I want to know which debug rpki has, I have to call a hook.

(vty, running))

unsigned long conf_bgp_debug_as4;
unsigned long conf_bgp_debug_neighbor_events;
unsigned long conf_bgp_debug_events;
Expand Down Expand Up @@ -2168,7 +2172,7 @@ DEFUN_NOSH (show_debugging_bgp,
vty_out(vty, " BGP policy based routing debugging is on\n");
if (BGP_DEBUG(pbr, PBR_ERROR))
vty_out(vty, " BGP policy based routing error debugging is on\n");

hook_call(bgp_hook_config_write_debug, vty, false);
vty_out(vty, "\n");
return CMD_SUCCESS;
}
Expand Down Expand Up @@ -2284,6 +2288,9 @@ static int bgp_config_write_debug(struct vty *vty)
vty_out(vty, "debug bgp graceful-restart\n");
write++;
}

if (hook_call(bgp_hook_config_write_debug, vty, true))
write++;
return write;
}

Expand Down
6 changes: 6 additions & 0 deletions bgpd/bgp_debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@
#ifndef _QUAGGA_BGP_DEBUG_H
#define _QUAGGA_BGP_DEBUG_H

#include "hook.h"
#include "vty.h"

#include "bgp_attr.h"
#include "bgp_updgrp.h"

DECLARE_HOOK(bgp_hook_config_write_debug, (struct vty *vty, bool running),
(vty, running))

/* sort of packet direction */
#define DUMP_ON 1
#define DUMP_SEND 2
Expand Down
28 changes: 28 additions & 0 deletions bgpd/bgp_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,16 @@
#include "bgpd/bgp_network.h"
#include "bgpd/bgp_errors.h"

DEFINE_HOOK(bgp_hook_config_write_vrf, (struct vty *vty, struct vrf *vrf),
(vty, vrf))

#ifdef ENABLE_BGP_VNC
#include "bgpd/rfapi/rfapi_backend.h"
#endif

DEFINE_HOOK(bgp_hook_vrf_update, (struct vrf *vrf, bool enabled),
(vrf, enabled))

/* bgpd options, we use GNU getopt library. */
static const struct option longopts[] = {
{"bgp_port", required_argument, NULL, 'p'},
Expand Down Expand Up @@ -302,6 +308,7 @@ static int bgp_vrf_enable(struct vrf *vrf)
if (old_vrf_id != bgp->vrf_id)
bgp_redistribute_redo(bgp);
bgp_instance_up(bgp);
hook_call(bgp_hook_vrf_update, vrf, true);
vpn_leak_zebra_vrf_label_update(bgp, AFI_IP);
vpn_leak_zebra_vrf_label_update(bgp, AFI_IP6);
vpn_leak_postchange(BGP_VPN_POLICY_DIR_TOVPN, AFI_IP,
Expand Down Expand Up @@ -351,16 +358,37 @@ static int bgp_vrf_disable(struct vrf *vrf)
if (old_vrf_id != bgp->vrf_id)
bgp_unset_redist_vrf_bitmaps(bgp, old_vrf_id);
bgp_instance_down(bgp);
hook_call(bgp_hook_vrf_update, vrf, false);
}

/* Note: This is a callback, the VRF will be deleted by the caller. */
return 0;
}

static int bgp_vrf_config_write(struct vty *vty)
{
struct vrf *vrf;

RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if (vrf->vrf_id == VRF_DEFAULT) {
vty_out(vty, "!\n");
continue;
}
vty_out(vty, "vrf %s\n", vrf->name);

hook_call(bgp_hook_config_write_vrf, vty, vrf);

vty_out(vty, " exit-vrf\n!\n");
}

return 0;
}

static void bgp_vrf_init(void)
{
vrf_init(bgp_vrf_new, bgp_vrf_enable, bgp_vrf_disable,
bgp_vrf_delete, bgp_vrf_enable);
vrf_cmd_init(bgp_vrf_config_write, &bgpd_privs);
}

static void bgp_vrf_terminate(void)
Expand Down
Loading