2016-05-27 01:31:38 +02:00
|
|
|
/* PIM Route-map Code
|
|
|
|
* Copyright (C) 2016 Cumulus Networks <sharpd@cumulusnetworks.com>
|
|
|
|
* Copyright (C) 1999 Kunihiro Ishiguro <kunihiro@zebra.org>
|
|
|
|
*
|
|
|
|
* This file is part of Quagga
|
|
|
|
*
|
|
|
|
* Quagga is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
* Free Software Foundation; either version 2, or (at your option) any
|
|
|
|
* later version.
|
|
|
|
*
|
|
|
|
* Quagga is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
2017-05-13 10:25:29 +02:00
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; see the file COPYING; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
2016-05-27 01:31:38 +02:00
|
|
|
*/
|
|
|
|
#include <zebra.h>
|
|
|
|
|
2016-06-18 02:43:21 +02:00
|
|
|
#include "if.h"
|
2016-10-06 21:56:13 +02:00
|
|
|
#include "vty.h"
|
2016-05-27 01:31:38 +02:00
|
|
|
#include "routemap.h"
|
|
|
|
|
|
|
|
#include "pimd.h"
|
|
|
|
|
2016-09-09 22:24:31 +02:00
|
|
|
|
|
|
|
static void
|
|
|
|
pim_route_map_mark_update (const char *rmap_name)
|
|
|
|
{
|
|
|
|
// placeholder
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
pim_route_map_add (const char *rmap_name)
|
|
|
|
{
|
|
|
|
if (route_map_mark_updated(rmap_name, 0) == 0)
|
|
|
|
pim_route_map_mark_update(rmap_name);
|
|
|
|
|
|
|
|
route_map_notify_dependencies(rmap_name, RMAP_EVENT_MATCH_ADDED);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
pim_route_map_delete (const char *rmap_name)
|
|
|
|
{
|
|
|
|
if (route_map_mark_updated(rmap_name, 1) == 0)
|
|
|
|
pim_route_map_mark_update(rmap_name);
|
|
|
|
|
|
|
|
route_map_notify_dependencies(rmap_name, RMAP_EVENT_MATCH_DELETED);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
pim_route_map_event (route_map_event_t event, const char *rmap_name)
|
|
|
|
{
|
|
|
|
if (route_map_mark_updated(rmap_name, 0) == 0)
|
|
|
|
pim_route_map_mark_update(rmap_name);
|
|
|
|
|
|
|
|
route_map_notify_dependencies(rmap_name, RMAP_EVENT_MATCH_ADDED);
|
|
|
|
}
|
|
|
|
|
2016-05-27 01:31:38 +02:00
|
|
|
void
|
|
|
|
pim_route_map_init (void)
|
|
|
|
{
|
|
|
|
route_map_init ();
|
2016-10-19 16:55:01 +02:00
|
|
|
|
2016-09-09 22:24:31 +02:00
|
|
|
route_map_add_hook (pim_route_map_add);
|
|
|
|
route_map_delete_hook (pim_route_map_delete);
|
|
|
|
route_map_event_hook (pim_route_map_event);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
pim_route_map_terminate (void)
|
|
|
|
{
|
|
|
|
route_map_add_hook (NULL);
|
|
|
|
route_map_delete_hook (NULL);
|
|
|
|
route_map_event_hook (NULL);
|
|
|
|
route_map_finish();
|
2016-05-27 01:31:38 +02:00
|
|
|
}
|