2023-02-08 13:17:09 +01:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2002-12-13 21:15:29 +01:00
|
|
|
/*
|
|
|
|
* Interface function.
|
|
|
|
* Copyright (C) 1997, 1999 Kunihiro Ishiguro
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <zebra.h>
|
|
|
|
|
|
|
|
#include "if.h"
|
2018-06-18 14:49:36 +02:00
|
|
|
#include "lib_errors.h"
|
2002-12-13 21:15:29 +01:00
|
|
|
#include "vty.h"
|
|
|
|
#include "sockunion.h"
|
|
|
|
#include "prefix.h"
|
|
|
|
#include "command.h"
|
|
|
|
#include "memory.h"
|
|
|
|
#include "ioctl.h"
|
|
|
|
#include "connected.h"
|
|
|
|
#include "log.h"
|
|
|
|
#include "zclient.h"
|
2015-05-22 11:40:00 +02:00
|
|
|
#include "vrf.h"
|
2022-11-08 17:59:33 +01:00
|
|
|
#include "lib/northbound_cli.h"
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
#include "zebra/rtadv.h"
|
2016-04-14 15:20:47 +02:00
|
|
|
#include "zebra_ns.h"
|
2016-05-04 03:04:00 +02:00
|
|
|
#include "zebra_vrf.h"
|
2016-04-14 15:20:47 +02:00
|
|
|
#include "zebra/interface.h"
|
2002-12-13 21:15:29 +01:00
|
|
|
#include "zebra/rib.h"
|
2016-08-04 15:07:32 +02:00
|
|
|
#include "zebra/rt.h"
|
2019-01-11 19:31:46 +01:00
|
|
|
#include "zebra/zebra_router.h"
|
2002-12-13 21:15:29 +01:00
|
|
|
#include "zebra/redistribute.h"
|
|
|
|
#include "zebra/debug.h"
|
2004-06-12 16:33:05 +02:00
|
|
|
#include "zebra/irdp.h"
|
2015-05-20 02:40:44 +02:00
|
|
|
#include "zebra/zebra_ptm.h"
|
2015-06-11 18:19:59 +02:00
|
|
|
#include "zebra/rt_netlink.h"
|
2019-02-05 23:02:40 +01:00
|
|
|
#include "zebra/if_netlink.h"
|
2015-07-26 00:55:47 +02:00
|
|
|
#include "zebra/interface.h"
|
2017-05-15 07:38:26 +02:00
|
|
|
#include "zebra/zebra_vxlan.h"
|
2018-08-16 22:10:32 +02:00
|
|
|
#include "zebra/zebra_errors.h"
|
2020-03-28 01:14:45 +01:00
|
|
|
#include "zebra/zebra_evpn_mh.h"
|
2015-05-20 02:40:44 +02:00
|
|
|
|
2018-09-19 17:35:43 +02:00
|
|
|
DEFINE_MTYPE_STATIC(ZEBRA, ZINFO, "Zebra Interface Information");
|
|
|
|
|
2015-05-20 02:40:44 +02:00
|
|
|
#define ZEBRA_PTM_SUPPORT
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2017-08-06 08:08:39 +02:00
|
|
|
DEFINE_HOOK(zebra_if_extra_info, (struct vty * vty, struct interface *ifp),
|
|
|
|
(vty, ifp));
|
|
|
|
DEFINE_HOOK(zebra_if_config_wr, (struct vty * vty, struct interface *ifp),
|
|
|
|
(vty, ifp));
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2022-12-02 17:10:58 +01:00
|
|
|
DEFINE_MTYPE(ZEBRA, ZIF_DESC, "Intf desc");
|
2018-01-11 01:01:57 +01:00
|
|
|
|
2016-02-25 20:30:53 +01:00
|
|
|
static void if_down_del_nbr_connected(struct interface *ifp);
|
|
|
|
|
2022-03-01 22:18:12 +01:00
|
|
|
static void if_zebra_speed_update(struct event *thread)
|
2018-01-11 01:01:57 +01:00
|
|
|
{
|
2022-12-25 16:26:52 +01:00
|
|
|
struct interface *ifp = EVENT_ARG(thread);
|
2018-01-11 01:01:57 +01:00
|
|
|
struct zebra_if *zif = ifp->info;
|
|
|
|
uint32_t new_speed;
|
2019-07-13 21:28:50 +02:00
|
|
|
bool changed = false;
|
2019-08-06 11:15:05 +02:00
|
|
|
int error = 0;
|
2018-01-11 01:01:57 +01:00
|
|
|
|
2019-08-06 11:15:05 +02:00
|
|
|
new_speed = kernel_get_speed(ifp, &error);
|
|
|
|
|
|
|
|
/* error may indicate vrf not available or
|
|
|
|
* interfaces not available.
|
|
|
|
* note that loopback & virtual interfaces can return 0 as speed
|
|
|
|
*/
|
|
|
|
if (error < 0)
|
2022-02-23 01:04:25 +01:00
|
|
|
return;
|
2019-08-06 11:15:05 +02:00
|
|
|
|
2018-01-11 01:01:57 +01:00
|
|
|
if (new_speed != ifp->speed) {
|
2020-03-05 19:17:54 +01:00
|
|
|
zlog_info("%s: %s old speed: %u new speed: %u", __func__,
|
|
|
|
ifp->name, ifp->speed, new_speed);
|
2018-01-11 01:01:57 +01:00
|
|
|
ifp->speed = new_speed;
|
|
|
|
if_add_update(ifp);
|
2019-07-13 21:28:50 +02:00
|
|
|
changed = true;
|
2018-01-11 01:01:57 +01:00
|
|
|
}
|
|
|
|
|
2022-01-19 20:56:25 +01:00
|
|
|
if (changed || new_speed == UINT32_MAX) {
|
2022-02-23 16:32:23 +01:00
|
|
|
#define SPEED_UPDATE_SLEEP_TIME 5
|
|
|
|
#define SPEED_UPDATE_COUNT_MAX (4 * 60 / SPEED_UPDATE_SLEEP_TIME)
|
|
|
|
/*
|
|
|
|
* Some interfaces never actually have an associated speed
|
|
|
|
* with them ( I am looking at you bridges ).
|
|
|
|
* So instead of iterating forever, let's give the
|
|
|
|
* system 4 minutes to try to figure out the speed
|
|
|
|
* if after that it it's probably never going to become
|
|
|
|
* useful.
|
|
|
|
* Since I don't know all the wonderful types of interfaces
|
|
|
|
* that may come into existence in the future I am going
|
|
|
|
* to not update the system to keep track of that. This
|
|
|
|
* is far simpler to just stop trying after 4 minutes
|
|
|
|
*/
|
|
|
|
if (new_speed == UINT32_MAX &&
|
|
|
|
zif->speed_update_count == SPEED_UPDATE_COUNT_MAX)
|
|
|
|
return;
|
|
|
|
|
|
|
|
zif->speed_update_count++;
|
2022-05-20 20:19:08 +02:00
|
|
|
event_add_timer(zrouter.master, if_zebra_speed_update, ifp,
|
|
|
|
SPEED_UPDATE_SLEEP_TIME, &zif->speed_update);
|
2022-12-11 16:51:58 +01:00
|
|
|
event_ignore_late_timer(zif->speed_update);
|
2022-01-19 20:56:25 +01:00
|
|
|
}
|
2018-01-11 01:01:57 +01:00
|
|
|
}
|
|
|
|
|
2016-11-01 21:57:53 +01:00
|
|
|
static void zebra_if_node_destroy(route_table_delegate_t *delegate,
|
|
|
|
struct route_table *table,
|
|
|
|
struct route_node *node)
|
|
|
|
{
|
|
|
|
if (node->info)
|
2018-10-02 11:39:51 +02:00
|
|
|
list_delete((struct list **)&node->info);
|
2016-11-01 21:57:53 +01:00
|
|
|
route_node_destroy(delegate, table, node);
|
|
|
|
}
|
|
|
|
|
2019-05-14 18:53:19 +02:00
|
|
|
static void zebra_if_nhg_dependents_free(struct zebra_if *zebra_if)
|
|
|
|
{
|
2019-07-24 18:27:40 +02:00
|
|
|
nhg_connected_tree_free(&zebra_if->nhg_dependents);
|
2019-05-14 18:53:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void zebra_if_nhg_dependents_init(struct zebra_if *zebra_if)
|
|
|
|
{
|
2019-07-24 18:27:40 +02:00
|
|
|
nhg_connected_tree_init(&zebra_if->nhg_dependents);
|
2019-05-14 18:53:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-11-01 21:57:53 +01:00
|
|
|
route_table_delegate_t zebra_if_table_delegate = {
|
|
|
|
.create_node = route_node_create,
|
|
|
|
.destroy_node = zebra_if_node_destroy};
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* Called when new interface is added. */
|
|
|
|
static int if_zebra_new_hook(struct interface *ifp)
|
|
|
|
{
|
|
|
|
struct zebra_if *zebra_if;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2018-09-19 17:35:43 +02:00
|
|
|
zebra_if = XCALLOC(MTYPE_ZINFO, sizeof(struct zebra_if));
|
2020-03-28 01:14:45 +01:00
|
|
|
zebra_if->ifp = ifp;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2022-06-29 15:05:17 +02:00
|
|
|
zebra_if->multicast = IF_ZEBRA_DATA_UNSPEC;
|
2023-04-26 21:55:32 +02:00
|
|
|
zebra_if->mpls_config = IF_ZEBRA_DATA_UNSPEC;
|
2022-06-29 15:05:17 +02:00
|
|
|
zebra_if->shutdown = IF_ZEBRA_DATA_OFF;
|
2019-03-11 21:29:57 +01:00
|
|
|
|
2023-02-21 07:00:36 +01:00
|
|
|
zebra_if->link_nsid = NS_UNKNOWN;
|
|
|
|
|
2019-05-14 18:53:19 +02:00
|
|
|
zebra_if_nhg_dependents_init(zebra_if);
|
2019-03-11 21:29:57 +01:00
|
|
|
|
2016-04-22 00:39:38 +02:00
|
|
|
zebra_ptm_if_init(zebra_if);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2015-07-22 22:07:08 +02:00
|
|
|
ifp->ptm_enable = zebra_ptm_get_enable_state();
|
2021-04-18 12:11:14 +02:00
|
|
|
|
|
|
|
rtadv_if_init(zebra_if);
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2018-09-19 17:02:42 +02:00
|
|
|
memset(&zebra_if->neigh_mac[0], 0, 6);
|
|
|
|
|
2004-10-03 20:46:08 +02:00
|
|
|
/* Initialize installed address chains tree. */
|
2016-11-01 21:57:53 +01:00
|
|
|
zebra_if->ipv4_subnets =
|
|
|
|
route_table_init_with_delegate(&zebra_if_table_delegate);
|
2004-10-03 20:46:08 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
ifp->info = zebra_if;
|
2018-01-11 01:01:57 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Some platforms are telling us that the interface is
|
|
|
|
* up and ready to go. When we check the speed we
|
|
|
|
* sometimes get the wrong value. Wait a couple
|
|
|
|
* of seconds and ask again. Hopefully it's all settled
|
|
|
|
* down upon startup.
|
|
|
|
*/
|
2022-02-23 16:32:23 +01:00
|
|
|
zebra_if->speed_update_count = 0;
|
2022-05-20 20:19:08 +02:00
|
|
|
event_add_timer(zrouter.master, if_zebra_speed_update, ifp, 15,
|
|
|
|
&zebra_if->speed_update);
|
2022-12-11 16:51:58 +01:00
|
|
|
event_ignore_late_timer(zebra_if->speed_update);
|
2022-01-19 20:56:25 +01:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2019-10-23 22:49:07 +02:00
|
|
|
static void if_nhg_dependents_check_valid(struct nhg_hash_entry *nhe)
|
2019-05-15 00:03:29 +02:00
|
|
|
{
|
2019-10-23 22:49:07 +02:00
|
|
|
zebra_nhg_check_valid(nhe);
|
|
|
|
}
|
2019-05-15 00:03:29 +02:00
|
|
|
|
2019-10-23 22:49:07 +02:00
|
|
|
static void if_down_nhg_dependents(const struct interface *ifp)
|
|
|
|
{
|
|
|
|
struct nhg_connected *rb_node_dep = NULL;
|
|
|
|
struct zebra_if *zif = (struct zebra_if *)ifp->info;
|
|
|
|
|
|
|
|
frr_each(nhg_connected_tree, &zif->nhg_dependents, rb_node_dep)
|
|
|
|
if_nhg_dependents_check_valid(rb_node_dep->nhe);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void if_nhg_dependents_release(const struct interface *ifp)
|
|
|
|
{
|
|
|
|
struct nhg_connected *rb_node_dep = NULL;
|
|
|
|
struct zebra_if *zif = (struct zebra_if *)ifp->info;
|
|
|
|
|
|
|
|
frr_each(nhg_connected_tree, &zif->nhg_dependents, rb_node_dep) {
|
|
|
|
rb_node_dep->nhe->ifp = NULL; /* Null it out */
|
|
|
|
if_nhg_dependents_check_valid(rb_node_dep->nhe);
|
2019-05-15 00:03:29 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* Called when interface is deleted. */
|
|
|
|
static int if_zebra_delete_hook(struct interface *ifp)
|
|
|
|
{
|
2004-10-03 20:46:08 +02:00
|
|
|
struct zebra_if *zebra_if;
|
|
|
|
|
|
|
|
if (ifp->info) {
|
|
|
|
zebra_if = ifp->info;
|
2016-06-27 13:34:32 +02:00
|
|
|
|
2022-01-31 22:12:01 +01:00
|
|
|
/* If we set protodown, clear our reason now from the kernel */
|
|
|
|
if (ZEBRA_IF_IS_PROTODOWN(zebra_if) && zebra_if->protodown_rc &&
|
2022-01-25 19:49:05 +01:00
|
|
|
!ZEBRA_IF_IS_PROTODOWN_ONLY_EXTERNAL(zebra_if))
|
2022-02-15 18:33:06 +01:00
|
|
|
zebra_if_update_protodown_rc(ifp, true,
|
|
|
|
(zebra_if->protodown_rc &
|
|
|
|
~ZEBRA_PROTODOWN_ALL));
|
2022-01-25 19:49:05 +01:00
|
|
|
|
2016-06-27 13:34:32 +02:00
|
|
|
/* Free installed address chains tree. */
|
2004-10-03 20:46:08 +02:00
|
|
|
if (zebra_if->ipv4_subnets)
|
2016-06-27 13:34:32 +02:00
|
|
|
route_table_finish(zebra_if->ipv4_subnets);
|
|
|
|
|
2021-04-18 12:11:14 +02:00
|
|
|
rtadv_if_fini(zebra_if);
|
2004-10-03 20:46:08 +02:00
|
|
|
|
2021-07-27 11:24:40 +02:00
|
|
|
zebra_l2_bridge_if_cleanup(ifp);
|
2020-03-28 01:14:45 +01:00
|
|
|
zebra_evpn_if_cleanup(zebra_if);
|
2020-09-08 15:56:33 +02:00
|
|
|
zebra_evpn_mac_ifp_del(ifp);
|
2020-03-28 01:14:45 +01:00
|
|
|
|
2019-05-15 00:03:29 +02:00
|
|
|
if_nhg_dependents_release(ifp);
|
2019-05-14 18:53:19 +02:00
|
|
|
zebra_if_nhg_dependents_free(zebra_if);
|
2019-03-11 21:29:57 +01:00
|
|
|
|
2022-12-02 17:10:58 +01:00
|
|
|
XFREE(MTYPE_ZIF_DESC, zebra_if->desc);
|
2019-05-14 18:53:19 +02:00
|
|
|
|
2022-12-25 16:26:52 +01:00
|
|
|
EVENT_OFF(zebra_if->speed_update);
|
2018-01-11 01:01:57 +01:00
|
|
|
|
2018-09-19 17:35:43 +02:00
|
|
|
XFREE(MTYPE_ZINFO, zebra_if);
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
|
|
|
|
2004-10-03 20:46:08 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-02-01 19:55:42 +01:00
|
|
|
/* Build the table key */
|
2018-03-27 21:13:34 +02:00
|
|
|
static void if_build_key(uint32_t ifindex, struct prefix *p)
|
2016-02-01 19:55:42 +01:00
|
|
|
{
|
|
|
|
p->family = AF_INET;
|
|
|
|
p->prefixlen = IPV4_MAX_BITLEN;
|
|
|
|
p->u.prefix4.s_addr = ifindex;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Link an interface in a per NS interface tree */
|
|
|
|
struct interface *if_link_per_ns(struct zebra_ns *ns, struct interface *ifp)
|
|
|
|
{
|
|
|
|
struct prefix p;
|
|
|
|
struct route_node *rn;
|
|
|
|
|
|
|
|
if (ifp->ifindex == IFINDEX_INTERNAL)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
if_build_key(ifp->ifindex, &p);
|
|
|
|
rn = route_node_get(ns->if_table, &p);
|
|
|
|
if (rn->info) {
|
|
|
|
ifp = (struct interface *)rn->info;
|
|
|
|
route_unlock_node(rn); /* get */
|
|
|
|
return ifp;
|
|
|
|
}
|
|
|
|
|
|
|
|
rn->info = ifp;
|
|
|
|
ifp->node = rn;
|
|
|
|
|
|
|
|
return ifp;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Delete a VRF. This is called in vrf_terminate(). */
|
|
|
|
void if_unlink_per_ns(struct interface *ifp)
|
|
|
|
{
|
2023-05-28 16:13:16 +02:00
|
|
|
if (!ifp->node)
|
|
|
|
return;
|
|
|
|
|
2016-02-01 19:55:42 +01:00
|
|
|
ifp->node->info = NULL;
|
|
|
|
route_unlock_node(ifp->node);
|
2017-04-26 16:17:38 +02:00
|
|
|
ifp->node = NULL;
|
2016-02-01 19:55:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Look up an interface by identifier within a NS */
|
|
|
|
struct interface *if_lookup_by_index_per_ns(struct zebra_ns *ns,
|
2018-03-27 21:13:34 +02:00
|
|
|
uint32_t ifindex)
|
2016-02-01 19:55:42 +01:00
|
|
|
{
|
|
|
|
struct prefix p;
|
|
|
|
struct route_node *rn;
|
|
|
|
struct interface *ifp = NULL;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2016-02-01 19:55:42 +01:00
|
|
|
if_build_key(ifindex, &p);
|
|
|
|
rn = route_node_lookup(ns->if_table, &p);
|
|
|
|
if (rn) {
|
|
|
|
ifp = (struct interface *)rn->info;
|
|
|
|
route_unlock_node(rn); /* lookup */
|
|
|
|
}
|
|
|
|
return ifp;
|
|
|
|
}
|
|
|
|
|
2017-04-30 15:26:06 +02:00
|
|
|
/* Look up an interface by name within a NS */
|
|
|
|
struct interface *if_lookup_by_name_per_ns(struct zebra_ns *ns,
|
|
|
|
const char *ifname)
|
|
|
|
{
|
|
|
|
struct route_node *rn;
|
|
|
|
struct interface *ifp;
|
|
|
|
|
|
|
|
for (rn = route_top(ns->if_table); rn; rn = route_next(rn)) {
|
|
|
|
ifp = (struct interface *)rn->info;
|
2019-09-25 08:51:06 +02:00
|
|
|
if (ifp && strcmp(ifp->name, ifname) == 0) {
|
|
|
|
route_unlock_node(rn);
|
2017-04-30 15:26:06 +02:00
|
|
|
return (ifp);
|
2019-09-25 08:51:06 +02:00
|
|
|
}
|
2017-04-30 15:26:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2023-02-21 07:00:36 +01:00
|
|
|
struct interface *if_lookup_by_index_per_nsid(ns_id_t ns_id, uint32_t ifindex)
|
|
|
|
{
|
|
|
|
struct zebra_ns *zns;
|
|
|
|
|
|
|
|
zns = zebra_ns_lookup(ns_id);
|
|
|
|
return zns ? if_lookup_by_index_per_ns(zns, ifindex) : NULL;
|
|
|
|
}
|
|
|
|
|
2016-02-23 05:17:09 +01:00
|
|
|
const char *ifindex2ifname_per_ns(struct zebra_ns *zns, unsigned int ifindex)
|
|
|
|
{
|
|
|
|
struct interface *ifp;
|
|
|
|
|
|
|
|
return ((ifp = if_lookup_by_index_per_ns(zns, ifindex)) != NULL)
|
|
|
|
? ifp->name
|
|
|
|
: "unknown";
|
|
|
|
}
|
2016-02-01 19:55:42 +01:00
|
|
|
|
2004-10-03 20:46:08 +02:00
|
|
|
/* Tie an interface address to its derived subnet list of addresses. */
|
|
|
|
int if_subnet_add(struct interface *ifp, struct connected *ifc)
|
|
|
|
{
|
|
|
|
struct route_node *rn;
|
|
|
|
struct zebra_if *zebra_if;
|
|
|
|
struct prefix cp;
|
|
|
|
struct list *addr_list;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2004-10-03 20:46:08 +02:00
|
|
|
assert(ifp && ifp->info && ifc);
|
|
|
|
zebra_if = ifp->info;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2004-10-03 20:46:08 +02:00
|
|
|
/* Get address derived subnet node and associated address list, while
|
|
|
|
marking
|
|
|
|
address secondary attribute appropriately. */
|
2010-01-30 12:10:23 +01:00
|
|
|
cp = *CONNECTED_PREFIX(ifc);
|
2004-10-03 20:46:08 +02:00
|
|
|
apply_mask(&cp);
|
|
|
|
rn = route_node_get(zebra_if->ipv4_subnets, &cp);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2004-10-03 20:46:08 +02:00
|
|
|
if ((addr_list = rn->info))
|
|
|
|
SET_FLAG(ifc->flags, ZEBRA_IFA_SECONDARY);
|
|
|
|
else {
|
|
|
|
UNSET_FLAG(ifc->flags, ZEBRA_IFA_SECONDARY);
|
|
|
|
rn->info = addr_list = list_new();
|
|
|
|
route_lock_node(rn);
|
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2004-10-03 20:46:08 +02:00
|
|
|
/* Tie address at the tail of address list. */
|
|
|
|
listnode_add(addr_list, ifc);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2004-10-03 20:46:08 +02:00
|
|
|
/* Return list element count. */
|
|
|
|
return (addr_list->count);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Untie an interface address from its derived subnet list of addresses. */
|
|
|
|
int if_subnet_delete(struct interface *ifp, struct connected *ifc)
|
|
|
|
{
|
|
|
|
struct route_node *rn;
|
|
|
|
struct zebra_if *zebra_if;
|
|
|
|
struct list *addr_list;
|
2010-01-30 12:10:23 +01:00
|
|
|
struct prefix cp;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2004-10-03 20:46:08 +02:00
|
|
|
assert(ifp && ifp->info && ifc);
|
|
|
|
zebra_if = ifp->info;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2010-01-30 12:10:23 +01:00
|
|
|
cp = *CONNECTED_PREFIX(ifc);
|
|
|
|
apply_mask(&cp);
|
|
|
|
|
2004-10-03 20:46:08 +02:00
|
|
|
/* Get address derived subnet node. */
|
2010-01-30 12:10:23 +01:00
|
|
|
rn = route_node_lookup(zebra_if->ipv4_subnets, &cp);
|
2004-10-03 20:46:08 +02:00
|
|
|
if (!(rn && rn->info)) {
|
2018-09-13 21:21:05 +02:00
|
|
|
flog_warn(EC_ZEBRA_REMOVE_ADDR_UNKNOWN_SUBNET,
|
2020-03-27 12:35:23 +01:00
|
|
|
"Trying to remove an address from an unknown subnet. (please report this bug)");
|
2013-01-24 15:04:44 +01:00
|
|
|
return -1;
|
|
|
|
}
|
2004-10-03 20:46:08 +02:00
|
|
|
route_unlock_node(rn);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2004-10-03 20:46:08 +02:00
|
|
|
/* Untie address from subnet's address list. */
|
|
|
|
addr_list = rn->info;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2013-01-24 15:04:44 +01:00
|
|
|
/* Deleting an address that is not registered is a bug.
|
|
|
|
* In any case, we shouldn't decrement the lock counter if the address
|
|
|
|
* is unknown. */
|
|
|
|
if (!listnode_lookup(addr_list, ifc)) {
|
2018-08-16 22:10:32 +02:00
|
|
|
flog_warn(
|
2018-09-13 21:21:05 +02:00
|
|
|
EC_ZEBRA_REMOVE_UNREGISTERED_ADDR,
|
2020-03-27 12:35:23 +01:00
|
|
|
"Trying to remove an address from a subnet where it is not currently registered. (please report this bug)");
|
2013-01-24 15:04:44 +01:00
|
|
|
return -1;
|
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2004-10-03 20:46:08 +02:00
|
|
|
listnode_delete(addr_list, ifc);
|
|
|
|
route_unlock_node(rn);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2004-10-03 20:46:08 +02:00
|
|
|
/* Return list element count, if not empty. */
|
|
|
|
if (addr_list->count) {
|
|
|
|
/* If deleted address is primary, mark subsequent one as such
|
|
|
|
* and distribute. */
|
|
|
|
if (!CHECK_FLAG(ifc->flags, ZEBRA_IFA_SECONDARY)) {
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
ifc = listgetdata(
|
|
|
|
(struct listnode *)listhead(addr_list));
|
2004-10-03 20:46:08 +02:00
|
|
|
zebra_interface_address_delete_update(ifp, ifc);
|
|
|
|
UNSET_FLAG(ifc->flags, ZEBRA_IFA_SECONDARY);
|
2013-01-24 15:04:49 +01:00
|
|
|
/* XXX: Linux kernel removes all the secondary addresses
|
|
|
|
* when the primary
|
|
|
|
* address is removed. We could try to work around that,
|
|
|
|
* though this is
|
|
|
|
* non-trivial. */
|
2004-10-03 20:46:08 +02:00
|
|
|
zebra_interface_address_add_update(ifp, ifc);
|
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2004-10-03 20:46:08 +02:00
|
|
|
return addr_list->count;
|
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2004-10-03 20:46:08 +02:00
|
|
|
/* Otherwise, free list and route node. */
|
2018-10-02 11:39:51 +02:00
|
|
|
list_delete(&addr_list);
|
2004-10-03 20:46:08 +02:00
|
|
|
rn->info = NULL;
|
|
|
|
route_unlock_node(rn);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
[zebra/solaris] Interface state fixups for Solaris.
2006-01-25 Paul Jakma <paul.jakma@sun.com>
* (general) More solaris PF_ROUTE hacks. The IFF_UP mangling
for solaris was incomplete on the PF_ROUTE side. fix it.
This changeset generally uglifies things. For some future
work I'd like to see the state changes seperated out from
the details of the code. Differences between systems might
then be slightly easier to implement without convoluted
hacks.
Changes should be specific to Solaris mostly, however
also tested on FreeBSD 6.
* if_ioctl_solaris.c: (interface_list_ioctl) ignore ~IFF_UP
interfaces, we'll hear about them when/if interface goes up
through NEWADDR.
Update flags explicitely at end of it to kick mangling.
* ioctl_solaris.c: (if_mangle_up) removed to interface.c, in
kind.
(lifreq_set_name) more convenient to take the string, than
the ifp.
(if_get_flags_direct) new convenience function, returns
the actual flags. Used during bootstrap in if_ioctl_solaris.c
to peek at flags of logical interfaces to see whether or
not to ignore them.
(if_get_flags) ENXIO means it's gone, poke out IFF_UP and
kick flags update.
(if_{un,}set_flags) flags argument should be 64bit.
* ioctl.{c,h}: flags argument should be 64bit.
* interface.h: Add a 'primary_state' flag to struct zebra_if on
SUNOS_5.
Export if_flags_update.
* interface.c: (if_flags_mangle) moved over in kind from
ioctl_solaris.c. Nasty kludge to try get IFF_UP right, as
much as is possible. Also keep track of the actual IFF_UP
value for the primary interface, so we can know when the ifp
must be deleted.
(if_flags_update) Take a new interface flags value, apply it
to the interface, and take whatever actions are required due
to flag transitions.
(if_refresh) flag state change logic is moved out to
previous. Just call if_get_flags, which will end up using
previous to effect the update of flags.
(if_flag_dump_vty) IFF_IPV{4,6} aren't interesting, VIRTUAL
and NOXMIT are though.
* kernel_socket.c: (ifm_read) Down->Down transitions shouldn't
create ifp, for non-IFANNOUNCE systems.
Use if_flags_update to update flags.
flag transition logic is now handled automatically through
if_flags_update.
(ifam_read) Better to call if_refresh *after* adding
connected addresses, as connected count affects IFF_UP on
IFF_UP-mangled systems.
On Solaris, Up->Down due to DELADDR means we need to delete
the ifp - the IFINFO might already have been and gone.
* rt.h: include other dependent headers.
2006-01-25 05:31:40 +01:00
|
|
|
/* if_flags_mangle: A place for hacks that require mangling
|
|
|
|
* or tweaking the interface flags.
|
|
|
|
*
|
|
|
|
* ******************** Solaris flags hacks **************************
|
|
|
|
*
|
|
|
|
* Solaris IFF_UP flag reflects only the primary interface as the
|
|
|
|
* routing socket only sends IFINFO for the primary interface. Hence
|
|
|
|
* ~IFF_UP does not per se imply all the logical interfaces are also
|
|
|
|
* down - which we only know of as addresses. Instead we must determine
|
|
|
|
* whether the interface really is up or not according to how many
|
|
|
|
* addresses are still attached. (Solaris always sends RTM_DELADDR if
|
|
|
|
* an interface, logical or not, goes ~IFF_UP).
|
|
|
|
*
|
|
|
|
* Ie, we mangle IFF_UP to *additionally* reflect whether or not there
|
|
|
|
* are addresses left in struct connected, not just the actual underlying
|
|
|
|
* IFF_UP flag.
|
|
|
|
*
|
|
|
|
* We must hence remember the real state of IFF_UP, which we do in
|
|
|
|
* struct zebra_if.primary_state.
|
|
|
|
*
|
|
|
|
* Setting IFF_UP within zebra to administratively shutdown the
|
|
|
|
* interface will affect only the primary interface/address on Solaris.
|
|
|
|
************************End Solaris flags hacks ***********************
|
|
|
|
*/
|
|
|
|
static void if_flags_mangle(struct interface *ifp, uint64_t *newflags)
|
|
|
|
{
|
2020-09-09 05:59:18 +02:00
|
|
|
return;
|
[zebra/solaris] Interface state fixups for Solaris.
2006-01-25 Paul Jakma <paul.jakma@sun.com>
* (general) More solaris PF_ROUTE hacks. The IFF_UP mangling
for solaris was incomplete on the PF_ROUTE side. fix it.
This changeset generally uglifies things. For some future
work I'd like to see the state changes seperated out from
the details of the code. Differences between systems might
then be slightly easier to implement without convoluted
hacks.
Changes should be specific to Solaris mostly, however
also tested on FreeBSD 6.
* if_ioctl_solaris.c: (interface_list_ioctl) ignore ~IFF_UP
interfaces, we'll hear about them when/if interface goes up
through NEWADDR.
Update flags explicitely at end of it to kick mangling.
* ioctl_solaris.c: (if_mangle_up) removed to interface.c, in
kind.
(lifreq_set_name) more convenient to take the string, than
the ifp.
(if_get_flags_direct) new convenience function, returns
the actual flags. Used during bootstrap in if_ioctl_solaris.c
to peek at flags of logical interfaces to see whether or
not to ignore them.
(if_get_flags) ENXIO means it's gone, poke out IFF_UP and
kick flags update.
(if_{un,}set_flags) flags argument should be 64bit.
* ioctl.{c,h}: flags argument should be 64bit.
* interface.h: Add a 'primary_state' flag to struct zebra_if on
SUNOS_5.
Export if_flags_update.
* interface.c: (if_flags_mangle) moved over in kind from
ioctl_solaris.c. Nasty kludge to try get IFF_UP right, as
much as is possible. Also keep track of the actual IFF_UP
value for the primary interface, so we can know when the ifp
must be deleted.
(if_flags_update) Take a new interface flags value, apply it
to the interface, and take whatever actions are required due
to flag transitions.
(if_refresh) flag state change logic is moved out to
previous. Just call if_get_flags, which will end up using
previous to effect the update of flags.
(if_flag_dump_vty) IFF_IPV{4,6} aren't interesting, VIRTUAL
and NOXMIT are though.
* kernel_socket.c: (ifm_read) Down->Down transitions shouldn't
create ifp, for non-IFANNOUNCE systems.
Use if_flags_update to update flags.
flag transition logic is now handled automatically through
if_flags_update.
(ifam_read) Better to call if_refresh *after* adding
connected addresses, as connected count affects IFF_UP on
IFF_UP-mangled systems.
On Solaris, Up->Down due to DELADDR means we need to delete
the ifp - the IFINFO might already have been and gone.
* rt.h: include other dependent headers.
2006-01-25 05:31:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Update the flags field of the ifp with the new flag set provided.
|
|
|
|
* Take whatever actions are required for any changes in flags we care
|
|
|
|
* about.
|
|
|
|
*
|
|
|
|
* newflags should be the raw value, as obtained from the OS.
|
|
|
|
*/
|
|
|
|
void if_flags_update(struct interface *ifp, uint64_t newflags)
|
|
|
|
{
|
|
|
|
if_flags_mangle(ifp, &newflags);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2015-05-20 02:40:44 +02:00
|
|
|
if (if_is_no_ptm_operative(ifp)) {
|
[zebra/solaris] Interface state fixups for Solaris.
2006-01-25 Paul Jakma <paul.jakma@sun.com>
* (general) More solaris PF_ROUTE hacks. The IFF_UP mangling
for solaris was incomplete on the PF_ROUTE side. fix it.
This changeset generally uglifies things. For some future
work I'd like to see the state changes seperated out from
the details of the code. Differences between systems might
then be slightly easier to implement without convoluted
hacks.
Changes should be specific to Solaris mostly, however
also tested on FreeBSD 6.
* if_ioctl_solaris.c: (interface_list_ioctl) ignore ~IFF_UP
interfaces, we'll hear about them when/if interface goes up
through NEWADDR.
Update flags explicitely at end of it to kick mangling.
* ioctl_solaris.c: (if_mangle_up) removed to interface.c, in
kind.
(lifreq_set_name) more convenient to take the string, than
the ifp.
(if_get_flags_direct) new convenience function, returns
the actual flags. Used during bootstrap in if_ioctl_solaris.c
to peek at flags of logical interfaces to see whether or
not to ignore them.
(if_get_flags) ENXIO means it's gone, poke out IFF_UP and
kick flags update.
(if_{un,}set_flags) flags argument should be 64bit.
* ioctl.{c,h}: flags argument should be 64bit.
* interface.h: Add a 'primary_state' flag to struct zebra_if on
SUNOS_5.
Export if_flags_update.
* interface.c: (if_flags_mangle) moved over in kind from
ioctl_solaris.c. Nasty kludge to try get IFF_UP right, as
much as is possible. Also keep track of the actual IFF_UP
value for the primary interface, so we can know when the ifp
must be deleted.
(if_flags_update) Take a new interface flags value, apply it
to the interface, and take whatever actions are required due
to flag transitions.
(if_refresh) flag state change logic is moved out to
previous. Just call if_get_flags, which will end up using
previous to effect the update of flags.
(if_flag_dump_vty) IFF_IPV{4,6} aren't interesting, VIRTUAL
and NOXMIT are though.
* kernel_socket.c: (ifm_read) Down->Down transitions shouldn't
create ifp, for non-IFANNOUNCE systems.
Use if_flags_update to update flags.
flag transition logic is now handled automatically through
if_flags_update.
(ifam_read) Better to call if_refresh *after* adding
connected addresses, as connected count affects IFF_UP on
IFF_UP-mangled systems.
On Solaris, Up->Down due to DELADDR means we need to delete
the ifp - the IFINFO might already have been and gone.
* rt.h: include other dependent headers.
2006-01-25 05:31:40 +01:00
|
|
|
/* operative -> inoperative? */
|
|
|
|
ifp->flags = newflags;
|
|
|
|
if (!if_is_operative(ifp))
|
|
|
|
if_down(ifp);
|
|
|
|
} else {
|
|
|
|
/* inoperative -> operative? */
|
|
|
|
ifp->flags = newflags;
|
|
|
|
if (if_is_operative(ifp))
|
2020-10-02 20:49:09 +02:00
|
|
|
if_up(ifp, true);
|
[zebra/solaris] Interface state fixups for Solaris.
2006-01-25 Paul Jakma <paul.jakma@sun.com>
* (general) More solaris PF_ROUTE hacks. The IFF_UP mangling
for solaris was incomplete on the PF_ROUTE side. fix it.
This changeset generally uglifies things. For some future
work I'd like to see the state changes seperated out from
the details of the code. Differences between systems might
then be slightly easier to implement without convoluted
hacks.
Changes should be specific to Solaris mostly, however
also tested on FreeBSD 6.
* if_ioctl_solaris.c: (interface_list_ioctl) ignore ~IFF_UP
interfaces, we'll hear about them when/if interface goes up
through NEWADDR.
Update flags explicitely at end of it to kick mangling.
* ioctl_solaris.c: (if_mangle_up) removed to interface.c, in
kind.
(lifreq_set_name) more convenient to take the string, than
the ifp.
(if_get_flags_direct) new convenience function, returns
the actual flags. Used during bootstrap in if_ioctl_solaris.c
to peek at flags of logical interfaces to see whether or
not to ignore them.
(if_get_flags) ENXIO means it's gone, poke out IFF_UP and
kick flags update.
(if_{un,}set_flags) flags argument should be 64bit.
* ioctl.{c,h}: flags argument should be 64bit.
* interface.h: Add a 'primary_state' flag to struct zebra_if on
SUNOS_5.
Export if_flags_update.
* interface.c: (if_flags_mangle) moved over in kind from
ioctl_solaris.c. Nasty kludge to try get IFF_UP right, as
much as is possible. Also keep track of the actual IFF_UP
value for the primary interface, so we can know when the ifp
must be deleted.
(if_flags_update) Take a new interface flags value, apply it
to the interface, and take whatever actions are required due
to flag transitions.
(if_refresh) flag state change logic is moved out to
previous. Just call if_get_flags, which will end up using
previous to effect the update of flags.
(if_flag_dump_vty) IFF_IPV{4,6} aren't interesting, VIRTUAL
and NOXMIT are though.
* kernel_socket.c: (ifm_read) Down->Down transitions shouldn't
create ifp, for non-IFANNOUNCE systems.
Use if_flags_update to update flags.
flag transition logic is now handled automatically through
if_flags_update.
(ifam_read) Better to call if_refresh *after* adding
connected addresses, as connected count affects IFF_UP on
IFF_UP-mangled systems.
On Solaris, Up->Down due to DELADDR means we need to delete
the ifp - the IFINFO might already have been and gone.
* rt.h: include other dependent headers.
2006-01-25 05:31:40 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* Wake up configured address if it is not in current kernel
|
|
|
|
address. */
|
2020-02-25 03:40:29 +01:00
|
|
|
void if_addr_wakeup(struct interface *ifp)
|
2002-12-13 21:15:29 +01:00
|
|
|
{
|
2013-01-24 15:04:49 +01:00
|
|
|
struct listnode *node, *nnode;
|
|
|
|
struct connected *ifc;
|
2002-12-13 21:15:29 +01:00
|
|
|
struct prefix *p;
|
2019-01-16 19:40:31 +01:00
|
|
|
enum zebra_dplane_result dplane_res;
|
2004-10-03 20:46:08 +02:00
|
|
|
|
2013-01-24 15:04:49 +01:00
|
|
|
for (ALL_LIST_ELEMENTS(ifp->connected, node, nnode, ifc)) {
|
2002-12-13 21:15:29 +01:00
|
|
|
p = ifc->address;
|
|
|
|
|
|
|
|
if (CHECK_FLAG(ifc->conf, ZEBRA_IFC_CONFIGURED)
|
2013-01-24 15:04:48 +01:00
|
|
|
&& !CHECK_FLAG(ifc->conf, ZEBRA_IFC_QUEUED)) {
|
2002-12-13 21:15:29 +01:00
|
|
|
/* Address check. */
|
|
|
|
if (p->family == AF_INET) {
|
2002-12-13 22:03:13 +01:00
|
|
|
if (!if_is_up(ifp)) {
|
2013-01-24 15:04:49 +01:00
|
|
|
/* Assume zebra is configured like
|
|
|
|
* following:
|
2017-07-17 14:03:14 +02:00
|
|
|
*
|
2013-01-24 15:04:49 +01:00
|
|
|
* interface gre0
|
2002-12-13 21:15:29 +01:00
|
|
|
* ip addr 192.0.2.1/24
|
2017-07-17 14:03:14 +02:00
|
|
|
* !
|
|
|
|
*
|
2013-01-24 15:04:49 +01:00
|
|
|
* As soon as zebra becomes first aware
|
|
|
|
* that gre0 exists in the
|
|
|
|
* kernel, it will set gre0 up and
|
|
|
|
* configure its addresses.
|
2017-07-17 14:03:14 +02:00
|
|
|
*
|
2013-01-24 15:04:49 +01:00
|
|
|
* (This may happen at startup when the
|
|
|
|
* interface already exists
|
|
|
|
* or during runtime when the interface
|
|
|
|
* is added to the kernel)
|
2017-07-17 14:03:14 +02:00
|
|
|
*
|
2013-01-24 15:04:49 +01:00
|
|
|
* XXX: IRDP code is calling here via
|
2002-12-13 21:15:29 +01:00
|
|
|
* if_add_update - this seems
|
2013-01-24 15:04:49 +01:00
|
|
|
* somewhat weird.
|
|
|
|
* XXX: RUNNING is not a settable flag
|
|
|
|
* on any system
|
|
|
|
* I (paulj) am aware of.
|
2017-07-22 14:52:33 +02:00
|
|
|
*/
|
2002-12-13 21:15:29 +01:00
|
|
|
if_set_flags(ifp, IFF_UP | IFF_RUNNING);
|
|
|
|
if_refresh(ifp);
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
|
|
|
|
2019-01-16 19:40:31 +01:00
|
|
|
dplane_res = dplane_intf_addr_set(ifp, ifc);
|
|
|
|
if (dplane_res ==
|
|
|
|
ZEBRA_DPLANE_REQUEST_FAILURE) {
|
2018-08-16 22:10:32 +02:00
|
|
|
flog_err_sys(
|
2018-09-13 21:21:05 +02:00
|
|
|
EC_ZEBRA_IFACE_ADDR_ADD_FAILED,
|
2002-12-13 21:15:29 +01:00
|
|
|
"Can't set interface's address: %s",
|
2019-01-16 19:40:31 +01:00
|
|
|
dplane_res2str(dplane_res));
|
2002-12-13 21:15:29 +01:00
|
|
|
continue;
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
|
|
|
|
2013-01-24 15:04:48 +01:00
|
|
|
SET_FLAG(ifc->conf, ZEBRA_IFC_QUEUED);
|
2013-01-24 15:04:49 +01:00
|
|
|
/* The address will be advertised to zebra
|
|
|
|
* clients when the notification
|
|
|
|
* from the kernel has been received.
|
|
|
|
* It will also be added to the interface's
|
|
|
|
* subnet list then. */
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
2002-12-13 21:15:29 +01:00
|
|
|
if (p->family == AF_INET6) {
|
2002-12-13 22:03:13 +01:00
|
|
|
if (!if_is_up(ifp)) {
|
2013-01-24 15:04:49 +01:00
|
|
|
/* See long comment above */
|
2002-12-13 21:15:29 +01:00
|
|
|
if_set_flags(ifp, IFF_UP | IFF_RUNNING);
|
|
|
|
if_refresh(ifp);
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
|
|
|
|
2019-01-25 17:31:51 +01:00
|
|
|
|
|
|
|
dplane_res = dplane_intf_addr_set(ifp, ifc);
|
|
|
|
if (dplane_res ==
|
|
|
|
ZEBRA_DPLANE_REQUEST_FAILURE) {
|
2018-08-16 22:10:32 +02:00
|
|
|
flog_err_sys(
|
2018-09-13 21:21:05 +02:00
|
|
|
EC_ZEBRA_IFACE_ADDR_ADD_FAILED,
|
2017-07-13 17:49:13 +02:00
|
|
|
"Can't set interface's address: %s",
|
2019-01-25 17:31:51 +01:00
|
|
|
dplane_res2str(dplane_res));
|
2002-12-13 21:15:29 +01:00
|
|
|
continue;
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
|
|
|
|
2013-01-24 15:04:49 +01:00
|
|
|
SET_FLAG(ifc->conf, ZEBRA_IFC_QUEUED);
|
|
|
|
/* The address will be advertised to zebra
|
|
|
|
* clients when the notification
|
|
|
|
* from the kernel has been received. */
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Handle interface addition */
|
|
|
|
void if_add_update(struct interface *ifp)
|
|
|
|
{
|
2002-12-13 21:52:52 +01:00
|
|
|
struct zebra_if *if_data;
|
2017-12-08 19:06:34 +01:00
|
|
|
struct zebra_ns *zns;
|
2021-10-22 00:17:40 +02:00
|
|
|
struct zebra_vrf *zvrf = ifp->vrf->info;
|
2002-12-13 21:52:52 +01:00
|
|
|
|
2018-02-13 10:48:48 +01:00
|
|
|
/* case interface populate before vrf enabled */
|
|
|
|
if (zvrf->zns)
|
|
|
|
zns = zvrf->zns;
|
2017-12-08 19:06:34 +01:00
|
|
|
else
|
|
|
|
zns = zebra_ns_lookup(NS_DEFAULT);
|
|
|
|
if_link_per_ns(zns, ifp);
|
2002-12-13 21:52:52 +01:00
|
|
|
if_data = ifp->info;
|
2015-09-18 01:04:30 +02:00
|
|
|
assert(if_data);
|
|
|
|
|
2022-06-29 15:05:17 +02:00
|
|
|
if (if_data->multicast == IF_ZEBRA_DATA_ON)
|
2002-12-13 21:52:52 +01:00
|
|
|
if_set_flags(ifp, IFF_MULTICAST);
|
2022-06-29 15:05:17 +02:00
|
|
|
else if (if_data->multicast == IF_ZEBRA_DATA_OFF)
|
2002-12-13 21:52:52 +01:00
|
|
|
if_unset_flags(ifp, IFF_MULTICAST);
|
|
|
|
|
2016-04-22 00:39:38 +02:00
|
|
|
zebra_ptm_if_set_ptm_state(ifp, if_data);
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
zebra_interface_add_update(ifp);
|
|
|
|
|
|
|
|
if (!CHECK_FLAG(ifp->status, ZEBRA_INTERFACE_ACTIVE)) {
|
|
|
|
SET_FLAG(ifp->status, ZEBRA_INTERFACE_ACTIVE);
|
|
|
|
|
2022-06-29 15:05:17 +02:00
|
|
|
if (if_data->shutdown == IF_ZEBRA_DATA_ON) {
|
2020-02-14 14:41:04 +01:00
|
|
|
if (IS_ZEBRA_DEBUG_KERNEL) {
|
2015-05-22 11:39:57 +02:00
|
|
|
zlog_debug(
|
2020-03-27 12:35:23 +01:00
|
|
|
"interface %s vrf %s(%u) index %d is shutdown. Won't wake it up.",
|
2021-10-22 00:17:40 +02:00
|
|
|
ifp->name, ifp->vrf->name,
|
|
|
|
ifp->vrf->vrf_id, ifp->ifindex);
|
2020-02-14 14:41:04 +01:00
|
|
|
}
|
|
|
|
|
2013-01-24 15:04:50 +01:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
if_addr_wakeup(ifp);
|
|
|
|
|
|
|
|
if (IS_ZEBRA_DEBUG_KERNEL)
|
2015-05-22 11:39:57 +02:00
|
|
|
zlog_debug(
|
2020-02-14 14:41:04 +01:00
|
|
|
"interface %s vrf %s(%u) index %d becomes active.",
|
2021-10-22 00:17:40 +02:00
|
|
|
ifp->name, ifp->vrf->name, ifp->vrf->vrf_id,
|
2020-02-14 14:41:04 +01:00
|
|
|
ifp->ifindex);
|
2017-08-06 05:14:39 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
} else {
|
|
|
|
if (IS_ZEBRA_DEBUG_KERNEL)
|
2020-02-14 14:41:04 +01:00
|
|
|
zlog_debug("interface %s vrf %s(%u) index %d is added.",
|
2021-10-22 00:17:40 +02:00
|
|
|
ifp->name, ifp->vrf->name, ifp->vrf->vrf_id,
|
|
|
|
ifp->ifindex);
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-02-25 20:30:53 +01:00
|
|
|
/* Install connected routes corresponding to an interface. */
|
|
|
|
static void if_install_connected(struct interface *ifp)
|
2002-12-13 21:15:29 +01:00
|
|
|
{
|
2016-02-25 20:30:53 +01:00
|
|
|
struct listnode *node;
|
|
|
|
struct listnode *next;
|
2002-12-13 21:15:29 +01:00
|
|
|
struct connected *ifc;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2016-02-25 20:30:53 +01:00
|
|
|
if (ifp->connected) {
|
|
|
|
for (ALL_LIST_ELEMENTS(ifp->connected, node, next, ifc)) {
|
2016-11-07 13:37:25 +01:00
|
|
|
if (CHECK_FLAG(ifc->conf, ZEBRA_IFC_REAL))
|
|
|
|
zebra_interface_address_add_update(ifp, ifc);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-08-30 00:23:08 +02:00
|
|
|
connected_up(ifp, ifc);
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
2016-02-25 20:30:53 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Uninstall connected routes corresponding to an interface. */
|
|
|
|
static void if_uninstall_connected(struct interface *ifp)
|
|
|
|
{
|
|
|
|
struct listnode *node;
|
|
|
|
struct listnode *next;
|
|
|
|
struct connected *ifc;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2016-02-25 20:30:53 +01:00
|
|
|
if (ifp->connected) {
|
|
|
|
for (ALL_LIST_ELEMENTS(ifp->connected, node, next, ifc)) {
|
2016-03-24 16:40:50 +01:00
|
|
|
zebra_interface_address_delete_update(ifp, ifc);
|
2017-08-31 19:47:26 +02:00
|
|
|
connected_down(ifp, ifc);
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
2016-02-25 20:30:53 +01:00
|
|
|
}
|
|
|
|
}
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2016-02-25 20:30:53 +01:00
|
|
|
/* Uninstall and delete connected routes corresponding to an interface. */
|
|
|
|
/* TODO - Check why IPv4 handling here is different from install or if_down */
|
|
|
|
static void if_delete_connected(struct interface *ifp)
|
|
|
|
{
|
|
|
|
struct connected *ifc;
|
2010-03-27 18:31:42 +01:00
|
|
|
struct prefix cp;
|
2016-02-25 20:30:53 +01:00
|
|
|
struct route_node *rn;
|
|
|
|
struct zebra_if *zebra_if;
|
2017-12-13 16:32:54 +01:00
|
|
|
struct listnode *node;
|
|
|
|
struct listnode *last = NULL;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2016-02-25 20:30:53 +01:00
|
|
|
zebra_if = ifp->info;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-12-13 16:32:54 +01:00
|
|
|
if (!ifp->connected)
|
|
|
|
return;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-12-13 16:32:54 +01:00
|
|
|
while ((node = (last ? last->next : listhead(ifp->connected)))) {
|
|
|
|
ifc = listgetdata(node);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-12-13 16:32:54 +01:00
|
|
|
cp = *CONNECTED_PREFIX(ifc);
|
|
|
|
apply_mask(&cp);
|
2010-03-27 18:31:42 +01:00
|
|
|
|
2017-12-13 16:32:54 +01:00
|
|
|
if (cp.family == AF_INET
|
|
|
|
&& (rn = route_node_lookup(zebra_if->ipv4_subnets, &cp))) {
|
|
|
|
struct listnode *anode;
|
|
|
|
struct listnode *next;
|
|
|
|
struct listnode *first;
|
|
|
|
struct list *addr_list;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-12-13 16:32:54 +01:00
|
|
|
route_unlock_node(rn);
|
|
|
|
addr_list = (struct list *)rn->info;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-12-13 16:32:54 +01:00
|
|
|
/* Remove addresses, secondaries first. */
|
|
|
|
first = listhead(addr_list);
|
|
|
|
if (first)
|
2007-04-10 21:30:20 +02:00
|
|
|
for (anode = first->next; anode || first;
|
|
|
|
anode = next) {
|
|
|
|
if (!anode) {
|
|
|
|
anode = first;
|
2004-10-03 20:46:08 +02:00
|
|
|
first = NULL;
|
|
|
|
}
|
2007-04-10 21:30:20 +02:00
|
|
|
next = anode->next;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2007-04-10 21:30:20 +02:00
|
|
|
ifc = listgetdata(anode);
|
2017-08-31 19:47:26 +02:00
|
|
|
connected_down(ifp, ifc);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2013-01-24 15:04:49 +01:00
|
|
|
/* XXX: We have to send notifications
|
|
|
|
* here explicitly, because we destroy
|
|
|
|
* the ifc before receiving the
|
|
|
|
* notification about the address being
|
|
|
|
* deleted.
|
|
|
|
*/
|
2004-10-03 20:46:08 +02:00
|
|
|
zebra_interface_address_delete_update(
|
|
|
|
ifp, ifc);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2004-10-03 20:46:08 +02:00
|
|
|
UNSET_FLAG(ifc->conf, ZEBRA_IFC_REAL);
|
2013-01-24 15:04:48 +01:00
|
|
|
UNSET_FLAG(ifc->conf, ZEBRA_IFC_QUEUED);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2004-10-03 20:46:08 +02:00
|
|
|
/* Remove from subnet chain. */
|
2007-04-10 21:30:20 +02:00
|
|
|
list_delete_node(addr_list, anode);
|
2004-10-03 20:46:08 +02:00
|
|
|
route_unlock_node(rn);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2004-10-03 20:46:08 +02:00
|
|
|
/* Remove from interface address list
|
|
|
|
* (unconditionally). */
|
2007-04-10 21:30:20 +02:00
|
|
|
if (!CHECK_FLAG(ifc->conf,
|
|
|
|
ZEBRA_IFC_CONFIGURED)) {
|
|
|
|
listnode_delete(ifp->connected,
|
|
|
|
ifc);
|
2019-10-30 01:16:28 +01:00
|
|
|
connected_free(&ifc);
|
2007-04-10 21:30:20 +02:00
|
|
|
} else
|
|
|
|
last = node;
|
2004-10-03 20:46:08 +02:00
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-12-13 16:32:54 +01:00
|
|
|
/* Free chain list and respective route node. */
|
2018-10-02 11:39:51 +02:00
|
|
|
list_delete(&addr_list);
|
2017-12-13 16:32:54 +01:00
|
|
|
rn->info = NULL;
|
|
|
|
route_unlock_node(rn);
|
|
|
|
} else if (cp.family == AF_INET6) {
|
|
|
|
connected_down(ifp, ifc);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-12-13 16:32:54 +01:00
|
|
|
zebra_interface_address_delete_update(ifp, ifc);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-12-13 16:32:54 +01:00
|
|
|
UNSET_FLAG(ifc->conf, ZEBRA_IFC_REAL);
|
|
|
|
UNSET_FLAG(ifc->conf, ZEBRA_IFC_QUEUED);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-12-13 16:32:54 +01:00
|
|
|
if (CHECK_FLAG(ifc->conf, ZEBRA_IFC_CONFIGURED))
|
2010-05-05 16:00:50 +02:00
|
|
|
last = node;
|
2017-12-13 16:32:54 +01:00
|
|
|
else {
|
|
|
|
listnode_delete(ifp->connected, ifc);
|
2019-10-30 01:16:28 +01:00
|
|
|
connected_free(&ifc);
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
2017-12-13 16:32:54 +01:00
|
|
|
} else {
|
|
|
|
last = node;
|
2004-10-03 20:46:08 +02:00
|
|
|
}
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
2016-02-25 20:30:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Handle an interface delete event */
|
2022-03-25 01:02:33 +01:00
|
|
|
void if_delete_update(struct interface **pifp)
|
2016-02-25 20:30:53 +01:00
|
|
|
{
|
2017-05-15 07:31:08 +02:00
|
|
|
struct zebra_if *zif;
|
2022-03-25 01:02:33 +01:00
|
|
|
struct interface *ifp = *pifp;
|
2005-04-02 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
Fix problems when netlink interfaces are renamed (same ifindex used
for a new interface). Start cleaning up some problems with the way
interface names are handled.
* interface.c: (if_new_intern_ifindex) Remove obsolete function.
(if_delete_update) After distributing the interface deletion message,
set ifp->ifindex to IFINDEX_INTERNAL.
(if_dump_vty) Detect pseudo interface by checking if ifp->ifindex is
IFINDEX_INTERNAL.
(zebra_interface) Check return code from interface_cmd.func.
Do not set internal ifindex values to if_new_intern_ifindex(),
since we now use IFINDEX_INTERNAL for all pseudo interfaces.
* kernel_socket.c: (ifm_read) Fix code and comments to reflect that
all internal interfaces now have ifp->ifindex set to IFINDEX_INTERNAL.
* rt_netlink.c: (set_ifindex) New function used to update ifp->ifindex.
Detects interface rename events by checking if that ifindex is already
being used. If it is, delete the old interface before assigning
the ifindex to the new interface.
(netlink_interface, netlink_link_change) Call set_ifindex to update
the ifindex.
* if.h: Remove define for IFINDEX_INTERNBASE and add define
IFINDEX_INTERNAL 0, since all internal (i.e. non-kernel) pseudo-
interfaces should have ifindex set to 0.
(if_new) Remove function.
(if_delete_retain) New function to delete an interface without
removing from iflist and freeing the structure.
(ifname2ifindex) New function.
* if.c: (if_new) Remove function (absorb into if_create).
(if_create) Replace function if_new with call to calloc.
Set ifp->ifindex to IFINDEX_INTERNAL. Fix off-by-one error
in assert to check length of interface name. Add error message
if interface with this name already exists.
(if_delete_retain) New function to delete an interface without
removing from iflist and freeing the structure.
(if_delete) Implement with help of if_delete_retain.
(ifindex2ifname) Reimplement using if_lookup_by_index.
(ifname2ifindex) New function to complement ifindex2ifname.
(interface) The interface command should check the name length
and fail with a warning message if it is too long.
(no_interface) Fix spelling in warning message.
(if_nametoindex) Reimplement using if_lookup_by_name.
(if_indextoname, ifaddr_ipv4_lookup) Reimplement using
if_lookup_by_index.
* bgp_zebra.c: (bgp_interface_delete) After deleting, set ifp->ifindex
to IFINDEX_INTERNAL.
* isis_zebra.c: (isis_zebra_if_del) Call if_delete_retain instead
of if_delete, since it is generally not safe to remove interface
structures. After deleting, set ifp->ifindex to IFINDEX_INTERNAL.
(zebra_interface_if_lookup) Tighten up code.
* ospf6_zebra.c: (ospf6_zebra_if_del) Previously, this whole function
was commented out. But this is not safe: we should at least update
the ifindex when the interface is deleted. So the new version
updates the interface status and sets ifp->ifindex to
IFINDEX_INTERNAL.
(ospf6_zebra_route_update) Use if_indextoname properly.
* ospf_vty.c: (show_ip_ospf_interface_sub) Show ifindex and interface
flags to help with debugging.
* ospf_zebra.c: (ospf_interface_delete) After deleting, set ifp->ifindex
to IFINDEX_INTERNAL.
(zebra_interface_if_lookup) Make function static. Tighten up code.
* rip_interface.c: (rip_interface_delete) After deleting, set
ifp->ifindex to IFINDEX_INTERNAL.
* ripng_interface.c: (ripng_interface_delete) After deleting, set
ifp->ifindex to IFINDEX_INTERNAL.
2005-04-02 20:38:43 +02:00
|
|
|
|
2016-02-01 19:55:42 +01:00
|
|
|
if (if_is_up(ifp)) {
|
2018-08-03 20:03:29 +02:00
|
|
|
flog_err(
|
2018-09-13 21:34:28 +02:00
|
|
|
EC_LIB_INTERFACE,
|
2020-02-14 14:41:04 +01:00
|
|
|
"interface %s vrf %s(%u) index %d is still up while being deleted.",
|
2021-10-22 00:17:40 +02:00
|
|
|
ifp->name, ifp->vrf->name, ifp->vrf->vrf_id,
|
|
|
|
ifp->ifindex);
|
2016-11-23 20:58:27 +01:00
|
|
|
return;
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
2017-05-15 07:31:08 +02:00
|
|
|
|
2018-05-04 13:49:56 +02:00
|
|
|
if (!CHECK_FLAG(ifp->status, ZEBRA_INTERFACE_ACTIVE))
|
|
|
|
return;
|
|
|
|
|
2016-02-25 20:30:53 +01:00
|
|
|
/* Mark interface as inactive */
|
|
|
|
UNSET_FLAG(ifp->status, ZEBRA_INTERFACE_ACTIVE);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2021-10-22 00:17:40 +02:00
|
|
|
if (IS_ZEBRA_DEBUG_KERNEL)
|
2020-02-14 14:41:04 +01:00
|
|
|
zlog_debug("interface %s vrf %s(%u) index %d is now inactive.",
|
2021-10-22 00:17:40 +02:00
|
|
|
ifp->name, ifp->vrf->name, ifp->vrf->vrf_id,
|
2020-02-14 14:41:04 +01:00
|
|
|
ifp->ifindex);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2016-02-25 20:30:53 +01:00
|
|
|
/* Delete connected routes from the kernel. */
|
|
|
|
if_delete_connected(ifp);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2016-02-25 20:30:53 +01:00
|
|
|
/* Send out notification on interface delete. */
|
2002-12-13 21:15:29 +01:00
|
|
|
zebra_interface_delete_update(ifp);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2016-02-01 19:55:42 +01:00
|
|
|
if_unlink_per_ns(ifp);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2005-04-02 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
Fix problems when netlink interfaces are renamed (same ifindex used
for a new interface). Start cleaning up some problems with the way
interface names are handled.
* interface.c: (if_new_intern_ifindex) Remove obsolete function.
(if_delete_update) After distributing the interface deletion message,
set ifp->ifindex to IFINDEX_INTERNAL.
(if_dump_vty) Detect pseudo interface by checking if ifp->ifindex is
IFINDEX_INTERNAL.
(zebra_interface) Check return code from interface_cmd.func.
Do not set internal ifindex values to if_new_intern_ifindex(),
since we now use IFINDEX_INTERNAL for all pseudo interfaces.
* kernel_socket.c: (ifm_read) Fix code and comments to reflect that
all internal interfaces now have ifp->ifindex set to IFINDEX_INTERNAL.
* rt_netlink.c: (set_ifindex) New function used to update ifp->ifindex.
Detects interface rename events by checking if that ifindex is already
being used. If it is, delete the old interface before assigning
the ifindex to the new interface.
(netlink_interface, netlink_link_change) Call set_ifindex to update
the ifindex.
* if.h: Remove define for IFINDEX_INTERNBASE and add define
IFINDEX_INTERNAL 0, since all internal (i.e. non-kernel) pseudo-
interfaces should have ifindex set to 0.
(if_new) Remove function.
(if_delete_retain) New function to delete an interface without
removing from iflist and freeing the structure.
(ifname2ifindex) New function.
* if.c: (if_new) Remove function (absorb into if_create).
(if_create) Replace function if_new with call to calloc.
Set ifp->ifindex to IFINDEX_INTERNAL. Fix off-by-one error
in assert to check length of interface name. Add error message
if interface with this name already exists.
(if_delete_retain) New function to delete an interface without
removing from iflist and freeing the structure.
(if_delete) Implement with help of if_delete_retain.
(ifindex2ifname) Reimplement using if_lookup_by_index.
(ifname2ifindex) New function to complement ifindex2ifname.
(interface) The interface command should check the name length
and fail with a warning message if it is too long.
(no_interface) Fix spelling in warning message.
(if_nametoindex) Reimplement using if_lookup_by_name.
(if_indextoname, ifaddr_ipv4_lookup) Reimplement using
if_lookup_by_index.
* bgp_zebra.c: (bgp_interface_delete) After deleting, set ifp->ifindex
to IFINDEX_INTERNAL.
* isis_zebra.c: (isis_zebra_if_del) Call if_delete_retain instead
of if_delete, since it is generally not safe to remove interface
structures. After deleting, set ifp->ifindex to IFINDEX_INTERNAL.
(zebra_interface_if_lookup) Tighten up code.
* ospf6_zebra.c: (ospf6_zebra_if_del) Previously, this whole function
was commented out. But this is not safe: we should at least update
the ifindex when the interface is deleted. So the new version
updates the interface status and sets ifp->ifindex to
IFINDEX_INTERNAL.
(ospf6_zebra_route_update) Use if_indextoname properly.
* ospf_vty.c: (show_ip_ospf_interface_sub) Show ifindex and interface
flags to help with debugging.
* ospf_zebra.c: (ospf_interface_delete) After deleting, set ifp->ifindex
to IFINDEX_INTERNAL.
(zebra_interface_if_lookup) Make function static. Tighten up code.
* rip_interface.c: (rip_interface_delete) After deleting, set
ifp->ifindex to IFINDEX_INTERNAL.
* ripng_interface.c: (ripng_interface_delete) After deleting, set
ifp->ifindex to IFINDEX_INTERNAL.
2005-04-02 20:38:43 +02:00
|
|
|
/* Update ifindex after distributing the delete message. This is in
|
|
|
|
case any client needs to have the old value of ifindex available
|
|
|
|
while processing the deletion. Each client daemon is responsible
|
|
|
|
for setting ifindex to IFINDEX_INTERNAL after processing the
|
|
|
|
interface deletion message. */
|
2017-10-03 03:06:04 +02:00
|
|
|
if_set_index(ifp, IFINDEX_INTERNAL);
|
2017-04-18 14:11:32 +02:00
|
|
|
ifp->node = NULL;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2016-11-23 20:58:27 +01:00
|
|
|
/* if the ifp is in a vrf, move it to default so vrf can be deleted if
|
2018-05-29 10:34:38 +02:00
|
|
|
* desired. This operation is not done for netns implementation to avoid
|
|
|
|
* collision with interface with the same name in the default vrf (can
|
|
|
|
* occur with this implementation whereas it is not possible with
|
|
|
|
* vrf-lite).
|
|
|
|
*/
|
2021-10-22 00:17:40 +02:00
|
|
|
if (ifp->vrf->vrf_id && !vrf_is_backend_netns())
|
2016-11-23 20:58:27 +01:00
|
|
|
if_handle_vrf_change(ifp, VRF_DEFAULT);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
zebra: Fix missing VRF flag
1. No any configuration in FRR, and `ip link add vrf1 type vrf ...`.
Currently, everything is ok.
2. `ip link del vrf1`.
`zebra` will wrongly/redundantly notify clients to add "vrf1" as a normal
interface after correct deletion of "vrf1".
```
ZEBRA: [KMXEB-K771Y] netlink_parse_info: netlink-listen (NS 0) type RTM_DELLINK(17), len=588, seq=0, pid=0
ZEBRA: [TDJW2-B9KJW] RTM_DELLINK for vrf1(93) <- Wrongly as normal interface, not vrf
ZEBRA: [WEEJX-M4HA0] interface vrf1 vrf vrf1(93) index 93 is now inactive.
ZEBRA: [NXAHW-290AC] MESSAGE: ZEBRA_INTERFACE_DELETE vrf1 vrf vrf1(93)
ZEBRA: [H97XA-ABB3A] MESSAGE: ZEBRA_INTERFACE_VRF_UPDATE/DEL vrf1 VRF Id 93 -> 0
ZEBRA: [HP8PZ-7D6D2] MESSAGE: ZEBRA_INTERFACE_VRF_UPDATE/ADD vrf1 VRF Id 93 -> 0 <-
ZEBRA: [Y6R2N-EF2N4] interface vrf1 is being deleted from the system
ZEBRA: [KNFMR-AFZ53] RTM_DELLINK for VRF vrf1(93)
ZEBRA: [P0CZ5-RF5FH] VRF vrf1 id 93 is now inactive
ZEBRA: [XC3P3-1DG4D] MESSAGE: ZEBRA_VRF_DELETE vrf1
ZEBRA: [ZMS2F-6K837] VRF vrf1 id 4294967295 deleted
OSPF: [JKWE3-97M3J] Zebra: interface add vrf1 vrf default[0] index 0 flags 480 metric 0 mtu 65575 speed 0 <- Wrongly add interface
```
`if_handle_vrf_change()` moved the interface from specific vrf to default
vrf. But it doesn't skip interface of vrf type. So, the wrong/redundant
add operation is done.
Note, the wrong add operation is regarded as an normal interface because
the `ifp->status` is cleared too early, so it is without VRF flag
( `ZEBRA_INTERFACE_VRF_LOOPBACK` ). Now, ospfd will initialize `ifp->type`
to `OSPF_IFTYPE_BROADCAST`.
3. `ip link add vrf1 type vrf ...`, add "vrf1" again. FRR will be with
wrong display:
```
interface vrf1
ip ospf network broadcast
exit
```
Here, zebra will send `ZEBRA_INTERFACE_ADD` again for "vrf1" with
correct `ifp->status`, so it will be updated into vrf type. But
it can't update `ifp->type` from `OSPF_IFTYPE_BROADCAST` to
`OSPF_IFTYPE_LOOPBACK` because it had been already configured in above
step 2.
Two changes to fix it:
1. Skip the procedure of switching VRF for interfaces of vrf type.
It means, don't send `ZEBRA_INTERFACE_ADD` to clients when deleting vrf.
2. Put the deletion of this flag at the last.
It means, clients should get correct `ifp->status`.
Signed-off-by: anlan_cs <vic.lan@pica8.com>
2023-04-28 07:39:59 +02:00
|
|
|
UNSET_FLAG(ifp->status, ZEBRA_INTERFACE_VRF_LOOPBACK);
|
|
|
|
|
2017-05-15 07:31:08 +02:00
|
|
|
/* Reset some zebra interface params to default values. */
|
|
|
|
zif = ifp->info;
|
|
|
|
if (zif) {
|
2021-07-27 17:45:09 +02:00
|
|
|
zebra_evpn_if_cleanup(zif);
|
2017-05-15 07:31:08 +02:00
|
|
|
zif->zif_type = ZEBRA_IF_OTHER;
|
|
|
|
zif->zif_slave_type = ZEBRA_IF_SLAVE_NONE;
|
|
|
|
memset(&zif->l2info, 0, sizeof(union zebra_l2if_info));
|
|
|
|
memset(&zif->brslave_info, 0,
|
|
|
|
sizeof(struct zebra_l2info_brslave));
|
2020-09-08 15:56:33 +02:00
|
|
|
zebra_evpn_mac_ifp_del(ifp);
|
2017-05-15 07:31:08 +02:00
|
|
|
}
|
2019-09-18 19:42:46 +02:00
|
|
|
|
|
|
|
if (!ifp->configured) {
|
|
|
|
if (IS_ZEBRA_DEBUG_KERNEL)
|
|
|
|
zlog_debug("interface %s is being deleted from the system",
|
|
|
|
ifp->name);
|
2022-03-25 01:02:33 +01:00
|
|
|
if_delete(pifp);
|
2019-09-18 19:42:46 +02:00
|
|
|
}
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
|
|
|
|
2016-02-25 20:30:53 +01:00
|
|
|
/* VRF change for an interface */
|
|
|
|
void if_handle_vrf_change(struct interface *ifp, vrf_id_t vrf_id)
|
|
|
|
{
|
|
|
|
vrf_id_t old_vrf_id;
|
|
|
|
|
2021-10-22 00:17:40 +02:00
|
|
|
old_vrf_id = ifp->vrf->vrf_id;
|
2016-02-25 20:30:53 +01:00
|
|
|
|
|
|
|
/* Uninstall connected routes. */
|
|
|
|
if_uninstall_connected(ifp);
|
|
|
|
|
|
|
|
/* Delete any IPv4 neighbors created to implement RFC 5549 */
|
|
|
|
if_nbr_ipv6ll_to_ipv4ll_neigh_del_all(ifp);
|
|
|
|
|
|
|
|
/* Delete all neighbor addresses learnt through IPv6 RA */
|
|
|
|
if_down_del_nbr_connected(ifp);
|
|
|
|
|
|
|
|
/* Send out notification on interface VRF change. */
|
|
|
|
/* This is to issue an UPDATE or a DELETE, as appropriate. */
|
|
|
|
zebra_interface_vrf_update_del(ifp, vrf_id);
|
|
|
|
|
zebra: Fix missing VRF flag
1. No any configuration in FRR, and `ip link add vrf1 type vrf ...`.
Currently, everything is ok.
2. `ip link del vrf1`.
`zebra` will wrongly/redundantly notify clients to add "vrf1" as a normal
interface after correct deletion of "vrf1".
```
ZEBRA: [KMXEB-K771Y] netlink_parse_info: netlink-listen (NS 0) type RTM_DELLINK(17), len=588, seq=0, pid=0
ZEBRA: [TDJW2-B9KJW] RTM_DELLINK for vrf1(93) <- Wrongly as normal interface, not vrf
ZEBRA: [WEEJX-M4HA0] interface vrf1 vrf vrf1(93) index 93 is now inactive.
ZEBRA: [NXAHW-290AC] MESSAGE: ZEBRA_INTERFACE_DELETE vrf1 vrf vrf1(93)
ZEBRA: [H97XA-ABB3A] MESSAGE: ZEBRA_INTERFACE_VRF_UPDATE/DEL vrf1 VRF Id 93 -> 0
ZEBRA: [HP8PZ-7D6D2] MESSAGE: ZEBRA_INTERFACE_VRF_UPDATE/ADD vrf1 VRF Id 93 -> 0 <-
ZEBRA: [Y6R2N-EF2N4] interface vrf1 is being deleted from the system
ZEBRA: [KNFMR-AFZ53] RTM_DELLINK for VRF vrf1(93)
ZEBRA: [P0CZ5-RF5FH] VRF vrf1 id 93 is now inactive
ZEBRA: [XC3P3-1DG4D] MESSAGE: ZEBRA_VRF_DELETE vrf1
ZEBRA: [ZMS2F-6K837] VRF vrf1 id 4294967295 deleted
OSPF: [JKWE3-97M3J] Zebra: interface add vrf1 vrf default[0] index 0 flags 480 metric 0 mtu 65575 speed 0 <- Wrongly add interface
```
`if_handle_vrf_change()` moved the interface from specific vrf to default
vrf. But it doesn't skip interface of vrf type. So, the wrong/redundant
add operation is done.
Note, the wrong add operation is regarded as an normal interface because
the `ifp->status` is cleared too early, so it is without VRF flag
( `ZEBRA_INTERFACE_VRF_LOOPBACK` ). Now, ospfd will initialize `ifp->type`
to `OSPF_IFTYPE_BROADCAST`.
3. `ip link add vrf1 type vrf ...`, add "vrf1" again. FRR will be with
wrong display:
```
interface vrf1
ip ospf network broadcast
exit
```
Here, zebra will send `ZEBRA_INTERFACE_ADD` again for "vrf1" with
correct `ifp->status`, so it will be updated into vrf type. But
it can't update `ifp->type` from `OSPF_IFTYPE_BROADCAST` to
`OSPF_IFTYPE_LOOPBACK` because it had been already configured in above
step 2.
Two changes to fix it:
1. Skip the procedure of switching VRF for interfaces of vrf type.
It means, don't send `ZEBRA_INTERFACE_ADD` to clients when deleting vrf.
2. Put the deletion of this flag at the last.
It means, clients should get correct `ifp->status`.
Signed-off-by: anlan_cs <vic.lan@pica8.com>
2023-04-28 07:39:59 +02:00
|
|
|
if (if_is_vrf(ifp))
|
|
|
|
return;
|
|
|
|
|
2016-02-25 20:30:53 +01:00
|
|
|
/* update VRF */
|
2019-06-24 01:46:39 +02:00
|
|
|
if_update_to_new_vrf(ifp, vrf_id);
|
2016-02-25 20:30:53 +01:00
|
|
|
|
|
|
|
/* Send out notification on interface VRF change. */
|
|
|
|
/* This is to issue an ADD, if needed. */
|
|
|
|
zebra_interface_vrf_update_add(ifp, old_vrf_id);
|
|
|
|
}
|
|
|
|
|
2018-03-27 21:13:34 +02:00
|
|
|
static void ipv6_ll_address_to_mac(struct in6_addr *address, uint8_t *mac)
|
2015-06-11 18:19:59 +02:00
|
|
|
{
|
2015-06-12 16:59:12 +02:00
|
|
|
mac[0] = address->s6_addr[8] ^ 0x02;
|
2015-06-11 18:19:59 +02:00
|
|
|
mac[1] = address->s6_addr[9];
|
|
|
|
mac[2] = address->s6_addr[10];
|
|
|
|
mac[3] = address->s6_addr[13];
|
|
|
|
mac[4] = address->s6_addr[14];
|
|
|
|
mac[5] = address->s6_addr[15];
|
|
|
|
}
|
|
|
|
|
2018-09-19 17:02:42 +02:00
|
|
|
void if_nbr_mac_to_ipv4ll_neigh_update(struct interface *ifp,
|
|
|
|
char mac[6],
|
|
|
|
struct in6_addr *address,
|
|
|
|
int add)
|
2015-06-11 18:19:59 +02:00
|
|
|
{
|
2021-10-22 00:17:40 +02:00
|
|
|
struct zebra_vrf *zvrf = ifp->vrf->info;
|
2018-04-09 14:04:39 +02:00
|
|
|
struct zebra_if *zif = ifp->info;
|
2015-06-11 18:19:59 +02:00
|
|
|
char buf[16] = "169.254.0.1";
|
|
|
|
struct in_addr ipv4_ll;
|
2017-12-19 12:23:32 +01:00
|
|
|
ns_id_t ns_id;
|
2015-06-11 18:19:59 +02:00
|
|
|
|
|
|
|
inet_pton(AF_INET, buf, &ipv4_ll);
|
|
|
|
|
2018-02-13 10:48:48 +01:00
|
|
|
ns_id = zvrf->zns->ns_id;
|
2017-07-18 09:34:21 +02:00
|
|
|
|
2017-07-17 16:23:20 +02:00
|
|
|
/*
|
2018-10-09 22:12:21 +02:00
|
|
|
* Remove and re-add any existing neighbor entry for this address,
|
|
|
|
* since Netlink doesn't currently offer update message types.
|
2017-07-18 18:06:57 +02:00
|
|
|
*/
|
2019-12-13 18:09:11 +01:00
|
|
|
kernel_neigh_update(0, ifp->ifindex, (void *)&ipv4_ll.s_addr, mac, 6,
|
|
|
|
ns_id, AF_INET, true);
|
2017-07-18 09:34:21 +02:00
|
|
|
|
2018-10-09 22:12:21 +02:00
|
|
|
/* Add new neighbor entry.
|
|
|
|
*
|
|
|
|
* We force installation even if current neighbor entry is the same.
|
|
|
|
* Since this function is used to refresh our MAC entries after an
|
|
|
|
* interface flap, if we don't force in our custom entries with their
|
|
|
|
* state set to PERMANENT or REACHABLE then the kernel will attempt to
|
|
|
|
* resolve our leftover entries, fail, mark them unreachable and then
|
|
|
|
* they'll be useless to us.
|
|
|
|
*/
|
|
|
|
if (add)
|
2019-12-13 18:09:11 +01:00
|
|
|
kernel_neigh_update(add, ifp->ifindex, (void *)&ipv4_ll.s_addr,
|
|
|
|
mac, 6, ns_id, AF_INET, true);
|
2017-07-18 09:34:21 +02:00
|
|
|
|
2018-09-19 17:02:42 +02:00
|
|
|
memcpy(&zif->neigh_mac[0], &mac[0], 6);
|
2018-04-09 14:04:39 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* We need to note whether or not we originated a v6
|
|
|
|
* neighbor entry for this interface. So that when
|
2022-04-19 14:31:30 +02:00
|
|
|
* someone unwisely accidentally deletes this entry
|
2018-04-09 14:04:39 +02:00
|
|
|
* we can shove it back in.
|
|
|
|
*/
|
|
|
|
zif->v6_2_v4_ll_neigh_entry = !!add;
|
|
|
|
memcpy(&zif->v6_2_v4_ll_addr6, address, sizeof(*address));
|
|
|
|
|
2017-05-18 19:13:32 +02:00
|
|
|
zvrf->neigh_updates++;
|
2015-06-11 18:19:59 +02:00
|
|
|
}
|
|
|
|
|
2018-09-19 17:02:42 +02:00
|
|
|
void if_nbr_ipv6ll_to_ipv4ll_neigh_update(struct interface *ifp,
|
|
|
|
struct in6_addr *address, int add)
|
|
|
|
{
|
|
|
|
|
|
|
|
char mac[6];
|
|
|
|
|
|
|
|
ipv6_ll_address_to_mac(address, (uint8_t *)mac);
|
|
|
|
if_nbr_mac_to_ipv4ll_neigh_update(ifp, mac, address, add);
|
|
|
|
}
|
|
|
|
|
2015-06-11 18:19:59 +02:00
|
|
|
static void if_nbr_ipv6ll_to_ipv4ll_neigh_add_all(struct interface *ifp)
|
|
|
|
{
|
|
|
|
if (listhead(ifp->nbr_connected)) {
|
|
|
|
struct nbr_connected *nbr_connected;
|
|
|
|
struct listnode *node;
|
|
|
|
|
|
|
|
for (ALL_LIST_ELEMENTS_RO(ifp->nbr_connected, node,
|
|
|
|
nbr_connected))
|
|
|
|
if_nbr_ipv6ll_to_ipv4ll_neigh_update(
|
|
|
|
ifp, &nbr_connected->address->u.prefix6, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void if_nbr_ipv6ll_to_ipv4ll_neigh_del_all(struct interface *ifp)
|
|
|
|
{
|
|
|
|
if (listhead(ifp->nbr_connected)) {
|
|
|
|
struct nbr_connected *nbr_connected;
|
|
|
|
struct listnode *node;
|
|
|
|
|
|
|
|
for (ALL_LIST_ELEMENTS_RO(ifp->nbr_connected, node,
|
|
|
|
nbr_connected))
|
|
|
|
if_nbr_ipv6ll_to_ipv4ll_neigh_update(
|
|
|
|
ifp, &nbr_connected->address->u.prefix6, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-06-12 16:59:09 +02:00
|
|
|
static void if_down_del_nbr_connected(struct interface *ifp)
|
|
|
|
{
|
|
|
|
struct nbr_connected *nbr_connected;
|
|
|
|
struct listnode *node, *nnode;
|
|
|
|
|
|
|
|
for (ALL_LIST_ELEMENTS(ifp->nbr_connected, node, nnode,
|
|
|
|
nbr_connected)) {
|
|
|
|
listnode_delete(ifp->nbr_connected, nbr_connected);
|
|
|
|
nbr_connected_free(nbr_connected);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-05-14 18:53:19 +02:00
|
|
|
void if_nhg_dependents_add(struct interface *ifp, struct nhg_hash_entry *nhe)
|
2019-03-11 21:29:57 +01:00
|
|
|
{
|
2019-05-14 18:53:19 +02:00
|
|
|
if (ifp->info) {
|
|
|
|
struct zebra_if *zif = (struct zebra_if *)ifp->info;
|
2019-03-11 21:29:57 +01:00
|
|
|
|
2019-07-24 18:27:40 +02:00
|
|
|
nhg_connected_tree_add_nhe(&zif->nhg_dependents, nhe);
|
2019-05-14 18:53:19 +02:00
|
|
|
}
|
|
|
|
}
|
2019-03-11 21:29:57 +01:00
|
|
|
|
2019-05-14 18:53:19 +02:00
|
|
|
void if_nhg_dependents_del(struct interface *ifp, struct nhg_hash_entry *nhe)
|
|
|
|
{
|
|
|
|
if (ifp->info) {
|
|
|
|
struct zebra_if *zif = (struct zebra_if *)ifp->info;
|
2019-03-11 21:29:57 +01:00
|
|
|
|
2019-07-24 18:27:40 +02:00
|
|
|
nhg_connected_tree_del_nhe(&zif->nhg_dependents, nhe);
|
2019-05-14 18:53:19 +02:00
|
|
|
}
|
2019-03-11 21:29:57 +01:00
|
|
|
}
|
|
|
|
|
2019-05-14 18:53:19 +02:00
|
|
|
unsigned int if_nhg_dependents_count(const struct interface *ifp)
|
2019-03-11 21:29:57 +01:00
|
|
|
{
|
2019-05-14 18:53:19 +02:00
|
|
|
if (ifp->info) {
|
|
|
|
struct zebra_if *zif = (struct zebra_if *)ifp->info;
|
|
|
|
|
2019-07-24 18:27:40 +02:00
|
|
|
return nhg_connected_tree_count(&zif->nhg_dependents);
|
2019-05-14 18:53:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool if_nhg_dependents_is_empty(const struct interface *ifp)
|
|
|
|
{
|
|
|
|
if (ifp->info) {
|
|
|
|
struct zebra_if *zif = (struct zebra_if *)ifp->info;
|
|
|
|
|
2019-07-24 18:27:40 +02:00
|
|
|
return nhg_connected_tree_is_empty(&zif->nhg_dependents);
|
2019-05-14 18:53:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
2019-03-11 21:29:57 +01:00
|
|
|
}
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* Interface is up. */
|
2020-10-02 20:49:09 +02:00
|
|
|
void if_up(struct interface *ifp, bool install_connected)
|
2002-12-13 21:15:29 +01:00
|
|
|
{
|
2016-04-07 21:43:44 +02:00
|
|
|
struct zebra_if *zif;
|
2017-05-15 07:44:13 +02:00
|
|
|
struct interface *link_if;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2016-04-07 21:43:44 +02:00
|
|
|
zif = ifp->info;
|
|
|
|
zif->up_count++;
|
2021-11-11 20:33:41 +01:00
|
|
|
frr_timestamp(2, zif->up_last, sizeof(zif->up_last));
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* Notify the protocol daemons. */
|
2015-10-09 20:18:09 +02:00
|
|
|
if (ifp->ptm_enable && (ifp->ptm_status == ZEBRA_PTM_STATUS_DOWN)) {
|
2018-09-13 21:21:05 +02:00
|
|
|
flog_warn(EC_ZEBRA_PTM_NOT_READY,
|
2021-02-14 15:35:07 +01:00
|
|
|
"%s: interface %s hasn't passed ptm check",
|
2015-05-20 02:40:44 +02:00
|
|
|
__func__, ifp->name);
|
|
|
|
return;
|
|
|
|
}
|
2002-12-13 21:15:29 +01:00
|
|
|
zebra_interface_up_update(ifp);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2015-06-11 18:19:59 +02:00
|
|
|
if_nbr_ipv6ll_to_ipv4ll_neigh_add_all(ifp);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2021-04-18 12:11:14 +02:00
|
|
|
rtadv_if_up(zif);
|
2016-04-27 03:26:10 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* Install connected routes to the kernel. */
|
2020-10-02 20:49:09 +02:00
|
|
|
if (install_connected)
|
|
|
|
if_install_connected(ifp);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-05-15 07:44:13 +02:00
|
|
|
/* Handle interface up for specific types for EVPN. Non-VxLAN interfaces
|
|
|
|
* are checked to see if (remote) neighbor entries need to be installed
|
|
|
|
* on them for ARP suppression.
|
|
|
|
*/
|
2017-05-15 07:38:26 +02:00
|
|
|
if (IS_ZEBRA_IF_VXLAN(ifp))
|
|
|
|
zebra_vxlan_if_up(ifp);
|
2017-05-15 07:44:13 +02:00
|
|
|
else if (IS_ZEBRA_IF_BRIDGE(ifp)) {
|
|
|
|
link_if = ifp;
|
|
|
|
zebra_vxlan_svi_up(ifp, link_if);
|
|
|
|
} else if (IS_ZEBRA_IF_VLAN(ifp)) {
|
2023-02-21 07:00:36 +01:00
|
|
|
link_if = zif->link;
|
2017-05-15 07:44:13 +02:00
|
|
|
if (link_if)
|
|
|
|
zebra_vxlan_svi_up(ifp, link_if);
|
2019-12-19 18:33:56 +01:00
|
|
|
} else if (IS_ZEBRA_IF_MACVLAN(ifp)) {
|
2019-09-06 22:55:35 +02:00
|
|
|
zebra_vxlan_macvlan_up(ifp);
|
2019-12-19 18:33:56 +01:00
|
|
|
}
|
2019-09-06 22:55:35 +02:00
|
|
|
|
2020-03-28 01:14:45 +01:00
|
|
|
if (zif->es_info.es)
|
|
|
|
zebra_evpn_es_if_oper_state_change(zif, true /*up*/);
|
zebra: uplink tracking and startup delay for EVPN-MH
Local ethernet segments are held in a protodown or error-disabled state
if access to the VxLAN overlay is not ready -
1. When FRR comes up the local-ESs/access-port are kept protodown
for the startup-delay duration. During this time the underlay and
EVPN routes via it are expected to converge.
2. When all the uplinks/core-links attached to the underlay go down
the access-ports are similarly protodowned.
The ES-bond protodown state is propagated to each ES-bond member
and programmed in the dataplane/kernel (per-bond-member).
Configuring uplinks -
vtysh -c "conf t" vtysh -c "interface swp4" vtysh -c "evpn mh uplink"
Configuring startup delay -
vtysh -c "conf t" vtysh -c "evpn mh startup-delay 100"
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
EVPN protodown display -
========================
root@torm-11:mgmt:~# vtysh -c "show evpn"
L2 VNIs: 10
L3 VNIs: 3
Advertise gateway mac-ip: No
Advertise svi mac-ip: No
Duplicate address detection: Disable
Detection max-moves 5, time 180
EVPN MH:
mac-holdtime: 60s, neigh-holdtime: 60s
startup-delay: 180s, start-delay-timer: 00:01:14 <<<<<<<<<<<<
uplink-cfg-cnt: 4, uplink-active-cnt: 4
protodown: startup-delay <<<<<<<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond protodown display -
===========================
root@torm-11:mgmt:~# vtysh -c "show interface hostbond1"
Interface hostbond1 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 1 last: 2020/04/26 20:38:03.53
PTM status: disabled
vrf: default
OS Description: Local Node/s torm-11 and Ports swp5 <==> Remote Node/s hostd-11 and Ports swp1
index 58 metric 0 mtu 9152 speed 4294967295
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type bond
Master interface: bridge
EVPN-MH: ES id 1 ES sysmac 00:00:00:00:01:11
protodown: off rc: startup-delay <<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond member protodown display -
==================================
root@torm-11:mgmt:~# vtysh -c "show interface swp5"
Interface swp5 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 3 last: 2020/04/26 20:38:03.52
PTM status: disabled
vrf: default
index 7 metric 0 mtu 9152 speed 10000
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type Other
Master interface: hostbond1
protodown: on rc: startup-delay <<<<<<<<<<<<<<<<
root@torm-11:mgmt:~#
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-05-09 04:11:13 +02:00
|
|
|
|
|
|
|
if (zif->flags & ZIF_FLAG_EVPN_MH_UPLINK)
|
|
|
|
zebra_evpn_mh_uplink_oper_update(zif);
|
2021-04-27 13:15:26 +02:00
|
|
|
|
2022-05-20 20:19:08 +02:00
|
|
|
event_add_timer(zrouter.master, if_zebra_speed_update, ifp, 0,
|
|
|
|
&zif->speed_update);
|
2022-12-11 16:51:58 +01:00
|
|
|
event_ignore_late_timer(zif->speed_update);
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Interface goes down. We have to manage different behavior of based
|
|
|
|
OS. */
|
|
|
|
void if_down(struct interface *ifp)
|
|
|
|
{
|
2016-04-07 21:43:44 +02:00
|
|
|
struct zebra_if *zif;
|
2017-05-15 07:44:13 +02:00
|
|
|
struct interface *link_if;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2016-04-07 21:43:44 +02:00
|
|
|
zif = ifp->info;
|
|
|
|
zif->down_count++;
|
2021-11-11 20:33:41 +01:00
|
|
|
frr_timestamp(2, zif->down_last, sizeof(zif->down_last));
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2019-05-14 19:11:30 +02:00
|
|
|
if_down_nhg_dependents(ifp);
|
|
|
|
|
2017-05-15 07:44:13 +02:00
|
|
|
/* Handle interface down for specific types for EVPN. Non-VxLAN
|
|
|
|
* interfaces
|
|
|
|
* are checked to see if (remote) neighbor entries need to be purged
|
|
|
|
* for ARP suppression.
|
|
|
|
*/
|
2017-05-15 07:38:26 +02:00
|
|
|
if (IS_ZEBRA_IF_VXLAN(ifp))
|
|
|
|
zebra_vxlan_if_down(ifp);
|
2017-05-15 07:44:13 +02:00
|
|
|
else if (IS_ZEBRA_IF_BRIDGE(ifp)) {
|
|
|
|
link_if = ifp;
|
|
|
|
zebra_vxlan_svi_down(ifp, link_if);
|
|
|
|
} else if (IS_ZEBRA_IF_VLAN(ifp)) {
|
2023-02-21 07:00:36 +01:00
|
|
|
link_if = zif->link;
|
2017-05-15 07:44:13 +02:00
|
|
|
if (link_if)
|
|
|
|
zebra_vxlan_svi_down(ifp, link_if);
|
2019-12-19 18:33:56 +01:00
|
|
|
} else if (IS_ZEBRA_IF_MACVLAN(ifp)) {
|
2019-09-06 22:55:35 +02:00
|
|
|
zebra_vxlan_macvlan_down(ifp);
|
2019-12-19 18:33:56 +01:00
|
|
|
}
|
2017-05-15 07:44:13 +02:00
|
|
|
|
2020-03-28 01:14:45 +01:00
|
|
|
if (zif->es_info.es)
|
|
|
|
zebra_evpn_es_if_oper_state_change(zif, false /*up*/);
|
2017-05-15 07:38:26 +02:00
|
|
|
|
zebra: uplink tracking and startup delay for EVPN-MH
Local ethernet segments are held in a protodown or error-disabled state
if access to the VxLAN overlay is not ready -
1. When FRR comes up the local-ESs/access-port are kept protodown
for the startup-delay duration. During this time the underlay and
EVPN routes via it are expected to converge.
2. When all the uplinks/core-links attached to the underlay go down
the access-ports are similarly protodowned.
The ES-bond protodown state is propagated to each ES-bond member
and programmed in the dataplane/kernel (per-bond-member).
Configuring uplinks -
vtysh -c "conf t" vtysh -c "interface swp4" vtysh -c "evpn mh uplink"
Configuring startup delay -
vtysh -c "conf t" vtysh -c "evpn mh startup-delay 100"
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
EVPN protodown display -
========================
root@torm-11:mgmt:~# vtysh -c "show evpn"
L2 VNIs: 10
L3 VNIs: 3
Advertise gateway mac-ip: No
Advertise svi mac-ip: No
Duplicate address detection: Disable
Detection max-moves 5, time 180
EVPN MH:
mac-holdtime: 60s, neigh-holdtime: 60s
startup-delay: 180s, start-delay-timer: 00:01:14 <<<<<<<<<<<<
uplink-cfg-cnt: 4, uplink-active-cnt: 4
protodown: startup-delay <<<<<<<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond protodown display -
===========================
root@torm-11:mgmt:~# vtysh -c "show interface hostbond1"
Interface hostbond1 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 1 last: 2020/04/26 20:38:03.53
PTM status: disabled
vrf: default
OS Description: Local Node/s torm-11 and Ports swp5 <==> Remote Node/s hostd-11 and Ports swp1
index 58 metric 0 mtu 9152 speed 4294967295
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type bond
Master interface: bridge
EVPN-MH: ES id 1 ES sysmac 00:00:00:00:01:11
protodown: off rc: startup-delay <<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond member protodown display -
==================================
root@torm-11:mgmt:~# vtysh -c "show interface swp5"
Interface swp5 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 3 last: 2020/04/26 20:38:03.52
PTM status: disabled
vrf: default
index 7 metric 0 mtu 9152 speed 10000
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type Other
Master interface: hostbond1
protodown: on rc: startup-delay <<<<<<<<<<<<<<<<
root@torm-11:mgmt:~#
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-05-09 04:11:13 +02:00
|
|
|
if (zif->flags & ZIF_FLAG_EVPN_MH_UPLINK)
|
|
|
|
zebra_evpn_mh_uplink_oper_update(zif);
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* Notify to the protocol daemons. */
|
|
|
|
zebra_interface_down_update(ifp);
|
|
|
|
|
2016-02-25 20:30:53 +01:00
|
|
|
/* Uninstall connected routes from the kernel. */
|
|
|
|
if_uninstall_connected(ifp);
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2015-06-11 18:19:59 +02:00
|
|
|
if_nbr_ipv6ll_to_ipv4ll_neigh_del_all(ifp);
|
2015-06-12 16:59:09 +02:00
|
|
|
|
|
|
|
/* Delete all neighbor addresses learnt through IPv6 RA */
|
|
|
|
if_down_del_nbr_connected(ifp);
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void if_refresh(struct interface *ifp)
|
|
|
|
{
|
2022-06-15 14:27:32 +02:00
|
|
|
#ifndef GNU_LINUX
|
[zebra/solaris] Interface state fixups for Solaris.
2006-01-25 Paul Jakma <paul.jakma@sun.com>
* (general) More solaris PF_ROUTE hacks. The IFF_UP mangling
for solaris was incomplete on the PF_ROUTE side. fix it.
This changeset generally uglifies things. For some future
work I'd like to see the state changes seperated out from
the details of the code. Differences between systems might
then be slightly easier to implement without convoluted
hacks.
Changes should be specific to Solaris mostly, however
also tested on FreeBSD 6.
* if_ioctl_solaris.c: (interface_list_ioctl) ignore ~IFF_UP
interfaces, we'll hear about them when/if interface goes up
through NEWADDR.
Update flags explicitely at end of it to kick mangling.
* ioctl_solaris.c: (if_mangle_up) removed to interface.c, in
kind.
(lifreq_set_name) more convenient to take the string, than
the ifp.
(if_get_flags_direct) new convenience function, returns
the actual flags. Used during bootstrap in if_ioctl_solaris.c
to peek at flags of logical interfaces to see whether or
not to ignore them.
(if_get_flags) ENXIO means it's gone, poke out IFF_UP and
kick flags update.
(if_{un,}set_flags) flags argument should be 64bit.
* ioctl.{c,h}: flags argument should be 64bit.
* interface.h: Add a 'primary_state' flag to struct zebra_if on
SUNOS_5.
Export if_flags_update.
* interface.c: (if_flags_mangle) moved over in kind from
ioctl_solaris.c. Nasty kludge to try get IFF_UP right, as
much as is possible. Also keep track of the actual IFF_UP
value for the primary interface, so we can know when the ifp
must be deleted.
(if_flags_update) Take a new interface flags value, apply it
to the interface, and take whatever actions are required due
to flag transitions.
(if_refresh) flag state change logic is moved out to
previous. Just call if_get_flags, which will end up using
previous to effect the update of flags.
(if_flag_dump_vty) IFF_IPV{4,6} aren't interesting, VIRTUAL
and NOXMIT are though.
* kernel_socket.c: (ifm_read) Down->Down transitions shouldn't
create ifp, for non-IFANNOUNCE systems.
Use if_flags_update to update flags.
flag transition logic is now handled automatically through
if_flags_update.
(ifam_read) Better to call if_refresh *after* adding
connected addresses, as connected count affects IFF_UP on
IFF_UP-mangled systems.
On Solaris, Up->Down due to DELADDR means we need to delete
the ifp - the IFINFO might already have been and gone.
* rt.h: include other dependent headers.
2006-01-25 05:31:40 +01:00
|
|
|
if_get_flags(ifp);
|
2022-06-15 14:27:32 +02:00
|
|
|
#endif
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
|
|
|
|
2018-08-27 17:00:18 +02:00
|
|
|
void zebra_if_update_link(struct interface *ifp, ifindex_t link_ifindex,
|
|
|
|
ns_id_t ns_id)
|
2017-05-15 07:31:08 +02:00
|
|
|
{
|
|
|
|
struct zebra_if *zif;
|
|
|
|
|
2018-08-29 11:29:07 +02:00
|
|
|
if (IS_ZEBRA_IF_VETH(ifp))
|
|
|
|
return;
|
2017-05-15 07:31:08 +02:00
|
|
|
zif = (struct zebra_if *)ifp->info;
|
2023-02-21 07:00:36 +01:00
|
|
|
zif->link_nsid = ns_id;
|
2017-05-15 07:31:08 +02:00
|
|
|
zif->link_ifindex = link_ifindex;
|
2018-08-27 17:00:18 +02:00
|
|
|
zif->link = if_lookup_by_index_per_ns(zebra_ns_lookup(ns_id),
|
2017-05-15 07:31:08 +02:00
|
|
|
link_ifindex);
|
|
|
|
}
|
|
|
|
|
2018-09-17 18:13:15 +02:00
|
|
|
/*
|
|
|
|
* during initial link dump kernel does not order lower devices before
|
|
|
|
* upper devices so we need to fixup link dependencies at the end of dump
|
|
|
|
*/
|
2021-04-29 12:02:47 +02:00
|
|
|
void zebra_if_update_all_links(struct zebra_ns *zns)
|
2018-09-12 20:33:51 +02:00
|
|
|
{
|
|
|
|
struct route_node *rn;
|
|
|
|
struct interface *ifp;
|
|
|
|
struct zebra_if *zif;
|
|
|
|
|
|
|
|
if (IS_ZEBRA_DEBUG_KERNEL)
|
|
|
|
zlog_info("fixup link dependencies");
|
|
|
|
|
2021-04-29 12:02:47 +02:00
|
|
|
for (rn = route_top(zns->if_table); rn; rn = route_next(rn)) {
|
2018-09-12 20:33:51 +02:00
|
|
|
ifp = (struct interface *)rn->info;
|
|
|
|
if (!ifp)
|
|
|
|
continue;
|
|
|
|
zif = ifp->info;
|
zebra: uplink tracking and startup delay for EVPN-MH
Local ethernet segments are held in a protodown or error-disabled state
if access to the VxLAN overlay is not ready -
1. When FRR comes up the local-ESs/access-port are kept protodown
for the startup-delay duration. During this time the underlay and
EVPN routes via it are expected to converge.
2. When all the uplinks/core-links attached to the underlay go down
the access-ports are similarly protodowned.
The ES-bond protodown state is propagated to each ES-bond member
and programmed in the dataplane/kernel (per-bond-member).
Configuring uplinks -
vtysh -c "conf t" vtysh -c "interface swp4" vtysh -c "evpn mh uplink"
Configuring startup delay -
vtysh -c "conf t" vtysh -c "evpn mh startup-delay 100"
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
EVPN protodown display -
========================
root@torm-11:mgmt:~# vtysh -c "show evpn"
L2 VNIs: 10
L3 VNIs: 3
Advertise gateway mac-ip: No
Advertise svi mac-ip: No
Duplicate address detection: Disable
Detection max-moves 5, time 180
EVPN MH:
mac-holdtime: 60s, neigh-holdtime: 60s
startup-delay: 180s, start-delay-timer: 00:01:14 <<<<<<<<<<<<
uplink-cfg-cnt: 4, uplink-active-cnt: 4
protodown: startup-delay <<<<<<<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond protodown display -
===========================
root@torm-11:mgmt:~# vtysh -c "show interface hostbond1"
Interface hostbond1 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 1 last: 2020/04/26 20:38:03.53
PTM status: disabled
vrf: default
OS Description: Local Node/s torm-11 and Ports swp5 <==> Remote Node/s hostd-11 and Ports swp1
index 58 metric 0 mtu 9152 speed 4294967295
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type bond
Master interface: bridge
EVPN-MH: ES id 1 ES sysmac 00:00:00:00:01:11
protodown: off rc: startup-delay <<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond member protodown display -
==================================
root@torm-11:mgmt:~# vtysh -c "show interface swp5"
Interface swp5 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 3 last: 2020/04/26 20:38:03.52
PTM status: disabled
vrf: default
index 7 metric 0 mtu 9152 speed 10000
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type Other
Master interface: hostbond1
protodown: on rc: startup-delay <<<<<<<<<<<<<<<<
root@torm-11:mgmt:~#
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-05-09 04:11:13 +02:00
|
|
|
/* update bond-member to bond linkages */
|
|
|
|
if ((IS_ZEBRA_IF_BOND_SLAVE(ifp))
|
|
|
|
&& (zif->bondslave_info.bond_ifindex != IFINDEX_INTERNAL)
|
|
|
|
&& !zif->bondslave_info.bond_if) {
|
|
|
|
if (IS_ZEBRA_DEBUG_EVPN_MH_ES || IS_ZEBRA_DEBUG_KERNEL)
|
|
|
|
zlog_debug("bond mbr %s map to bond %d",
|
|
|
|
zif->ifp->name,
|
|
|
|
zif->bondslave_info.bond_ifindex);
|
2021-10-22 00:17:40 +02:00
|
|
|
zebra_l2_map_slave_to_bond(zif, ifp->vrf->vrf_id);
|
zebra: uplink tracking and startup delay for EVPN-MH
Local ethernet segments are held in a protodown or error-disabled state
if access to the VxLAN overlay is not ready -
1. When FRR comes up the local-ESs/access-port are kept protodown
for the startup-delay duration. During this time the underlay and
EVPN routes via it are expected to converge.
2. When all the uplinks/core-links attached to the underlay go down
the access-ports are similarly protodowned.
The ES-bond protodown state is propagated to each ES-bond member
and programmed in the dataplane/kernel (per-bond-member).
Configuring uplinks -
vtysh -c "conf t" vtysh -c "interface swp4" vtysh -c "evpn mh uplink"
Configuring startup delay -
vtysh -c "conf t" vtysh -c "evpn mh startup-delay 100"
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
EVPN protodown display -
========================
root@torm-11:mgmt:~# vtysh -c "show evpn"
L2 VNIs: 10
L3 VNIs: 3
Advertise gateway mac-ip: No
Advertise svi mac-ip: No
Duplicate address detection: Disable
Detection max-moves 5, time 180
EVPN MH:
mac-holdtime: 60s, neigh-holdtime: 60s
startup-delay: 180s, start-delay-timer: 00:01:14 <<<<<<<<<<<<
uplink-cfg-cnt: 4, uplink-active-cnt: 4
protodown: startup-delay <<<<<<<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond protodown display -
===========================
root@torm-11:mgmt:~# vtysh -c "show interface hostbond1"
Interface hostbond1 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 1 last: 2020/04/26 20:38:03.53
PTM status: disabled
vrf: default
OS Description: Local Node/s torm-11 and Ports swp5 <==> Remote Node/s hostd-11 and Ports swp1
index 58 metric 0 mtu 9152 speed 4294967295
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type bond
Master interface: bridge
EVPN-MH: ES id 1 ES sysmac 00:00:00:00:01:11
protodown: off rc: startup-delay <<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond member protodown display -
==================================
root@torm-11:mgmt:~# vtysh -c "show interface swp5"
Interface swp5 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 3 last: 2020/04/26 20:38:03.52
PTM status: disabled
vrf: default
index 7 metric 0 mtu 9152 speed 10000
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type Other
Master interface: hostbond1
protodown: on rc: startup-delay <<<<<<<<<<<<<<<<
root@torm-11:mgmt:~#
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-05-09 04:11:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* update SVI linkages */
|
2018-09-12 20:33:51 +02:00
|
|
|
if ((zif->link_ifindex != IFINDEX_INTERNAL) && !zif->link) {
|
2023-02-21 07:00:36 +01:00
|
|
|
zif->link = if_lookup_by_index_per_nsid(
|
|
|
|
zif->link_nsid, zif->link_ifindex);
|
2018-09-12 20:33:51 +02:00
|
|
|
if (IS_ZEBRA_DEBUG_KERNEL)
|
|
|
|
zlog_debug("interface %s/%d's lower fixup to %s/%d",
|
|
|
|
ifp->name, ifp->ifindex,
|
|
|
|
zif->link?zif->link->name:"unk",
|
|
|
|
zif->link_ifindex);
|
|
|
|
}
|
2020-11-02 19:53:50 +01:00
|
|
|
|
|
|
|
/* Update VLAN<=>SVI map */
|
|
|
|
if (IS_ZEBRA_IF_VLAN(ifp))
|
|
|
|
zebra_evpn_acc_bd_svi_set(zif, NULL,
|
|
|
|
!!if_is_operative(ifp));
|
2018-09-12 20:33:51 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-21 10:03:01 +01:00
|
|
|
static bool if_ignore_set_protodown(const struct interface *ifp, bool new_down,
|
|
|
|
uint32_t new_protodown_rc)
|
|
|
|
{
|
|
|
|
struct zebra_if *zif;
|
|
|
|
bool old_down, old_set_down, old_unset_down;
|
|
|
|
|
|
|
|
zif = ifp->info;
|
|
|
|
|
|
|
|
/* Current state as we know it */
|
2022-01-25 20:44:25 +01:00
|
|
|
old_down = !!(ZEBRA_IF_IS_PROTODOWN(zif));
|
2022-02-16 00:21:18 +01:00
|
|
|
old_set_down = !!CHECK_FLAG(zif->flags, ZIF_FLAG_SET_PROTODOWN);
|
|
|
|
old_unset_down = !!CHECK_FLAG(zif->flags, ZIF_FLAG_UNSET_PROTODOWN);
|
2022-01-21 10:03:01 +01:00
|
|
|
|
|
|
|
if (new_protodown_rc == zif->protodown_rc) {
|
|
|
|
/* Early return if already down & reason bitfield matches */
|
|
|
|
if (new_down == old_down) {
|
|
|
|
if (IS_ZEBRA_DEBUG_KERNEL)
|
|
|
|
zlog_debug(
|
2022-02-15 20:22:50 +01:00
|
|
|
"Ignoring request to set protodown %s for interface %s (%u): protodown %s is already set (reason bitfield: old 0x%x new 0x%x)",
|
|
|
|
new_down ? "on" : "off", ifp->name,
|
|
|
|
ifp->ifindex, new_down ? "on" : "off",
|
2022-01-21 10:03:01 +01:00
|
|
|
zif->protodown_rc, new_protodown_rc);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Early return if already set queued & reason bitfield matches
|
|
|
|
*/
|
|
|
|
if (new_down && old_set_down) {
|
|
|
|
if (IS_ZEBRA_DEBUG_KERNEL)
|
|
|
|
zlog_debug(
|
2022-02-15 20:22:50 +01:00
|
|
|
"Ignoring request to set protodown %s for interface %s (%u): protodown %s is already queued to dplane (reason bitfield: old 0x%x new 0x%x)",
|
|
|
|
new_down ? "on" : "off", ifp->name,
|
|
|
|
ifp->ifindex, new_down ? "on" : "off",
|
2022-01-21 10:03:01 +01:00
|
|
|
zif->protodown_rc, new_protodown_rc);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Early return if already unset queued & reason bitfield
|
|
|
|
* matches */
|
|
|
|
if (!new_down && old_unset_down) {
|
|
|
|
if (IS_ZEBRA_DEBUG_KERNEL)
|
|
|
|
zlog_debug(
|
2022-02-15 20:22:50 +01:00
|
|
|
"Ignoring request to set protodown %s for interface %s (%u): protodown %s is already queued to dplane (reason bitfield: old 0x%x new 0x%x)",
|
|
|
|
new_down ? "on" : "off", ifp->name,
|
|
|
|
ifp->ifindex, new_down ? "on" : "off",
|
2022-01-21 10:03:01 +01:00
|
|
|
zif->protodown_rc, new_protodown_rc);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2022-02-15 18:33:06 +01:00
|
|
|
int zebra_if_update_protodown_rc(struct interface *ifp, bool new_down,
|
|
|
|
uint32_t new_protodown_rc)
|
2019-02-05 23:02:40 +01:00
|
|
|
{
|
2022-01-26 06:07:57 +01:00
|
|
|
struct zebra_if *zif;
|
|
|
|
|
|
|
|
zif = ifp->info;
|
|
|
|
|
2022-01-21 10:03:01 +01:00
|
|
|
/* Check if we already have this state or it's queued */
|
|
|
|
if (if_ignore_set_protodown(ifp, new_down, new_protodown_rc))
|
|
|
|
return 1;
|
2022-01-26 06:07:57 +01:00
|
|
|
|
|
|
|
zlog_info(
|
2022-02-15 20:22:50 +01:00
|
|
|
"Setting protodown %s - interface %s (%u): reason bitfield change from 0x%x --> 0x%x",
|
|
|
|
new_down ? "on" : "off", ifp->name, ifp->ifindex,
|
2022-01-26 06:07:57 +01:00
|
|
|
zif->protodown_rc, new_protodown_rc);
|
|
|
|
|
|
|
|
zif->protodown_rc = new_protodown_rc;
|
|
|
|
|
2022-01-21 10:03:01 +01:00
|
|
|
if (new_down)
|
2022-02-16 00:21:18 +01:00
|
|
|
SET_FLAG(zif->flags, ZIF_FLAG_SET_PROTODOWN);
|
2022-01-21 10:03:01 +01:00
|
|
|
else
|
2022-02-16 00:21:18 +01:00
|
|
|
SET_FLAG(zif->flags, ZIF_FLAG_UNSET_PROTODOWN);
|
2022-01-21 10:03:01 +01:00
|
|
|
|
2019-05-17 02:26:24 +02:00
|
|
|
#ifdef HAVE_NETLINK
|
2022-01-26 06:07:57 +01:00
|
|
|
dplane_intf_update(ifp);
|
2019-05-17 02:26:24 +02:00
|
|
|
#else
|
|
|
|
zlog_warn("Protodown is not supported on this platform");
|
|
|
|
#endif
|
2022-01-26 06:07:57 +01:00
|
|
|
return 0;
|
2019-02-05 23:02:40 +01:00
|
|
|
}
|
2015-05-20 02:47:23 +02:00
|
|
|
|
2022-01-31 22:12:01 +01:00
|
|
|
int zebra_if_set_protodown(struct interface *ifp, bool new_down,
|
|
|
|
enum protodown_reasons new_reason)
|
|
|
|
{
|
|
|
|
struct zebra_if *zif;
|
|
|
|
uint32_t new_protodown_rc;
|
|
|
|
|
|
|
|
zif = ifp->info;
|
|
|
|
|
|
|
|
if (new_down)
|
|
|
|
new_protodown_rc = zif->protodown_rc | new_reason;
|
|
|
|
else
|
|
|
|
new_protodown_rc = zif->protodown_rc & ~new_reason;
|
|
|
|
|
2022-02-15 18:33:06 +01:00
|
|
|
return zebra_if_update_protodown_rc(ifp, new_down, new_protodown_rc);
|
2022-01-31 22:12:01 +01:00
|
|
|
}
|
|
|
|
|
2021-09-08 21:58:04 +02:00
|
|
|
/*
|
2022-01-26 06:07:57 +01:00
|
|
|
* Handle an interface events based on info in a dplane context object.
|
2021-09-08 21:58:04 +02:00
|
|
|
* This runs in the main pthread, using the info in the context object to
|
|
|
|
* modify an interface.
|
|
|
|
*/
|
2022-01-26 06:07:57 +01:00
|
|
|
static void zebra_if_addr_update_ctx(struct zebra_dplane_ctx *ctx,
|
|
|
|
struct interface *ifp)
|
2021-07-14 19:06:41 +02:00
|
|
|
{
|
2021-09-08 21:58:04 +02:00
|
|
|
uint8_t flags = 0;
|
|
|
|
const char *label = NULL;
|
|
|
|
uint32_t metric = METRIC_MAX;
|
|
|
|
const struct prefix *addr, *dest = NULL;
|
|
|
|
enum dplane_op_e op;
|
|
|
|
|
2023-04-27 05:02:09 +02:00
|
|
|
if (!ifp)
|
|
|
|
return;
|
|
|
|
|
2021-09-08 21:58:04 +02:00
|
|
|
op = dplane_ctx_get_op(ctx);
|
|
|
|
addr = dplane_ctx_get_intf_addr(ctx);
|
|
|
|
|
|
|
|
if (IS_ZEBRA_DEBUG_KERNEL)
|
2022-01-26 06:07:57 +01:00
|
|
|
zlog_debug("%s: %s: ifindex %s(%u), addr %pFX", __func__,
|
|
|
|
dplane_op2str(dplane_ctx_get_op(ctx)), ifp->name,
|
|
|
|
ifp->ifindex, addr);
|
2021-09-08 21:58:04 +02:00
|
|
|
|
|
|
|
/* Is there a peer or broadcast address? */
|
|
|
|
dest = dplane_ctx_get_intf_dest(ctx);
|
|
|
|
if (dest->prefixlen == 0)
|
|
|
|
dest = NULL;
|
|
|
|
|
|
|
|
if (dplane_ctx_intf_is_connected(ctx))
|
|
|
|
SET_FLAG(flags, ZEBRA_IFA_PEER);
|
|
|
|
|
|
|
|
/* Flags. */
|
|
|
|
if (dplane_ctx_intf_is_secondary(ctx))
|
|
|
|
SET_FLAG(flags, ZEBRA_IFA_SECONDARY);
|
|
|
|
|
|
|
|
/* Label? */
|
|
|
|
if (dplane_ctx_intf_has_label(ctx))
|
|
|
|
label = dplane_ctx_get_intf_label(ctx);
|
|
|
|
|
|
|
|
if (label && strcmp(ifp->name, label) == 0)
|
|
|
|
label = NULL;
|
|
|
|
|
|
|
|
metric = dplane_ctx_get_intf_metric(ctx);
|
|
|
|
|
|
|
|
/* Register interface address to the interface. */
|
|
|
|
if (addr->family == AF_INET) {
|
|
|
|
if (op == DPLANE_OP_INTF_ADDR_ADD)
|
|
|
|
connected_add_ipv4(
|
|
|
|
ifp, flags, &addr->u.prefix4, addr->prefixlen,
|
|
|
|
dest ? &dest->u.prefix4 : NULL, label, metric);
|
|
|
|
else if (CHECK_FLAG(flags, ZEBRA_IFA_PEER)) {
|
|
|
|
/* Delete with a peer address */
|
|
|
|
connected_delete_ipv4(ifp, flags, &addr->u.prefix4,
|
|
|
|
addr->prefixlen,
|
|
|
|
&dest->u.prefix4);
|
|
|
|
} else
|
|
|
|
connected_delete_ipv4(ifp, flags, &addr->u.prefix4,
|
|
|
|
addr->prefixlen, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (addr->family == AF_INET6) {
|
|
|
|
if (op == DPLANE_OP_INTF_ADDR_ADD) {
|
|
|
|
connected_add_ipv6(ifp, flags, &addr->u.prefix6,
|
|
|
|
dest ? &dest->u.prefix6 : NULL,
|
|
|
|
addr->prefixlen, label, metric);
|
|
|
|
} else
|
|
|
|
connected_delete_ipv6(ifp, &addr->u.prefix6, NULL,
|
|
|
|
addr->prefixlen);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Linux kernel does not send route delete on interface down/addr del
|
|
|
|
* so we have to re-process routes it owns (i.e. kernel routes)
|
|
|
|
*/
|
|
|
|
if (op != DPLANE_OP_INTF_ADDR_ADD)
|
|
|
|
rib_update(RIB_UPDATE_KERNEL);
|
2022-01-26 06:07:57 +01:00
|
|
|
}
|
2021-09-08 21:58:04 +02:00
|
|
|
|
2022-01-26 06:07:57 +01:00
|
|
|
static void zebra_if_update_ctx(struct zebra_dplane_ctx *ctx,
|
|
|
|
struct interface *ifp)
|
|
|
|
{
|
|
|
|
enum zebra_dplane_result dp_res;
|
|
|
|
struct zebra_if *zif;
|
2022-01-31 22:12:01 +01:00
|
|
|
bool pd_reason_val;
|
2022-01-26 06:07:57 +01:00
|
|
|
bool down;
|
|
|
|
|
|
|
|
dp_res = dplane_ctx_get_status(ctx);
|
2022-01-31 22:12:01 +01:00
|
|
|
pd_reason_val = dplane_ctx_get_intf_pd_reason_val(ctx);
|
2022-01-26 06:07:57 +01:00
|
|
|
down = dplane_ctx_intf_is_protodown(ctx);
|
|
|
|
|
|
|
|
if (IS_ZEBRA_DEBUG_KERNEL)
|
2022-01-31 22:12:01 +01:00
|
|
|
zlog_debug("%s: %s: if %s(%u) ctx-protodown %s ctx-reason %d",
|
2022-01-26 06:07:57 +01:00
|
|
|
__func__, dplane_op2str(dplane_ctx_get_op(ctx)),
|
|
|
|
ifp->name, ifp->ifindex, down ? "on" : "off",
|
2022-01-31 22:12:01 +01:00
|
|
|
pd_reason_val);
|
2022-01-26 06:07:57 +01:00
|
|
|
|
|
|
|
zif = ifp->info;
|
|
|
|
if (!zif) {
|
|
|
|
if (IS_ZEBRA_DEBUG_KERNEL)
|
|
|
|
zlog_debug("%s: if %s(%u) zebra info pointer is NULL",
|
|
|
|
__func__, ifp->name, ifp->ifindex);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (dp_res != ZEBRA_DPLANE_REQUEST_SUCCESS) {
|
|
|
|
if (IS_ZEBRA_DEBUG_KERNEL)
|
|
|
|
zlog_debug("%s: if %s(%u) dplane update failed",
|
|
|
|
__func__, ifp->name, ifp->ifindex);
|
2022-02-15 23:51:36 +01:00
|
|
|
goto done;
|
2022-01-26 06:07:57 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Update our info */
|
2022-02-16 00:21:18 +01:00
|
|
|
COND_FLAG(zif->flags, ZIF_FLAG_PROTODOWN, down);
|
2022-02-15 23:51:36 +01:00
|
|
|
|
|
|
|
done:
|
|
|
|
/* Clear our dplane flags */
|
2022-02-16 00:21:18 +01:00
|
|
|
UNSET_FLAG(zif->flags, ZIF_FLAG_SET_PROTODOWN);
|
|
|
|
UNSET_FLAG(zif->flags, ZIF_FLAG_UNSET_PROTODOWN);
|
2021-07-14 19:06:41 +02:00
|
|
|
}
|
|
|
|
|
2021-10-28 17:23:31 +02:00
|
|
|
/*
|
|
|
|
* Handle netconf change from a dplane context object; runs in the main
|
|
|
|
* pthread so it can update zebra data structs.
|
|
|
|
*/
|
2022-01-26 06:07:57 +01:00
|
|
|
static void zebra_if_netconf_update_ctx(struct zebra_dplane_ctx *ctx,
|
2022-06-27 21:30:55 +02:00
|
|
|
struct interface *ifp,
|
|
|
|
ifindex_t ifindex)
|
2021-10-28 17:23:31 +02:00
|
|
|
{
|
2022-06-27 21:30:55 +02:00
|
|
|
struct zebra_if *zif = NULL;
|
2022-06-27 21:11:45 +02:00
|
|
|
afi_t afi;
|
2022-06-27 21:04:21 +02:00
|
|
|
enum dplane_netconf_status_e mpls, mcast_on, linkdown;
|
2022-06-27 21:11:45 +02:00
|
|
|
bool *mcast_set, *linkdown_set;
|
2021-10-28 17:23:31 +02:00
|
|
|
|
2023-04-27 05:02:09 +02:00
|
|
|
if (!ifp && ifindex != -1 && ifindex != -2) {
|
|
|
|
if (IS_ZEBRA_DEBUG_KERNEL)
|
|
|
|
zlog_debug("%s: Can't find ifp(%u)", __func__, ifindex);
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2022-06-27 21:11:45 +02:00
|
|
|
afi = dplane_ctx_get_afi(ctx);
|
2021-10-28 17:23:31 +02:00
|
|
|
mpls = dplane_ctx_get_netconf_mpls(ctx);
|
2022-06-27 21:30:55 +02:00
|
|
|
linkdown = dplane_ctx_get_netconf_linkdown(ctx);
|
|
|
|
mcast_on = dplane_ctx_get_netconf_mcast(ctx);
|
2021-10-28 17:23:31 +02:00
|
|
|
|
2022-06-27 21:30:55 +02:00
|
|
|
if (ifindex == DPLANE_NETCONF_IFINDEX_ALL) {
|
|
|
|
if (afi == AFI_IP) {
|
|
|
|
mcast_set = &zrouter.all_mc_forwardingv4;
|
|
|
|
linkdown_set = &zrouter.all_linkdownv4;
|
|
|
|
} else {
|
|
|
|
mcast_set = &zrouter.all_mc_forwardingv6;
|
|
|
|
linkdown_set = &zrouter.all_linkdownv6;
|
|
|
|
}
|
|
|
|
} else if (ifindex == DPLANE_NETCONF_IFINDEX_DEFAULT) {
|
|
|
|
if (afi == AFI_IP) {
|
|
|
|
mcast_set = &zrouter.default_mc_forwardingv4;
|
|
|
|
linkdown_set = &zrouter.default_linkdownv4;
|
|
|
|
} else {
|
|
|
|
mcast_set = &zrouter.default_mc_forwardingv6;
|
|
|
|
linkdown_set = &zrouter.default_linkdownv6;
|
|
|
|
}
|
2022-06-27 21:11:45 +02:00
|
|
|
} else {
|
2022-06-27 21:30:55 +02:00
|
|
|
zif = ifp ? ifp->info : NULL;
|
|
|
|
if (!zif) {
|
|
|
|
if (IS_ZEBRA_DEBUG_KERNEL)
|
|
|
|
zlog_debug(
|
|
|
|
"%s: if %s(%u) zebra info pointer is NULL",
|
2023-01-19 14:32:18 +01:00
|
|
|
__func__, ifp ? ifp->name : "(null)",
|
|
|
|
ifp ? ifp->ifindex : ifindex);
|
2022-06-27 21:30:55 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (afi == AFI_IP) {
|
|
|
|
mcast_set = &zif->v4mcast_on;
|
|
|
|
linkdown_set = &zif->linkdown;
|
|
|
|
} else {
|
|
|
|
mcast_set = &zif->v6mcast_on;
|
|
|
|
linkdown_set = &zif->linkdownv6;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* mpls netconf data is neither v4 or v6 it's AF_MPLS!
|
|
|
|
*/
|
2022-06-28 20:58:55 +02:00
|
|
|
if (mpls == DPLANE_NETCONF_STATUS_ENABLED) {
|
2022-06-27 21:30:55 +02:00
|
|
|
zif->mpls = true;
|
2022-06-28 20:58:55 +02:00
|
|
|
zebra_mpls_turned_on();
|
|
|
|
} else if (mpls == DPLANE_NETCONF_STATUS_DISABLED)
|
2022-06-27 21:30:55 +02:00
|
|
|
zif->mpls = false;
|
2022-06-27 21:11:45 +02:00
|
|
|
}
|
|
|
|
|
2022-06-23 17:00:08 +02:00
|
|
|
if (linkdown == DPLANE_NETCONF_STATUS_ENABLED)
|
2022-06-27 21:11:45 +02:00
|
|
|
*linkdown_set = true;
|
2022-06-23 17:00:08 +02:00
|
|
|
else if (linkdown == DPLANE_NETCONF_STATUS_DISABLED)
|
2022-06-27 21:11:45 +02:00
|
|
|
*linkdown_set = false;
|
2022-06-23 17:00:08 +02:00
|
|
|
|
2022-06-27 21:04:21 +02:00
|
|
|
if (mcast_on == DPLANE_NETCONF_STATUS_ENABLED)
|
2022-06-27 21:11:45 +02:00
|
|
|
*mcast_set = true;
|
2022-06-27 21:04:21 +02:00
|
|
|
else if (mcast_on == DPLANE_NETCONF_STATUS_DISABLED)
|
2022-06-27 21:11:45 +02:00
|
|
|
*mcast_set = false;
|
2022-06-27 21:04:21 +02:00
|
|
|
|
2021-10-28 17:23:31 +02:00
|
|
|
if (IS_ZEBRA_DEBUG_KERNEL)
|
2022-06-27 21:04:21 +02:00
|
|
|
zlog_debug(
|
2022-06-27 21:11:45 +02:00
|
|
|
"%s: afi: %d if %s, ifindex %d, mpls %s mc_forwarding: %s linkdown %s",
|
2022-06-27 21:30:55 +02:00
|
|
|
__func__, afi, ifp ? ifp->name : "Global",
|
|
|
|
ifp ? ifp->ifindex : ifindex,
|
|
|
|
(zif ? (zif->mpls ? "ON" : "OFF") : "OFF"),
|
|
|
|
(*mcast_set ? "ON" : "OFF"),
|
2022-06-27 21:11:45 +02:00
|
|
|
(*linkdown_set ? "ON" : "OFF"));
|
2022-01-26 06:07:57 +01:00
|
|
|
}
|
|
|
|
|
2023-04-27 05:02:09 +02:00
|
|
|
static void interface_vrf_change(enum dplane_op_e op, ifindex_t ifindex,
|
|
|
|
const char *name, uint32_t tableid,
|
|
|
|
ns_id_t ns_id)
|
|
|
|
{
|
|
|
|
struct vrf *vrf;
|
|
|
|
struct zebra_vrf *zvrf = NULL;
|
|
|
|
|
|
|
|
if (op == DPLANE_OP_INTF_DELETE) {
|
|
|
|
if (IS_ZEBRA_DEBUG_DPLANE)
|
|
|
|
zlog_debug("DPLANE_OP_INTF_DELETE for VRF %s(%u)", name,
|
|
|
|
ifindex);
|
|
|
|
|
|
|
|
vrf = vrf_lookup_by_id((vrf_id_t)ifindex);
|
|
|
|
if (!vrf) {
|
|
|
|
flog_warn(EC_ZEBRA_VRF_NOT_FOUND,
|
|
|
|
"%s(%u): vrf not found", name, ifindex);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
vrf_delete(vrf);
|
|
|
|
} else {
|
|
|
|
if (IS_ZEBRA_DEBUG_DPLANE)
|
|
|
|
zlog_debug(
|
|
|
|
"DPLANE_OP_INTF_UPDATE for VRF %s(%u) table %u",
|
|
|
|
name, ifindex, tableid);
|
|
|
|
|
|
|
|
if (!vrf_lookup_by_id((vrf_id_t)ifindex)) {
|
|
|
|
vrf_id_t exist_id;
|
|
|
|
|
|
|
|
exist_id = zebra_vrf_lookup_by_table(tableid, ns_id);
|
|
|
|
if (exist_id != VRF_DEFAULT) {
|
|
|
|
vrf = vrf_lookup_by_id(exist_id);
|
|
|
|
|
|
|
|
flog_err(
|
|
|
|
EC_ZEBRA_VRF_MISCONFIGURED,
|
|
|
|
"VRF %s id %u table id overlaps existing vrf %s(%d), misconfiguration exiting",
|
|
|
|
name, ifindex, vrf->name, vrf->vrf_id);
|
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
vrf = vrf_update((vrf_id_t)ifindex, name);
|
|
|
|
if (!vrf) {
|
|
|
|
flog_err(EC_LIB_INTERFACE, "VRF %s id %u not created",
|
|
|
|
name, ifindex);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This is the only place that we get the actual kernel table_id
|
|
|
|
* being used. We need it to set the table_id of the routes
|
|
|
|
* we are passing to the kernel.... And to throw some totally
|
|
|
|
* awesome parties. that too.
|
|
|
|
*
|
|
|
|
* At this point we *must* have a zvrf because the vrf_create
|
|
|
|
* callback creates one. We *must* set the table id
|
|
|
|
* before the vrf_enable because of( at the very least )
|
|
|
|
* static routes being delayed for installation until
|
|
|
|
* during the vrf_enable callbacks.
|
|
|
|
*/
|
|
|
|
zvrf = (struct zebra_vrf *)vrf->info;
|
|
|
|
zvrf->table_id = tableid;
|
|
|
|
|
|
|
|
/* Enable the created VRF. */
|
|
|
|
if (!vrf_enable(vrf)) {
|
|
|
|
flog_err(EC_LIB_INTERFACE,
|
|
|
|
"Failed to enable VRF %s id %u", name,
|
|
|
|
ifindex);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Note: on netlink systems, there should be a 1-to-1 mapping
|
|
|
|
* between interface names and ifindex values.
|
|
|
|
*/
|
|
|
|
static void set_ifindex(struct interface *ifp, ifindex_t ifi_index,
|
|
|
|
struct zebra_ns *zns)
|
|
|
|
{
|
|
|
|
struct interface *oifp;
|
|
|
|
|
|
|
|
oifp = if_lookup_by_index_per_ns(zns, ifi_index);
|
|
|
|
if ((oifp != NULL) && (oifp != ifp)) {
|
|
|
|
if (ifi_index == IFINDEX_INTERNAL)
|
|
|
|
flog_err(
|
|
|
|
EC_LIB_INTERFACE,
|
|
|
|
"Netlink is setting interface %s ifindex to reserved internal value %u",
|
|
|
|
ifp->name, ifi_index);
|
|
|
|
else {
|
|
|
|
if (IS_ZEBRA_DEBUG_KERNEL)
|
|
|
|
zlog_debug(
|
|
|
|
"interface index %d was renamed from %s to %s",
|
|
|
|
ifi_index, oifp->name, ifp->name);
|
|
|
|
if (if_is_up(oifp))
|
|
|
|
flog_err(
|
|
|
|
EC_LIB_INTERFACE,
|
|
|
|
"interface rename detected on up interface: index %d was renamed from %s to %s, results are uncertain!",
|
|
|
|
ifi_index, oifp->name, ifp->name);
|
|
|
|
if_delete_update(&oifp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if_set_index(ifp, ifi_index);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void zebra_if_set_ziftype(struct interface *ifp,
|
|
|
|
enum zebra_iftype zif_type,
|
|
|
|
enum zebra_slave_iftype zif_slave_type)
|
|
|
|
{
|
|
|
|
struct zebra_if *zif;
|
|
|
|
|
|
|
|
zif = (struct zebra_if *)ifp->info;
|
|
|
|
zif->zif_slave_type = zif_slave_type;
|
|
|
|
|
|
|
|
if (zif->zif_type != zif_type) {
|
|
|
|
zif->zif_type = zif_type;
|
|
|
|
/* If the if_type has been set to bond initialize ES info
|
|
|
|
* against it. XXX - note that we don't handle the case where
|
|
|
|
* a zif changes from bond to non-bond; it is really
|
|
|
|
* an unexpected/error condition.
|
|
|
|
*/
|
|
|
|
zebra_evpn_if_init(zif);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void interface_update_hw_addr(struct zebra_dplane_ctx *ctx,
|
|
|
|
struct interface *ifp)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
ifp->hw_addr_len = dplane_ctx_get_ifp_hw_addr_len(ctx);
|
|
|
|
memcpy(ifp->hw_addr, dplane_ctx_get_ifp_hw_addr(ctx), ifp->hw_addr_len);
|
|
|
|
|
|
|
|
for (i = 0; i < ifp->hw_addr_len; i++)
|
|
|
|
if (ifp->hw_addr[i] != 0)
|
|
|
|
break;
|
|
|
|
|
|
|
|
if (i == ifp->hw_addr_len)
|
|
|
|
ifp->hw_addr_len = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void interface_update_l2info(struct zebra_dplane_ctx *ctx,
|
|
|
|
struct interface *ifp,
|
|
|
|
enum zebra_iftype zif_type, int add,
|
|
|
|
ns_id_t link_nsid)
|
|
|
|
{
|
|
|
|
const struct zebra_l2info_vxlan *vxlan_info;
|
|
|
|
const struct zebra_l2info_gre *gre_info;
|
|
|
|
|
|
|
|
switch (zif_type) {
|
|
|
|
case ZEBRA_IF_BRIDGE:
|
|
|
|
zebra_l2_bridge_add_update(ifp,
|
|
|
|
dplane_ctx_get_ifp_bridge_info(ctx));
|
|
|
|
break;
|
|
|
|
case ZEBRA_IF_VLAN:
|
|
|
|
zebra_l2_vlanif_update(ifp, dplane_ctx_get_ifp_vlan_info(ctx));
|
|
|
|
zebra_evpn_acc_bd_svi_set(ifp->info, NULL,
|
|
|
|
!!if_is_operative(ifp));
|
|
|
|
break;
|
|
|
|
case ZEBRA_IF_VXLAN:
|
|
|
|
vxlan_info = dplane_ctx_get_ifp_vxlan_info(ctx);
|
|
|
|
zebra_l2_vxlanif_add_update(ifp, vxlan_info, add);
|
|
|
|
if (link_nsid != NS_UNKNOWN && vxlan_info->ifindex_link)
|
|
|
|
zebra_if_update_link(ifp, vxlan_info->ifindex_link,
|
|
|
|
link_nsid);
|
|
|
|
break;
|
|
|
|
case ZEBRA_IF_GRE:
|
|
|
|
gre_info = dplane_ctx_get_ifp_gre_info(ctx);
|
|
|
|
zebra_l2_greif_add_update(ifp, gre_info, add);
|
|
|
|
if (link_nsid != NS_UNKNOWN && gre_info->ifindex_link)
|
|
|
|
zebra_if_update_link(ifp, gre_info->ifindex_link,
|
|
|
|
link_nsid);
|
|
|
|
break;
|
|
|
|
case ZEBRA_IF_OTHER:
|
|
|
|
case ZEBRA_IF_VRF:
|
|
|
|
case ZEBRA_IF_MACVLAN:
|
|
|
|
case ZEBRA_IF_VETH:
|
|
|
|
case ZEBRA_IF_BOND:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool is_if_protodown_reason_only_frr(uint32_t rc_bitfield)
|
|
|
|
{
|
|
|
|
uint8_t frr_protodown_r_bit = if_netlink_get_frr_protodown_r_bit();
|
|
|
|
|
|
|
|
return (rc_bitfield == (((uint32_t)1) << frr_protodown_r_bit));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void interface_if_protodown(struct interface *ifp, bool protodown,
|
|
|
|
uint32_t rc_bitfield)
|
|
|
|
{
|
|
|
|
struct zebra_if *zif = ifp->info;
|
|
|
|
bool old_protodown;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Set our reason code to note it wasn't us.
|
|
|
|
* If the reason we got from the kernel is ONLY frr though, don't
|
|
|
|
* set it.
|
|
|
|
*/
|
|
|
|
COND_FLAG(zif->protodown_rc, ZEBRA_PROTODOWN_EXTERNAL,
|
|
|
|
protodown && rc_bitfield &&
|
|
|
|
!is_if_protodown_reason_only_frr(rc_bitfield));
|
|
|
|
|
|
|
|
|
|
|
|
old_protodown = !!ZEBRA_IF_IS_PROTODOWN(zif);
|
|
|
|
if (protodown == old_protodown)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (IS_ZEBRA_DEBUG_EVPN_MH_ES || IS_ZEBRA_DEBUG_DPLANE)
|
|
|
|
zlog_debug("interface %s dplane change, protodown %s",
|
|
|
|
ifp->name, protodown ? "on" : "off");
|
|
|
|
|
|
|
|
/* Set protodown, respectively */
|
|
|
|
COND_FLAG(zif->flags, ZIF_FLAG_PROTODOWN, protodown);
|
|
|
|
|
|
|
|
if (zebra_evpn_is_es_bond_member(ifp)) {
|
|
|
|
/* Check it's not already being sent to the dplane first */
|
|
|
|
if (protodown &&
|
|
|
|
CHECK_FLAG(zif->flags, ZIF_FLAG_SET_PROTODOWN)) {
|
|
|
|
if (IS_ZEBRA_DEBUG_EVPN_MH_ES || IS_ZEBRA_DEBUG_KERNEL)
|
|
|
|
zlog_debug(
|
|
|
|
"bond mbr %s protodown on recv'd but already sent protodown on to the dplane",
|
|
|
|
ifp->name);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!protodown &&
|
|
|
|
CHECK_FLAG(zif->flags, ZIF_FLAG_UNSET_PROTODOWN)) {
|
|
|
|
if (IS_ZEBRA_DEBUG_EVPN_MH_ES || IS_ZEBRA_DEBUG_KERNEL)
|
|
|
|
zlog_debug(
|
|
|
|
"bond mbr %s protodown off recv'd but already sent protodown off to the dplane",
|
|
|
|
ifp->name);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (IS_ZEBRA_DEBUG_EVPN_MH_ES || IS_ZEBRA_DEBUG_KERNEL)
|
|
|
|
zlog_debug(
|
|
|
|
"bond mbr %s reinstate protodown %s in the dplane",
|
|
|
|
ifp->name, old_protodown ? "on" : "off");
|
|
|
|
|
|
|
|
if (old_protodown)
|
|
|
|
SET_FLAG(zif->flags, ZIF_FLAG_SET_PROTODOWN);
|
|
|
|
else
|
|
|
|
SET_FLAG(zif->flags, ZIF_FLAG_UNSET_PROTODOWN);
|
|
|
|
|
|
|
|
dplane_intf_update(zif->ifp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void if_sweep_protodown(struct zebra_if *zif)
|
|
|
|
{
|
|
|
|
bool protodown;
|
|
|
|
|
|
|
|
protodown = !!ZEBRA_IF_IS_PROTODOWN(zif);
|
|
|
|
|
|
|
|
if (!protodown)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (IS_ZEBRA_DEBUG_KERNEL)
|
|
|
|
zlog_debug("interface %s sweeping protodown %s reason 0x%x",
|
|
|
|
zif->ifp->name, protodown ? "on" : "off",
|
|
|
|
zif->protodown_rc);
|
|
|
|
|
|
|
|
/* Only clear our reason codes, leave external if it was set */
|
|
|
|
UNSET_FLAG(zif->protodown_rc, ZEBRA_PROTODOWN_ALL);
|
|
|
|
dplane_intf_update(zif->ifp);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
interface_bridge_vxlan_vlan_vni_map_update(struct zebra_dplane_ctx *ctx,
|
|
|
|
struct interface *ifp)
|
|
|
|
{
|
|
|
|
const struct zebra_vxlan_vni_array *vniarray =
|
|
|
|
dplane_ctx_get_ifp_vxlan_vni_array(ctx);
|
|
|
|
struct zebra_vxlan_vni vni_start, vni_end;
|
|
|
|
struct hash *vni_table = NULL;
|
|
|
|
struct zebra_vxlan_vni vni, *vnip;
|
|
|
|
vni_t vni_id;
|
|
|
|
vlanid_t vid;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
memset(&vni_start, 0, sizeof(vni_start));
|
|
|
|
memset(&vni_end, 0, sizeof(vni_end));
|
|
|
|
|
|
|
|
for (i = 0; i < vniarray->count; i++) {
|
|
|
|
uint16_t flags = vniarray->vnis[i].flags;
|
|
|
|
|
|
|
|
if (flags & DPLANE_BRIDGE_VLAN_INFO_RANGE_BEGIN) {
|
|
|
|
vni_start = vniarray->vnis[i];
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (flags & DPLANE_BRIDGE_VLAN_INFO_RANGE_END)
|
|
|
|
vni_end = vniarray->vnis[i];
|
|
|
|
|
|
|
|
if (!(flags & DPLANE_BRIDGE_VLAN_INFO_RANGE_END)) {
|
|
|
|
vni_start = vniarray->vnis[i];
|
|
|
|
vni_end = vniarray->vnis[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
if (IS_ZEBRA_DEBUG_DPLANE)
|
|
|
|
zlog_debug(
|
|
|
|
"Vlan-Vni(%d:%d-%d:%d) update for VxLAN IF %s(%u)",
|
|
|
|
vni_start.access_vlan, vni_end.access_vlan,
|
|
|
|
vni_start.vni, vni_end.vni, ifp->name,
|
|
|
|
ifp->ifindex);
|
|
|
|
|
|
|
|
if (!vni_table) {
|
|
|
|
vni_table = zebra_vxlan_vni_table_create();
|
|
|
|
if (!vni_table)
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (vid = vni_start.access_vlan, vni_id = vni_start.vni;
|
|
|
|
vid <= vni_end.access_vlan; vid++, vni_id++) {
|
|
|
|
|
|
|
|
memset(&vni, 0, sizeof(vni));
|
|
|
|
vni.vni = vni_id;
|
|
|
|
vni.access_vlan = vid;
|
|
|
|
vnip = hash_get(vni_table, &vni, zebra_vxlan_vni_alloc);
|
|
|
|
if (!vnip)
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
memset(&vni_start, 0, sizeof(vni_start));
|
|
|
|
memset(&vni_end, 0, sizeof(vni_end));
|
|
|
|
}
|
|
|
|
|
|
|
|
if (vni_table)
|
|
|
|
zebra_vxlan_if_vni_table_add_update(ifp, vni_table);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void interface_bridge_vxlan_update(struct zebra_dplane_ctx *ctx,
|
|
|
|
struct interface *ifp)
|
|
|
|
{
|
|
|
|
struct zebra_if *zif = ifp->info;
|
|
|
|
const struct zebra_dplane_bridge_vlan_info *bvinfo;
|
|
|
|
|
|
|
|
if (IS_ZEBRA_VXLAN_IF_SVD(zif))
|
|
|
|
interface_bridge_vxlan_vlan_vni_map_update(ctx, ifp);
|
|
|
|
|
|
|
|
bvinfo = dplane_ctx_get_ifp_bridge_vlan_info(ctx);
|
|
|
|
|
|
|
|
if (!(bvinfo->flags & DPLANE_BRIDGE_VLAN_INFO_PVID))
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (IS_ZEBRA_DEBUG_DPLANE)
|
|
|
|
zlog_debug("Access VLAN %u for VxLAN IF %s(%u)", bvinfo->vid,
|
|
|
|
ifp->name, ifp->ifindex);
|
|
|
|
|
|
|
|
zebra_l2_vxlanif_update_access_vlan(ifp, bvinfo->vid);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void interface_bridge_vlan_update(struct zebra_dplane_ctx *ctx,
|
|
|
|
struct interface *ifp)
|
|
|
|
{
|
|
|
|
struct zebra_if *zif = ifp->info;
|
|
|
|
const struct zebra_dplane_bridge_vlan_info_array *bvarray;
|
|
|
|
struct zebra_dplane_bridge_vlan_info bvinfo;
|
|
|
|
bitfield_t old_vlan_bitmap;
|
|
|
|
uint16_t vid_range_start = 0;
|
|
|
|
int32_t i;
|
|
|
|
|
|
|
|
/* cache the old bitmap addrs */
|
|
|
|
old_vlan_bitmap = zif->vlan_bitmap;
|
|
|
|
/* create a new bitmap space for re-eval */
|
|
|
|
bf_init(zif->vlan_bitmap, IF_VLAN_BITMAP_MAX);
|
|
|
|
|
|
|
|
/* Could we have multiple bridge vlan infos? */
|
|
|
|
bvarray = dplane_ctx_get_ifp_bridge_vlan_info_array(ctx);
|
|
|
|
if (!bvarray)
|
|
|
|
return;
|
|
|
|
|
|
|
|
for (i = 0; i < bvarray->count; i++) {
|
|
|
|
bvinfo = bvarray->array[i];
|
|
|
|
|
|
|
|
if (bvinfo.flags & DPLANE_BRIDGE_VLAN_INFO_RANGE_BEGIN) {
|
|
|
|
vid_range_start = bvinfo.vid;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!(bvinfo.flags & DPLANE_BRIDGE_VLAN_INFO_RANGE_END))
|
|
|
|
vid_range_start = bvinfo.vid;
|
|
|
|
|
|
|
|
zebra_vlan_bitmap_compute(ifp, vid_range_start, bvinfo.vid);
|
|
|
|
}
|
|
|
|
|
|
|
|
zebra_vlan_mbr_re_eval(ifp, old_vlan_bitmap);
|
|
|
|
bf_free(old_vlan_bitmap);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void interface_bridge_handling(struct zebra_dplane_ctx *ctx,
|
|
|
|
struct interface *ifp,
|
|
|
|
enum zebra_iftype zif_type)
|
|
|
|
{
|
|
|
|
struct zebra_if *zif;
|
|
|
|
|
|
|
|
if (!ifp) {
|
|
|
|
zlog_warn("Cannot find bridge if %s(%u)",
|
|
|
|
dplane_ctx_get_ifname(ctx),
|
|
|
|
dplane_ctx_get_ifindex(ctx));
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (IS_ZEBRA_IF_VXLAN(ifp))
|
|
|
|
return interface_bridge_vxlan_update(ctx, ifp);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* build vlan bitmap associated with this interface if that
|
|
|
|
* device type is interested in the vlans
|
|
|
|
*/
|
|
|
|
zif = ifp->info;
|
|
|
|
if (bf_is_inited(zif->vlan_bitmap))
|
|
|
|
interface_bridge_vlan_update(ctx, ifp);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void zebra_if_dplane_ifp_handling(struct zebra_dplane_ctx *ctx)
|
|
|
|
{
|
|
|
|
enum dplane_op_e op = dplane_ctx_get_op(ctx);
|
|
|
|
const char *name = dplane_ctx_get_ifname(ctx);
|
|
|
|
ns_id_t ns_id = dplane_ctx_get_ns_id(ctx);
|
|
|
|
ifindex_t ifindex = dplane_ctx_get_ifindex(ctx);
|
|
|
|
ifindex_t bond_ifindex = dplane_ctx_get_ifp_bond_ifindex(ctx);
|
|
|
|
uint32_t tableid = dplane_ctx_get_ifp_table_id(ctx);
|
|
|
|
enum zebra_iftype zif_type = dplane_ctx_get_ifp_zif_type(ctx);
|
|
|
|
struct interface *ifp;
|
|
|
|
struct zebra_ns *zns;
|
|
|
|
|
|
|
|
zns = zebra_ns_lookup(ns_id);
|
|
|
|
if (!zns) {
|
|
|
|
zlog_err("Where is our namespace?");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (IS_ZEBRA_DEBUG_DPLANE)
|
|
|
|
zlog_debug("%s for %s(%u)", dplane_op2str(op), name, ifindex);
|
|
|
|
|
|
|
|
ifp = if_lookup_by_name_per_ns(zns, name);
|
|
|
|
if (op == DPLANE_OP_INTF_DELETE) {
|
|
|
|
/* Delete interface notification from kernel */
|
|
|
|
if (ifp == NULL) {
|
|
|
|
if (IS_ZEBRA_DEBUG_EVENT)
|
|
|
|
zlog_debug(
|
|
|
|
"Delete LINK received for unknown interface %s(%u)",
|
|
|
|
name, ifindex);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (IS_ZEBRA_IF_BOND(ifp))
|
|
|
|
zebra_l2if_update_bond(ifp, false);
|
|
|
|
if (IS_ZEBRA_IF_BOND_SLAVE(ifp))
|
|
|
|
zebra_l2if_update_bond_slave(ifp, bond_ifindex, false);
|
|
|
|
/* Special handling for bridge or VxLAN interfaces. */
|
|
|
|
if (IS_ZEBRA_IF_BRIDGE(ifp))
|
|
|
|
zebra_l2_bridge_del(ifp);
|
|
|
|
else if (IS_ZEBRA_IF_VXLAN(ifp))
|
|
|
|
zebra_l2_vxlanif_del(ifp);
|
|
|
|
|
|
|
|
if_delete_update(&ifp);
|
|
|
|
|
|
|
|
if (zif_type == ZEBRA_IF_VRF && !vrf_is_backend_netns())
|
|
|
|
interface_vrf_change(op, ifindex, name, tableid, ns_id);
|
|
|
|
} else {
|
|
|
|
ifindex_t master_ifindex, bridge_ifindex, bond_ifindex,
|
|
|
|
link_ifindex;
|
|
|
|
enum zebra_slave_iftype zif_slave_type;
|
|
|
|
uint8_t bypass;
|
|
|
|
uint64_t flags;
|
|
|
|
vrf_id_t vrf_id;
|
|
|
|
uint32_t mtu;
|
|
|
|
ns_id_t link_nsid;
|
|
|
|
struct zebra_if *zif;
|
|
|
|
bool protodown, protodown_set, startup;
|
|
|
|
uint32_t rc_bitfield;
|
|
|
|
uint8_t old_hw_addr[INTERFACE_HWADDR_MAX];
|
|
|
|
char *desc;
|
|
|
|
uint8_t family;
|
|
|
|
|
|
|
|
/* If VRF, create or update the VRF structure itself. */
|
|
|
|
if (zif_type == ZEBRA_IF_VRF && !vrf_is_backend_netns())
|
|
|
|
interface_vrf_change(op, ifindex, name, tableid, ns_id);
|
|
|
|
|
|
|
|
master_ifindex = dplane_ctx_get_ifp_master_ifindex(ctx);
|
|
|
|
zif_slave_type = dplane_ctx_get_ifp_zif_slave_type(ctx);
|
|
|
|
bridge_ifindex = dplane_ctx_get_ifp_bridge_ifindex(ctx);
|
|
|
|
bond_ifindex = dplane_ctx_get_ifp_bond_ifindex(ctx);
|
|
|
|
bypass = dplane_ctx_get_ifp_bypass(ctx);
|
|
|
|
flags = dplane_ctx_get_ifp_flags(ctx);
|
|
|
|
vrf_id = dplane_ctx_get_ifp_vrf_id(ctx);
|
|
|
|
mtu = dplane_ctx_get_ifp_mtu(ctx);
|
|
|
|
link_ifindex = dplane_ctx_get_ifp_link_ifindex(ctx);
|
|
|
|
link_nsid = dplane_ctx_get_ifp_link_nsid(ctx);
|
|
|
|
protodown_set = dplane_ctx_get_ifp_protodown_set(ctx);
|
|
|
|
protodown = dplane_ctx_get_ifp_protodown(ctx);
|
|
|
|
rc_bitfield = dplane_ctx_get_ifp_rc_bitfield(ctx);
|
|
|
|
startup = dplane_ctx_get_ifp_startup(ctx);
|
|
|
|
desc = dplane_ctx_get_ifp_desc(ctx);
|
|
|
|
family = dplane_ctx_get_ifp_family(ctx);
|
|
|
|
|
|
|
|
#ifndef AF_BRIDGE
|
|
|
|
/*
|
|
|
|
* Work around to make free bsd happy at the moment
|
|
|
|
*/
|
|
|
|
#define AF_BRIDGE 7
|
|
|
|
#endif
|
|
|
|
if (family == AF_BRIDGE)
|
|
|
|
return interface_bridge_handling(ctx, ifp, zif_type);
|
|
|
|
|
|
|
|
if (ifp == NULL ||
|
|
|
|
!CHECK_FLAG(ifp->status, ZEBRA_INTERFACE_ACTIVE)) {
|
|
|
|
/* Add interface notification from kernel */
|
|
|
|
if (IS_ZEBRA_DEBUG_KERNEL)
|
|
|
|
zlog_debug(
|
|
|
|
"RTM_NEWLINK ADD for %s(%u) vrf_id %u type %d sl_type %d master %u",
|
|
|
|
name, ifindex, vrf_id, zif_type,
|
|
|
|
zif_slave_type, master_ifindex);
|
|
|
|
|
|
|
|
if (ifp == NULL) {
|
|
|
|
/* unknown interface */
|
|
|
|
ifp = if_get_by_name(name, vrf_id, NULL);
|
|
|
|
} else {
|
|
|
|
/* pre-configured interface, learnt now */
|
|
|
|
if (ifp->vrf->vrf_id != vrf_id)
|
|
|
|
if_update_to_new_vrf(ifp, vrf_id);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Update interface information. */
|
|
|
|
set_ifindex(ifp, ifindex, zns);
|
|
|
|
ifp->flags = flags;
|
|
|
|
ifp->mtu6 = ifp->mtu = mtu;
|
|
|
|
ifp->metric = 0;
|
|
|
|
ifp->speed = kernel_get_speed(ifp, NULL);
|
|
|
|
ifp->ptm_status = ZEBRA_PTM_STATUS_UNKNOWN;
|
|
|
|
|
|
|
|
/* Set interface type */
|
|
|
|
zebra_if_set_ziftype(ifp, zif_type, zif_slave_type);
|
|
|
|
if (IS_ZEBRA_IF_VRF(ifp))
|
|
|
|
SET_FLAG(ifp->status,
|
|
|
|
ZEBRA_INTERFACE_VRF_LOOPBACK);
|
|
|
|
|
|
|
|
/* Update link. */
|
|
|
|
zebra_if_update_link(ifp, link_ifindex, link_nsid);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Just set the @link/lower-device ifindex. During
|
|
|
|
* nldump interfaces are not ordered in any fashion so
|
|
|
|
* we may end up getting upper devices before lower
|
|
|
|
* devices. We will setup the real linkage once the dump
|
|
|
|
* is complete.
|
|
|
|
*/
|
|
|
|
zif = (struct zebra_if *)ifp->info;
|
|
|
|
zif->link_ifindex = link_ifindex;
|
|
|
|
|
|
|
|
ifp->ll_type = dplane_ctx_get_ifp_zltype(ctx);
|
|
|
|
interface_update_hw_addr(ctx, ifp);
|
|
|
|
|
|
|
|
/* Inform clients, install any configured addresses. */
|
|
|
|
if_add_update(ifp);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Extract and save L2 interface information, take
|
|
|
|
* additional actions.
|
|
|
|
*/
|
|
|
|
interface_update_l2info(ctx, ifp, zif_type, 1,
|
|
|
|
link_nsid);
|
|
|
|
if (IS_ZEBRA_IF_BOND(ifp))
|
|
|
|
zebra_l2if_update_bond(ifp, true);
|
|
|
|
if (IS_ZEBRA_IF_BRIDGE_SLAVE(ifp))
|
|
|
|
zebra_l2if_update_bridge_slave(
|
|
|
|
ifp, bridge_ifindex, ns_id,
|
|
|
|
ZEBRA_BRIDGE_NO_ACTION);
|
|
|
|
else if (IS_ZEBRA_IF_BOND_SLAVE(ifp))
|
|
|
|
zebra_l2if_update_bond_slave(ifp, bond_ifindex,
|
|
|
|
!!bypass);
|
|
|
|
|
|
|
|
if (protodown_set) {
|
|
|
|
interface_if_protodown(ifp, protodown,
|
|
|
|
rc_bitfield);
|
|
|
|
if (startup)
|
|
|
|
if_sweep_protodown(zif);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (IS_ZEBRA_IF_BRIDGE(ifp)) {
|
|
|
|
if (IS_ZEBRA_DEBUG_KERNEL)
|
|
|
|
zlog_debug(
|
|
|
|
"RTM_NEWLINK ADD for %s(%u), vlan-aware %d",
|
|
|
|
name, ifp->ifindex,
|
|
|
|
IS_ZEBRA_IF_BRIDGE_VLAN_AWARE(
|
|
|
|
zif));
|
|
|
|
}
|
|
|
|
} else if (ifp->vrf->vrf_id != vrf_id) {
|
|
|
|
/* VRF change for an interface. */
|
|
|
|
if (IS_ZEBRA_DEBUG_KERNEL)
|
|
|
|
zlog_debug(
|
|
|
|
"RTM_NEWLINK vrf-change for %s(%u) vrf_id %u -> %u",
|
|
|
|
name, ifp->ifindex, ifp->vrf->vrf_id,
|
|
|
|
vrf_id);
|
|
|
|
|
|
|
|
if_handle_vrf_change(ifp, vrf_id);
|
|
|
|
} else {
|
|
|
|
bool was_bridge_slave, was_bond_slave;
|
|
|
|
uint8_t chgflags = ZEBRA_BRIDGE_NO_ACTION;
|
|
|
|
|
|
|
|
zif = ifp->info;
|
|
|
|
|
|
|
|
/* Interface update. */
|
|
|
|
if (IS_ZEBRA_DEBUG_KERNEL)
|
|
|
|
zlog_debug(
|
|
|
|
"RTM_NEWLINK update for %s(%u) sl_type %d master %u",
|
|
|
|
name, ifp->ifindex, zif_slave_type,
|
|
|
|
master_ifindex);
|
|
|
|
|
|
|
|
set_ifindex(ifp, ifindex, zns);
|
|
|
|
ifp->mtu6 = ifp->mtu = mtu;
|
|
|
|
ifp->metric = 0;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Update interface type - NOTE: Only slave_type can
|
|
|
|
* change.
|
|
|
|
*/
|
|
|
|
was_bridge_slave = IS_ZEBRA_IF_BRIDGE_SLAVE(ifp);
|
|
|
|
was_bond_slave = IS_ZEBRA_IF_BOND_SLAVE(ifp);
|
|
|
|
zebra_if_set_ziftype(ifp, zif_type, zif_slave_type);
|
|
|
|
|
|
|
|
memcpy(old_hw_addr, ifp->hw_addr, INTERFACE_HWADDR_MAX);
|
|
|
|
|
|
|
|
/* Update link. */
|
|
|
|
zebra_if_update_link(ifp, link_ifindex, link_nsid);
|
|
|
|
|
|
|
|
ifp->ll_type = dplane_ctx_get_ifp_zltype(ctx);
|
|
|
|
interface_update_hw_addr(ctx, ifp);
|
|
|
|
|
|
|
|
if (protodown_set)
|
|
|
|
interface_if_protodown(ifp, protodown,
|
|
|
|
rc_bitfield);
|
|
|
|
|
|
|
|
if (if_is_no_ptm_operative(ifp)) {
|
|
|
|
bool is_up = if_is_operative(ifp);
|
|
|
|
|
|
|
|
ifp->flags = flags;
|
|
|
|
if (!if_is_no_ptm_operative(ifp) ||
|
|
|
|
CHECK_FLAG(zif->flags,
|
|
|
|
ZIF_FLAG_PROTODOWN)) {
|
|
|
|
if (IS_ZEBRA_DEBUG_KERNEL)
|
|
|
|
zlog_debug(
|
|
|
|
"Intf %s(%u) has gone DOWN",
|
|
|
|
name, ifp->ifindex);
|
|
|
|
if_down(ifp);
|
|
|
|
rib_update(RIB_UPDATE_KERNEL);
|
|
|
|
} else if (if_is_operative(ifp)) {
|
|
|
|
bool mac_updated = false;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Must notify client daemons of new
|
|
|
|
* interface status.
|
|
|
|
*/
|
|
|
|
if (IS_ZEBRA_DEBUG_KERNEL)
|
|
|
|
zlog_debug(
|
|
|
|
"Intf %s(%u) PTM up, notifying clients",
|
|
|
|
name, ifp->ifindex);
|
|
|
|
if_up(ifp, !is_up);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Update EVPN VNI when SVI MAC change
|
|
|
|
*/
|
|
|
|
if (memcmp(old_hw_addr, ifp->hw_addr,
|
|
|
|
INTERFACE_HWADDR_MAX))
|
|
|
|
mac_updated = true;
|
|
|
|
if (IS_ZEBRA_IF_VLAN(ifp) &&
|
|
|
|
mac_updated) {
|
|
|
|
struct interface *link_if;
|
|
|
|
|
|
|
|
link_if = if_lookup_by_index_per_ns(
|
|
|
|
zebra_ns_lookup(
|
|
|
|
NS_DEFAULT),
|
|
|
|
link_ifindex);
|
|
|
|
if (link_if)
|
|
|
|
zebra_vxlan_svi_up(
|
|
|
|
ifp, link_if);
|
|
|
|
} else if (mac_updated &&
|
|
|
|
IS_ZEBRA_IF_BRIDGE(ifp)) {
|
|
|
|
zlog_debug(
|
|
|
|
"Intf %s(%u) bridge changed MAC address",
|
|
|
|
name, ifp->ifindex);
|
|
|
|
chgflags =
|
|
|
|
ZEBRA_BRIDGE_MASTER_MAC_CHANGE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
ifp->flags = flags;
|
|
|
|
if (if_is_operative(ifp) &&
|
|
|
|
!CHECK_FLAG(zif->flags,
|
|
|
|
ZIF_FLAG_PROTODOWN)) {
|
|
|
|
if (IS_ZEBRA_DEBUG_KERNEL)
|
|
|
|
zlog_debug(
|
|
|
|
"Intf %s(%u) has come UP",
|
|
|
|
name, ifp->ifindex);
|
|
|
|
if_up(ifp, true);
|
|
|
|
if (IS_ZEBRA_IF_BRIDGE(ifp))
|
|
|
|
chgflags =
|
|
|
|
ZEBRA_BRIDGE_MASTER_UP;
|
|
|
|
} else {
|
|
|
|
if (IS_ZEBRA_DEBUG_KERNEL)
|
|
|
|
zlog_debug(
|
|
|
|
"Intf %s(%u) has gone DOWN",
|
|
|
|
name, ifp->ifindex);
|
|
|
|
if_down(ifp);
|
|
|
|
rib_update(RIB_UPDATE_KERNEL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Extract and save L2 interface information, take
|
|
|
|
* additional actions.
|
|
|
|
*/
|
|
|
|
interface_update_l2info(ctx, ifp, zif_type, 0,
|
|
|
|
link_nsid);
|
|
|
|
if (IS_ZEBRA_IF_BRIDGE(ifp))
|
|
|
|
zebra_l2if_update_bridge(ifp, chgflags);
|
|
|
|
if (IS_ZEBRA_IF_BOND(ifp))
|
|
|
|
zebra_l2if_update_bond(ifp, true);
|
|
|
|
if (IS_ZEBRA_IF_BRIDGE_SLAVE(ifp) || was_bridge_slave)
|
|
|
|
zebra_l2if_update_bridge_slave(
|
|
|
|
ifp, bridge_ifindex, ns_id, chgflags);
|
|
|
|
else if (IS_ZEBRA_IF_BOND_SLAVE(ifp) || was_bond_slave)
|
|
|
|
zebra_l2if_update_bond_slave(ifp, bond_ifindex,
|
|
|
|
!!bypass);
|
|
|
|
if (IS_ZEBRA_IF_BRIDGE(ifp)) {
|
|
|
|
if (IS_ZEBRA_DEBUG_KERNEL)
|
|
|
|
zlog_debug(
|
|
|
|
"RTM_NEWLINK update for %s(%u), vlan-aware %d",
|
|
|
|
name, ifp->ifindex,
|
|
|
|
IS_ZEBRA_IF_BRIDGE_VLAN_AWARE(
|
|
|
|
zif));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
zif = ifp->info;
|
|
|
|
if (zif) {
|
|
|
|
XFREE(MTYPE_ZIF_DESC, zif->desc);
|
|
|
|
if (desc[0])
|
|
|
|
zif->desc = XSTRDUP(MTYPE_ZIF_DESC, desc);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-26 06:07:57 +01:00
|
|
|
void zebra_if_dplane_result(struct zebra_dplane_ctx *ctx)
|
|
|
|
{
|
|
|
|
struct zebra_ns *zns;
|
|
|
|
struct interface *ifp;
|
|
|
|
ns_id_t ns_id;
|
|
|
|
enum dplane_op_e op;
|
|
|
|
enum zebra_dplane_result dp_res;
|
|
|
|
ifindex_t ifindex;
|
|
|
|
|
|
|
|
ns_id = dplane_ctx_get_ns_id(ctx);
|
|
|
|
dp_res = dplane_ctx_get_status(ctx);
|
|
|
|
op = dplane_ctx_get_op(ctx);
|
|
|
|
ifindex = dplane_ctx_get_ifindex(ctx);
|
|
|
|
|
|
|
|
if (IS_ZEBRA_DEBUG_DPLANE_DETAIL || IS_ZEBRA_DEBUG_KERNEL)
|
|
|
|
zlog_debug("Intf dplane ctx %p, op %s, ifindex (%u), result %s",
|
|
|
|
ctx, dplane_op2str(op), ifindex,
|
|
|
|
dplane_res2str(dp_res));
|
|
|
|
|
|
|
|
zns = zebra_ns_lookup(ns_id);
|
|
|
|
if (zns == NULL) {
|
|
|
|
/* No ns - deleted maybe? */
|
|
|
|
if (IS_ZEBRA_DEBUG_KERNEL)
|
|
|
|
zlog_debug("%s: can't find zns id %u", __func__, ns_id);
|
|
|
|
|
2022-06-29 21:24:20 +02:00
|
|
|
return;
|
2022-01-26 06:07:57 +01:00
|
|
|
}
|
2021-10-28 17:23:31 +02:00
|
|
|
|
2022-01-26 06:07:57 +01:00
|
|
|
ifp = if_lookup_by_index_per_ns(zns, ifindex);
|
|
|
|
|
|
|
|
switch (op) {
|
|
|
|
case DPLANE_OP_INTF_ADDR_ADD:
|
|
|
|
case DPLANE_OP_INTF_ADDR_DEL:
|
|
|
|
zebra_if_addr_update_ctx(ctx, ifp);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case DPLANE_OP_INTF_INSTALL:
|
|
|
|
case DPLANE_OP_INTF_UPDATE:
|
|
|
|
case DPLANE_OP_INTF_DELETE:
|
2023-04-27 05:02:09 +02:00
|
|
|
/*
|
|
|
|
* Queued from the dplane means it is something
|
|
|
|
* that we need to handle( create/delete the
|
|
|
|
* interface as needed )
|
|
|
|
*/
|
|
|
|
if (dp_res == ZEBRA_DPLANE_REQUEST_QUEUED)
|
|
|
|
zebra_if_dplane_ifp_handling(ctx);
|
|
|
|
else
|
|
|
|
zebra_if_update_ctx(ctx, ifp);
|
2022-01-26 06:07:57 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DPLANE_OP_INTF_NETCONFIG:
|
2022-06-27 21:30:55 +02:00
|
|
|
zebra_if_netconf_update_ctx(ctx, ifp, ifindex);
|
2022-01-26 06:07:57 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DPLANE_OP_ROUTE_INSTALL:
|
|
|
|
case DPLANE_OP_ROUTE_UPDATE:
|
|
|
|
case DPLANE_OP_ROUTE_DELETE:
|
|
|
|
case DPLANE_OP_NH_DELETE:
|
|
|
|
case DPLANE_OP_NH_INSTALL:
|
|
|
|
case DPLANE_OP_NH_UPDATE:
|
|
|
|
case DPLANE_OP_ROUTE_NOTIFY:
|
|
|
|
case DPLANE_OP_LSP_INSTALL:
|
|
|
|
case DPLANE_OP_LSP_UPDATE:
|
|
|
|
case DPLANE_OP_LSP_DELETE:
|
|
|
|
case DPLANE_OP_LSP_NOTIFY:
|
|
|
|
case DPLANE_OP_PW_INSTALL:
|
|
|
|
case DPLANE_OP_PW_UNINSTALL:
|
|
|
|
case DPLANE_OP_SYS_ROUTE_ADD:
|
|
|
|
case DPLANE_OP_SYS_ROUTE_DELETE:
|
|
|
|
case DPLANE_OP_ADDR_INSTALL:
|
|
|
|
case DPLANE_OP_ADDR_UNINSTALL:
|
|
|
|
case DPLANE_OP_MAC_INSTALL:
|
|
|
|
case DPLANE_OP_MAC_DELETE:
|
|
|
|
case DPLANE_OP_NEIGH_INSTALL:
|
|
|
|
case DPLANE_OP_NEIGH_UPDATE:
|
|
|
|
case DPLANE_OP_NEIGH_DELETE:
|
|
|
|
case DPLANE_OP_NEIGH_IP_INSTALL:
|
|
|
|
case DPLANE_OP_NEIGH_IP_DELETE:
|
|
|
|
case DPLANE_OP_VTEP_ADD:
|
|
|
|
case DPLANE_OP_VTEP_DELETE:
|
|
|
|
case DPLANE_OP_RULE_ADD:
|
|
|
|
case DPLANE_OP_RULE_DELETE:
|
|
|
|
case DPLANE_OP_RULE_UPDATE:
|
|
|
|
case DPLANE_OP_NEIGH_DISCOVER:
|
|
|
|
case DPLANE_OP_BR_PORT_UPDATE:
|
|
|
|
case DPLANE_OP_NONE:
|
|
|
|
case DPLANE_OP_IPTABLE_ADD:
|
|
|
|
case DPLANE_OP_IPTABLE_DELETE:
|
|
|
|
case DPLANE_OP_IPSET_ADD:
|
|
|
|
case DPLANE_OP_IPSET_DELETE:
|
|
|
|
case DPLANE_OP_IPSET_ENTRY_ADD:
|
|
|
|
case DPLANE_OP_IPSET_ENTRY_DELETE:
|
|
|
|
case DPLANE_OP_NEIGH_TABLE_UPDATE:
|
|
|
|
case DPLANE_OP_GRE_SET:
|
2022-09-06 09:10:11 +02:00
|
|
|
case DPLANE_OP_TC_QDISC_INSTALL:
|
|
|
|
case DPLANE_OP_TC_QDISC_UNINSTALL:
|
|
|
|
case DPLANE_OP_TC_CLASS_ADD:
|
|
|
|
case DPLANE_OP_TC_CLASS_DELETE:
|
|
|
|
case DPLANE_OP_TC_CLASS_UPDATE:
|
|
|
|
case DPLANE_OP_TC_FILTER_ADD:
|
|
|
|
case DPLANE_OP_TC_FILTER_DELETE:
|
|
|
|
case DPLANE_OP_TC_FILTER_UPDATE:
|
2023-04-20 14:51:42 +02:00
|
|
|
case DPLANE_OP_STARTUP_STAGE:
|
2022-01-26 06:07:57 +01:00
|
|
|
break; /* should never hit here */
|
|
|
|
}
|
2021-10-28 17:23:31 +02:00
|
|
|
}
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* Dump if address information to vty. */
|
2021-08-02 20:38:26 +02:00
|
|
|
static void connected_dump_vty(struct vty *vty, json_object *json,
|
|
|
|
struct connected *connected)
|
2002-12-13 21:15:29 +01:00
|
|
|
{
|
|
|
|
struct prefix *p;
|
2021-08-02 20:38:26 +02:00
|
|
|
json_object *json_addr = NULL;
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
/* Print interface address. */
|
|
|
|
p = connected->address;
|
2021-08-02 20:38:26 +02:00
|
|
|
|
|
|
|
if (json) {
|
|
|
|
json_addr = json_object_new_object();
|
|
|
|
json_object_array_add(json, json_addr);
|
2021-11-25 16:28:12 +01:00
|
|
|
json_object_string_addf(json_addr, "address", "%pFX", p);
|
2021-08-02 20:38:26 +02:00
|
|
|
} else {
|
|
|
|
vty_out(vty, " %s %pFX", prefix_family_str(p), p);
|
|
|
|
}
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
/* If there is destination address, print it. */
|
2019-08-10 11:52:03 +02:00
|
|
|
if (CONNECTED_PEER(connected) && connected->destination) {
|
2021-08-02 20:38:26 +02:00
|
|
|
if (json) {
|
2021-11-25 16:28:12 +01:00
|
|
|
json_object_string_addf(json_addr, "peer", "%pFX",
|
|
|
|
connected->destination);
|
2021-08-02 20:38:26 +02:00
|
|
|
} else {
|
|
|
|
vty_out(vty, " peer %pFX", connected->destination);
|
|
|
|
}
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
|
|
|
|
2021-08-02 20:38:26 +02:00
|
|
|
if (json)
|
|
|
|
json_object_boolean_add(
|
|
|
|
json_addr, "secondary",
|
|
|
|
CHECK_FLAG(connected->flags, ZEBRA_IFA_SECONDARY));
|
|
|
|
else if (CHECK_FLAG(connected->flags, ZEBRA_IFA_SECONDARY))
|
2002-12-13 21:15:29 +01:00
|
|
|
vty_out(vty, " secondary");
|
|
|
|
|
2021-08-02 20:38:26 +02:00
|
|
|
if (json)
|
|
|
|
json_object_boolean_add(
|
|
|
|
json_addr, "unnumbered",
|
|
|
|
CHECK_FLAG(connected->flags, ZEBRA_IFA_UNNUMBERED));
|
|
|
|
else if (CHECK_FLAG(connected->flags, ZEBRA_IFA_UNNUMBERED))
|
2015-05-20 02:58:13 +02:00
|
|
|
vty_out(vty, " unnumbered");
|
|
|
|
|
2021-08-02 20:38:26 +02:00
|
|
|
if (connected->label) {
|
|
|
|
if (json)
|
|
|
|
json_object_string_add(json_addr, "label",
|
|
|
|
connected->label);
|
|
|
|
else
|
|
|
|
vty_out(vty, " %s", connected->label);
|
|
|
|
}
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2021-08-02 20:38:26 +02:00
|
|
|
if (!json)
|
|
|
|
vty_out(vty, "\n");
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
|
|
|
|
2015-05-20 02:40:40 +02:00
|
|
|
/* Dump interface neighbor address information to vty. */
|
2021-08-02 20:38:26 +02:00
|
|
|
static void nbr_connected_dump_vty(struct vty *vty, json_object *json,
|
2015-05-20 02:40:40 +02:00
|
|
|
struct nbr_connected *connected)
|
|
|
|
{
|
|
|
|
struct prefix *p;
|
2021-08-02 20:38:26 +02:00
|
|
|
char buf[PREFIX2STR_BUFFER];
|
2015-05-20 02:40:40 +02:00
|
|
|
|
|
|
|
/* Print interface address. */
|
|
|
|
p = connected->address;
|
2021-08-02 20:38:26 +02:00
|
|
|
if (json)
|
|
|
|
json_array_string_add(json, prefix2str(p, buf, sizeof(buf)));
|
|
|
|
else
|
|
|
|
vty_out(vty, " %s %pFX\n", prefix_family_str(p), p);
|
2015-05-20 02:40:40 +02:00
|
|
|
}
|
|
|
|
|
2021-08-30 19:27:02 +02:00
|
|
|
static const char *
|
|
|
|
zebra_zifslavetype_2str(enum zebra_slave_iftype zif_slave_type)
|
2019-09-27 15:12:27 +02:00
|
|
|
{
|
|
|
|
switch (zif_slave_type) {
|
|
|
|
case ZEBRA_IF_SLAVE_BRIDGE:
|
|
|
|
return "Bridge";
|
|
|
|
case ZEBRA_IF_SLAVE_VRF:
|
|
|
|
return "Vrf";
|
|
|
|
case ZEBRA_IF_SLAVE_BOND:
|
|
|
|
return "Bond";
|
|
|
|
case ZEBRA_IF_SLAVE_OTHER:
|
|
|
|
return "Other";
|
|
|
|
case ZEBRA_IF_SLAVE_NONE:
|
|
|
|
return "None";
|
|
|
|
}
|
|
|
|
return "None";
|
|
|
|
}
|
|
|
|
|
2021-08-30 19:24:26 +02:00
|
|
|
static const char *zebra_ziftype_2str(enum zebra_iftype zif_type)
|
2017-05-15 07:31:08 +02:00
|
|
|
{
|
|
|
|
switch (zif_type) {
|
|
|
|
case ZEBRA_IF_OTHER:
|
|
|
|
return "Other";
|
|
|
|
|
|
|
|
case ZEBRA_IF_BRIDGE:
|
|
|
|
return "Bridge";
|
|
|
|
|
|
|
|
case ZEBRA_IF_VLAN:
|
|
|
|
return "Vlan";
|
|
|
|
|
|
|
|
case ZEBRA_IF_VXLAN:
|
|
|
|
return "Vxlan";
|
|
|
|
|
|
|
|
case ZEBRA_IF_VRF:
|
|
|
|
return "VRF";
|
|
|
|
|
2018-08-29 11:29:07 +02:00
|
|
|
case ZEBRA_IF_VETH:
|
|
|
|
return "VETH";
|
|
|
|
|
2018-11-10 21:54:43 +01:00
|
|
|
case ZEBRA_IF_BOND:
|
|
|
|
return "bond";
|
|
|
|
|
|
|
|
case ZEBRA_IF_MACVLAN:
|
|
|
|
return "macvlan";
|
|
|
|
|
2019-12-19 18:33:56 +01:00
|
|
|
case ZEBRA_IF_GRE:
|
|
|
|
return "GRE";
|
|
|
|
|
2017-05-15 07:31:08 +02:00
|
|
|
default:
|
|
|
|
return "Unknown";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-11-07 10:58:29 +01:00
|
|
|
/* Interface's brief information print out to vty interface. */
|
|
|
|
static void ifs_dump_brief_vty(struct vty *vty, struct vrf *vrf)
|
|
|
|
{
|
|
|
|
struct connected *connected;
|
|
|
|
struct listnode *node;
|
|
|
|
struct route_node *rn;
|
|
|
|
struct zebra_if *zebra_if;
|
|
|
|
struct prefix *p;
|
|
|
|
struct interface *ifp;
|
|
|
|
bool print_header = true;
|
|
|
|
|
|
|
|
FOR_ALL_INTERFACES (vrf, ifp) {
|
|
|
|
bool first_pfx_printed = false;
|
|
|
|
|
|
|
|
if (print_header) {
|
|
|
|
vty_out(vty, "%-16s%-8s%-16s%s\n", "Interface",
|
|
|
|
"Status", "VRF", "Addresses");
|
|
|
|
vty_out(vty, "%-16s%-8s%-16s%s\n", "---------",
|
|
|
|
"------", "---", "---------");
|
|
|
|
print_header = false; /* We have at least 1 iface */
|
|
|
|
}
|
|
|
|
zebra_if = ifp->info;
|
|
|
|
|
|
|
|
vty_out(vty, "%-16s", ifp->name);
|
|
|
|
|
|
|
|
if (if_is_up(ifp))
|
|
|
|
vty_out(vty, "%-8s", "up");
|
|
|
|
else
|
|
|
|
vty_out(vty, "%-8s", "down");
|
|
|
|
|
|
|
|
vty_out(vty, "%-16s", vrf->name);
|
|
|
|
|
|
|
|
for (rn = route_top(zebra_if->ipv4_subnets); rn;
|
|
|
|
rn = route_next(rn)) {
|
|
|
|
if (!rn->info)
|
|
|
|
continue;
|
|
|
|
uint32_t list_size = listcount((struct list *)rn->info);
|
|
|
|
|
|
|
|
for (ALL_LIST_ELEMENTS_RO((struct list *)rn->info, node,
|
|
|
|
connected)) {
|
|
|
|
if (!CHECK_FLAG(connected->flags,
|
|
|
|
ZEBRA_IFA_SECONDARY)) {
|
|
|
|
p = connected->address;
|
|
|
|
if (first_pfx_printed) {
|
2020-10-18 13:33:54 +02:00
|
|
|
/* padding to prepare row only
|
|
|
|
* for ip addr */
|
2018-11-07 10:58:29 +01:00
|
|
|
vty_out(vty, "%-40s", "");
|
|
|
|
if (list_size > 1)
|
|
|
|
vty_out(vty, "+ ");
|
2020-10-18 13:33:54 +02:00
|
|
|
vty_out(vty, "%pFX\n", p);
|
2018-11-07 10:58:29 +01:00
|
|
|
} else {
|
|
|
|
if (list_size > 1)
|
|
|
|
vty_out(vty, "+ ");
|
2020-10-18 13:33:54 +02:00
|
|
|
vty_out(vty, "%pFX\n", p);
|
2018-11-07 10:58:29 +01:00
|
|
|
}
|
|
|
|
first_pfx_printed = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
uint32_t v6_list_size = 0;
|
|
|
|
for (ALL_LIST_ELEMENTS_RO(ifp->connected, node, connected)) {
|
|
|
|
if (CHECK_FLAG(connected->conf, ZEBRA_IFC_REAL)
|
|
|
|
&& (connected->address->family == AF_INET6))
|
|
|
|
v6_list_size++;
|
|
|
|
}
|
|
|
|
for (ALL_LIST_ELEMENTS_RO(ifp->connected, node, connected)) {
|
|
|
|
if (CHECK_FLAG(connected->conf, ZEBRA_IFC_REAL)
|
|
|
|
&& !CHECK_FLAG(connected->flags,
|
|
|
|
ZEBRA_IFA_SECONDARY)
|
|
|
|
&& (connected->address->family == AF_INET6)) {
|
|
|
|
p = connected->address;
|
|
|
|
/* Don't print link local pfx */
|
|
|
|
if (!IN6_IS_ADDR_LINKLOCAL(&p->u.prefix6)) {
|
|
|
|
if (first_pfx_printed) {
|
2020-10-18 13:33:54 +02:00
|
|
|
/* padding to prepare row only
|
|
|
|
* for ip addr */
|
2018-11-07 10:58:29 +01:00
|
|
|
vty_out(vty, "%-40s", "");
|
|
|
|
if (v6_list_size > 1)
|
|
|
|
vty_out(vty, "+ ");
|
2020-10-18 13:33:54 +02:00
|
|
|
vty_out(vty, "%pFX\n", p);
|
2018-11-07 10:58:29 +01:00
|
|
|
} else {
|
|
|
|
if (v6_list_size > 1)
|
|
|
|
vty_out(vty, "+ ");
|
2020-10-18 13:33:54 +02:00
|
|
|
vty_out(vty, "%pFX\n", p);
|
2018-11-07 10:58:29 +01:00
|
|
|
}
|
|
|
|
first_pfx_printed = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!first_pfx_printed)
|
|
|
|
vty_out(vty, "\n");
|
|
|
|
}
|
|
|
|
vty_out(vty, "\n");
|
|
|
|
}
|
|
|
|
|
2021-08-02 20:38:26 +02:00
|
|
|
static void ifs_dump_brief_vty_json(json_object *json, struct vrf *vrf)
|
|
|
|
{
|
|
|
|
struct connected *connected;
|
|
|
|
struct listnode *node;
|
|
|
|
struct interface *ifp;
|
|
|
|
|
|
|
|
FOR_ALL_INTERFACES (vrf, ifp) {
|
|
|
|
json_object *json_if;
|
|
|
|
json_object *json_addrs;
|
|
|
|
|
|
|
|
json_if = json_object_new_object();
|
|
|
|
json_object_object_add(json, ifp->name, json_if);
|
|
|
|
|
|
|
|
json_object_string_add(json_if, "status",
|
|
|
|
if_is_up(ifp) ? "up" : "down");
|
|
|
|
json_object_string_add(json_if, "vrfName", vrf->name);
|
|
|
|
|
|
|
|
json_addrs = json_object_new_array();
|
|
|
|
json_object_object_add(json_if, "addresses", json_addrs);
|
|
|
|
for (ALL_LIST_ELEMENTS_RO(ifp->connected, node, connected)) {
|
|
|
|
if (CHECK_FLAG(connected->conf, ZEBRA_IFC_REAL)
|
|
|
|
&& !CHECK_FLAG(connected->flags,
|
|
|
|
ZEBRA_IFA_SECONDARY)
|
|
|
|
&& !(connected->address->family == AF_INET6
|
|
|
|
&& IN6_IS_ADDR_LINKLOCAL(
|
|
|
|
&connected->address->u.prefix6))) {
|
|
|
|
char buf[PREFIX2STR_BUFFER];
|
|
|
|
|
|
|
|
json_array_string_add(
|
|
|
|
json_addrs,
|
|
|
|
prefix2str(connected->address, buf,
|
|
|
|
sizeof(buf)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-26 06:07:57 +01:00
|
|
|
const char *zebra_protodown_rc_str(uint32_t protodown_rc, char *pd_buf,
|
|
|
|
uint32_t pd_buf_len)
|
zebra: uplink tracking and startup delay for EVPN-MH
Local ethernet segments are held in a protodown or error-disabled state
if access to the VxLAN overlay is not ready -
1. When FRR comes up the local-ESs/access-port are kept protodown
for the startup-delay duration. During this time the underlay and
EVPN routes via it are expected to converge.
2. When all the uplinks/core-links attached to the underlay go down
the access-ports are similarly protodowned.
The ES-bond protodown state is propagated to each ES-bond member
and programmed in the dataplane/kernel (per-bond-member).
Configuring uplinks -
vtysh -c "conf t" vtysh -c "interface swp4" vtysh -c "evpn mh uplink"
Configuring startup delay -
vtysh -c "conf t" vtysh -c "evpn mh startup-delay 100"
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
EVPN protodown display -
========================
root@torm-11:mgmt:~# vtysh -c "show evpn"
L2 VNIs: 10
L3 VNIs: 3
Advertise gateway mac-ip: No
Advertise svi mac-ip: No
Duplicate address detection: Disable
Detection max-moves 5, time 180
EVPN MH:
mac-holdtime: 60s, neigh-holdtime: 60s
startup-delay: 180s, start-delay-timer: 00:01:14 <<<<<<<<<<<<
uplink-cfg-cnt: 4, uplink-active-cnt: 4
protodown: startup-delay <<<<<<<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond protodown display -
===========================
root@torm-11:mgmt:~# vtysh -c "show interface hostbond1"
Interface hostbond1 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 1 last: 2020/04/26 20:38:03.53
PTM status: disabled
vrf: default
OS Description: Local Node/s torm-11 and Ports swp5 <==> Remote Node/s hostd-11 and Ports swp1
index 58 metric 0 mtu 9152 speed 4294967295
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type bond
Master interface: bridge
EVPN-MH: ES id 1 ES sysmac 00:00:00:00:01:11
protodown: off rc: startup-delay <<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond member protodown display -
==================================
root@torm-11:mgmt:~# vtysh -c "show interface swp5"
Interface swp5 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 3 last: 2020/04/26 20:38:03.52
PTM status: disabled
vrf: default
index 7 metric 0 mtu 9152 speed 10000
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type Other
Master interface: hostbond1
protodown: on rc: startup-delay <<<<<<<<<<<<<<<<
root@torm-11:mgmt:~#
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-05-09 04:11:13 +02:00
|
|
|
{
|
|
|
|
pd_buf[0] = '\0';
|
2022-02-15 23:46:05 +01:00
|
|
|
size_t len;
|
zebra: uplink tracking and startup delay for EVPN-MH
Local ethernet segments are held in a protodown or error-disabled state
if access to the VxLAN overlay is not ready -
1. When FRR comes up the local-ESs/access-port are kept protodown
for the startup-delay duration. During this time the underlay and
EVPN routes via it are expected to converge.
2. When all the uplinks/core-links attached to the underlay go down
the access-ports are similarly protodowned.
The ES-bond protodown state is propagated to each ES-bond member
and programmed in the dataplane/kernel (per-bond-member).
Configuring uplinks -
vtysh -c "conf t" vtysh -c "interface swp4" vtysh -c "evpn mh uplink"
Configuring startup delay -
vtysh -c "conf t" vtysh -c "evpn mh startup-delay 100"
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
EVPN protodown display -
========================
root@torm-11:mgmt:~# vtysh -c "show evpn"
L2 VNIs: 10
L3 VNIs: 3
Advertise gateway mac-ip: No
Advertise svi mac-ip: No
Duplicate address detection: Disable
Detection max-moves 5, time 180
EVPN MH:
mac-holdtime: 60s, neigh-holdtime: 60s
startup-delay: 180s, start-delay-timer: 00:01:14 <<<<<<<<<<<<
uplink-cfg-cnt: 4, uplink-active-cnt: 4
protodown: startup-delay <<<<<<<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond protodown display -
===========================
root@torm-11:mgmt:~# vtysh -c "show interface hostbond1"
Interface hostbond1 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 1 last: 2020/04/26 20:38:03.53
PTM status: disabled
vrf: default
OS Description: Local Node/s torm-11 and Ports swp5 <==> Remote Node/s hostd-11 and Ports swp1
index 58 metric 0 mtu 9152 speed 4294967295
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type bond
Master interface: bridge
EVPN-MH: ES id 1 ES sysmac 00:00:00:00:01:11
protodown: off rc: startup-delay <<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond member protodown display -
==================================
root@torm-11:mgmt:~# vtysh -c "show interface swp5"
Interface swp5 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 3 last: 2020/04/26 20:38:03.52
PTM status: disabled
vrf: default
index 7 metric 0 mtu 9152 speed 10000
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type Other
Master interface: hostbond1
protodown: on rc: startup-delay <<<<<<<<<<<<<<<<
root@torm-11:mgmt:~#
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-05-09 04:11:13 +02:00
|
|
|
|
2020-10-29 17:03:25 +01:00
|
|
|
strlcat(pd_buf, "(", pd_buf_len);
|
zebra: uplink tracking and startup delay for EVPN-MH
Local ethernet segments are held in a protodown or error-disabled state
if access to the VxLAN overlay is not ready -
1. When FRR comes up the local-ESs/access-port are kept protodown
for the startup-delay duration. During this time the underlay and
EVPN routes via it are expected to converge.
2. When all the uplinks/core-links attached to the underlay go down
the access-ports are similarly protodowned.
The ES-bond protodown state is propagated to each ES-bond member
and programmed in the dataplane/kernel (per-bond-member).
Configuring uplinks -
vtysh -c "conf t" vtysh -c "interface swp4" vtysh -c "evpn mh uplink"
Configuring startup delay -
vtysh -c "conf t" vtysh -c "evpn mh startup-delay 100"
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
EVPN protodown display -
========================
root@torm-11:mgmt:~# vtysh -c "show evpn"
L2 VNIs: 10
L3 VNIs: 3
Advertise gateway mac-ip: No
Advertise svi mac-ip: No
Duplicate address detection: Disable
Detection max-moves 5, time 180
EVPN MH:
mac-holdtime: 60s, neigh-holdtime: 60s
startup-delay: 180s, start-delay-timer: 00:01:14 <<<<<<<<<<<<
uplink-cfg-cnt: 4, uplink-active-cnt: 4
protodown: startup-delay <<<<<<<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond protodown display -
===========================
root@torm-11:mgmt:~# vtysh -c "show interface hostbond1"
Interface hostbond1 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 1 last: 2020/04/26 20:38:03.53
PTM status: disabled
vrf: default
OS Description: Local Node/s torm-11 and Ports swp5 <==> Remote Node/s hostd-11 and Ports swp1
index 58 metric 0 mtu 9152 speed 4294967295
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type bond
Master interface: bridge
EVPN-MH: ES id 1 ES sysmac 00:00:00:00:01:11
protodown: off rc: startup-delay <<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond member protodown display -
==================================
root@torm-11:mgmt:~# vtysh -c "show interface swp5"
Interface swp5 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 3 last: 2020/04/26 20:38:03.52
PTM status: disabled
vrf: default
index 7 metric 0 mtu 9152 speed 10000
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type Other
Master interface: hostbond1
protodown: on rc: startup-delay <<<<<<<<<<<<<<<<
root@torm-11:mgmt:~#
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-05-09 04:11:13 +02:00
|
|
|
|
2022-02-16 00:21:18 +01:00
|
|
|
if (CHECK_FLAG(protodown_rc, ZEBRA_PROTODOWN_EXTERNAL))
|
2022-02-15 23:46:05 +01:00
|
|
|
strlcat(pd_buf, "external,", pd_buf_len);
|
2022-01-26 06:07:57 +01:00
|
|
|
|
2022-02-16 00:21:18 +01:00
|
|
|
if (CHECK_FLAG(protodown_rc, ZEBRA_PROTODOWN_EVPN_STARTUP_DELAY))
|
2022-02-15 23:46:05 +01:00
|
|
|
strlcat(pd_buf, "startup-delay,", pd_buf_len);
|
zebra: uplink tracking and startup delay for EVPN-MH
Local ethernet segments are held in a protodown or error-disabled state
if access to the VxLAN overlay is not ready -
1. When FRR comes up the local-ESs/access-port are kept protodown
for the startup-delay duration. During this time the underlay and
EVPN routes via it are expected to converge.
2. When all the uplinks/core-links attached to the underlay go down
the access-ports are similarly protodowned.
The ES-bond protodown state is propagated to each ES-bond member
and programmed in the dataplane/kernel (per-bond-member).
Configuring uplinks -
vtysh -c "conf t" vtysh -c "interface swp4" vtysh -c "evpn mh uplink"
Configuring startup delay -
vtysh -c "conf t" vtysh -c "evpn mh startup-delay 100"
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
EVPN protodown display -
========================
root@torm-11:mgmt:~# vtysh -c "show evpn"
L2 VNIs: 10
L3 VNIs: 3
Advertise gateway mac-ip: No
Advertise svi mac-ip: No
Duplicate address detection: Disable
Detection max-moves 5, time 180
EVPN MH:
mac-holdtime: 60s, neigh-holdtime: 60s
startup-delay: 180s, start-delay-timer: 00:01:14 <<<<<<<<<<<<
uplink-cfg-cnt: 4, uplink-active-cnt: 4
protodown: startup-delay <<<<<<<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond protodown display -
===========================
root@torm-11:mgmt:~# vtysh -c "show interface hostbond1"
Interface hostbond1 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 1 last: 2020/04/26 20:38:03.53
PTM status: disabled
vrf: default
OS Description: Local Node/s torm-11 and Ports swp5 <==> Remote Node/s hostd-11 and Ports swp1
index 58 metric 0 mtu 9152 speed 4294967295
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type bond
Master interface: bridge
EVPN-MH: ES id 1 ES sysmac 00:00:00:00:01:11
protodown: off rc: startup-delay <<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond member protodown display -
==================================
root@torm-11:mgmt:~# vtysh -c "show interface swp5"
Interface swp5 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 3 last: 2020/04/26 20:38:03.52
PTM status: disabled
vrf: default
index 7 metric 0 mtu 9152 speed 10000
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type Other
Master interface: hostbond1
protodown: on rc: startup-delay <<<<<<<<<<<<<<<<
root@torm-11:mgmt:~#
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-05-09 04:11:13 +02:00
|
|
|
|
2022-02-16 00:21:18 +01:00
|
|
|
if (CHECK_FLAG(protodown_rc, ZEBRA_PROTODOWN_EVPN_UPLINK_DOWN))
|
2022-02-15 23:46:05 +01:00
|
|
|
strlcat(pd_buf, "uplinks-down,", pd_buf_len);
|
zebra: uplink tracking and startup delay for EVPN-MH
Local ethernet segments are held in a protodown or error-disabled state
if access to the VxLAN overlay is not ready -
1. When FRR comes up the local-ESs/access-port are kept protodown
for the startup-delay duration. During this time the underlay and
EVPN routes via it are expected to converge.
2. When all the uplinks/core-links attached to the underlay go down
the access-ports are similarly protodowned.
The ES-bond protodown state is propagated to each ES-bond member
and programmed in the dataplane/kernel (per-bond-member).
Configuring uplinks -
vtysh -c "conf t" vtysh -c "interface swp4" vtysh -c "evpn mh uplink"
Configuring startup delay -
vtysh -c "conf t" vtysh -c "evpn mh startup-delay 100"
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
EVPN protodown display -
========================
root@torm-11:mgmt:~# vtysh -c "show evpn"
L2 VNIs: 10
L3 VNIs: 3
Advertise gateway mac-ip: No
Advertise svi mac-ip: No
Duplicate address detection: Disable
Detection max-moves 5, time 180
EVPN MH:
mac-holdtime: 60s, neigh-holdtime: 60s
startup-delay: 180s, start-delay-timer: 00:01:14 <<<<<<<<<<<<
uplink-cfg-cnt: 4, uplink-active-cnt: 4
protodown: startup-delay <<<<<<<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond protodown display -
===========================
root@torm-11:mgmt:~# vtysh -c "show interface hostbond1"
Interface hostbond1 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 1 last: 2020/04/26 20:38:03.53
PTM status: disabled
vrf: default
OS Description: Local Node/s torm-11 and Ports swp5 <==> Remote Node/s hostd-11 and Ports swp1
index 58 metric 0 mtu 9152 speed 4294967295
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type bond
Master interface: bridge
EVPN-MH: ES id 1 ES sysmac 00:00:00:00:01:11
protodown: off rc: startup-delay <<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond member protodown display -
==================================
root@torm-11:mgmt:~# vtysh -c "show interface swp5"
Interface swp5 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 3 last: 2020/04/26 20:38:03.52
PTM status: disabled
vrf: default
index 7 metric 0 mtu 9152 speed 10000
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type Other
Master interface: hostbond1
protodown: on rc: startup-delay <<<<<<<<<<<<<<<<
root@torm-11:mgmt:~#
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-05-09 04:11:13 +02:00
|
|
|
|
2022-02-16 00:21:18 +01:00
|
|
|
if (CHECK_FLAG(protodown_rc, ZEBRA_PROTODOWN_VRRP))
|
2022-02-15 23:46:05 +01:00
|
|
|
strlcat(pd_buf, "vrrp,", pd_buf_len);
|
2022-01-26 06:07:57 +01:00
|
|
|
|
2022-02-16 00:21:18 +01:00
|
|
|
if (CHECK_FLAG(protodown_rc, ZEBRA_PROTODOWN_SHARP))
|
2022-02-15 23:46:05 +01:00
|
|
|
strlcat(pd_buf, "sharp,", pd_buf_len);
|
|
|
|
|
|
|
|
len = strnlen(pd_buf, pd_buf_len);
|
|
|
|
|
|
|
|
/* Remove trailing comma */
|
|
|
|
if (pd_buf[len - 1] == ',')
|
|
|
|
pd_buf[len - 1] = '\0';
|
2022-01-26 06:07:57 +01:00
|
|
|
|
2020-10-29 17:03:25 +01:00
|
|
|
strlcat(pd_buf, ")", pd_buf_len);
|
zebra: uplink tracking and startup delay for EVPN-MH
Local ethernet segments are held in a protodown or error-disabled state
if access to the VxLAN overlay is not ready -
1. When FRR comes up the local-ESs/access-port are kept protodown
for the startup-delay duration. During this time the underlay and
EVPN routes via it are expected to converge.
2. When all the uplinks/core-links attached to the underlay go down
the access-ports are similarly protodowned.
The ES-bond protodown state is propagated to each ES-bond member
and programmed in the dataplane/kernel (per-bond-member).
Configuring uplinks -
vtysh -c "conf t" vtysh -c "interface swp4" vtysh -c "evpn mh uplink"
Configuring startup delay -
vtysh -c "conf t" vtysh -c "evpn mh startup-delay 100"
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
EVPN protodown display -
========================
root@torm-11:mgmt:~# vtysh -c "show evpn"
L2 VNIs: 10
L3 VNIs: 3
Advertise gateway mac-ip: No
Advertise svi mac-ip: No
Duplicate address detection: Disable
Detection max-moves 5, time 180
EVPN MH:
mac-holdtime: 60s, neigh-holdtime: 60s
startup-delay: 180s, start-delay-timer: 00:01:14 <<<<<<<<<<<<
uplink-cfg-cnt: 4, uplink-active-cnt: 4
protodown: startup-delay <<<<<<<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond protodown display -
===========================
root@torm-11:mgmt:~# vtysh -c "show interface hostbond1"
Interface hostbond1 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 1 last: 2020/04/26 20:38:03.53
PTM status: disabled
vrf: default
OS Description: Local Node/s torm-11 and Ports swp5 <==> Remote Node/s hostd-11 and Ports swp1
index 58 metric 0 mtu 9152 speed 4294967295
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type bond
Master interface: bridge
EVPN-MH: ES id 1 ES sysmac 00:00:00:00:01:11
protodown: off rc: startup-delay <<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond member protodown display -
==================================
root@torm-11:mgmt:~# vtysh -c "show interface swp5"
Interface swp5 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 3 last: 2020/04/26 20:38:03.52
PTM status: disabled
vrf: default
index 7 metric 0 mtu 9152 speed 10000
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type Other
Master interface: hostbond1
protodown: on rc: startup-delay <<<<<<<<<<<<<<<<
root@torm-11:mgmt:~#
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-05-09 04:11:13 +02:00
|
|
|
|
|
|
|
return pd_buf;
|
|
|
|
}
|
|
|
|
|
2020-06-14 16:31:45 +02:00
|
|
|
static inline bool if_is_protodown_applicable(struct interface *ifp)
|
|
|
|
{
|
|
|
|
if (IS_ZEBRA_IF_BOND(ifp))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2021-07-27 09:44:15 +02:00
|
|
|
static void zebra_vxlan_if_vni_dump_vty(struct vty *vty,
|
|
|
|
struct zebra_vxlan_vni *vni)
|
|
|
|
{
|
2021-07-27 18:29:00 +02:00
|
|
|
char str[INET6_ADDRSTRLEN];
|
|
|
|
|
2021-07-27 09:44:15 +02:00
|
|
|
vty_out(vty, " VxLAN Id %u", vni->vni);
|
|
|
|
if (vni->access_vlan)
|
|
|
|
vty_out(vty, " Access VLAN Id %u\n", vni->access_vlan);
|
|
|
|
|
|
|
|
if (vni->mcast_grp.s_addr != INADDR_ANY)
|
2021-07-27 18:29:00 +02:00
|
|
|
vty_out(vty, " Mcast Group %s",
|
|
|
|
inet_ntop(AF_INET, &vni->mcast_grp, str, sizeof(str)));
|
2021-07-27 09:44:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void zebra_vxlan_if_vni_hash_dump_vty(struct hash_bucket *bucket,
|
|
|
|
void *ctxt)
|
|
|
|
{
|
|
|
|
struct vty *vty;
|
|
|
|
struct zebra_vxlan_vni *vni;
|
|
|
|
|
|
|
|
vni = (struct zebra_vxlan_vni *)bucket->data;
|
2022-12-10 00:51:22 +01:00
|
|
|
vty = (struct vty *)ctxt;
|
2021-07-27 09:44:15 +02:00
|
|
|
|
2021-08-04 08:46:25 +02:00
|
|
|
zebra_vxlan_if_vni_dump_vty(vty, vni);
|
2021-07-27 09:44:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void zebra_vxlan_if_dump_vty(struct vty *vty, struct zebra_if *zebra_if)
|
|
|
|
{
|
|
|
|
struct zebra_l2info_vxlan *vxlan_info;
|
|
|
|
struct zebra_vxlan_vni_info *vni_info;
|
|
|
|
|
|
|
|
vxlan_info = &zebra_if->l2info.vxl;
|
|
|
|
vni_info = &vxlan_info->vni_info;
|
|
|
|
|
|
|
|
if (vxlan_info->vtep_ip.s_addr != INADDR_ANY)
|
2021-08-04 08:46:25 +02:00
|
|
|
vty_out(vty, " VTEP IP: %pI4", &vxlan_info->vtep_ip);
|
2021-07-27 09:44:15 +02:00
|
|
|
|
|
|
|
if (vxlan_info->ifindex_link && (vxlan_info->link_nsid != NS_UNKNOWN)) {
|
|
|
|
struct interface *ifp;
|
|
|
|
|
|
|
|
ifp = if_lookup_by_index_per_ns(
|
|
|
|
zebra_ns_lookup(vxlan_info->link_nsid),
|
|
|
|
vxlan_info->ifindex_link);
|
|
|
|
vty_out(vty, " Link Interface %s",
|
|
|
|
ifp == NULL ? "Unknown" : ifp->name);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (IS_ZEBRA_VXLAN_IF_VNI(zebra_if)) {
|
|
|
|
zebra_vxlan_if_vni_dump_vty(vty, &vni_info->vni);
|
|
|
|
} else {
|
|
|
|
hash_iterate(vni_info->vni_table,
|
2021-08-04 08:46:25 +02:00
|
|
|
zebra_vxlan_if_vni_hash_dump_vty, vty);
|
2021-07-27 09:44:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
vty_out(vty, "\n");
|
|
|
|
}
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* Interface's information print out to vty interface. */
|
|
|
|
static void if_dump_vty(struct vty *vty, struct interface *ifp)
|
|
|
|
{
|
|
|
|
struct connected *connected;
|
2015-05-20 02:40:40 +02:00
|
|
|
struct nbr_connected *nbr_connected;
|
2004-09-23 21:18:23 +02:00
|
|
|
struct listnode *node;
|
2004-10-03 20:46:08 +02:00
|
|
|
struct route_node *rn;
|
|
|
|
struct zebra_if *zebra_if;
|
zebra: uplink tracking and startup delay for EVPN-MH
Local ethernet segments are held in a protodown or error-disabled state
if access to the VxLAN overlay is not ready -
1. When FRR comes up the local-ESs/access-port are kept protodown
for the startup-delay duration. During this time the underlay and
EVPN routes via it are expected to converge.
2. When all the uplinks/core-links attached to the underlay go down
the access-ports are similarly protodowned.
The ES-bond protodown state is propagated to each ES-bond member
and programmed in the dataplane/kernel (per-bond-member).
Configuring uplinks -
vtysh -c "conf t" vtysh -c "interface swp4" vtysh -c "evpn mh uplink"
Configuring startup delay -
vtysh -c "conf t" vtysh -c "evpn mh startup-delay 100"
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
EVPN protodown display -
========================
root@torm-11:mgmt:~# vtysh -c "show evpn"
L2 VNIs: 10
L3 VNIs: 3
Advertise gateway mac-ip: No
Advertise svi mac-ip: No
Duplicate address detection: Disable
Detection max-moves 5, time 180
EVPN MH:
mac-holdtime: 60s, neigh-holdtime: 60s
startup-delay: 180s, start-delay-timer: 00:01:14 <<<<<<<<<<<<
uplink-cfg-cnt: 4, uplink-active-cnt: 4
protodown: startup-delay <<<<<<<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond protodown display -
===========================
root@torm-11:mgmt:~# vtysh -c "show interface hostbond1"
Interface hostbond1 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 1 last: 2020/04/26 20:38:03.53
PTM status: disabled
vrf: default
OS Description: Local Node/s torm-11 and Ports swp5 <==> Remote Node/s hostd-11 and Ports swp1
index 58 metric 0 mtu 9152 speed 4294967295
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type bond
Master interface: bridge
EVPN-MH: ES id 1 ES sysmac 00:00:00:00:01:11
protodown: off rc: startup-delay <<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond member protodown display -
==================================
root@torm-11:mgmt:~# vtysh -c "show interface swp5"
Interface swp5 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 3 last: 2020/04/26 20:38:03.52
PTM status: disabled
vrf: default
index 7 metric 0 mtu 9152 speed 10000
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type Other
Master interface: hostbond1
protodown: on rc: startup-delay <<<<<<<<<<<<<<<<
root@torm-11:mgmt:~#
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-05-09 04:11:13 +02:00
|
|
|
char pd_buf[ZEBRA_PROTODOWN_RC_STR_LEN];
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2004-10-03 20:46:08 +02:00
|
|
|
zebra_if = ifp->info;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2002-12-13 22:03:13 +01:00
|
|
|
vty_out(vty, "Interface %s is ", ifp->name);
|
|
|
|
if (if_is_up(ifp)) {
|
|
|
|
vty_out(vty, "up, line protocol ");
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2002-12-13 22:03:13 +01:00
|
|
|
if (CHECK_FLAG(ifp->status, ZEBRA_INTERFACE_LINKDETECTION)) {
|
|
|
|
if (if_is_running(ifp))
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "is up\n");
|
2002-12-13 22:03:13 +01:00
|
|
|
else
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "is down\n");
|
2002-12-13 22:03:13 +01:00
|
|
|
} else {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "detection is disabled\n");
|
2002-12-13 22:03:13 +01:00
|
|
|
}
|
|
|
|
} else {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "down\n");
|
2002-12-13 22:03:13 +01:00
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, " Link ups: %5u last: %s\n", zebra_if->up_count,
|
2017-06-21 05:10:57 +02:00
|
|
|
zebra_if->up_last[0] ? zebra_if->up_last : "(never)");
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, " Link downs: %5u last: %s\n", zebra_if->down_count,
|
2017-06-21 05:10:57 +02:00
|
|
|
zebra_if->down_last[0] ? zebra_if->down_last : "(never)");
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2021-08-02 20:38:26 +02:00
|
|
|
zebra_ptm_show_status(vty, NULL, ifp);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2021-10-13 14:06:38 +02:00
|
|
|
vty_out(vty, " vrf: %s\n", ifp->vrf->name);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
if (ifp->desc)
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, " Description: %s\n", ifp->desc);
|
2019-04-28 01:55:21 +02:00
|
|
|
if (zebra_if->desc)
|
|
|
|
vty_out(vty, " OS Description: %s\n", zebra_if->desc);
|
|
|
|
|
2005-04-02 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
Fix problems when netlink interfaces are renamed (same ifindex used
for a new interface). Start cleaning up some problems with the way
interface names are handled.
* interface.c: (if_new_intern_ifindex) Remove obsolete function.
(if_delete_update) After distributing the interface deletion message,
set ifp->ifindex to IFINDEX_INTERNAL.
(if_dump_vty) Detect pseudo interface by checking if ifp->ifindex is
IFINDEX_INTERNAL.
(zebra_interface) Check return code from interface_cmd.func.
Do not set internal ifindex values to if_new_intern_ifindex(),
since we now use IFINDEX_INTERNAL for all pseudo interfaces.
* kernel_socket.c: (ifm_read) Fix code and comments to reflect that
all internal interfaces now have ifp->ifindex set to IFINDEX_INTERNAL.
* rt_netlink.c: (set_ifindex) New function used to update ifp->ifindex.
Detects interface rename events by checking if that ifindex is already
being used. If it is, delete the old interface before assigning
the ifindex to the new interface.
(netlink_interface, netlink_link_change) Call set_ifindex to update
the ifindex.
* if.h: Remove define for IFINDEX_INTERNBASE and add define
IFINDEX_INTERNAL 0, since all internal (i.e. non-kernel) pseudo-
interfaces should have ifindex set to 0.
(if_new) Remove function.
(if_delete_retain) New function to delete an interface without
removing from iflist and freeing the structure.
(ifname2ifindex) New function.
* if.c: (if_new) Remove function (absorb into if_create).
(if_create) Replace function if_new with call to calloc.
Set ifp->ifindex to IFINDEX_INTERNAL. Fix off-by-one error
in assert to check length of interface name. Add error message
if interface with this name already exists.
(if_delete_retain) New function to delete an interface without
removing from iflist and freeing the structure.
(if_delete) Implement with help of if_delete_retain.
(ifindex2ifname) Reimplement using if_lookup_by_index.
(ifname2ifindex) New function to complement ifindex2ifname.
(interface) The interface command should check the name length
and fail with a warning message if it is too long.
(no_interface) Fix spelling in warning message.
(if_nametoindex) Reimplement using if_lookup_by_name.
(if_indextoname, ifaddr_ipv4_lookup) Reimplement using
if_lookup_by_index.
* bgp_zebra.c: (bgp_interface_delete) After deleting, set ifp->ifindex
to IFINDEX_INTERNAL.
* isis_zebra.c: (isis_zebra_if_del) Call if_delete_retain instead
of if_delete, since it is generally not safe to remove interface
structures. After deleting, set ifp->ifindex to IFINDEX_INTERNAL.
(zebra_interface_if_lookup) Tighten up code.
* ospf6_zebra.c: (ospf6_zebra_if_del) Previously, this whole function
was commented out. But this is not safe: we should at least update
the ifindex when the interface is deleted. So the new version
updates the interface status and sets ifp->ifindex to
IFINDEX_INTERNAL.
(ospf6_zebra_route_update) Use if_indextoname properly.
* ospf_vty.c: (show_ip_ospf_interface_sub) Show ifindex and interface
flags to help with debugging.
* ospf_zebra.c: (ospf_interface_delete) After deleting, set ifp->ifindex
to IFINDEX_INTERNAL.
(zebra_interface_if_lookup) Make function static. Tighten up code.
* rip_interface.c: (rip_interface_delete) After deleting, set
ifp->ifindex to IFINDEX_INTERNAL.
* ripng_interface.c: (ripng_interface_delete) After deleting, set
ifp->ifindex to IFINDEX_INTERNAL.
2005-04-02 20:38:43 +02:00
|
|
|
if (ifp->ifindex == IFINDEX_INTERNAL) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, " pseudo interface\n");
|
2002-12-13 21:15:29 +01:00
|
|
|
return;
|
|
|
|
} else if (!CHECK_FLAG(ifp->status, ZEBRA_INTERFACE_ACTIVE)) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, " index %d inactive interface\n", ifp->ifindex);
|
2002-12-13 21:15:29 +01:00
|
|
|
return;
|
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-04-04 13:50:31 +02:00
|
|
|
vty_out(vty, " index %d metric %d mtu %d speed %u ", ifp->ifindex,
|
2017-03-30 22:54:15 +02:00
|
|
|
ifp->metric, ifp->mtu, ifp->speed);
|
2004-05-09 13:00:23 +02:00
|
|
|
if (ifp->mtu6 != ifp->mtu)
|
|
|
|
vty_out(vty, "mtu6 %d ", ifp->mtu6);
|
2017-07-13 19:20:20 +02:00
|
|
|
vty_out(vty, "\n flags: %s\n", if_flag_dump(ifp->flags));
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2021-09-17 22:32:27 +02:00
|
|
|
if (zebra_if->mpls)
|
|
|
|
vty_out(vty, " MPLS enabled\n");
|
|
|
|
|
2022-06-23 17:00:08 +02:00
|
|
|
if (zebra_if->linkdown)
|
2022-06-27 21:11:45 +02:00
|
|
|
vty_out(vty, " Ignore all v4 routes with linkdown\n");
|
|
|
|
if (zebra_if->linkdownv6)
|
|
|
|
vty_out(vty, " Ignore all v6 routes with linkdown\n");
|
2022-06-23 17:00:08 +02:00
|
|
|
|
2022-06-27 21:04:21 +02:00
|
|
|
if (zebra_if->v4mcast_on)
|
|
|
|
vty_out(vty, " v4 Multicast forwarding is on\n");
|
2022-06-27 21:11:45 +02:00
|
|
|
if (zebra_if->v6mcast_on)
|
|
|
|
vty_out(vty, " v6 Multicast forwarding is on\n");
|
2022-06-27 21:04:21 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* Hardware address. */
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, " Type: %s\n", if_link_type_str(ifp->ll_type));
|
2002-12-13 21:15:29 +01:00
|
|
|
if (ifp->hw_addr_len != 0) {
|
|
|
|
int i;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
vty_out(vty, " HWaddr: ");
|
|
|
|
for (i = 0; i < ifp->hw_addr_len; i++)
|
|
|
|
vty_out(vty, "%s%02x", i == 0 ? "" : ":",
|
|
|
|
ifp->hw_addr[i]);
|
2017-07-13 19:04:25 +02:00
|
|
|
vty_out(vty, "\n");
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2016-06-13 15:06:45 +02:00
|
|
|
/* Bandwidth in Mbps */
|
2002-12-13 21:15:29 +01:00
|
|
|
if (ifp->bandwidth != 0) {
|
2016-06-13 15:06:45 +02:00
|
|
|
vty_out(vty, " bandwidth %u Mbps", ifp->bandwidth);
|
2017-07-13 19:04:25 +02:00
|
|
|
vty_out(vty, "\n");
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2004-10-03 20:46:08 +02:00
|
|
|
for (rn = route_top(zebra_if->ipv4_subnets); rn; rn = route_next(rn)) {
|
|
|
|
if (!rn->info)
|
|
|
|
continue;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2005-04-07 Paul Jakma <paul.jakma@sun.com>
* (global): Fix up list loops to match changes in lib/linklist,
and some basic auditing of usage.
* configure.ac: define QUAGGA_NO_DEPRECATED_INTERFACES
* HACKING: Add notes about deprecating interfaces and commands.
* lib/linklist.h: Add usage comments.
Rename getdata macro to listgetdata.
Rename nextnode to listnextnode and fix its odd behaviour to be
less dangerous.
Make listgetdata macro assert node is not null, NULL list entries
should be bug condition.
ALL_LIST_ELEMENTS, new macro, forward-referencing macro for use
with for loop, Suggested by Jim Carlson of Sun.
Add ALL_LIST_ELEMENTS_RO for cases which obviously do not need the
"safety" of previous macro.
LISTNODE_ADD and DELETE macros renamed to ATTACH, DETACH, to
distinguish from the similarly named functions, and reflect their
effect better.
Add a QUAGGA_NO_DEPRECATED_INTERFACES define guarded section
with the old defines which were modified above,
for backwards compatibility - guarded to prevent Quagga using it..
* lib/linklist.c: fix up for linklist.h changes.
* ospf6d/ospf6_abr.c: (ospf6_abr_examin_brouter) change to a single
scan of the area list, rather than scanning all areas first for
INTER_ROUTER and then again for INTER_NETWORK. According to
16.2, the scan should be area specific anyway, and further
ospf6d does not seem to implement 16.3 anyway.
2005-04-07 09:30:20 +02:00
|
|
|
for (ALL_LIST_ELEMENTS_RO((struct list *)rn->info, node,
|
|
|
|
connected))
|
2021-08-02 20:38:26 +02:00
|
|
|
connected_dump_vty(vty, NULL, connected);
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2005-04-07 Paul Jakma <paul.jakma@sun.com>
* (global): Fix up list loops to match changes in lib/linklist,
and some basic auditing of usage.
* configure.ac: define QUAGGA_NO_DEPRECATED_INTERFACES
* HACKING: Add notes about deprecating interfaces and commands.
* lib/linklist.h: Add usage comments.
Rename getdata macro to listgetdata.
Rename nextnode to listnextnode and fix its odd behaviour to be
less dangerous.
Make listgetdata macro assert node is not null, NULL list entries
should be bug condition.
ALL_LIST_ELEMENTS, new macro, forward-referencing macro for use
with for loop, Suggested by Jim Carlson of Sun.
Add ALL_LIST_ELEMENTS_RO for cases which obviously do not need the
"safety" of previous macro.
LISTNODE_ADD and DELETE macros renamed to ATTACH, DETACH, to
distinguish from the similarly named functions, and reflect their
effect better.
Add a QUAGGA_NO_DEPRECATED_INTERFACES define guarded section
with the old defines which were modified above,
for backwards compatibility - guarded to prevent Quagga using it..
* lib/linklist.c: fix up for linklist.h changes.
* ospf6d/ospf6_abr.c: (ospf6_abr_examin_brouter) change to a single
scan of the area list, rather than scanning all areas first for
INTER_ROUTER and then again for INTER_NETWORK. According to
16.2, the scan should be area specific anyway, and further
ospf6d does not seem to implement 16.3 anyway.
2005-04-07 09:30:20 +02:00
|
|
|
for (ALL_LIST_ELEMENTS_RO(ifp->connected, node, connected)) {
|
2004-10-12 22:50:58 +02:00
|
|
|
if (CHECK_FLAG(connected->conf, ZEBRA_IFC_REAL)
|
|
|
|
&& (connected->address->family == AF_INET6))
|
2021-08-02 20:38:26 +02:00
|
|
|
connected_dump_vty(vty, NULL, connected);
|
2004-10-12 22:50:58 +02:00
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-07-14 14:52:45 +02:00
|
|
|
vty_out(vty, " Interface Type %s\n",
|
|
|
|
zebra_ziftype_2str(zebra_if->zif_type));
|
2019-09-27 15:12:27 +02:00
|
|
|
vty_out(vty, " Interface Slave Type %s\n",
|
|
|
|
zebra_zifslavetype_2str(zebra_if->zif_slave_type));
|
|
|
|
|
2017-05-15 07:31:08 +02:00
|
|
|
if (IS_ZEBRA_IF_BRIDGE(ifp)) {
|
2017-07-14 14:52:45 +02:00
|
|
|
vty_out(vty, " Bridge VLAN-aware: %s\n",
|
2021-07-27 09:44:15 +02:00
|
|
|
IS_ZEBRA_IF_BRIDGE_VLAN_AWARE(zebra_if) ? "yes" : "no");
|
2017-05-15 07:31:08 +02:00
|
|
|
} else if (IS_ZEBRA_IF_VLAN(ifp)) {
|
|
|
|
struct zebra_l2info_vlan *vlan_info;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-05-15 07:31:08 +02:00
|
|
|
vlan_info = &zebra_if->l2info.vl;
|
2017-07-14 14:52:45 +02:00
|
|
|
vty_out(vty, " VLAN Id %u\n", vlan_info->vid);
|
|
|
|
} else if (IS_ZEBRA_IF_VXLAN(ifp)) {
|
2021-07-27 09:44:15 +02:00
|
|
|
zebra_vxlan_if_dump_vty(vty, zebra_if);
|
2019-12-19 18:33:56 +01:00
|
|
|
} else if (IS_ZEBRA_IF_GRE(ifp)) {
|
|
|
|
struct zebra_l2info_gre *gre_info;
|
|
|
|
|
|
|
|
gre_info = &zebra_if->l2info.gre;
|
|
|
|
if (gre_info->vtep_ip.s_addr != INADDR_ANY) {
|
|
|
|
vty_out(vty, " VTEP IP: %pI4", &gre_info->vtep_ip);
|
|
|
|
if (gre_info->vtep_ip_remote.s_addr != INADDR_ANY)
|
|
|
|
vty_out(vty, " , remote %pI4",
|
|
|
|
&gre_info->vtep_ip_remote);
|
|
|
|
vty_out(vty, "\n");
|
|
|
|
}
|
|
|
|
if (gre_info->ifindex_link &&
|
|
|
|
(gre_info->link_nsid != NS_UNKNOWN)) {
|
|
|
|
struct interface *ifp;
|
|
|
|
|
|
|
|
ifp = if_lookup_by_index_per_ns(
|
|
|
|
zebra_ns_lookup(gre_info->link_nsid),
|
|
|
|
gre_info->ifindex_link);
|
|
|
|
vty_out(vty, " Link Interface %s\n",
|
|
|
|
ifp == NULL ? "Unknown" :
|
|
|
|
ifp->name);
|
|
|
|
}
|
2017-05-15 07:31:08 +02:00
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-05-15 07:31:08 +02:00
|
|
|
if (IS_ZEBRA_IF_BRIDGE_SLAVE(ifp)) {
|
|
|
|
struct zebra_l2info_brslave *br_slave;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-05-15 07:31:08 +02:00
|
|
|
br_slave = &zebra_if->brslave_info;
|
2019-08-13 18:28:16 +02:00
|
|
|
if (br_slave->bridge_ifindex != IFINDEX_INTERNAL) {
|
|
|
|
if (br_slave->br_if)
|
|
|
|
vty_out(vty, " Master interface: %s\n",
|
|
|
|
br_slave->br_if->name);
|
|
|
|
else
|
|
|
|
vty_out(vty, " Master ifindex: %u\n",
|
|
|
|
br_slave->bridge_ifindex);
|
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
|
|
|
|
2018-11-10 21:54:43 +01:00
|
|
|
if (IS_ZEBRA_IF_BOND_SLAVE(ifp)) {
|
|
|
|
struct zebra_l2info_bondslave *bond_slave;
|
|
|
|
|
|
|
|
bond_slave = &zebra_if->bondslave_info;
|
2019-08-13 18:28:16 +02:00
|
|
|
if (bond_slave->bond_ifindex != IFINDEX_INTERNAL) {
|
|
|
|
if (bond_slave->bond_if)
|
|
|
|
vty_out(vty, " Master interface: %s\n",
|
|
|
|
bond_slave->bond_if->name);
|
|
|
|
else
|
|
|
|
vty_out(vty, " Master ifindex: %u\n",
|
|
|
|
bond_slave->bond_ifindex);
|
|
|
|
}
|
2018-11-10 21:54:43 +01:00
|
|
|
}
|
|
|
|
|
2020-08-05 16:13:55 +02:00
|
|
|
if (zebra_if->flags & ZIF_FLAG_LACP_BYPASS)
|
|
|
|
vty_out(vty, " LACP bypass: on\n");
|
|
|
|
|
2021-08-02 20:38:26 +02:00
|
|
|
zebra_evpn_if_es_print(vty, NULL, zebra_if);
|
2020-06-14 16:31:45 +02:00
|
|
|
vty_out(vty, " protodown: %s %s\n",
|
2022-01-25 20:44:25 +01:00
|
|
|
(ZEBRA_IF_IS_PROTODOWN(zebra_if)) ? "on" : "off",
|
2020-06-14 16:31:45 +02:00
|
|
|
if_is_protodown_applicable(ifp) ? "" : "(n/a)");
|
zebra: uplink tracking and startup delay for EVPN-MH
Local ethernet segments are held in a protodown or error-disabled state
if access to the VxLAN overlay is not ready -
1. When FRR comes up the local-ESs/access-port are kept protodown
for the startup-delay duration. During this time the underlay and
EVPN routes via it are expected to converge.
2. When all the uplinks/core-links attached to the underlay go down
the access-ports are similarly protodowned.
The ES-bond protodown state is propagated to each ES-bond member
and programmed in the dataplane/kernel (per-bond-member).
Configuring uplinks -
vtysh -c "conf t" vtysh -c "interface swp4" vtysh -c "evpn mh uplink"
Configuring startup delay -
vtysh -c "conf t" vtysh -c "evpn mh startup-delay 100"
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
EVPN protodown display -
========================
root@torm-11:mgmt:~# vtysh -c "show evpn"
L2 VNIs: 10
L3 VNIs: 3
Advertise gateway mac-ip: No
Advertise svi mac-ip: No
Duplicate address detection: Disable
Detection max-moves 5, time 180
EVPN MH:
mac-holdtime: 60s, neigh-holdtime: 60s
startup-delay: 180s, start-delay-timer: 00:01:14 <<<<<<<<<<<<
uplink-cfg-cnt: 4, uplink-active-cnt: 4
protodown: startup-delay <<<<<<<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond protodown display -
===========================
root@torm-11:mgmt:~# vtysh -c "show interface hostbond1"
Interface hostbond1 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 1 last: 2020/04/26 20:38:03.53
PTM status: disabled
vrf: default
OS Description: Local Node/s torm-11 and Ports swp5 <==> Remote Node/s hostd-11 and Ports swp1
index 58 metric 0 mtu 9152 speed 4294967295
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type bond
Master interface: bridge
EVPN-MH: ES id 1 ES sysmac 00:00:00:00:01:11
protodown: off rc: startup-delay <<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond member protodown display -
==================================
root@torm-11:mgmt:~# vtysh -c "show interface swp5"
Interface swp5 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 3 last: 2020/04/26 20:38:03.52
PTM status: disabled
vrf: default
index 7 metric 0 mtu 9152 speed 10000
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type Other
Master interface: hostbond1
protodown: on rc: startup-delay <<<<<<<<<<<<<<<<
root@torm-11:mgmt:~#
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-05-09 04:11:13 +02:00
|
|
|
if (zebra_if->protodown_rc)
|
2020-06-14 16:31:45 +02:00
|
|
|
vty_out(vty, " protodown reasons: %s\n",
|
zebra: uplink tracking and startup delay for EVPN-MH
Local ethernet segments are held in a protodown or error-disabled state
if access to the VxLAN overlay is not ready -
1. When FRR comes up the local-ESs/access-port are kept protodown
for the startup-delay duration. During this time the underlay and
EVPN routes via it are expected to converge.
2. When all the uplinks/core-links attached to the underlay go down
the access-ports are similarly protodowned.
The ES-bond protodown state is propagated to each ES-bond member
and programmed in the dataplane/kernel (per-bond-member).
Configuring uplinks -
vtysh -c "conf t" vtysh -c "interface swp4" vtysh -c "evpn mh uplink"
Configuring startup delay -
vtysh -c "conf t" vtysh -c "evpn mh startup-delay 100"
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
EVPN protodown display -
========================
root@torm-11:mgmt:~# vtysh -c "show evpn"
L2 VNIs: 10
L3 VNIs: 3
Advertise gateway mac-ip: No
Advertise svi mac-ip: No
Duplicate address detection: Disable
Detection max-moves 5, time 180
EVPN MH:
mac-holdtime: 60s, neigh-holdtime: 60s
startup-delay: 180s, start-delay-timer: 00:01:14 <<<<<<<<<<<<
uplink-cfg-cnt: 4, uplink-active-cnt: 4
protodown: startup-delay <<<<<<<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond protodown display -
===========================
root@torm-11:mgmt:~# vtysh -c "show interface hostbond1"
Interface hostbond1 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 1 last: 2020/04/26 20:38:03.53
PTM status: disabled
vrf: default
OS Description: Local Node/s torm-11 and Ports swp5 <==> Remote Node/s hostd-11 and Ports swp1
index 58 metric 0 mtu 9152 speed 4294967295
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type bond
Master interface: bridge
EVPN-MH: ES id 1 ES sysmac 00:00:00:00:01:11
protodown: off rc: startup-delay <<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond member protodown display -
==================================
root@torm-11:mgmt:~# vtysh -c "show interface swp5"
Interface swp5 is up, line protocol is down
Link ups: 0 last: (never)
Link downs: 3 last: 2020/04/26 20:38:03.52
PTM status: disabled
vrf: default
index 7 metric 0 mtu 9152 speed 10000
flags: <UP,BROADCAST,MULTICAST>
Type: Ethernet
HWaddr: 00:02:00:00:00:35
Interface Type Other
Master interface: hostbond1
protodown: on rc: startup-delay <<<<<<<<<<<<<<<<
root@torm-11:mgmt:~#
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-05-09 04:11:13 +02:00
|
|
|
zebra_protodown_rc_str(zebra_if->protodown_rc, pd_buf,
|
|
|
|
sizeof(pd_buf)));
|
2020-03-28 01:14:45 +01:00
|
|
|
|
2017-07-07 19:42:40 +02:00
|
|
|
if (zebra_if->link_ifindex != IFINDEX_INTERNAL) {
|
|
|
|
if (zebra_if->link)
|
2019-08-13 18:28:16 +02:00
|
|
|
vty_out(vty, " Parent interface: %s\n", zebra_if->link->name);
|
2017-07-07 19:42:40 +02:00
|
|
|
else
|
2019-08-13 18:28:16 +02:00
|
|
|
vty_out(vty, " Parent ifindex: %d\n", zebra_if->link_ifindex);
|
2017-07-07 19:42:40 +02:00
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-07-14 14:52:45 +02:00
|
|
|
if (HAS_LINK_PARAMS(ifp)) {
|
2017-07-17 14:03:14 +02:00
|
|
|
int i;
|
2017-07-14 14:52:45 +02:00
|
|
|
struct if_link_params *iflp = ifp->link_params;
|
|
|
|
vty_out(vty, " Traffic Engineering Link Parameters:\n");
|
|
|
|
if (IS_PARAM_SET(iflp, LP_TE_METRIC))
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, " TE metric %u\n", iflp->te_metric);
|
2016-12-01 16:49:22 +01:00
|
|
|
if (IS_PARAM_SET(iflp, LP_MAX_BW))
|
2017-07-14 14:52:45 +02:00
|
|
|
vty_out(vty, " Maximum Bandwidth %g (Byte/s)\n",
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
iflp->max_bw);
|
|
|
|
if (IS_PARAM_SET(iflp, LP_MAX_RSV_BW))
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty,
|
|
|
|
" Maximum Reservable Bandwidth %g (Byte/s)\n",
|
|
|
|
iflp->max_rsv_bw);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
if (IS_PARAM_SET(iflp, LP_UNRSV_BW)) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty,
|
|
|
|
" Unreserved Bandwidth per Class Type in Byte/s:\n");
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
for (i = 0; i < MAX_CLASS_TYPE; i += 2)
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty,
|
|
|
|
" [%d]: %g (Bytes/sec),\t[%d]: %g (Bytes/sec)\n",
|
2017-06-21 05:10:57 +02:00
|
|
|
i, iflp->unrsv_bw[i], i + 1,
|
|
|
|
iflp->unrsv_bw[i + 1]);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
if (IS_PARAM_SET(iflp, LP_ADM_GRP))
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, " Administrative Group:%u\n",
|
|
|
|
iflp->admin_grp);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
if (IS_PARAM_SET(iflp, LP_DELAY)) {
|
|
|
|
vty_out(vty, " Link Delay Average: %u (micro-sec.)",
|
|
|
|
iflp->av_delay);
|
|
|
|
if (IS_PARAM_SET(iflp, LP_MM_DELAY)) {
|
|
|
|
vty_out(vty, " Min: %u (micro-sec.)",
|
|
|
|
iflp->min_delay);
|
|
|
|
vty_out(vty, " Max: %u (micro-sec.)",
|
|
|
|
iflp->max_delay);
|
|
|
|
}
|
2017-07-13 19:04:25 +02:00
|
|
|
vty_out(vty, "\n");
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
}
|
|
|
|
if (IS_PARAM_SET(iflp, LP_DELAY_VAR))
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty,
|
|
|
|
" Link Delay Variation %u (micro-sec.)\n",
|
2017-06-21 05:10:57 +02:00
|
|
|
iflp->delay_var);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
if (IS_PARAM_SET(iflp, LP_PKT_LOSS))
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, " Link Packet Loss %g (in %%)\n",
|
|
|
|
iflp->pkt_loss);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
if (IS_PARAM_SET(iflp, LP_AVA_BW))
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, " Available Bandwidth %g (Byte/s)\n",
|
|
|
|
iflp->ava_bw);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
if (IS_PARAM_SET(iflp, LP_RES_BW))
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, " Residual Bandwidth %g (Byte/s)\n",
|
|
|
|
iflp->res_bw);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
if (IS_PARAM_SET(iflp, LP_USE_BW))
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, " Utilized Bandwidth %g (Byte/s)\n",
|
|
|
|
iflp->use_bw);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
if (IS_PARAM_SET(iflp, LP_RMT_AS))
|
2020-10-21 19:57:06 +02:00
|
|
|
vty_out(vty, " Neighbor ASBR IP: %pI4 AS: %u \n",
|
|
|
|
&iflp->rmt_ip, iflp->rmt_as);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-08-06 08:08:39 +02:00
|
|
|
hook_call(zebra_if_extra_info, vty, ifp);
|
|
|
|
|
2015-05-20 02:40:40 +02:00
|
|
|
if (listhead(ifp->nbr_connected))
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, " Neighbor address(s):\n");
|
2015-05-20 02:40:40 +02:00
|
|
|
for (ALL_LIST_ELEMENTS_RO(ifp->nbr_connected, node, nbr_connected))
|
2021-08-02 20:38:26 +02:00
|
|
|
nbr_connected_dump_vty(vty, NULL, nbr_connected);
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
#ifdef HAVE_PROC_NET_DEV
|
|
|
|
/* Statistics print out using proc file system. */
|
2017-07-13 18:50:29 +02:00
|
|
|
vty_out(vty,
|
2020-03-27 12:35:23 +01:00
|
|
|
" %lu input packets (%lu multicast), %lu bytes, %lu dropped\n",
|
2005-01-18 14:44:35 +01:00
|
|
|
ifp->stats.rx_packets, ifp->stats.rx_multicast,
|
2017-06-21 05:10:57 +02:00
|
|
|
ifp->stats.rx_bytes, ifp->stats.rx_dropped);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-07-13 18:50:29 +02:00
|
|
|
vty_out(vty,
|
2020-03-27 12:35:23 +01:00
|
|
|
" %lu input errors, %lu length, %lu overrun, %lu CRC, %lu frame\n",
|
2002-12-13 21:15:29 +01:00
|
|
|
ifp->stats.rx_errors, ifp->stats.rx_length_errors,
|
|
|
|
ifp->stats.rx_over_errors, ifp->stats.rx_crc_errors,
|
2017-06-21 05:10:57 +02:00
|
|
|
ifp->stats.rx_frame_errors);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, " %lu fifo, %lu missed\n", ifp->stats.rx_fifo_errors,
|
2017-06-21 05:10:57 +02:00
|
|
|
ifp->stats.rx_missed_errors);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, " %lu output packets, %lu bytes, %lu dropped\n",
|
2002-12-13 21:15:29 +01:00
|
|
|
ifp->stats.tx_packets, ifp->stats.tx_bytes,
|
2017-06-21 05:10:57 +02:00
|
|
|
ifp->stats.tx_dropped);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-07-13 18:50:29 +02:00
|
|
|
vty_out(vty,
|
2020-03-27 12:35:23 +01:00
|
|
|
" %lu output errors, %lu aborted, %lu carrier, %lu fifo, %lu heartbeat\n",
|
2002-12-13 21:15:29 +01:00
|
|
|
ifp->stats.tx_errors, ifp->stats.tx_aborted_errors,
|
|
|
|
ifp->stats.tx_carrier_errors, ifp->stats.tx_fifo_errors,
|
2017-06-21 05:10:57 +02:00
|
|
|
ifp->stats.tx_heartbeat_errors);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, " %lu window, %lu collisions\n",
|
2017-06-21 05:10:57 +02:00
|
|
|
ifp->stats.tx_window_errors, ifp->stats.collisions);
|
2002-12-13 21:15:29 +01:00
|
|
|
#endif /* HAVE_PROC_NET_DEV */
|
|
|
|
|
|
|
|
#ifdef HAVE_NET_RT_IFLIST
|
|
|
|
/* Statistics print out using sysctl (). */
|
2017-07-13 18:50:29 +02:00
|
|
|
vty_out(vty,
|
2020-03-27 12:35:23 +01:00
|
|
|
" input packets %llu, bytes %llu, dropped %llu, multicast packets %llu\n",
|
2015-04-21 10:42:30 +02:00
|
|
|
(unsigned long long)ifp->stats.ifi_ipackets,
|
|
|
|
(unsigned long long)ifp->stats.ifi_ibytes,
|
|
|
|
(unsigned long long)ifp->stats.ifi_iqdrops,
|
2017-06-21 05:10:57 +02:00
|
|
|
(unsigned long long)ifp->stats.ifi_imcasts);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, " input errors %llu\n",
|
2017-06-21 05:10:57 +02:00
|
|
|
(unsigned long long)ifp->stats.ifi_ierrors);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-07-13 18:50:29 +02:00
|
|
|
vty_out(vty,
|
2020-03-27 12:35:23 +01:00
|
|
|
" output packets %llu, bytes %llu, multicast packets %llu\n",
|
2015-04-21 10:42:30 +02:00
|
|
|
(unsigned long long)ifp->stats.ifi_opackets,
|
|
|
|
(unsigned long long)ifp->stats.ifi_obytes,
|
2017-06-21 05:10:57 +02:00
|
|
|
(unsigned long long)ifp->stats.ifi_omcasts);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, " output errors %llu\n",
|
2017-06-21 05:10:57 +02:00
|
|
|
(unsigned long long)ifp->stats.ifi_oerrors);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, " collisions %llu\n",
|
2017-06-21 05:10:57 +02:00
|
|
|
(unsigned long long)ifp->stats.ifi_collisions);
|
2002-12-13 21:15:29 +01:00
|
|
|
#endif /* HAVE_NET_RT_IFLIST */
|
|
|
|
}
|
|
|
|
|
2021-08-04 08:46:25 +02:00
|
|
|
static void zebra_vxlan_if_vni_dump_vty_json(json_object *json_if,
|
|
|
|
struct zebra_vxlan_vni *vni)
|
|
|
|
{
|
|
|
|
json_object_int_add(json_if, "vxlanId", vni->vni);
|
|
|
|
if (vni->access_vlan)
|
|
|
|
json_object_int_add(json_if, "accessVlanId", vni->access_vlan);
|
|
|
|
if (vni->mcast_grp.s_addr != INADDR_ANY)
|
|
|
|
json_object_string_addf(json_if, "mcastGroup", "%pI4",
|
|
|
|
&vni->mcast_grp);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void zebra_vxlan_if_vni_hash_dump_vty_json(struct hash_bucket *bucket,
|
|
|
|
void *ctxt)
|
|
|
|
{
|
|
|
|
json_object *json_if;
|
|
|
|
struct zebra_vxlan_vni *vni;
|
|
|
|
|
|
|
|
vni = (struct zebra_vxlan_vni *)bucket->data;
|
|
|
|
json_if = (json_object *)ctxt;
|
|
|
|
|
|
|
|
zebra_vxlan_if_vni_dump_vty_json(json_if, vni);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void zebra_vxlan_if_dump_vty_json(json_object *json_if,
|
|
|
|
struct zebra_if *zebra_if)
|
|
|
|
{
|
|
|
|
struct zebra_l2info_vxlan *vxlan_info;
|
|
|
|
struct zebra_vxlan_vni_info *vni_info;
|
|
|
|
|
|
|
|
vxlan_info = &zebra_if->l2info.vxl;
|
|
|
|
vni_info = &vxlan_info->vni_info;
|
|
|
|
|
|
|
|
if (vxlan_info->vtep_ip.s_addr != INADDR_ANY)
|
|
|
|
json_object_string_addf(json_if, "vtepIp", "%pI4",
|
|
|
|
&vxlan_info->vtep_ip);
|
|
|
|
|
|
|
|
if (vxlan_info->ifindex_link && (vxlan_info->link_nsid != NS_UNKNOWN)) {
|
|
|
|
struct interface *ifp;
|
|
|
|
|
|
|
|
ifp = if_lookup_by_index_per_ns(
|
|
|
|
zebra_ns_lookup(vxlan_info->link_nsid),
|
|
|
|
vxlan_info->ifindex_link);
|
|
|
|
json_object_string_add(json_if, "linkInterface",
|
|
|
|
ifp == NULL ? "Unknown" : ifp->name);
|
|
|
|
}
|
|
|
|
if (IS_ZEBRA_VXLAN_IF_VNI(zebra_if)) {
|
|
|
|
zebra_vxlan_if_vni_dump_vty_json(json_if, &vni_info->vni);
|
|
|
|
} else {
|
|
|
|
hash_iterate(vni_info->vni_table,
|
|
|
|
zebra_vxlan_if_vni_hash_dump_vty_json, json_if);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-08-02 20:38:26 +02:00
|
|
|
static void if_dump_vty_json(struct vty *vty, struct interface *ifp,
|
|
|
|
json_object *json)
|
|
|
|
{
|
|
|
|
struct connected *connected;
|
|
|
|
struct nbr_connected *nbr_connected;
|
|
|
|
struct listnode *node;
|
|
|
|
struct route_node *rn;
|
|
|
|
struct zebra_if *zebra_if;
|
|
|
|
char pd_buf[ZEBRA_PROTODOWN_RC_STR_LEN];
|
|
|
|
char buf[BUFSIZ];
|
|
|
|
json_object *json_if;
|
|
|
|
json_object *json_addrs;
|
|
|
|
|
|
|
|
json_if = json_object_new_object();
|
|
|
|
json_object_object_add(json, ifp->name, json_if);
|
|
|
|
|
|
|
|
if (if_is_up(ifp)) {
|
|
|
|
json_object_string_add(json_if, "administrativeStatus", "up");
|
|
|
|
|
|
|
|
if (CHECK_FLAG(ifp->status, ZEBRA_INTERFACE_LINKDETECTION)) {
|
|
|
|
json_object_string_add(json_if, "operationalStatus",
|
|
|
|
if_is_running(ifp) ? "up"
|
|
|
|
: "down");
|
|
|
|
json_object_boolean_add(json_if, "linkDetection", true);
|
|
|
|
} else {
|
|
|
|
json_object_boolean_add(json_if, "linkDetection",
|
|
|
|
false);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
json_object_string_add(json_if, "administrativeStatus", "down");
|
|
|
|
}
|
|
|
|
|
|
|
|
zebra_if = ifp->info;
|
|
|
|
|
|
|
|
json_object_int_add(json_if, "linkUps", zebra_if->up_count);
|
|
|
|
json_object_int_add(json_if, "linkDowns", zebra_if->down_count);
|
|
|
|
if (zebra_if->up_last[0])
|
|
|
|
json_object_string_add(json_if, "lastLinkUp",
|
|
|
|
zebra_if->up_last);
|
|
|
|
if (zebra_if->down_last[0])
|
|
|
|
json_object_string_add(json_if, "lastLinkDown",
|
|
|
|
zebra_if->down_last);
|
|
|
|
|
|
|
|
zebra_ptm_show_status(vty, json, ifp);
|
|
|
|
|
2021-10-13 14:06:38 +02:00
|
|
|
json_object_string_add(json_if, "vrfName", ifp->vrf->name);
|
2021-08-02 20:38:26 +02:00
|
|
|
|
|
|
|
if (ifp->desc)
|
|
|
|
json_object_string_add(json_if, "description", ifp->desc);
|
|
|
|
if (zebra_if->desc)
|
|
|
|
json_object_string_add(json_if, "OsDescription",
|
|
|
|
zebra_if->desc);
|
|
|
|
|
2021-09-17 22:32:27 +02:00
|
|
|
json_object_boolean_add(json_if, "mplsEnabled", zebra_if->mpls);
|
2022-06-23 17:00:08 +02:00
|
|
|
json_object_boolean_add(json_if, "linkDown", zebra_if->linkdown);
|
2022-06-27 21:11:45 +02:00
|
|
|
json_object_boolean_add(json_if, "linkDownV6", zebra_if->linkdownv6);
|
|
|
|
json_object_boolean_add(json_if, "mcForwardingV4",
|
|
|
|
zebra_if->v4mcast_on);
|
|
|
|
json_object_boolean_add(json_if, "mcForwardingV6",
|
|
|
|
zebra_if->v6mcast_on);
|
2021-09-17 22:32:27 +02:00
|
|
|
|
2021-08-02 20:38:26 +02:00
|
|
|
if (ifp->ifindex == IFINDEX_INTERNAL) {
|
|
|
|
json_object_boolean_add(json_if, "pseudoInterface", true);
|
|
|
|
return;
|
|
|
|
} else if (!CHECK_FLAG(ifp->status, ZEBRA_INTERFACE_ACTIVE)) {
|
|
|
|
json_object_int_add(json_if, "index", ifp->ifindex);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
json_object_boolean_add(json_if, "pseudoInterface", false);
|
|
|
|
json_object_int_add(json_if, "index", ifp->ifindex);
|
|
|
|
json_object_int_add(json_if, "metric", ifp->metric);
|
|
|
|
json_object_int_add(json_if, "mtu", ifp->mtu);
|
|
|
|
if (ifp->mtu6 != ifp->mtu)
|
|
|
|
json_object_int_add(json_if, "mtu6", ifp->mtu6);
|
|
|
|
json_object_int_add(json_if, "speed", ifp->speed);
|
|
|
|
json_object_string_add(json_if, "flags", if_flag_dump(ifp->flags));
|
|
|
|
|
|
|
|
/* Hardware address. */
|
|
|
|
json_object_string_add(json_if, "type", if_link_type_str(ifp->ll_type));
|
|
|
|
if (ifp->hw_addr_len != 0) {
|
|
|
|
char hwbuf[BUFSIZ];
|
|
|
|
|
|
|
|
hwbuf[0] = '\0';
|
|
|
|
for (int i = 0; i < ifp->hw_addr_len; i++) {
|
|
|
|
snprintf(buf, sizeof(buf), "%s%02x", i == 0 ? "" : ":",
|
|
|
|
ifp->hw_addr[i]);
|
|
|
|
strlcat(hwbuf, buf, sizeof(hwbuf));
|
|
|
|
}
|
|
|
|
json_object_string_add(json_if, "hardwareAddress", hwbuf);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Bandwidth in Mbps */
|
|
|
|
if (ifp->bandwidth != 0)
|
|
|
|
json_object_int_add(json_if, "bandwidth", ifp->bandwidth);
|
|
|
|
|
|
|
|
|
|
|
|
/* IP addresses. */
|
|
|
|
json_addrs = json_object_new_array();
|
|
|
|
json_object_object_add(json_if, "ipAddresses", json_addrs);
|
|
|
|
|
|
|
|
for (rn = route_top(zebra_if->ipv4_subnets); rn; rn = route_next(rn)) {
|
|
|
|
if (!rn->info)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
for (ALL_LIST_ELEMENTS_RO((struct list *)rn->info, node,
|
|
|
|
connected))
|
|
|
|
connected_dump_vty(vty, json_addrs, connected);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (ALL_LIST_ELEMENTS_RO(ifp->connected, node, connected)) {
|
|
|
|
if (CHECK_FLAG(connected->conf, ZEBRA_IFC_REAL)
|
|
|
|
&& (connected->address->family == AF_INET6))
|
|
|
|
connected_dump_vty(vty, json_addrs, connected);
|
|
|
|
}
|
|
|
|
|
|
|
|
json_object_string_add(json_if, "interfaceType",
|
|
|
|
zebra_ziftype_2str(zebra_if->zif_type));
|
|
|
|
json_object_string_add(
|
|
|
|
json_if, "interfaceSlaveType",
|
|
|
|
zebra_zifslavetype_2str(zebra_if->zif_slave_type));
|
|
|
|
|
|
|
|
if (IS_ZEBRA_IF_BRIDGE(ifp)) {
|
|
|
|
struct zebra_l2info_bridge *bridge_info;
|
|
|
|
|
|
|
|
bridge_info = &zebra_if->l2info.br;
|
|
|
|
json_object_boolean_add(json_if, "bridgeVlanAware",
|
2021-07-27 09:47:52 +02:00
|
|
|
bridge_info->bridge.vlan_aware);
|
2021-08-02 20:38:26 +02:00
|
|
|
} else if (IS_ZEBRA_IF_VLAN(ifp)) {
|
|
|
|
struct zebra_l2info_vlan *vlan_info;
|
|
|
|
|
|
|
|
vlan_info = &zebra_if->l2info.vl;
|
|
|
|
json_object_int_add(json_if, "vlanId", vlan_info->vid);
|
|
|
|
} else if (IS_ZEBRA_IF_VXLAN(ifp)) {
|
2021-08-04 08:46:25 +02:00
|
|
|
zebra_vxlan_if_dump_vty_json(json_if, zebra_if);
|
|
|
|
|
2021-08-02 20:38:26 +02:00
|
|
|
} else if (IS_ZEBRA_IF_GRE(ifp)) {
|
|
|
|
struct zebra_l2info_gre *gre_info;
|
|
|
|
|
|
|
|
gre_info = &zebra_if->l2info.gre;
|
|
|
|
if (gre_info->vtep_ip.s_addr != INADDR_ANY) {
|
2021-11-18 09:58:23 +01:00
|
|
|
json_object_string_addf(json_if, "vtepIp", "%pI4",
|
|
|
|
&gre_info->vtep_ip);
|
2021-08-02 20:38:26 +02:00
|
|
|
if (gre_info->vtep_ip_remote.s_addr != INADDR_ANY)
|
2021-11-18 09:58:23 +01:00
|
|
|
json_object_string_addf(
|
|
|
|
json_if, "vtepRemoteIp", "%pI4",
|
|
|
|
&gre_info->vtep_ip_remote);
|
2021-08-02 20:38:26 +02:00
|
|
|
}
|
|
|
|
if (gre_info->ifindex_link
|
|
|
|
&& (gre_info->link_nsid != NS_UNKNOWN)) {
|
|
|
|
struct interface *ifp;
|
|
|
|
|
|
|
|
ifp = if_lookup_by_index_per_ns(
|
|
|
|
zebra_ns_lookup(gre_info->link_nsid),
|
|
|
|
gre_info->ifindex_link);
|
|
|
|
json_object_string_add(json_if, "linkInterface",
|
|
|
|
ifp == NULL ? "Unknown"
|
|
|
|
: ifp->name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (IS_ZEBRA_IF_BRIDGE_SLAVE(ifp)) {
|
|
|
|
struct zebra_l2info_brslave *br_slave;
|
|
|
|
|
|
|
|
br_slave = &zebra_if->brslave_info;
|
|
|
|
if (br_slave->bridge_ifindex != IFINDEX_INTERNAL) {
|
|
|
|
if (br_slave->br_if)
|
|
|
|
json_object_string_add(json_if,
|
|
|
|
"masterInterface",
|
|
|
|
br_slave->br_if->name);
|
|
|
|
else
|
|
|
|
json_object_int_add(json_if, "masterIfindex",
|
|
|
|
br_slave->bridge_ifindex);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (IS_ZEBRA_IF_BOND_SLAVE(ifp)) {
|
|
|
|
struct zebra_l2info_bondslave *bond_slave;
|
|
|
|
|
|
|
|
bond_slave = &zebra_if->bondslave_info;
|
|
|
|
if (bond_slave->bond_ifindex != IFINDEX_INTERNAL) {
|
|
|
|
if (bond_slave->bond_if)
|
|
|
|
json_object_string_add(
|
|
|
|
json_if, "masterInterface",
|
|
|
|
bond_slave->bond_if->name);
|
|
|
|
else
|
|
|
|
json_object_int_add(json_if, "masterIfindex",
|
|
|
|
bond_slave->bond_ifindex);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
json_object_boolean_add(
|
|
|
|
json_if, "lacpBypass",
|
|
|
|
CHECK_FLAG(zebra_if->flags, ZIF_FLAG_LACP_BYPASS));
|
|
|
|
|
|
|
|
zebra_evpn_if_es_print(vty, json_if, zebra_if);
|
|
|
|
|
|
|
|
if (if_is_protodown_applicable(ifp)) {
|
|
|
|
json_object_string_add(
|
|
|
|
json_if, "protodown",
|
2022-01-25 20:44:25 +01:00
|
|
|
(ZEBRA_IF_IS_PROTODOWN(zebra_if)) ? "on" : "off");
|
2021-08-02 20:38:26 +02:00
|
|
|
if (zebra_if->protodown_rc)
|
|
|
|
json_object_string_add(
|
|
|
|
json_if, "protodownReason",
|
|
|
|
zebra_protodown_rc_str(zebra_if->protodown_rc,
|
|
|
|
pd_buf, sizeof(pd_buf)));
|
|
|
|
}
|
|
|
|
|
|
|
|
if (zebra_if->link_ifindex != IFINDEX_INTERNAL) {
|
|
|
|
if (zebra_if->link)
|
|
|
|
json_object_string_add(json_if, "parentInterface",
|
|
|
|
zebra_if->link->name);
|
|
|
|
else
|
|
|
|
json_object_int_add(json_if, "parentIfindex",
|
|
|
|
zebra_if->link_ifindex);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (HAS_LINK_PARAMS(ifp)) {
|
|
|
|
struct if_link_params *iflp = ifp->link_params;
|
|
|
|
json_object *json_te;
|
|
|
|
|
|
|
|
json_te = json_object_new_object();
|
|
|
|
json_object_object_add(
|
|
|
|
json_if, "trafficEngineeringLinkParameters", json_te);
|
|
|
|
|
|
|
|
if (IS_PARAM_SET(iflp, LP_TE_METRIC))
|
|
|
|
json_object_int_add(json_te, "teMetric",
|
|
|
|
iflp->te_metric);
|
|
|
|
if (IS_PARAM_SET(iflp, LP_MAX_BW))
|
|
|
|
json_object_double_add(json_te, "maximumBandwidth",
|
|
|
|
iflp->max_bw);
|
|
|
|
if (IS_PARAM_SET(iflp, LP_MAX_RSV_BW))
|
|
|
|
json_object_double_add(json_te,
|
|
|
|
"maximumReservableBandwidth",
|
|
|
|
iflp->max_rsv_bw);
|
|
|
|
if (IS_PARAM_SET(iflp, LP_UNRSV_BW)) {
|
|
|
|
json_object *json_bws;
|
|
|
|
|
|
|
|
json_bws = json_object_new_object();
|
|
|
|
json_object_object_add(json_te, "unreservedBandwidth",
|
|
|
|
json_bws);
|
|
|
|
for (unsigned int i = 0; i < MAX_CLASS_TYPE; ++i) {
|
|
|
|
char buf_ct[64];
|
|
|
|
|
|
|
|
snprintf(buf_ct, sizeof(buf_ct), "classType%u",
|
|
|
|
i);
|
|
|
|
json_object_double_add(json_bws, buf_ct,
|
|
|
|
iflp->unrsv_bw[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (IS_PARAM_SET(iflp, LP_ADM_GRP))
|
|
|
|
json_object_int_add(json_te, "administrativeGroup",
|
|
|
|
iflp->admin_grp);
|
|
|
|
if (IS_PARAM_SET(iflp, LP_DELAY)) {
|
|
|
|
json_object_int_add(json_te, "linkDelayAverage",
|
|
|
|
iflp->av_delay);
|
|
|
|
if (IS_PARAM_SET(iflp, LP_MM_DELAY)) {
|
|
|
|
json_object_int_add(json_te, "linkDelayMinimum",
|
|
|
|
iflp->min_delay);
|
|
|
|
json_object_int_add(json_te, "linkDelayMaximum",
|
|
|
|
iflp->max_delay);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (IS_PARAM_SET(iflp, LP_DELAY_VAR))
|
|
|
|
json_object_int_add(json_te, "linkDelayVariation",
|
|
|
|
iflp->delay_var);
|
|
|
|
if (IS_PARAM_SET(iflp, LP_PKT_LOSS))
|
|
|
|
json_object_double_add(json_te, "linkPacketLoss",
|
|
|
|
iflp->pkt_loss);
|
|
|
|
if (IS_PARAM_SET(iflp, LP_AVA_BW))
|
|
|
|
json_object_double_add(json_te, "availableBandwidth",
|
|
|
|
iflp->ava_bw);
|
|
|
|
if (IS_PARAM_SET(iflp, LP_RES_BW))
|
|
|
|
json_object_double_add(json_te, "residualBandwidth",
|
|
|
|
iflp->res_bw);
|
|
|
|
if (IS_PARAM_SET(iflp, LP_USE_BW))
|
|
|
|
json_object_double_add(json_te, "utilizedBandwidth",
|
|
|
|
iflp->use_bw);
|
|
|
|
if (IS_PARAM_SET(iflp, LP_RMT_AS))
|
2021-11-18 09:58:23 +01:00
|
|
|
json_object_string_addf(json_te, "neighborAsbrIp",
|
|
|
|
"%pI4", &iflp->rmt_ip);
|
2021-08-02 20:38:26 +02:00
|
|
|
json_object_int_add(json_te, "neighborAsbrAs", iflp->rmt_as);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (listhead(ifp->nbr_connected)) {
|
|
|
|
json_object *json_nbr_addrs;
|
|
|
|
|
|
|
|
json_nbr_addrs = json_object_new_array();
|
|
|
|
json_object_object_add(json_if, "neighborIpAddresses",
|
|
|
|
json_nbr_addrs);
|
|
|
|
|
|
|
|
for (ALL_LIST_ELEMENTS_RO(ifp->nbr_connected, node,
|
|
|
|
nbr_connected))
|
|
|
|
nbr_connected_dump_vty(vty, json_nbr_addrs,
|
|
|
|
nbr_connected);
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef HAVE_PROC_NET_DEV
|
|
|
|
json_object_int_add(json_if, "inputPackets", stats.rx_packets);
|
|
|
|
json_object_int_add(json_if, "inputBytes", ifp->stats.rx_bytes);
|
|
|
|
json_object_int_add(json_if, "inputDropped", ifp->stats.rx_dropped);
|
|
|
|
json_object_int_add(json_if, "inputMulticastPackets",
|
|
|
|
ifp->stats.rx_multicast);
|
|
|
|
json_object_int_add(json_if, "inputErrors", ifp->stats.rx_errors);
|
|
|
|
json_object_int_add(json_if, "inputLengthErrors",
|
|
|
|
ifp->stats.rx_length_errors);
|
|
|
|
json_object_int_add(json_if, "inputOverrunErrors",
|
|
|
|
ifp->stats.rx_over_errors);
|
|
|
|
json_object_int_add(json_if, "inputCrcErrors",
|
|
|
|
ifp->stats.rx_crc_errors);
|
|
|
|
json_object_int_add(json_if, "inputFrameErrors",
|
|
|
|
ifp->stats.rx_frame_errors);
|
|
|
|
json_object_int_add(json_if, "inputFifoErrors",
|
|
|
|
ifp->stats.rx_fifo_errors);
|
|
|
|
json_object_int_add(json_if, "inputMissedErrors",
|
|
|
|
ifp->stats.rx_missed_errors);
|
|
|
|
json_object_int_add(json_if, "outputPackets", ifp->stats.tx_packets);
|
|
|
|
json_object_int_add(json_if, "outputBytes", ifp->stats.tx_bytes);
|
|
|
|
json_object_int_add(json_if, "outputDroppedPackets",
|
|
|
|
ifp->stats.tx_dropped);
|
|
|
|
json_object_int_add(json_if, "outputErrors", ifp->stats.tx_errors);
|
|
|
|
json_object_int_add(json_if, "outputAbortedErrors",
|
|
|
|
ifp->stats.tx_aborted_errors);
|
|
|
|
json_object_int_add(json_if, "outputCarrierErrors",
|
|
|
|
ifp->stats.tx_carrier_errors);
|
|
|
|
json_object_int_add(json_if, "outputFifoErrors",
|
|
|
|
ifp->stats.tx_fifo_errors);
|
|
|
|
json_object_int_add(json_if, "outputHeartbeatErrors",
|
|
|
|
ifp->stats.tx_heartbeat_errors);
|
|
|
|
json_object_int_add(json_if, "outputWindowErrors",
|
|
|
|
ifp->stats.tx_window_errors);
|
|
|
|
json_object_int_add(json_if, "collisions", ifp->stats.collisions);
|
|
|
|
#endif /* HAVE_PROC_NET_DEV */
|
|
|
|
|
|
|
|
#ifdef HAVE_NET_RT_IFLIST
|
|
|
|
json_object_int_add(json_if, "inputPackets", ifp->stats.ifi_ipackets);
|
|
|
|
json_object_int_add(json_if, "inputBytes", ifp->stats.ifi_ibytes);
|
|
|
|
json_object_int_add(json_if, "inputDropd", ifp->stats.ifi_iqdrops);
|
|
|
|
json_object_int_add(json_if, "inputMulticastPackets",
|
|
|
|
ifp->stats.ifi_imcasts);
|
|
|
|
json_object_int_add(json_if, "inputErrors", ifp->stats.ifi_ierrors);
|
|
|
|
json_object_int_add(json_if, "outputPackets", ifp->stats.ifi_opackets);
|
|
|
|
json_object_int_add(json_if, "outputBytes", ifp->stats.ifi_obytes);
|
|
|
|
json_object_int_add(json_if, "outputMulticastPackets",
|
|
|
|
ifp->stats.ifi_omcasts);
|
|
|
|
json_object_int_add(json_if, "outputErrors", ifp->stats.ifi_oerrors);
|
|
|
|
json_object_int_add(json_if, "collisions", ifp->stats.ifi_collisions);
|
|
|
|
#endif /* HAVE_NET_RT_IFLIST */
|
|
|
|
}
|
|
|
|
|
2016-02-06 03:17:08 +01:00
|
|
|
static void interface_update_stats(void)
|
|
|
|
{
|
|
|
|
#ifdef HAVE_PROC_NET_DEV
|
|
|
|
/* If system has interface statistics via proc file system, update
|
|
|
|
statistics. */
|
|
|
|
ifstat_update_proc();
|
|
|
|
#endif /* HAVE_PROC_NET_DEV */
|
|
|
|
#ifdef HAVE_NET_RT_IFLIST
|
|
|
|
ifstat_update_sysctl();
|
|
|
|
#endif /* HAVE_NET_RT_IFLIST */
|
|
|
|
}
|
|
|
|
|
2018-11-07 10:58:29 +01:00
|
|
|
#include "zebra/interface_clippy.c"
|
2015-05-22 11:40:01 +02:00
|
|
|
/* Show all interfaces to vty. */
|
2018-11-07 10:58:29 +01:00
|
|
|
DEFPY(show_interface, show_interface_cmd,
|
2021-08-02 20:38:26 +02:00
|
|
|
"show interface vrf NAME$vrf_name [brief$brief] [json$uj]",
|
2018-11-07 10:58:29 +01:00
|
|
|
SHOW_STR
|
|
|
|
"Interface status and configuration\n"
|
|
|
|
VRF_CMD_HELP_STR
|
2021-08-02 20:38:26 +02:00
|
|
|
"Interface status and configuration summary\n"
|
|
|
|
JSON_STR)
|
2015-05-22 11:40:01 +02:00
|
|
|
{
|
2019-06-24 01:46:39 +02:00
|
|
|
struct vrf *vrf;
|
2015-05-22 11:40:01 +02:00
|
|
|
struct interface *ifp;
|
2021-08-02 20:38:26 +02:00
|
|
|
json_object *json = NULL;
|
2015-05-22 11:40:01 +02:00
|
|
|
|
2016-02-06 03:17:08 +01:00
|
|
|
interface_update_stats();
|
2015-05-22 11:40:01 +02:00
|
|
|
|
2020-06-21 18:21:51 +02:00
|
|
|
vrf = vrf_lookup_by_name(vrf_name);
|
|
|
|
if (!vrf) {
|
2021-08-02 20:38:26 +02:00
|
|
|
if (uj)
|
|
|
|
vty_out(vty, "{}\n");
|
|
|
|
else
|
|
|
|
vty_out(vty, "%% VRF %s not found\n", vrf_name);
|
2020-06-21 18:21:51 +02:00
|
|
|
return CMD_WARNING;
|
|
|
|
}
|
2015-05-22 11:40:01 +02:00
|
|
|
|
2021-08-02 20:38:26 +02:00
|
|
|
if (uj)
|
|
|
|
json = json_object_new_object();
|
|
|
|
|
2018-11-07 10:58:29 +01:00
|
|
|
if (brief) {
|
2021-08-02 20:38:26 +02:00
|
|
|
if (json)
|
|
|
|
ifs_dump_brief_vty_json(json, vrf);
|
|
|
|
else
|
|
|
|
ifs_dump_brief_vty(vty, vrf);
|
2018-11-07 10:58:29 +01:00
|
|
|
} else {
|
|
|
|
FOR_ALL_INTERFACES (vrf, ifp) {
|
2021-08-02 20:38:26 +02:00
|
|
|
if (json)
|
|
|
|
if_dump_vty_json(vty, ifp, json);
|
|
|
|
else
|
|
|
|
if_dump_vty(vty, ifp);
|
2018-11-07 10:58:29 +01:00
|
|
|
}
|
|
|
|
}
|
2015-05-22 11:40:01 +02:00
|
|
|
|
2021-11-25 23:02:37 +01:00
|
|
|
if (json)
|
2021-11-25 16:49:46 +01:00
|
|
|
vty_json(vty, json);
|
2021-08-02 20:38:26 +02:00
|
|
|
|
2015-05-22 11:40:01 +02:00
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Show all interfaces to vty. */
|
2019-06-13 13:22:11 +02:00
|
|
|
DEFPY (show_interface_vrf_all,
|
2016-09-22 22:00:23 +02:00
|
|
|
show_interface_vrf_all_cmd,
|
2021-08-02 20:38:26 +02:00
|
|
|
"show interface [vrf all] [brief$brief] [json$uj]",
|
2015-05-22 11:40:01 +02:00
|
|
|
SHOW_STR
|
|
|
|
"Interface status and configuration\n"
|
2019-06-13 13:22:11 +02:00
|
|
|
VRF_ALL_CMD_HELP_STR
|
2021-08-02 20:38:26 +02:00
|
|
|
"Interface status and configuration summary\n"
|
|
|
|
JSON_STR)
|
2002-12-13 21:15:29 +01:00
|
|
|
{
|
2016-10-29 18:37:11 +02:00
|
|
|
struct vrf *vrf;
|
2002-12-13 21:15:29 +01:00
|
|
|
struct interface *ifp;
|
2021-08-02 20:38:26 +02:00
|
|
|
json_object *json = NULL;
|
2015-05-22 11:40:01 +02:00
|
|
|
|
2016-02-06 03:17:08 +01:00
|
|
|
interface_update_stats();
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2021-08-02 20:38:26 +02:00
|
|
|
if (uj)
|
|
|
|
json = json_object_new_object();
|
|
|
|
|
2015-05-22 11:40:01 +02:00
|
|
|
/* All interface print. */
|
2019-06-13 13:22:11 +02:00
|
|
|
RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
|
|
|
|
if (brief) {
|
2021-08-02 20:38:26 +02:00
|
|
|
if (json)
|
|
|
|
ifs_dump_brief_vty_json(json, vrf);
|
|
|
|
else
|
|
|
|
ifs_dump_brief_vty(vty, vrf);
|
2019-06-13 13:22:11 +02:00
|
|
|
} else {
|
2021-08-02 20:38:26 +02:00
|
|
|
FOR_ALL_INTERFACES (vrf, ifp) {
|
|
|
|
if (json)
|
|
|
|
if_dump_vty_json(vty, ifp, json);
|
|
|
|
else
|
|
|
|
if_dump_vty(vty, ifp);
|
|
|
|
}
|
2019-06-13 13:22:11 +02:00
|
|
|
}
|
|
|
|
}
|
2015-05-22 11:40:01 +02:00
|
|
|
|
2021-11-25 23:02:37 +01:00
|
|
|
if (json)
|
2021-11-25 16:49:46 +01:00
|
|
|
vty_json(vty, json);
|
2021-08-02 20:38:26 +02:00
|
|
|
|
2015-05-22 11:40:01 +02:00
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Show specified interface to vty. */
|
2016-02-04 14:59:12 +01:00
|
|
|
|
2021-08-02 20:38:26 +02:00
|
|
|
DEFPY (show_interface_name_vrf,
|
2016-02-04 14:59:12 +01:00
|
|
|
show_interface_name_vrf_cmd,
|
2021-08-02 20:38:26 +02:00
|
|
|
"show interface IFNAME$ifname vrf NAME$vrf_name [json$uj]",
|
2015-05-22 11:40:01 +02:00
|
|
|
SHOW_STR
|
|
|
|
"Interface status and configuration\n"
|
2016-02-04 14:59:12 +01:00
|
|
|
"Interface name\n"
|
2021-08-02 20:38:26 +02:00
|
|
|
VRF_CMD_HELP_STR
|
|
|
|
JSON_STR)
|
2015-05-22 11:40:01 +02:00
|
|
|
{
|
|
|
|
struct interface *ifp;
|
2020-06-21 18:21:51 +02:00
|
|
|
struct vrf *vrf;
|
2021-08-02 20:38:26 +02:00
|
|
|
json_object *json = NULL;
|
2015-05-22 11:40:01 +02:00
|
|
|
|
2016-02-06 03:17:08 +01:00
|
|
|
interface_update_stats();
|
2015-05-22 11:40:01 +02:00
|
|
|
|
2021-08-02 20:38:26 +02:00
|
|
|
vrf = vrf_lookup_by_name(vrf_name);
|
2020-06-21 18:21:51 +02:00
|
|
|
if (!vrf) {
|
2021-08-02 20:38:26 +02:00
|
|
|
if (uj)
|
|
|
|
vty_out(vty, "{}\n");
|
|
|
|
else
|
|
|
|
vty_out(vty, "%% VRF %s not found\n", vrf_name);
|
2020-06-21 18:21:51 +02:00
|
|
|
return CMD_WARNING;
|
|
|
|
}
|
2015-05-22 11:40:01 +02:00
|
|
|
|
2021-08-02 20:38:26 +02:00
|
|
|
ifp = if_lookup_by_name_vrf(ifname, vrf);
|
2015-05-22 11:40:01 +02:00
|
|
|
if (ifp == NULL) {
|
2021-08-02 20:38:26 +02:00
|
|
|
if (uj)
|
|
|
|
vty_out(vty, "{}\n");
|
|
|
|
else
|
|
|
|
vty_out(vty, "%% Can't find interface %s\n", ifname);
|
2015-05-22 11:40:01 +02:00
|
|
|
return CMD_WARNING;
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
2021-08-02 20:38:26 +02:00
|
|
|
|
|
|
|
if (uj)
|
|
|
|
json = json_object_new_object();
|
|
|
|
|
|
|
|
if (json)
|
|
|
|
if_dump_vty_json(vty, ifp, json);
|
|
|
|
else
|
|
|
|
if_dump_vty(vty, ifp);
|
|
|
|
|
2021-11-25 23:02:37 +01:00
|
|
|
if (json)
|
2021-11-25 16:49:46 +01:00
|
|
|
vty_json(vty, json);
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2015-05-22 11:40:01 +02:00
|
|
|
/* Show specified interface to vty. */
|
2021-08-02 20:38:26 +02:00
|
|
|
DEFPY (show_interface_name_vrf_all,
|
2016-09-22 22:00:23 +02:00
|
|
|
show_interface_name_vrf_all_cmd,
|
2021-08-02 20:38:26 +02:00
|
|
|
"show interface IFNAME$ifname [vrf all] [json$uj]",
|
2015-05-22 11:40:01 +02:00
|
|
|
SHOW_STR
|
|
|
|
"Interface status and configuration\n"
|
2016-02-04 14:59:12 +01:00
|
|
|
"Interface name\n"
|
2021-08-02 20:38:26 +02:00
|
|
|
VRF_ALL_CMD_HELP_STR
|
|
|
|
JSON_STR)
|
2015-05-22 11:40:01 +02:00
|
|
|
{
|
2021-10-14 20:06:38 +02:00
|
|
|
struct interface *ifp = NULL;
|
|
|
|
struct interface *ifptmp;
|
|
|
|
struct vrf *vrf;
|
2021-08-02 20:38:26 +02:00
|
|
|
json_object *json = NULL;
|
2021-10-14 20:06:38 +02:00
|
|
|
int count = 0;
|
2015-05-22 11:40:01 +02:00
|
|
|
|
2016-02-06 03:17:08 +01:00
|
|
|
interface_update_stats();
|
2015-05-22 11:40:01 +02:00
|
|
|
|
2021-10-14 20:06:38 +02:00
|
|
|
RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
|
|
|
|
ifptmp = if_lookup_by_name_vrf(ifname, vrf);
|
|
|
|
if (ifptmp) {
|
|
|
|
ifp = ifptmp;
|
|
|
|
count++;
|
|
|
|
if (!vrf_is_backend_netns())
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-06-21 18:21:51 +02:00
|
|
|
if (ifp == NULL) {
|
2021-08-02 20:38:26 +02:00
|
|
|
if (uj)
|
|
|
|
vty_out(vty, "{}\n");
|
|
|
|
else
|
|
|
|
vty_out(vty, "%% Can't find interface %s\n", ifname);
|
2015-05-22 11:40:01 +02:00
|
|
|
return CMD_WARNING;
|
|
|
|
}
|
2021-10-14 20:06:38 +02:00
|
|
|
if (count > 1) {
|
|
|
|
if (uj) {
|
|
|
|
vty_out(vty, "{}\n");
|
|
|
|
} else {
|
|
|
|
vty_out(vty,
|
|
|
|
"%% There are multiple interfaces with name %s\n",
|
|
|
|
ifname);
|
|
|
|
vty_out(vty, "%% You must specify the VRF name\n");
|
|
|
|
}
|
|
|
|
return CMD_WARNING;
|
2015-05-22 11:40:01 +02:00
|
|
|
}
|
2021-08-02 20:38:26 +02:00
|
|
|
|
|
|
|
if (uj)
|
|
|
|
json = json_object_new_object();
|
|
|
|
|
|
|
|
if (json)
|
|
|
|
if_dump_vty_json(vty, ifp, json);
|
|
|
|
else
|
|
|
|
if_dump_vty(vty, ifp);
|
|
|
|
|
2021-11-25 23:02:37 +01:00
|
|
|
if (json)
|
2021-11-25 16:49:46 +01:00
|
|
|
vty_json(vty, json);
|
2015-05-22 11:40:01 +02:00
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2020-06-21 18:21:51 +02:00
|
|
|
static void if_show_description(struct vty *vty, struct vrf *vrf)
|
2005-03-13 20:17:21 +01:00
|
|
|
{
|
|
|
|
struct interface *ifp;
|
|
|
|
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "Interface Status Protocol Description\n");
|
2017-10-06 20:25:58 +02:00
|
|
|
FOR_ALL_INTERFACES (vrf, ifp) {
|
2005-03-13 20:17:21 +01:00
|
|
|
int len;
|
2019-04-28 01:55:21 +02:00
|
|
|
struct zebra_if *zif;
|
|
|
|
bool intf_desc;
|
|
|
|
|
|
|
|
intf_desc = false;
|
2005-03-13 20:17:21 +01:00
|
|
|
|
|
|
|
len = vty_out(vty, "%s", ifp->name);
|
|
|
|
vty_out(vty, "%*s", (16 - len), " ");
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2005-03-13 20:17:21 +01:00
|
|
|
if (if_is_up(ifp)) {
|
|
|
|
vty_out(vty, "up ");
|
|
|
|
if (CHECK_FLAG(ifp->status,
|
|
|
|
ZEBRA_INTERFACE_LINKDETECTION)) {
|
|
|
|
if (if_is_running(ifp))
|
|
|
|
vty_out(vty, "up ");
|
|
|
|
else
|
|
|
|
vty_out(vty, "down ");
|
|
|
|
} else {
|
|
|
|
vty_out(vty, "unknown ");
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
vty_out(vty, "down down ");
|
|
|
|
}
|
|
|
|
|
2019-04-28 01:55:21 +02:00
|
|
|
if (ifp->desc) {
|
|
|
|
intf_desc = true;
|
2005-03-13 20:17:21 +01:00
|
|
|
vty_out(vty, "%s", ifp->desc);
|
2019-04-28 01:55:21 +02:00
|
|
|
}
|
|
|
|
zif = ifp->info;
|
|
|
|
if (zif && zif->desc) {
|
|
|
|
vty_out(vty, "%s%s",
|
|
|
|
intf_desc
|
|
|
|
? "\n "
|
|
|
|
: "",
|
|
|
|
zif->desc);
|
|
|
|
}
|
|
|
|
|
2017-07-13 19:04:25 +02:00
|
|
|
vty_out(vty, "\n");
|
2005-03-13 20:17:21 +01:00
|
|
|
}
|
2015-05-22 11:40:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (show_interface_desc,
|
|
|
|
show_interface_desc_cmd,
|
2020-06-21 18:21:51 +02:00
|
|
|
"show interface description vrf NAME",
|
2015-05-22 11:40:01 +02:00
|
|
|
SHOW_STR
|
|
|
|
"Interface status and configuration\n"
|
2016-09-28 06:47:43 +02:00
|
|
|
"Interface description\n"
|
|
|
|
VRF_CMD_HELP_STR)
|
2015-05-22 11:40:01 +02:00
|
|
|
{
|
2020-06-21 18:21:51 +02:00
|
|
|
struct vrf *vrf;
|
2015-05-22 11:40:01 +02:00
|
|
|
|
2020-06-21 18:21:51 +02:00
|
|
|
vrf = vrf_lookup_by_name(argv[4]->arg);
|
|
|
|
if (!vrf) {
|
|
|
|
vty_out(vty, "%% VRF %s not found\n", argv[4]->arg);
|
|
|
|
return CMD_WARNING;
|
|
|
|
}
|
2015-05-22 11:40:01 +02:00
|
|
|
|
2020-06-21 18:21:51 +02:00
|
|
|
if_show_description(vty, vrf);
|
2015-05-22 11:40:01 +02:00
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
DEFUN (show_interface_desc_vrf_all,
|
|
|
|
show_interface_desc_vrf_all_cmd,
|
2020-06-21 18:21:51 +02:00
|
|
|
"show interface description [vrf all]",
|
2015-05-22 11:40:01 +02:00
|
|
|
SHOW_STR
|
|
|
|
"Interface status and configuration\n"
|
|
|
|
"Interface description\n"
|
|
|
|
VRF_ALL_CMD_HELP_STR)
|
|
|
|
{
|
2016-10-29 18:37:11 +02:00
|
|
|
struct vrf *vrf;
|
2015-05-22 11:40:01 +02:00
|
|
|
|
2017-09-15 17:47:35 +02:00
|
|
|
RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name)
|
2017-10-03 03:06:01 +02:00
|
|
|
if (!RB_EMPTY(if_name_head, &vrf->ifaces_by_name)) {
|
2020-02-14 14:41:04 +01:00
|
|
|
vty_out(vty, "\n\tVRF %s(%u)\n\n", VRF_LOGNAME(vrf),
|
|
|
|
vrf->vrf_id);
|
2020-06-21 18:21:51 +02:00
|
|
|
if_show_description(vty, vrf);
|
2017-09-15 17:47:35 +02:00
|
|
|
}
|
2015-05-22 11:40:01 +02:00
|
|
|
|
2005-03-13 20:17:21 +01:00
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2020-02-25 03:40:29 +01:00
|
|
|
int if_multicast_set(struct interface *ifp)
|
|
|
|
{
|
|
|
|
struct zebra_if *if_data;
|
|
|
|
|
|
|
|
if (CHECK_FLAG(ifp->status, ZEBRA_INTERFACE_ACTIVE)) {
|
|
|
|
if (if_set_flags(ifp, IFF_MULTICAST) < 0) {
|
|
|
|
zlog_debug("Can't set multicast flag on interface %s",
|
|
|
|
ifp->name);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
if_refresh(ifp);
|
|
|
|
}
|
|
|
|
if_data = ifp->info;
|
2022-06-29 15:05:17 +02:00
|
|
|
if_data->multicast = IF_ZEBRA_DATA_ON;
|
2020-02-25 03:40:29 +01:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
DEFUN (multicast,
|
|
|
|
multicast_cmd,
|
|
|
|
"multicast",
|
|
|
|
"Set multicast flag to interface\n")
|
|
|
|
{
|
2016-09-30 15:38:03 +02:00
|
|
|
VTY_DECLVAR_CONTEXT(interface, ifp);
|
2002-12-13 21:15:29 +01:00
|
|
|
int ret;
|
|
|
|
struct zebra_if *if_data;
|
|
|
|
|
2002-12-13 21:52:52 +01:00
|
|
|
if (CHECK_FLAG(ifp->status, ZEBRA_INTERFACE_ACTIVE)) {
|
|
|
|
ret = if_set_flags(ifp, IFF_MULTICAST);
|
|
|
|
if (ret < 0) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "Can't set multicast flag\n");
|
2017-07-13 21:56:08 +02:00
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
2002-12-13 21:52:52 +01:00
|
|
|
if_refresh(ifp);
|
|
|
|
}
|
2002-12-13 21:15:29 +01:00
|
|
|
if_data = ifp->info;
|
2022-06-29 15:05:17 +02:00
|
|
|
if_data->multicast = IF_ZEBRA_DATA_ON;
|
2002-12-13 21:52:52 +01:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2022-06-29 13:43:50 +02:00
|
|
|
DEFPY (mpls,
|
|
|
|
mpls_cmd,
|
|
|
|
"[no] mpls enable",
|
|
|
|
NO_STR
|
|
|
|
MPLS_STR
|
|
|
|
"Set mpls to be on for the interface\n")
|
|
|
|
{
|
|
|
|
VTY_DECLVAR_CONTEXT(interface, ifp);
|
|
|
|
struct zebra_if *if_data = ifp->info;
|
|
|
|
|
|
|
|
if (no) {
|
|
|
|
dplane_intf_mpls_modify_state(ifp, false);
|
2023-04-26 21:55:32 +02:00
|
|
|
if_data->mpls_config = IF_ZEBRA_DATA_UNSPEC;
|
2022-06-29 13:43:50 +02:00
|
|
|
} else {
|
|
|
|
dplane_intf_mpls_modify_state(ifp, true);
|
2023-04-26 21:55:32 +02:00
|
|
|
if_data->mpls_config = IF_ZEBRA_DATA_ON;
|
2022-06-29 13:43:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2020-02-25 03:40:29 +01:00
|
|
|
int if_multicast_unset(struct interface *ifp)
|
|
|
|
{
|
|
|
|
struct zebra_if *if_data;
|
|
|
|
|
|
|
|
if (CHECK_FLAG(ifp->status, ZEBRA_INTERFACE_ACTIVE)) {
|
|
|
|
if (if_unset_flags(ifp, IFF_MULTICAST) < 0) {
|
|
|
|
zlog_debug("Can't unset multicast flag on interface %s",
|
|
|
|
ifp->name);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
if_refresh(ifp);
|
|
|
|
}
|
|
|
|
if_data = ifp->info;
|
2022-06-29 15:05:17 +02:00
|
|
|
if_data->multicast = IF_ZEBRA_DATA_OFF;
|
2020-02-25 03:40:29 +01:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
DEFUN (no_multicast,
|
|
|
|
no_multicast_cmd,
|
|
|
|
"no multicast",
|
|
|
|
NO_STR
|
|
|
|
"Unset multicast flag to interface\n")
|
|
|
|
{
|
2016-09-30 15:38:03 +02:00
|
|
|
VTY_DECLVAR_CONTEXT(interface, ifp);
|
2002-12-13 21:15:29 +01:00
|
|
|
int ret;
|
|
|
|
struct zebra_if *if_data;
|
|
|
|
|
2002-12-13 21:52:52 +01:00
|
|
|
if (CHECK_FLAG(ifp->status, ZEBRA_INTERFACE_ACTIVE)) {
|
|
|
|
ret = if_unset_flags(ifp, IFF_MULTICAST);
|
|
|
|
if (ret < 0) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "Can't unset multicast flag\n");
|
2017-07-13 21:56:08 +02:00
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
2002-12-13 21:52:52 +01:00
|
|
|
if_refresh(ifp);
|
|
|
|
}
|
2002-12-13 21:15:29 +01:00
|
|
|
if_data = ifp->info;
|
2022-06-29 15:05:17 +02:00
|
|
|
if_data->multicast = IF_ZEBRA_DATA_OFF;
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2020-02-25 03:40:29 +01:00
|
|
|
int if_linkdetect(struct interface *ifp, bool detect)
|
2002-12-13 22:03:13 +01:00
|
|
|
{
|
|
|
|
int if_was_operative;
|
|
|
|
|
2015-05-20 02:40:44 +02:00
|
|
|
if_was_operative = if_is_no_ptm_operative(ifp);
|
2020-02-25 03:40:29 +01:00
|
|
|
if (detect) {
|
|
|
|
SET_FLAG(ifp->status, ZEBRA_INTERFACE_LINKDETECTION);
|
2002-12-13 22:03:13 +01:00
|
|
|
|
2020-02-25 03:40:29 +01:00
|
|
|
/* When linkdetection is enabled, if might come down */
|
|
|
|
if (!if_is_no_ptm_operative(ifp) && if_was_operative)
|
|
|
|
if_down(ifp);
|
|
|
|
} else {
|
|
|
|
UNSET_FLAG(ifp->status, ZEBRA_INTERFACE_LINKDETECTION);
|
2002-12-13 22:03:13 +01:00
|
|
|
|
2020-02-25 03:40:29 +01:00
|
|
|
/* Interface may come up after disabling link detection */
|
|
|
|
if (if_is_operative(ifp) && !if_was_operative)
|
2020-10-02 20:49:09 +02:00
|
|
|
if_up(ifp, true);
|
2020-02-25 03:40:29 +01:00
|
|
|
}
|
2002-12-13 22:03:13 +01:00
|
|
|
/* FIXME: Will defer status change forwarding if interface
|
|
|
|
does not come down! */
|
2020-02-25 03:40:29 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN(linkdetect, linkdetect_cmd, "link-detect",
|
|
|
|
"Enable link detection on interface\n")
|
|
|
|
{
|
|
|
|
VTY_DECLVAR_CONTEXT(interface, ifp);
|
|
|
|
|
|
|
|
if_linkdetect(ifp, true);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2002-12-13 22:03:13 +01:00
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
DEFUN (no_linkdetect,
|
|
|
|
no_linkdetect_cmd,
|
|
|
|
"no link-detect",
|
|
|
|
NO_STR
|
|
|
|
"Disable link detection on interface\n")
|
|
|
|
{
|
2016-09-30 15:38:03 +02:00
|
|
|
VTY_DECLVAR_CONTEXT(interface, ifp);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2020-02-25 03:40:29 +01:00
|
|
|
if_linkdetect(ifp, false);
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
2002-12-13 22:03:13 +01:00
|
|
|
|
2020-02-25 03:40:29 +01:00
|
|
|
int if_shutdown(struct interface *ifp)
|
|
|
|
{
|
|
|
|
struct zebra_if *if_data;
|
2002-12-13 22:03:13 +01:00
|
|
|
|
2020-02-25 03:40:29 +01:00
|
|
|
if (ifp->ifindex != IFINDEX_INTERNAL) {
|
|
|
|
/* send RA lifetime of 0 before stopping. rfc4861/6.2.5 */
|
|
|
|
rtadv_stop_ra(ifp);
|
|
|
|
if (if_unset_flags(ifp, IFF_UP) < 0) {
|
|
|
|
zlog_debug("Can't shutdown interface %s", ifp->name);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
if_refresh(ifp);
|
|
|
|
}
|
|
|
|
if_data = ifp->info;
|
2022-06-29 15:05:17 +02:00
|
|
|
if_data->shutdown = IF_ZEBRA_DATA_ON;
|
2002-12-13 22:03:13 +01:00
|
|
|
|
2020-02-25 03:40:29 +01:00
|
|
|
return 0;
|
2002-12-13 22:03:13 +01:00
|
|
|
}
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
DEFUN (shutdown_if,
|
|
|
|
shutdown_if_cmd,
|
|
|
|
"shutdown",
|
|
|
|
"Shutdown the selected interface\n")
|
|
|
|
{
|
2016-09-30 15:38:03 +02:00
|
|
|
VTY_DECLVAR_CONTEXT(interface, ifp);
|
2002-12-13 21:15:29 +01:00
|
|
|
int ret;
|
|
|
|
struct zebra_if *if_data;
|
|
|
|
|
2013-01-24 15:04:50 +01:00
|
|
|
if (ifp->ifindex != IFINDEX_INTERNAL) {
|
2019-12-03 15:02:20 +01:00
|
|
|
/* send RA lifetime of 0 before stopping. rfc4861/6.2.5 */
|
|
|
|
rtadv_stop_ra(ifp);
|
2013-01-24 15:04:50 +01:00
|
|
|
ret = if_unset_flags(ifp, IFF_UP);
|
|
|
|
if (ret < 0) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "Can't shutdown interface\n");
|
2017-07-13 21:56:08 +02:00
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
2013-01-24 15:04:50 +01:00
|
|
|
}
|
|
|
|
if_refresh(ifp);
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
|
|
|
if_data = ifp->info;
|
2022-06-29 15:05:17 +02:00
|
|
|
if_data->shutdown = IF_ZEBRA_DATA_ON;
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2020-02-25 03:40:29 +01:00
|
|
|
int if_no_shutdown(struct interface *ifp)
|
|
|
|
{
|
|
|
|
struct zebra_if *if_data;
|
|
|
|
|
|
|
|
if (ifp->ifindex != IFINDEX_INTERNAL) {
|
|
|
|
if (if_set_flags(ifp, IFF_UP | IFF_RUNNING) < 0) {
|
|
|
|
zlog_debug("Can't up interface %s", ifp->name);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
if_refresh(ifp);
|
|
|
|
|
|
|
|
/* Some addresses (in particular, IPv6 addresses on Linux) get
|
|
|
|
* removed when the interface goes down. They need to be
|
|
|
|
* readded.
|
|
|
|
*/
|
|
|
|
if_addr_wakeup(ifp);
|
|
|
|
}
|
|
|
|
|
|
|
|
if_data = ifp->info;
|
2022-06-29 15:05:17 +02:00
|
|
|
if_data->shutdown = IF_ZEBRA_DATA_OFF;
|
2020-02-25 03:40:29 +01:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
DEFUN (no_shutdown_if,
|
|
|
|
no_shutdown_if_cmd,
|
|
|
|
"no shutdown",
|
|
|
|
NO_STR
|
|
|
|
"Shutdown the selected interface\n")
|
|
|
|
{
|
2016-09-30 15:38:03 +02:00
|
|
|
VTY_DECLVAR_CONTEXT(interface, ifp);
|
2002-12-13 21:15:29 +01:00
|
|
|
int ret;
|
|
|
|
struct zebra_if *if_data;
|
|
|
|
|
2013-01-24 15:04:50 +01:00
|
|
|
if (ifp->ifindex != IFINDEX_INTERNAL) {
|
|
|
|
ret = if_set_flags(ifp, IFF_UP | IFF_RUNNING);
|
|
|
|
if (ret < 0) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "Can't up interface\n");
|
2017-07-13 21:56:08 +02:00
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
2013-01-24 15:04:50 +01:00
|
|
|
}
|
|
|
|
if_refresh(ifp);
|
|
|
|
|
|
|
|
/* Some addresses (in particular, IPv6 addresses on Linux) get
|
|
|
|
* removed when the interface goes down. They need to be
|
|
|
|
* readded.
|
|
|
|
*/
|
|
|
|
if_addr_wakeup(ifp);
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
2013-01-24 15:04:50 +01:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
if_data = ifp->info;
|
2022-06-29 15:05:17 +02:00
|
|
|
if_data->shutdown = IF_ZEBRA_DATA_OFF;
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (bandwidth_if,
|
|
|
|
bandwidth_if_cmd,
|
2016-09-23 15:47:20 +02:00
|
|
|
"bandwidth (1-100000)",
|
2002-12-13 21:15:29 +01:00
|
|
|
"Set bandwidth informational parameter\n"
|
2016-06-13 15:06:45 +02:00
|
|
|
"Bandwidth in megabits\n")
|
2002-12-13 21:15:29 +01:00
|
|
|
{
|
2016-09-23 21:26:31 +02:00
|
|
|
int idx_number = 1;
|
2016-09-30 15:38:03 +02:00
|
|
|
VTY_DECLVAR_CONTEXT(interface, ifp);
|
2002-12-13 21:15:29 +01:00
|
|
|
unsigned int bandwidth;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2016-09-23 21:26:31 +02:00
|
|
|
bandwidth = strtol(argv[idx_number]->arg, NULL, 10);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2016-06-13 15:06:45 +02:00
|
|
|
/* bandwidth range is <1-100000> */
|
|
|
|
if (bandwidth < 1 || bandwidth > 100000) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "Bandwidth is invalid\n");
|
2017-07-13 21:56:08 +02:00
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
ifp->bandwidth = bandwidth;
|
|
|
|
|
2016-06-13 15:06:45 +02:00
|
|
|
/* force protocols to recalculate routes due to cost change */
|
|
|
|
if (if_is_operative(ifp))
|
2002-12-13 21:15:29 +01:00
|
|
|
zebra_interface_up_update(ifp);
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_bandwidth_if,
|
|
|
|
no_bandwidth_if_cmd,
|
2016-09-28 06:47:43 +02:00
|
|
|
"no bandwidth [(1-100000)]",
|
2002-12-13 21:15:29 +01:00
|
|
|
NO_STR
|
2016-09-28 06:47:43 +02:00
|
|
|
"Set bandwidth informational parameter\n"
|
|
|
|
"Bandwidth in megabits\n")
|
2002-12-13 21:15:29 +01:00
|
|
|
{
|
2016-09-30 15:38:03 +02:00
|
|
|
VTY_DECLVAR_CONTEXT(interface, ifp);
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
ifp->bandwidth = 0;
|
|
|
|
|
|
|
|
/* force protocols to recalculate routes due to cost change */
|
2002-12-13 22:03:13 +01:00
|
|
|
if (if_is_operative(ifp))
|
2002-12-13 21:15:29 +01:00
|
|
|
zebra_interface_up_update(ifp);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2014-06-04 06:53:35 +02:00
|
|
|
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
struct cmd_node link_params_node = {
|
2018-09-09 00:15:50 +02:00
|
|
|
.name = "link-params",
|
2018-09-08 21:46:23 +02:00
|
|
|
.node = LINK_PARAMS_NODE,
|
2018-09-08 23:15:09 +02:00
|
|
|
.parent_node = INTERFACE_NODE,
|
2018-09-08 21:46:23 +02:00
|
|
|
.prompt = "%s(config-link-params)# ",
|
2021-11-06 21:10:41 +01:00
|
|
|
.no_xpath = true,
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
static void link_param_cmd_set_uint32(struct interface *ifp, uint32_t *field,
|
|
|
|
uint32_t type, uint32_t value)
|
|
|
|
{
|
|
|
|
/* Update field as needed */
|
|
|
|
if (IS_PARAM_UNSET(ifp->link_params, type) || *field != value) {
|
|
|
|
*field = value;
|
|
|
|
SET_PARAM(ifp->link_params, type);
|
|
|
|
|
|
|
|
/* force protocols to update LINK STATE due to parameters change
|
|
|
|
*/
|
|
|
|
if (if_is_operative(ifp))
|
|
|
|
zebra_interface_parameters_update(ifp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
static void link_param_cmd_set_float(struct interface *ifp, float *field,
|
|
|
|
uint32_t type, float value)
|
|
|
|
{
|
|
|
|
|
|
|
|
/* Update field as needed */
|
|
|
|
if (IS_PARAM_UNSET(ifp->link_params, type) || *field != value) {
|
|
|
|
*field = value;
|
|
|
|
SET_PARAM(ifp->link_params, type);
|
|
|
|
|
|
|
|
/* force protocols to update LINK STATE due to parameters change
|
|
|
|
*/
|
|
|
|
if (if_is_operative(ifp))
|
|
|
|
zebra_interface_parameters_update(ifp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void link_param_cmd_unset(struct interface *ifp, uint32_t type)
|
|
|
|
{
|
2017-05-04 04:49:50 +02:00
|
|
|
if (ifp->link_params == NULL)
|
|
|
|
return;
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
|
|
|
|
/* Unset field */
|
|
|
|
UNSET_PARAM(ifp->link_params, type);
|
|
|
|
|
|
|
|
/* force protocols to update LINK STATE due to parameters change */
|
|
|
|
if (if_is_operative(ifp))
|
|
|
|
zebra_interface_parameters_update(ifp);
|
|
|
|
}
|
|
|
|
|
2017-03-22 10:38:22 +01:00
|
|
|
DEFUN_NOSH (link_params,
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
link_params_cmd,
|
|
|
|
"link-params",
|
|
|
|
LINK_PARAMS_STR)
|
|
|
|
{
|
2016-09-30 15:38:03 +02:00
|
|
|
/* vty->qobj_index stays the same @ interface pointer */
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
vty->node = LINK_PARAMS_NODE;
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2017-03-22 10:38:22 +01:00
|
|
|
DEFUN_NOSH (exit_link_params,
|
2016-11-18 21:42:41 +01:00
|
|
|
exit_link_params_cmd,
|
|
|
|
"exit-link-params",
|
|
|
|
"Exit from Link Params configuration mode\n")
|
|
|
|
{
|
|
|
|
if (vty->node == LINK_PARAMS_NODE)
|
|
|
|
vty->node = INTERFACE_NODE;
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
/* Specific Traffic Engineering parameters commands */
|
|
|
|
DEFUN (link_params_enable,
|
|
|
|
link_params_enable_cmd,
|
|
|
|
"enable",
|
|
|
|
"Activate link parameters on this interface\n")
|
|
|
|
{
|
2016-09-30 15:38:03 +02:00
|
|
|
VTY_DECLVAR_CONTEXT(interface, ifp);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
|
|
|
|
/* This command could be issue at startup, when activate MPLS TE */
|
|
|
|
/* on a new interface or after a ON / OFF / ON toggle */
|
|
|
|
/* In all case, TE parameters are reset to their default factory */
|
2019-08-23 14:28:43 +02:00
|
|
|
if (IS_ZEBRA_DEBUG_EVENT || IS_ZEBRA_DEBUG_MPLS)
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
zlog_debug(
|
|
|
|
"Link-params: enable TE link parameters on interface %s",
|
|
|
|
ifp->name);
|
|
|
|
|
2022-10-14 17:57:17 +02:00
|
|
|
if (!if_link_params_get(ifp))
|
|
|
|
if_link_params_enable(ifp);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
|
|
|
|
/* force protocols to update LINK STATE due to parameters change */
|
|
|
|
if (if_is_operative(ifp))
|
|
|
|
zebra_interface_parameters_update(ifp);
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_link_params_enable,
|
|
|
|
no_link_params_enable_cmd,
|
|
|
|
"no enable",
|
|
|
|
NO_STR
|
|
|
|
"Disable link parameters on this interface\n")
|
|
|
|
{
|
2022-11-08 17:59:33 +01:00
|
|
|
char xpath[XPATH_MAXLEN];
|
|
|
|
int ret;
|
2016-09-30 15:38:03 +02:00
|
|
|
VTY_DECLVAR_CONTEXT(interface, ifp);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
|
2019-08-23 14:28:43 +02:00
|
|
|
if (IS_ZEBRA_DEBUG_EVENT || IS_ZEBRA_DEBUG_MPLS)
|
|
|
|
zlog_debug("MPLS-TE: disable TE link parameters on interface %s",
|
|
|
|
ifp->name);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
|
|
|
|
if_link_params_free(ifp);
|
|
|
|
|
2022-11-08 17:59:33 +01:00
|
|
|
snprintf(
|
|
|
|
xpath, sizeof(xpath),
|
|
|
|
"/frr-interface:lib/interface[name='%s']/frr-zebra:zebra/link-params/affinities",
|
|
|
|
ifp->name);
|
|
|
|
if (yang_dnode_exists(running_config->dnode, xpath))
|
|
|
|
nb_cli_enqueue_change(vty, xpath, NB_OP_DESTROY, NULL);
|
|
|
|
|
|
|
|
ret = nb_cli_apply_changes(vty, NULL);
|
|
|
|
|
|
|
|
if (ret != CMD_SUCCESS)
|
|
|
|
return ret;
|
|
|
|
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
/* force protocols to update LINK STATE due to parameters change */
|
|
|
|
if (if_is_operative(ifp))
|
|
|
|
zebra_interface_parameters_update(ifp);
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* STANDARD TE metrics */
|
|
|
|
DEFUN (link_params_metric,
|
|
|
|
link_params_metric_cmd,
|
2016-09-23 15:47:20 +02:00
|
|
|
"metric (0-4294967295)",
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
"Link metric for MPLS-TE purpose\n"
|
|
|
|
"Metric value in decimal\n")
|
|
|
|
{
|
2016-09-23 21:26:31 +02:00
|
|
|
int idx_number = 1;
|
2016-09-30 15:38:03 +02:00
|
|
|
VTY_DECLVAR_CONTEXT(interface, ifp);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
struct if_link_params *iflp = if_link_params_get(ifp);
|
2018-03-27 21:13:34 +02:00
|
|
|
uint32_t metric;
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
|
*: remove VTY_GET_*
CLI validates input tokens, so there's no need to do it in handler
functions anymore.
spatch follows
----------------
@getull@
expression v;
expression str;
@@
<...
- VTY_GET_ULL(..., v, str)
+ v = strtoull (str, NULL, 10)
...>
@getul@
expression v;
expression str;
@@
<...
- VTY_GET_ULONG(..., v, str)
+ v = strtoul (str, NULL, 10)
...>
@getintrange@
expression name;
expression v;
expression str;
@@
<...
- VTY_GET_INTEGER_RANGE(name, v, str, ...)
+ v = strtoul (str, NULL, 10)
...>
@getint@
expression v;
expression str;
@@
<...
- VTY_GET_INTEGER(..., v, str)
+ v = strtoul (str, NULL, 10)
...>
@getv4@
expression v;
expression str;
@@
<...
- VTY_GET_IPV4_ADDRESS(..., v, str)
+ inet_aton (str, &v)
...>
@getv4pfx@
expression v;
expression str;
@@
<...
- VTY_GET_IPV4_PREFIX(..., v, str)
+ str2prefix_ipv4 (str, &v)
...>
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-27 20:47:03 +02:00
|
|
|
metric = strtoul(argv[idx_number]->arg, NULL, 10);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
|
2022-10-14 17:57:17 +02:00
|
|
|
if (!iflp)
|
|
|
|
iflp = if_link_params_enable(ifp);
|
|
|
|
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
/* Update TE metric if needed */
|
2016-12-20 15:02:34 +01:00
|
|
|
link_param_cmd_set_uint32(ifp, &iflp->te_metric, LP_TE_METRIC, metric);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_link_params_metric,
|
|
|
|
no_link_params_metric_cmd,
|
|
|
|
"no metric",
|
|
|
|
NO_STR
|
2016-09-30 15:38:03 +02:00
|
|
|
"Disable Link Metric on this interface\n")
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
{
|
2016-09-30 15:38:03 +02:00
|
|
|
VTY_DECLVAR_CONTEXT(interface, ifp);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
|
|
|
|
/* Unset TE Metric */
|
2016-12-20 15:02:34 +01:00
|
|
|
link_param_cmd_unset(ifp, LP_TE_METRIC);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (link_params_maxbw,
|
|
|
|
link_params_maxbw_cmd,
|
|
|
|
"max-bw BANDWIDTH",
|
|
|
|
"Maximum bandwidth that can be used\n"
|
|
|
|
"Bytes/second (IEEE floating point format)\n")
|
|
|
|
{
|
2016-09-23 21:26:31 +02:00
|
|
|
int idx_bandwidth = 1;
|
2016-09-30 15:38:03 +02:00
|
|
|
VTY_DECLVAR_CONTEXT(interface, ifp);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
struct if_link_params *iflp = if_link_params_get(ifp);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
float bw;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2016-09-23 21:26:31 +02:00
|
|
|
if (sscanf(argv[idx_bandwidth]->arg, "%g", &bw) != 1) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "link_params_maxbw: fscanf: %s\n",
|
|
|
|
safe_strerror(errno));
|
2017-07-13 21:56:08 +02:00
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
/* Check that Maximum bandwidth is not lower than other bandwidth
|
|
|
|
* parameters */
|
2022-10-14 17:57:17 +02:00
|
|
|
if (iflp && ((bw <= iflp->max_rsv_bw) || (bw <= iflp->unrsv_bw[0]) ||
|
|
|
|
(bw <= iflp->unrsv_bw[1]) || (bw <= iflp->unrsv_bw[2]) ||
|
|
|
|
(bw <= iflp->unrsv_bw[3]) || (bw <= iflp->unrsv_bw[4]) ||
|
|
|
|
(bw <= iflp->unrsv_bw[5]) || (bw <= iflp->unrsv_bw[6]) ||
|
|
|
|
(bw <= iflp->unrsv_bw[7]) || (bw <= iflp->ava_bw) ||
|
|
|
|
(bw <= iflp->res_bw) || (bw <= iflp->use_bw))) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty,
|
|
|
|
"Maximum Bandwidth could not be lower than others bandwidth\n");
|
2017-07-13 21:56:08 +02:00
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2022-10-14 17:57:17 +02:00
|
|
|
if (!iflp)
|
|
|
|
iflp = if_link_params_enable(ifp);
|
|
|
|
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
/* Update Maximum Bandwidth if needed */
|
|
|
|
link_param_cmd_set_float(ifp, &iflp->max_bw, LP_MAX_BW, bw);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (link_params_max_rsv_bw,
|
|
|
|
link_params_max_rsv_bw_cmd,
|
|
|
|
"max-rsv-bw BANDWIDTH",
|
|
|
|
"Maximum bandwidth that may be reserved\n"
|
|
|
|
"Bytes/second (IEEE floating point format)\n")
|
|
|
|
{
|
2016-09-23 21:26:31 +02:00
|
|
|
int idx_bandwidth = 1;
|
2016-09-30 15:38:03 +02:00
|
|
|
VTY_DECLVAR_CONTEXT(interface, ifp);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
struct if_link_params *iflp = if_link_params_get(ifp);
|
|
|
|
float bw;
|
|
|
|
|
2016-09-23 21:26:31 +02:00
|
|
|
if (sscanf(argv[idx_bandwidth]->arg, "%g", &bw) != 1) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "link_params_max_rsv_bw: fscanf: %s\n",
|
2017-06-21 05:10:57 +02:00
|
|
|
safe_strerror(errno));
|
2017-07-13 21:56:08 +02:00
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Check that bandwidth is not greater than maximum bandwidth parameter
|
|
|
|
*/
|
2022-10-14 17:57:17 +02:00
|
|
|
if (iflp && bw > iflp->max_bw) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty,
|
|
|
|
"Maximum Reservable Bandwidth could not be greater than Maximum Bandwidth (%g)\n",
|
2017-06-21 05:10:57 +02:00
|
|
|
iflp->max_bw);
|
2017-07-13 21:56:08 +02:00
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
}
|
|
|
|
|
2022-10-14 17:57:17 +02:00
|
|
|
if (!iflp)
|
|
|
|
iflp = if_link_params_enable(ifp);
|
|
|
|
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
/* Update Maximum Reservable Bandwidth if needed */
|
|
|
|
link_param_cmd_set_float(ifp, &iflp->max_rsv_bw, LP_MAX_RSV_BW, bw);
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (link_params_unrsv_bw,
|
|
|
|
link_params_unrsv_bw_cmd,
|
2016-09-23 15:47:20 +02:00
|
|
|
"unrsv-bw (0-7) BANDWIDTH",
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
"Unreserved bandwidth at each priority level\n"
|
|
|
|
"Priority\n"
|
|
|
|
"Bytes/second (IEEE floating point format)\n")
|
|
|
|
{
|
2016-09-23 21:26:31 +02:00
|
|
|
int idx_number = 1;
|
|
|
|
int idx_bandwidth = 2;
|
2016-09-30 15:38:03 +02:00
|
|
|
VTY_DECLVAR_CONTEXT(interface, ifp);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
struct if_link_params *iflp = if_link_params_get(ifp);
|
|
|
|
int priority;
|
|
|
|
float bw;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
/* We don't have to consider about range check here. */
|
2016-09-23 21:26:31 +02:00
|
|
|
if (sscanf(argv[idx_number]->arg, "%d", &priority) != 1) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "link_params_unrsv_bw: fscanf: %s\n",
|
2017-06-21 05:10:57 +02:00
|
|
|
safe_strerror(errno));
|
2017-07-13 21:56:08 +02:00
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2016-09-23 21:26:31 +02:00
|
|
|
if (sscanf(argv[idx_bandwidth]->arg, "%g", &bw) != 1) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "link_params_unrsv_bw: fscanf: %s\n",
|
2017-06-21 05:10:57 +02:00
|
|
|
safe_strerror(errno));
|
2017-07-13 21:56:08 +02:00
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
/* Check that bandwidth is not greater than maximum bandwidth parameter
|
|
|
|
*/
|
2022-10-14 17:57:17 +02:00
|
|
|
if (iflp && bw > iflp->max_bw) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty,
|
|
|
|
"UnReserved Bandwidth could not be greater than Maximum Bandwidth (%g)\n",
|
2017-06-21 05:10:57 +02:00
|
|
|
iflp->max_bw);
|
2017-07-13 21:56:08 +02:00
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2022-10-14 17:57:17 +02:00
|
|
|
if (!iflp)
|
|
|
|
iflp = if_link_params_enable(ifp);
|
|
|
|
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
/* Update Unreserved Bandwidth if needed */
|
|
|
|
link_param_cmd_set_float(ifp, &iflp->unrsv_bw[priority], LP_UNRSV_BW,
|
|
|
|
bw);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2022-11-08 17:59:33 +01:00
|
|
|
DEFPY_YANG(link_params_admin_grp, link_params_admin_grp_cmd,
|
|
|
|
"admin-grp BITPATTERN",
|
|
|
|
"Administrative group membership\n"
|
|
|
|
"32-bit Hexadecimal value (e.g. 0xa1)\n")
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
{
|
2022-11-08 17:59:33 +01:00
|
|
|
char xpath[XPATH_MAXLEN];
|
2016-09-23 21:26:31 +02:00
|
|
|
int idx_bitpattern = 1;
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
unsigned long value;
|
2022-11-08 17:59:33 +01:00
|
|
|
char value_str[11];
|
|
|
|
|
|
|
|
VTY_DECLVAR_CONTEXT(interface, ifp);
|
|
|
|
|
|
|
|
snprintf(
|
|
|
|
xpath, sizeof(xpath),
|
|
|
|
"/frr-interface:lib/interface[name='%s']/frr-zebra:zebra/link-params/affinities",
|
|
|
|
ifp->name);
|
|
|
|
if (yang_dnode_exists(running_config->dnode, xpath)) {
|
|
|
|
vty_out(vty,
|
|
|
|
"cannot use the admin-grp command when affinity is set\n");
|
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
|
|
|
}
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
|
2016-09-23 21:26:31 +02:00
|
|
|
if (sscanf(argv[idx_bitpattern]->arg, "0x%lx", &value) != 1) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "link_params_admin_grp: fscanf: %s\n",
|
2017-06-21 05:10:57 +02:00
|
|
|
safe_strerror(errno));
|
2017-07-13 21:56:08 +02:00
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
}
|
|
|
|
|
2022-11-08 17:59:33 +01:00
|
|
|
if (value > 0xFFFFFFFF) {
|
|
|
|
vty_out(vty, "value must be not be superior to 0xFFFFFFFF\n");
|
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
|
|
|
}
|
2022-10-14 17:57:17 +02:00
|
|
|
|
2022-11-08 17:59:33 +01:00
|
|
|
snprintf(value_str, sizeof(value_str), "%ld", value);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
|
2022-11-08 17:59:33 +01:00
|
|
|
nb_cli_enqueue_change(
|
|
|
|
vty, "./frr-zebra:zebra/link-params/legacy-admin-group",
|
|
|
|
NB_OP_MODIFY, value_str);
|
|
|
|
|
|
|
|
return nb_cli_apply_changes(vty, NULL);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
}
|
|
|
|
|
2022-11-08 17:59:33 +01:00
|
|
|
DEFPY_YANG(no_link_params_admin_grp, no_link_params_admin_grp_cmd,
|
|
|
|
"no admin-grp",
|
|
|
|
NO_STR "Disable Administrative group membership on this interface\n")
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
{
|
2022-11-08 17:59:33 +01:00
|
|
|
nb_cli_enqueue_change(
|
|
|
|
vty, "./frr-zebra:zebra/link-params/legacy-admin-group",
|
|
|
|
NB_OP_DESTROY, NULL);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
|
2022-11-08 17:59:33 +01:00
|
|
|
return nb_cli_apply_changes(vty, NULL);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* RFC5392 & RFC5316: INTER-AS */
|
|
|
|
DEFUN (link_params_inter_as,
|
|
|
|
link_params_inter_as_cmd,
|
2016-09-23 15:47:20 +02:00
|
|
|
"neighbor A.B.C.D as (1-4294967295)",
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
"Configure remote ASBR information (Neighbor IP address and AS number)\n"
|
|
|
|
"Remote IP address in dot decimal A.B.C.D\n"
|
|
|
|
"Remote AS number\n"
|
|
|
|
"AS number in the range <1-4294967295>\n")
|
|
|
|
{
|
2016-09-23 21:26:31 +02:00
|
|
|
int idx_ipv4 = 1;
|
|
|
|
int idx_number = 3;
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
|
2016-09-30 15:38:03 +02:00
|
|
|
VTY_DECLVAR_CONTEXT(interface, ifp);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
struct if_link_params *iflp = if_link_params_get(ifp);
|
|
|
|
struct in_addr addr;
|
2018-03-27 21:13:34 +02:00
|
|
|
uint32_t as;
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
|
2016-09-23 21:26:31 +02:00
|
|
|
if (!inet_aton(argv[idx_ipv4]->arg, &addr)) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "Please specify Router-Addr by A.B.C.D\n");
|
2017-07-13 21:56:08 +02:00
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
}
|
|
|
|
|
2022-10-14 17:57:17 +02:00
|
|
|
if (!iflp)
|
|
|
|
iflp = if_link_params_enable(ifp);
|
|
|
|
|
*: remove VTY_GET_*
CLI validates input tokens, so there's no need to do it in handler
functions anymore.
spatch follows
----------------
@getull@
expression v;
expression str;
@@
<...
- VTY_GET_ULL(..., v, str)
+ v = strtoull (str, NULL, 10)
...>
@getul@
expression v;
expression str;
@@
<...
- VTY_GET_ULONG(..., v, str)
+ v = strtoul (str, NULL, 10)
...>
@getintrange@
expression name;
expression v;
expression str;
@@
<...
- VTY_GET_INTEGER_RANGE(name, v, str, ...)
+ v = strtoul (str, NULL, 10)
...>
@getint@
expression v;
expression str;
@@
<...
- VTY_GET_INTEGER(..., v, str)
+ v = strtoul (str, NULL, 10)
...>
@getv4@
expression v;
expression str;
@@
<...
- VTY_GET_IPV4_ADDRESS(..., v, str)
+ inet_aton (str, &v)
...>
@getv4pfx@
expression v;
expression str;
@@
<...
- VTY_GET_IPV4_PREFIX(..., v, str)
+ str2prefix_ipv4 (str, &v)
...>
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-27 20:47:03 +02:00
|
|
|
as = strtoul(argv[idx_number]->arg, NULL, 10);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
|
|
|
|
/* Update Remote IP and Remote AS fields if needed */
|
|
|
|
if (IS_PARAM_UNSET(iflp, LP_RMT_AS) || iflp->rmt_as != as
|
|
|
|
|| iflp->rmt_ip.s_addr != addr.s_addr) {
|
|
|
|
|
|
|
|
iflp->rmt_as = as;
|
|
|
|
iflp->rmt_ip.s_addr = addr.s_addr;
|
|
|
|
SET_PARAM(iflp, LP_RMT_AS);
|
|
|
|
|
|
|
|
/* force protocols to update LINK STATE due to parameters change
|
|
|
|
*/
|
|
|
|
if (if_is_operative(ifp))
|
|
|
|
zebra_interface_parameters_update(ifp);
|
|
|
|
}
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_link_params_inter_as,
|
|
|
|
no_link_params_inter_as_cmd,
|
|
|
|
"no neighbor",
|
|
|
|
NO_STR
|
|
|
|
"Remove Neighbor IP address and AS number for Inter-AS TE\n")
|
|
|
|
{
|
2016-09-30 15:38:03 +02:00
|
|
|
VTY_DECLVAR_CONTEXT(interface, ifp);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
struct if_link_params *iflp = if_link_params_get(ifp);
|
|
|
|
|
2022-10-14 17:57:17 +02:00
|
|
|
if (!iflp)
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
/* Reset Remote IP and AS neighbor */
|
|
|
|
iflp->rmt_as = 0;
|
|
|
|
iflp->rmt_ip.s_addr = 0;
|
|
|
|
UNSET_PARAM(iflp, LP_RMT_AS);
|
|
|
|
|
|
|
|
/* force protocols to update LINK STATE due to parameters change */
|
|
|
|
if (if_is_operative(ifp))
|
|
|
|
zebra_interface_parameters_update(ifp);
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* RFC7471: OSPF Traffic Engineering (TE) Metric extensions &
|
|
|
|
* draft-ietf-isis-metric-extensions-07.txt */
|
|
|
|
DEFUN (link_params_delay,
|
|
|
|
link_params_delay_cmd,
|
2016-09-28 06:47:43 +02:00
|
|
|
"delay (0-16777215) [min (0-16777215) max (0-16777215)]",
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
"Unidirectional Average Link Delay\n"
|
2016-09-28 06:47:43 +02:00
|
|
|
"Average delay in micro-second as decimal (0...16777215)\n"
|
|
|
|
"Minimum delay\n"
|
|
|
|
"Minimum delay in micro-second as decimal (0...16777215)\n"
|
|
|
|
"Maximum delay\n"
|
|
|
|
"Maximum delay in micro-second as decimal (0...16777215)\n")
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
{
|
2016-09-28 06:47:43 +02:00
|
|
|
/* Get and Check new delay values */
|
2018-03-27 21:13:34 +02:00
|
|
|
uint32_t delay = 0, low = 0, high = 0;
|
*: remove VTY_GET_*
CLI validates input tokens, so there's no need to do it in handler
functions anymore.
spatch follows
----------------
@getull@
expression v;
expression str;
@@
<...
- VTY_GET_ULL(..., v, str)
+ v = strtoull (str, NULL, 10)
...>
@getul@
expression v;
expression str;
@@
<...
- VTY_GET_ULONG(..., v, str)
+ v = strtoul (str, NULL, 10)
...>
@getintrange@
expression name;
expression v;
expression str;
@@
<...
- VTY_GET_INTEGER_RANGE(name, v, str, ...)
+ v = strtoul (str, NULL, 10)
...>
@getint@
expression v;
expression str;
@@
<...
- VTY_GET_INTEGER(..., v, str)
+ v = strtoul (str, NULL, 10)
...>
@getv4@
expression v;
expression str;
@@
<...
- VTY_GET_IPV4_ADDRESS(..., v, str)
+ inet_aton (str, &v)
...>
@getv4pfx@
expression v;
expression str;
@@
<...
- VTY_GET_IPV4_PREFIX(..., v, str)
+ str2prefix_ipv4 (str, &v)
...>
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-27 20:47:03 +02:00
|
|
|
delay = strtoul(argv[1]->arg, NULL, 10);
|
2016-09-28 06:47:43 +02:00
|
|
|
if (argc == 6) {
|
*: remove VTY_GET_*
CLI validates input tokens, so there's no need to do it in handler
functions anymore.
spatch follows
----------------
@getull@
expression v;
expression str;
@@
<...
- VTY_GET_ULL(..., v, str)
+ v = strtoull (str, NULL, 10)
...>
@getul@
expression v;
expression str;
@@
<...
- VTY_GET_ULONG(..., v, str)
+ v = strtoul (str, NULL, 10)
...>
@getintrange@
expression name;
expression v;
expression str;
@@
<...
- VTY_GET_INTEGER_RANGE(name, v, str, ...)
+ v = strtoul (str, NULL, 10)
...>
@getint@
expression v;
expression str;
@@
<...
- VTY_GET_INTEGER(..., v, str)
+ v = strtoul (str, NULL, 10)
...>
@getv4@
expression v;
expression str;
@@
<...
- VTY_GET_IPV4_ADDRESS(..., v, str)
+ inet_aton (str, &v)
...>
@getv4pfx@
expression v;
expression str;
@@
<...
- VTY_GET_IPV4_PREFIX(..., v, str)
+ str2prefix_ipv4 (str, &v)
...>
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-27 20:47:03 +02:00
|
|
|
low = strtoul(argv[3]->arg, NULL, 10);
|
|
|
|
high = strtoul(argv[5]->arg, NULL, 10);
|
2016-09-28 06:47:43 +02:00
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2016-09-30 15:38:03 +02:00
|
|
|
VTY_DECLVAR_CONTEXT(interface, ifp);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
struct if_link_params *iflp = if_link_params_get(ifp);
|
2018-03-27 21:13:34 +02:00
|
|
|
uint8_t update = 0;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2016-09-28 06:47:43 +02:00
|
|
|
if (argc == 2) {
|
2022-05-06 23:32:49 +02:00
|
|
|
/*
|
|
|
|
* Check new delay value against old Min and Max delays if set
|
|
|
|
*
|
|
|
|
* RFC 7471 Section 4.2.7:
|
|
|
|
* It is possible for min delay and max delay to be
|
|
|
|
* the same value.
|
|
|
|
*
|
|
|
|
* Therefore, it is also allowed that the average
|
|
|
|
* delay be equal to the min delay or max delay.
|
2016-09-28 06:47:43 +02:00
|
|
|
*/
|
2022-10-14 17:57:17 +02:00
|
|
|
if (iflp && IS_PARAM_SET(iflp, LP_MM_DELAY) &&
|
|
|
|
(delay < iflp->min_delay || delay > iflp->max_delay)) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty,
|
2022-05-06 23:32:49 +02:00
|
|
|
"Average delay should be in range Min (%d) - Max (%d) delay\n",
|
2017-06-21 05:10:57 +02:00
|
|
|
iflp->min_delay, iflp->max_delay);
|
2017-07-13 21:56:08 +02:00
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
2016-09-28 06:47:43 +02:00
|
|
|
}
|
2022-10-14 17:57:17 +02:00
|
|
|
|
|
|
|
if (!iflp)
|
|
|
|
iflp = if_link_params_enable(ifp);
|
|
|
|
|
2016-09-28 06:47:43 +02:00
|
|
|
/* Update delay if value is not set or change */
|
|
|
|
if (IS_PARAM_UNSET(iflp, LP_DELAY) || iflp->av_delay != delay) {
|
|
|
|
iflp->av_delay = delay;
|
|
|
|
SET_PARAM(iflp, LP_DELAY);
|
|
|
|
update = 1;
|
|
|
|
}
|
|
|
|
/* Unset Min and Max delays if already set */
|
|
|
|
if (IS_PARAM_SET(iflp, LP_MM_DELAY)) {
|
|
|
|
iflp->min_delay = 0;
|
|
|
|
iflp->max_delay = 0;
|
|
|
|
UNSET_PARAM(iflp, LP_MM_DELAY);
|
|
|
|
update = 1;
|
|
|
|
}
|
|
|
|
} else {
|
2022-05-06 23:32:49 +02:00
|
|
|
/*
|
|
|
|
* Check new delays value coherency. See above note
|
|
|
|
* regarding average delay equal to min/max allowed
|
|
|
|
*/
|
|
|
|
if (delay < low || delay > high) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty,
|
2022-05-06 23:32:49 +02:00
|
|
|
"Average delay should be in range Min (%d) - Max (%d) delay\n",
|
2017-06-21 05:10:57 +02:00
|
|
|
low, high);
|
2017-07-13 21:56:08 +02:00
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
2016-09-28 06:47:43 +02:00
|
|
|
}
|
2022-10-14 17:57:17 +02:00
|
|
|
|
|
|
|
if (!iflp)
|
|
|
|
iflp = if_link_params_enable(ifp);
|
|
|
|
|
2016-09-28 06:47:43 +02:00
|
|
|
/* Update Delays if needed */
|
|
|
|
if (IS_PARAM_UNSET(iflp, LP_DELAY)
|
|
|
|
|| IS_PARAM_UNSET(iflp, LP_MM_DELAY)
|
|
|
|
|| iflp->av_delay != delay || iflp->min_delay != low
|
|
|
|
|| iflp->max_delay != high) {
|
|
|
|
iflp->av_delay = delay;
|
|
|
|
SET_PARAM(iflp, LP_DELAY);
|
|
|
|
iflp->min_delay = low;
|
|
|
|
iflp->max_delay = high;
|
|
|
|
SET_PARAM(iflp, LP_MM_DELAY);
|
|
|
|
update = 1;
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
2016-09-28 06:47:43 +02:00
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
/* force protocols to update LINK STATE due to parameters change */
|
|
|
|
if (update == 1 && if_is_operative(ifp))
|
|
|
|
zebra_interface_parameters_update(ifp);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_link_params_delay,
|
|
|
|
no_link_params_delay_cmd,
|
|
|
|
"no delay",
|
|
|
|
NO_STR
|
2016-09-30 15:38:03 +02:00
|
|
|
"Disable Unidirectional Average, Min & Max Link Delay on this interface\n")
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
{
|
2016-09-30 15:38:03 +02:00
|
|
|
VTY_DECLVAR_CONTEXT(interface, ifp);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
struct if_link_params *iflp = if_link_params_get(ifp);
|
|
|
|
|
2022-10-14 17:57:17 +02:00
|
|
|
if (!iflp)
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
/* Unset Delays */
|
|
|
|
iflp->av_delay = 0;
|
|
|
|
UNSET_PARAM(iflp, LP_DELAY);
|
|
|
|
iflp->min_delay = 0;
|
|
|
|
iflp->max_delay = 0;
|
|
|
|
UNSET_PARAM(iflp, LP_MM_DELAY);
|
|
|
|
|
|
|
|
/* force protocols to update LINK STATE due to parameters change */
|
|
|
|
if (if_is_operative(ifp))
|
|
|
|
zebra_interface_parameters_update(ifp);
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (link_params_delay_var,
|
|
|
|
link_params_delay_var_cmd,
|
2016-09-23 15:47:20 +02:00
|
|
|
"delay-variation (0-16777215)",
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
"Unidirectional Link Delay Variation\n"
|
|
|
|
"delay variation in micro-second as decimal (0...16777215)\n")
|
|
|
|
{
|
2016-09-23 21:26:31 +02:00
|
|
|
int idx_number = 1;
|
2016-09-30 15:38:03 +02:00
|
|
|
VTY_DECLVAR_CONTEXT(interface, ifp);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
struct if_link_params *iflp = if_link_params_get(ifp);
|
2018-03-27 21:13:34 +02:00
|
|
|
uint32_t value;
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
|
*: remove VTY_GET_*
CLI validates input tokens, so there's no need to do it in handler
functions anymore.
spatch follows
----------------
@getull@
expression v;
expression str;
@@
<...
- VTY_GET_ULL(..., v, str)
+ v = strtoull (str, NULL, 10)
...>
@getul@
expression v;
expression str;
@@
<...
- VTY_GET_ULONG(..., v, str)
+ v = strtoul (str, NULL, 10)
...>
@getintrange@
expression name;
expression v;
expression str;
@@
<...
- VTY_GET_INTEGER_RANGE(name, v, str, ...)
+ v = strtoul (str, NULL, 10)
...>
@getint@
expression v;
expression str;
@@
<...
- VTY_GET_INTEGER(..., v, str)
+ v = strtoul (str, NULL, 10)
...>
@getv4@
expression v;
expression str;
@@
<...
- VTY_GET_IPV4_ADDRESS(..., v, str)
+ inet_aton (str, &v)
...>
@getv4pfx@
expression v;
expression str;
@@
<...
- VTY_GET_IPV4_PREFIX(..., v, str)
+ str2prefix_ipv4 (str, &v)
...>
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-27 20:47:03 +02:00
|
|
|
value = strtoul(argv[idx_number]->arg, NULL, 10);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
|
2022-10-14 17:57:17 +02:00
|
|
|
if (!iflp)
|
|
|
|
iflp = if_link_params_enable(ifp);
|
|
|
|
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
/* Update Delay Variation if needed */
|
|
|
|
link_param_cmd_set_uint32(ifp, &iflp->delay_var, LP_DELAY_VAR, value);
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_link_params_delay_var,
|
|
|
|
no_link_params_delay_var_cmd,
|
|
|
|
"no delay-variation",
|
|
|
|
NO_STR
|
2016-09-30 15:38:03 +02:00
|
|
|
"Disable Unidirectional Delay Variation on this interface\n")
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
{
|
2016-09-30 15:38:03 +02:00
|
|
|
VTY_DECLVAR_CONTEXT(interface, ifp);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
|
|
|
|
/* Unset Delay Variation */
|
|
|
|
link_param_cmd_unset(ifp, LP_DELAY_VAR);
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (link_params_pkt_loss,
|
|
|
|
link_params_pkt_loss_cmd,
|
|
|
|
"packet-loss PERCENTAGE",
|
|
|
|
"Unidirectional Link Packet Loss\n"
|
|
|
|
"percentage of total traffic by 0.000003% step and less than 50.331642%\n")
|
|
|
|
{
|
2016-09-23 21:26:31 +02:00
|
|
|
int idx_percentage = 1;
|
2016-09-30 15:38:03 +02:00
|
|
|
VTY_DECLVAR_CONTEXT(interface, ifp);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
struct if_link_params *iflp = if_link_params_get(ifp);
|
|
|
|
float fval;
|
|
|
|
|
2016-09-23 21:26:31 +02:00
|
|
|
if (sscanf(argv[idx_percentage]->arg, "%g", &fval) != 1) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "link_params_pkt_loss: fscanf: %s\n",
|
2017-06-21 05:10:57 +02:00
|
|
|
safe_strerror(errno));
|
2017-07-13 21:56:08 +02:00
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (fval > MAX_PKT_LOSS)
|
|
|
|
fval = MAX_PKT_LOSS;
|
|
|
|
|
2022-10-14 17:57:17 +02:00
|
|
|
if (!iflp)
|
|
|
|
iflp = if_link_params_enable(ifp);
|
|
|
|
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
/* Update Packet Loss if needed */
|
|
|
|
link_param_cmd_set_float(ifp, &iflp->pkt_loss, LP_PKT_LOSS, fval);
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_link_params_pkt_loss,
|
|
|
|
no_link_params_pkt_loss_cmd,
|
|
|
|
"no packet-loss",
|
|
|
|
NO_STR
|
2016-09-30 15:38:03 +02:00
|
|
|
"Disable Unidirectional Link Packet Loss on this interface\n")
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
{
|
2016-09-30 15:38:03 +02:00
|
|
|
VTY_DECLVAR_CONTEXT(interface, ifp);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
|
|
|
|
/* Unset Packet Loss */
|
|
|
|
link_param_cmd_unset(ifp, LP_PKT_LOSS);
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (link_params_res_bw,
|
|
|
|
link_params_res_bw_cmd,
|
|
|
|
"res-bw BANDWIDTH",
|
|
|
|
"Unidirectional Residual Bandwidth\n"
|
|
|
|
"Bytes/second (IEEE floating point format)\n")
|
|
|
|
{
|
2016-09-23 21:26:31 +02:00
|
|
|
int idx_bandwidth = 1;
|
2016-09-30 15:38:03 +02:00
|
|
|
VTY_DECLVAR_CONTEXT(interface, ifp);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
struct if_link_params *iflp = if_link_params_get(ifp);
|
|
|
|
float bw;
|
|
|
|
|
2016-09-23 21:26:31 +02:00
|
|
|
if (sscanf(argv[idx_bandwidth]->arg, "%g", &bw) != 1) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "link_params_res_bw: fscanf: %s\n",
|
|
|
|
safe_strerror(errno));
|
2017-07-13 21:56:08 +02:00
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Check that bandwidth is not greater than maximum bandwidth parameter
|
|
|
|
*/
|
2022-10-14 17:57:17 +02:00
|
|
|
if (iflp && bw > iflp->max_bw) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty,
|
|
|
|
"Residual Bandwidth could not be greater than Maximum Bandwidth (%g)\n",
|
2017-06-21 05:10:57 +02:00
|
|
|
iflp->max_bw);
|
2017-07-13 21:56:08 +02:00
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
}
|
|
|
|
|
2022-10-14 17:57:17 +02:00
|
|
|
if (!iflp)
|
|
|
|
iflp = if_link_params_enable(ifp);
|
|
|
|
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
/* Update Residual Bandwidth if needed */
|
|
|
|
link_param_cmd_set_float(ifp, &iflp->res_bw, LP_RES_BW, bw);
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_link_params_res_bw,
|
|
|
|
no_link_params_res_bw_cmd,
|
|
|
|
"no res-bw",
|
|
|
|
NO_STR
|
2016-09-30 15:38:03 +02:00
|
|
|
"Disable Unidirectional Residual Bandwidth on this interface\n")
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
{
|
2016-09-30 15:38:03 +02:00
|
|
|
VTY_DECLVAR_CONTEXT(interface, ifp);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
|
|
|
|
/* Unset Residual Bandwidth */
|
|
|
|
link_param_cmd_unset(ifp, LP_RES_BW);
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (link_params_ava_bw,
|
|
|
|
link_params_ava_bw_cmd,
|
|
|
|
"ava-bw BANDWIDTH",
|
|
|
|
"Unidirectional Available Bandwidth\n"
|
|
|
|
"Bytes/second (IEEE floating point format)\n")
|
|
|
|
{
|
2016-09-23 21:26:31 +02:00
|
|
|
int idx_bandwidth = 1;
|
2016-09-30 15:38:03 +02:00
|
|
|
VTY_DECLVAR_CONTEXT(interface, ifp);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
struct if_link_params *iflp = if_link_params_get(ifp);
|
|
|
|
float bw;
|
|
|
|
|
2016-09-23 21:26:31 +02:00
|
|
|
if (sscanf(argv[idx_bandwidth]->arg, "%g", &bw) != 1) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "link_params_ava_bw: fscanf: %s\n",
|
|
|
|
safe_strerror(errno));
|
2017-07-13 21:56:08 +02:00
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Check that bandwidth is not greater than maximum bandwidth parameter
|
|
|
|
*/
|
2022-10-14 17:57:17 +02:00
|
|
|
if (iflp && bw > iflp->max_bw) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty,
|
|
|
|
"Available Bandwidth could not be greater than Maximum Bandwidth (%g)\n",
|
2017-06-21 05:10:57 +02:00
|
|
|
iflp->max_bw);
|
2017-07-13 21:56:08 +02:00
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
}
|
|
|
|
|
2022-10-14 17:57:17 +02:00
|
|
|
if (!iflp)
|
|
|
|
iflp = if_link_params_enable(ifp);
|
|
|
|
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
/* Update Residual Bandwidth if needed */
|
|
|
|
link_param_cmd_set_float(ifp, &iflp->ava_bw, LP_AVA_BW, bw);
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_link_params_ava_bw,
|
|
|
|
no_link_params_ava_bw_cmd,
|
|
|
|
"no ava-bw",
|
|
|
|
NO_STR
|
2016-09-30 15:38:03 +02:00
|
|
|
"Disable Unidirectional Available Bandwidth on this interface\n")
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
{
|
2016-09-30 15:38:03 +02:00
|
|
|
VTY_DECLVAR_CONTEXT(interface, ifp);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
|
|
|
|
/* Unset Available Bandwidth */
|
|
|
|
link_param_cmd_unset(ifp, LP_AVA_BW);
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (link_params_use_bw,
|
|
|
|
link_params_use_bw_cmd,
|
|
|
|
"use-bw BANDWIDTH",
|
|
|
|
"Unidirectional Utilised Bandwidth\n"
|
|
|
|
"Bytes/second (IEEE floating point format)\n")
|
|
|
|
{
|
2016-09-23 21:26:31 +02:00
|
|
|
int idx_bandwidth = 1;
|
2016-09-30 15:38:03 +02:00
|
|
|
VTY_DECLVAR_CONTEXT(interface, ifp);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
struct if_link_params *iflp = if_link_params_get(ifp);
|
|
|
|
float bw;
|
|
|
|
|
2016-09-23 21:26:31 +02:00
|
|
|
if (sscanf(argv[idx_bandwidth]->arg, "%g", &bw) != 1) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "link_params_use_bw: fscanf: %s\n",
|
|
|
|
safe_strerror(errno));
|
2017-07-13 21:56:08 +02:00
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Check that bandwidth is not greater than maximum bandwidth parameter
|
|
|
|
*/
|
2022-10-14 17:57:17 +02:00
|
|
|
if (iflp && bw > iflp->max_bw) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty,
|
|
|
|
"Utilised Bandwidth could not be greater than Maximum Bandwidth (%g)\n",
|
2017-06-21 05:10:57 +02:00
|
|
|
iflp->max_bw);
|
2017-07-13 21:56:08 +02:00
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
}
|
|
|
|
|
2022-10-14 17:57:17 +02:00
|
|
|
if (!iflp)
|
|
|
|
iflp = if_link_params_enable(ifp);
|
|
|
|
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
/* Update Utilized Bandwidth if needed */
|
|
|
|
link_param_cmd_set_float(ifp, &iflp->use_bw, LP_USE_BW, bw);
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_link_params_use_bw,
|
|
|
|
no_link_params_use_bw_cmd,
|
|
|
|
"no use-bw",
|
|
|
|
NO_STR
|
2016-09-30 15:38:03 +02:00
|
|
|
"Disable Unidirectional Utilised Bandwidth on this interface\n")
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
{
|
2016-09-30 15:38:03 +02:00
|
|
|
VTY_DECLVAR_CONTEXT(interface, ifp);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
|
|
|
|
/* Unset Utilised Bandwidth */
|
|
|
|
link_param_cmd_unset(ifp, LP_USE_BW);
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2022-11-08 17:59:33 +01:00
|
|
|
static int ag_change(struct vty *vty, int argc, struct cmd_token **argv,
|
|
|
|
const char *xpath, bool no, int start_idx)
|
|
|
|
{
|
|
|
|
for (int i = start_idx; i < argc; i++)
|
|
|
|
nb_cli_enqueue_change(vty, xpath,
|
|
|
|
no ? NB_OP_DESTROY : NB_OP_CREATE,
|
|
|
|
argv[i]->arg);
|
|
|
|
return nb_cli_apply_changes(vty, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* XPath:
|
|
|
|
* /frr-interface:lib/interface/frr-zebra:zebra/link-params/affinities/affinity
|
|
|
|
*/
|
|
|
|
DEFPY_YANG(link_params_affinity, link_params_affinity_cmd,
|
|
|
|
"[no] affinity NAME...",
|
|
|
|
NO_STR
|
|
|
|
"Interface affinities\n"
|
|
|
|
"Affinity names\n")
|
|
|
|
{
|
|
|
|
VTY_DECLVAR_CONTEXT(interface, ifp);
|
|
|
|
char xpath[XPATH_MAXLEN];
|
|
|
|
|
|
|
|
snprintf(
|
|
|
|
xpath, sizeof(xpath),
|
|
|
|
"/frr-interface:lib/interface[name='%s']/frr-zebra:zebra/link-params/legacy-admin-group",
|
|
|
|
ifp->name);
|
|
|
|
if (yang_dnode_exists(running_config->dnode, xpath)) {
|
|
|
|
vty_out(vty,
|
|
|
|
"cannot use the affinity command when admin-grp is set\n");
|
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
|
|
|
}
|
|
|
|
|
|
|
|
return ag_change(vty, argc, argv,
|
|
|
|
"./frr-zebra:zebra/link-params/affinities/affinity",
|
|
|
|
no, no ? 2 : 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* XPath:
|
|
|
|
* /frr-interface:lib/interface/frr-zebra:zebra/link-params/affinities/affinity-mode
|
|
|
|
*/
|
|
|
|
DEFPY_YANG(link_params_affinity_mode, link_params_affinity_mode_cmd,
|
|
|
|
"affinity-mode <standard|extended|both>$affmode",
|
|
|
|
"Interface affinity mode\n"
|
|
|
|
"Standard Admin-Group only RFC3630,5305,5329 (default)\n"
|
|
|
|
"Extended Admin-Group only RFC7308\n"
|
|
|
|
"Standard and extended Admin-Group format\n")
|
|
|
|
{
|
|
|
|
const char *xpath = "./frr-zebra:zebra/link-params/affinity-mode";
|
|
|
|
|
|
|
|
nb_cli_enqueue_change(vty, xpath, NB_OP_MODIFY, affmode);
|
|
|
|
|
|
|
|
return nb_cli_apply_changes(vty, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFPY_YANG(no_link_params_affinity_mode, no_link_params_affinity_mode_cmd,
|
|
|
|
"no affinity-mode [<standard|extended|both>]",
|
|
|
|
NO_STR
|
|
|
|
"Interface affinity mode\n"
|
|
|
|
"Standard Admin-Group only RFC3630,5305,5329 (default)\n"
|
|
|
|
"Extended Admin-Group only RFC7308\n"
|
|
|
|
"Standard and extended Admin-Group format\n")
|
|
|
|
{
|
|
|
|
const char *xpath = "./frr-zebra:zebra/link-params/affinity-mode";
|
|
|
|
|
|
|
|
nb_cli_enqueue_change(vty, xpath, NB_OP_MODIFY, "standard");
|
|
|
|
|
|
|
|
return nb_cli_apply_changes(vty, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int ag_iter_cb(const struct lyd_node *dnode, void *arg)
|
|
|
|
{
|
|
|
|
struct vty *vty = (struct vty *)arg;
|
|
|
|
|
|
|
|
vty_out(vty, " %s", yang_dnode_get_string(dnode, "."));
|
|
|
|
return YANG_ITER_CONTINUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
void cli_show_legacy_admin_group(struct vty *vty, const struct lyd_node *dnode,
|
|
|
|
bool show_defaults)
|
|
|
|
{
|
|
|
|
if (!yang_dnode_exists(dnode, "./legacy-admin-group"))
|
|
|
|
return;
|
|
|
|
|
|
|
|
vty_out(vty, " admin-group 0x%x\n",
|
|
|
|
yang_dnode_get_uint32(dnode, "./legacy-admin-group"));
|
|
|
|
}
|
|
|
|
|
|
|
|
void cli_show_affinity_mode(struct vty *vty, const struct lyd_node *dnode,
|
|
|
|
bool show_defaults)
|
|
|
|
{
|
|
|
|
enum affinity_mode affinity_mode = yang_dnode_get_enum(dnode, ".");
|
|
|
|
|
|
|
|
if (affinity_mode == AFFINITY_MODE_STANDARD)
|
|
|
|
vty_out(vty, " affinity-mode standard\n");
|
|
|
|
else if (affinity_mode == AFFINITY_MODE_BOTH)
|
|
|
|
vty_out(vty, " affinity-mode both\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
void cli_show_affinity(struct vty *vty, const struct lyd_node *dnode,
|
|
|
|
bool show_defaults)
|
|
|
|
{
|
|
|
|
if (!yang_dnode_exists(dnode, "./affinity"))
|
|
|
|
return;
|
|
|
|
|
|
|
|
vty_out(vty, " affinity");
|
|
|
|
yang_dnode_iterate(ag_iter_cb, vty, dnode, "./affinity");
|
|
|
|
vty_out(vty, "\n");
|
|
|
|
}
|
|
|
|
|
2020-02-25 03:40:29 +01:00
|
|
|
int if_ip_address_install(struct interface *ifp, struct prefix *prefix,
|
|
|
|
const char *label, struct prefix *pp)
|
|
|
|
{
|
|
|
|
struct zebra_if *if_data;
|
|
|
|
struct prefix_ipv4 lp;
|
|
|
|
struct prefix_ipv4 *p;
|
|
|
|
struct connected *ifc;
|
|
|
|
enum zebra_dplane_result dplane_res;
|
|
|
|
|
|
|
|
if_data = ifp->info;
|
|
|
|
|
|
|
|
lp.family = prefix->family;
|
|
|
|
lp.prefix = prefix->u.prefix4;
|
|
|
|
lp.prefixlen = prefix->prefixlen;
|
|
|
|
apply_mask_ipv4(&lp);
|
|
|
|
|
|
|
|
ifc = connected_check_ptp(ifp, &lp, pp ? pp : NULL);
|
|
|
|
if (!ifc) {
|
|
|
|
ifc = connected_new();
|
|
|
|
ifc->ifp = ifp;
|
|
|
|
|
|
|
|
/* Address. */
|
|
|
|
p = prefix_ipv4_new();
|
|
|
|
*p = lp;
|
|
|
|
ifc->address = (struct prefix *)p;
|
|
|
|
|
|
|
|
if (pp) {
|
|
|
|
SET_FLAG(ifc->flags, ZEBRA_IFA_PEER);
|
|
|
|
p = prefix_ipv4_new();
|
|
|
|
*p = *(struct prefix_ipv4 *)pp;
|
|
|
|
ifc->destination = (struct prefix *)p;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Label. */
|
|
|
|
if (label)
|
|
|
|
ifc->label = XSTRDUP(MTYPE_CONNECTED_LABEL, label);
|
|
|
|
|
|
|
|
/* Add to linked list. */
|
|
|
|
listnode_add(ifp->connected, ifc);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* This address is configured from zebra. */
|
|
|
|
if (!CHECK_FLAG(ifc->conf, ZEBRA_IFC_CONFIGURED))
|
|
|
|
SET_FLAG(ifc->conf, ZEBRA_IFC_CONFIGURED);
|
|
|
|
|
|
|
|
/* In case of this route need to install kernel. */
|
2022-06-29 15:05:17 +02:00
|
|
|
if (!CHECK_FLAG(ifc->conf, ZEBRA_IFC_QUEUED) &&
|
|
|
|
CHECK_FLAG(ifp->status, ZEBRA_INTERFACE_ACTIVE) &&
|
|
|
|
!(if_data && if_data->shutdown == IF_ZEBRA_DATA_ON)) {
|
2020-02-25 03:40:29 +01:00
|
|
|
/* Some system need to up the interface to set IP address. */
|
|
|
|
if (!if_is_up(ifp)) {
|
|
|
|
if_set_flags(ifp, IFF_UP | IFF_RUNNING);
|
|
|
|
if_refresh(ifp);
|
|
|
|
}
|
|
|
|
|
|
|
|
dplane_res = dplane_intf_addr_set(ifp, ifc);
|
|
|
|
if (dplane_res == ZEBRA_DPLANE_REQUEST_FAILURE) {
|
|
|
|
zlog_debug(
|
2021-02-14 15:35:07 +01:00
|
|
|
"dplane can't set interface IP address: %s.",
|
2020-02-25 03:40:29 +01:00
|
|
|
dplane_res2str(dplane_res));
|
|
|
|
return NB_ERR;
|
|
|
|
}
|
|
|
|
|
|
|
|
SET_FLAG(ifc->conf, ZEBRA_IFC_QUEUED);
|
|
|
|
/* The address will be advertised to zebra clients when the
|
|
|
|
* notification
|
|
|
|
* from the kernel has been received.
|
|
|
|
* It will also be added to the subnet chain list, then. */
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2004-10-12 22:50:58 +02:00
|
|
|
static int ip_address_install(struct vty *vty, struct interface *ifp,
|
|
|
|
const char *addr_str, const char *peer_str,
|
|
|
|
const char *label)
|
2002-12-13 21:15:29 +01:00
|
|
|
{
|
2013-01-24 15:04:50 +01:00
|
|
|
struct zebra_if *if_data;
|
2010-01-30 11:26:59 +01:00
|
|
|
struct prefix_ipv4 lp, pp;
|
2002-12-13 21:15:29 +01:00
|
|
|
struct connected *ifc;
|
|
|
|
struct prefix_ipv4 *p;
|
|
|
|
int ret;
|
2019-01-16 19:40:31 +01:00
|
|
|
enum zebra_dplane_result dplane_res;
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2013-01-24 15:04:50 +01:00
|
|
|
if_data = ifp->info;
|
|
|
|
|
2010-01-30 11:26:59 +01:00
|
|
|
ret = str2prefix_ipv4(addr_str, &lp);
|
2002-12-13 21:15:29 +01:00
|
|
|
if (ret <= 0) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "%% Malformed address \n");
|
2017-07-13 21:56:08 +02:00
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
|
|
|
|
2010-01-30 11:26:59 +01:00
|
|
|
if (ipv4_martian(&lp.prefix)) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "%% Invalid address\n");
|
2017-07-13 21:56:08 +02:00
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
2015-05-20 02:47:23 +02:00
|
|
|
}
|
|
|
|
|
2010-01-30 11:26:59 +01:00
|
|
|
if (peer_str) {
|
2021-07-01 17:05:11 +02:00
|
|
|
if (lp.prefixlen != IPV4_MAX_BITLEN) {
|
2010-01-30 11:26:59 +01:00
|
|
|
vty_out(vty,
|
|
|
|
"%% Local prefix length for P-t-P address must be /32\n");
|
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
|
|
|
}
|
|
|
|
|
|
|
|
ret = str2prefix_ipv4(peer_str, &pp);
|
|
|
|
if (ret <= 0) {
|
|
|
|
vty_out(vty, "%% Malformed peer address\n");
|
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ifc = connected_check_ptp(ifp, &lp, peer_str ? &pp : NULL);
|
2002-12-13 21:15:29 +01:00
|
|
|
if (!ifc) {
|
|
|
|
ifc = connected_new();
|
|
|
|
ifc->ifp = ifp;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* Address. */
|
|
|
|
p = prefix_ipv4_new();
|
2010-01-30 11:26:59 +01:00
|
|
|
*p = lp;
|
2002-12-13 21:15:29 +01:00
|
|
|
ifc->address = (struct prefix *)p;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2010-01-30 11:26:59 +01:00
|
|
|
if (peer_str) {
|
|
|
|
SET_FLAG(ifc->flags, ZEBRA_IFA_PEER);
|
|
|
|
p = prefix_ipv4_new();
|
|
|
|
*p = pp;
|
|
|
|
ifc->destination = (struct prefix *)p;
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
/* Label. */
|
|
|
|
if (label)
|
|
|
|
ifc->label = XSTRDUP(MTYPE_CONNECTED_LABEL, label);
|
|
|
|
|
|
|
|
/* Add to linked list. */
|
|
|
|
listnode_add(ifp->connected, ifc);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* This address is configured from zebra. */
|
|
|
|
if (!CHECK_FLAG(ifc->conf, ZEBRA_IFC_CONFIGURED))
|
|
|
|
SET_FLAG(ifc->conf, ZEBRA_IFC_CONFIGURED);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-07-13 17:49:13 +02:00
|
|
|
/* In case of this route need to install kernel. */
|
2022-06-29 15:05:17 +02:00
|
|
|
if (!CHECK_FLAG(ifc->conf, ZEBRA_IFC_QUEUED) &&
|
|
|
|
CHECK_FLAG(ifp->status, ZEBRA_INTERFACE_ACTIVE) &&
|
|
|
|
!(if_data && if_data->shutdown == IF_ZEBRA_DATA_ON)) {
|
2013-01-24 15:04:48 +01:00
|
|
|
/* Some system need to up the interface to set IP address. */
|
2002-12-13 21:15:29 +01:00
|
|
|
if (!if_is_up(ifp)) {
|
2013-01-24 15:04:48 +01:00
|
|
|
if_set_flags(ifp, IFF_UP | IFF_RUNNING);
|
2013-01-24 15:04:49 +01:00
|
|
|
if_refresh(ifp);
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
|
|
|
|
2019-01-16 19:40:31 +01:00
|
|
|
dplane_res = dplane_intf_addr_set(ifp, ifc);
|
|
|
|
if (dplane_res == ZEBRA_DPLANE_REQUEST_FAILURE) {
|
2013-01-24 15:04:49 +01:00
|
|
|
vty_out(vty, "%% Can't set interface IP address: %s.\n",
|
2019-01-16 19:40:31 +01:00
|
|
|
dplane_res2str(dplane_res));
|
2013-01-24 15:04:49 +01:00
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
|
|
|
|
2013-01-24 15:04:48 +01:00
|
|
|
SET_FLAG(ifc->conf, ZEBRA_IFC_QUEUED);
|
2013-01-24 15:04:49 +01:00
|
|
|
/* The address will be advertised to zebra clients when the
|
|
|
|
* notification
|
|
|
|
* from the kernel has been received.
|
2005-06-28 19:17:12 +02:00
|
|
|
* It will also be added to the subnet chain list, then. */
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
return CMD_SUCCESS;
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
|
|
|
|
2020-02-25 03:40:29 +01:00
|
|
|
int if_ip_address_uinstall(struct interface *ifp, struct prefix *prefix)
|
|
|
|
{
|
|
|
|
struct connected *ifc = NULL;
|
|
|
|
enum zebra_dplane_result dplane_res;
|
|
|
|
|
|
|
|
if (prefix->family == AF_INET) {
|
|
|
|
/* Check current interface address. */
|
|
|
|
ifc = connected_check_ptp(ifp, prefix, NULL);
|
|
|
|
if (!ifc) {
|
2021-02-14 15:35:07 +01:00
|
|
|
zlog_debug("interface %s Can't find address",
|
2020-02-25 03:40:29 +01:00
|
|
|
ifp->name);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if (prefix->family == AF_INET6) {
|
|
|
|
/* Check current interface address. */
|
|
|
|
ifc = connected_check(ifp, prefix);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!ifc) {
|
2021-02-14 15:35:07 +01:00
|
|
|
zlog_debug("interface %s Can't find address", ifp->name);
|
2020-02-25 03:40:29 +01:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
UNSET_FLAG(ifc->conf, ZEBRA_IFC_CONFIGURED);
|
|
|
|
|
|
|
|
/* This is not real address or interface is not active. */
|
|
|
|
if (!CHECK_FLAG(ifc->conf, ZEBRA_IFC_QUEUED)
|
|
|
|
|| !CHECK_FLAG(ifp->status, ZEBRA_INTERFACE_ACTIVE)) {
|
|
|
|
listnode_delete(ifp->connected, ifc);
|
|
|
|
connected_free(&ifc);
|
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* This is real route. */
|
|
|
|
dplane_res = dplane_intf_addr_unset(ifp, ifc);
|
|
|
|
if (dplane_res == ZEBRA_DPLANE_REQUEST_FAILURE) {
|
2021-02-14 15:35:07 +01:00
|
|
|
zlog_debug("Can't unset interface IP address: %s.",
|
2020-02-25 03:40:29 +01:00
|
|
|
dplane_res2str(dplane_res));
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
UNSET_FLAG(ifc->conf, ZEBRA_IFC_QUEUED);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2004-10-12 22:50:58 +02:00
|
|
|
static int ip_address_uninstall(struct vty *vty, struct interface *ifp,
|
|
|
|
const char *addr_str, const char *peer_str,
|
|
|
|
const char *label)
|
2002-12-13 21:15:29 +01:00
|
|
|
{
|
2010-01-30 11:26:59 +01:00
|
|
|
struct prefix_ipv4 lp, pp;
|
2002-12-13 21:15:29 +01:00
|
|
|
struct connected *ifc;
|
|
|
|
int ret;
|
2019-01-16 19:40:31 +01:00
|
|
|
enum zebra_dplane_result dplane_res;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* Convert to prefix structure. */
|
2010-01-30 11:26:59 +01:00
|
|
|
ret = str2prefix_ipv4(addr_str, &lp);
|
2002-12-13 21:15:29 +01:00
|
|
|
if (ret <= 0) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "%% Malformed address \n");
|
2017-07-13 21:56:08 +02:00
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2010-01-30 11:26:59 +01:00
|
|
|
if (peer_str) {
|
2021-07-01 17:05:11 +02:00
|
|
|
if (lp.prefixlen != IPV4_MAX_BITLEN) {
|
2010-01-30 11:26:59 +01:00
|
|
|
vty_out(vty,
|
|
|
|
"%% Local prefix length for P-t-P address must be /32\n");
|
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
|
|
|
}
|
|
|
|
|
|
|
|
ret = str2prefix_ipv4(peer_str, &pp);
|
|
|
|
if (ret <= 0) {
|
|
|
|
vty_out(vty, "%% Malformed peer address\n");
|
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* Check current interface address. */
|
2010-01-30 11:26:59 +01:00
|
|
|
ifc = connected_check_ptp(ifp, &lp, peer_str ? &pp : NULL);
|
2002-12-13 21:15:29 +01:00
|
|
|
if (!ifc) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "%% Can't find address\n");
|
2017-07-13 21:56:08 +02:00
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* This is not configured address. */
|
|
|
|
if (!CHECK_FLAG(ifc->conf, ZEBRA_IFC_CONFIGURED))
|
2017-07-13 21:56:08 +02:00
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2006-06-15 20:10:47 +02:00
|
|
|
UNSET_FLAG(ifc->conf, ZEBRA_IFC_CONFIGURED);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* This is not real address or interface is not active. */
|
2013-01-24 15:04:48 +01:00
|
|
|
if (!CHECK_FLAG(ifc->conf, ZEBRA_IFC_QUEUED)
|
2002-12-13 21:15:29 +01:00
|
|
|
|| !CHECK_FLAG(ifp->status, ZEBRA_INTERFACE_ACTIVE)) {
|
|
|
|
listnode_delete(ifp->connected, ifc);
|
2019-10-30 01:16:28 +01:00
|
|
|
connected_free(&ifc);
|
2017-07-13 21:56:08 +02:00
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* This is real route. */
|
2019-01-16 19:40:31 +01:00
|
|
|
dplane_res = dplane_intf_addr_unset(ifp, ifc);
|
|
|
|
if (dplane_res == ZEBRA_DPLANE_REQUEST_FAILURE) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "%% Can't unset interface IP address: %s.\n",
|
2019-01-16 19:40:31 +01:00
|
|
|
dplane_res2str(dplane_res));
|
2017-07-13 21:56:08 +02:00
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
2013-01-24 15:04:48 +01:00
|
|
|
UNSET_FLAG(ifc->conf, ZEBRA_IFC_QUEUED);
|
2013-01-24 15:04:49 +01:00
|
|
|
/* we will receive a kernel notification about this route being removed.
|
|
|
|
* this will trigger its removal from the connected list. */
|
2002-12-13 21:15:29 +01:00
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (ip_address,
|
|
|
|
ip_address_cmd,
|
|
|
|
"ip address A.B.C.D/M",
|
|
|
|
"Interface Internet Protocol config commands\n"
|
|
|
|
"Set the IP address of an interface\n"
|
|
|
|
"IP address (e.g. 10.0.0.1/8)\n")
|
|
|
|
{
|
2016-09-23 21:26:31 +02:00
|
|
|
int idx_ipv4_prefixlen = 2;
|
2016-09-30 15:38:03 +02:00
|
|
|
VTY_DECLVAR_CONTEXT(interface, ifp);
|
2016-10-18 01:36:21 +02:00
|
|
|
return ip_address_install(vty, ifp, argv[idx_ipv4_prefixlen]->arg, NULL,
|
|
|
|
NULL);
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_ip_address,
|
|
|
|
no_ip_address_cmd,
|
|
|
|
"no ip address A.B.C.D/M",
|
|
|
|
NO_STR
|
|
|
|
"Interface Internet Protocol config commands\n"
|
|
|
|
"Set the IP address of an interface\n"
|
2017-10-21 02:16:57 +02:00
|
|
|
"IP Address (e.g. 10.0.0.1/8)\n")
|
2002-12-13 21:15:29 +01:00
|
|
|
{
|
2016-09-23 21:26:31 +02:00
|
|
|
int idx_ipv4_prefixlen = 3;
|
2016-09-30 15:38:03 +02:00
|
|
|
VTY_DECLVAR_CONTEXT(interface, ifp);
|
2016-10-18 01:36:21 +02:00
|
|
|
return ip_address_uninstall(vty, ifp, argv[idx_ipv4_prefixlen]->arg,
|
|
|
|
NULL, NULL);
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
|
|
|
|
2017-08-30 17:23:01 +02:00
|
|
|
DEFUN(ip_address_peer,
|
|
|
|
ip_address_peer_cmd,
|
|
|
|
"ip address A.B.C.D peer A.B.C.D/M",
|
|
|
|
"Interface Internet Protocol config commands\n"
|
|
|
|
"Set the IP address of an interface\n"
|
|
|
|
"Local IP (e.g. 10.0.0.1) for P-t-P address\n"
|
|
|
|
"Specify P-t-P address\n"
|
|
|
|
"Peer IP address (e.g. 10.0.0.1/8)\n")
|
2010-01-30 11:26:59 +01:00
|
|
|
{
|
|
|
|
VTY_DECLVAR_CONTEXT(interface, ifp);
|
|
|
|
return ip_address_install(vty, ifp, argv[2]->arg, argv[4]->arg, NULL);
|
|
|
|
}
|
|
|
|
|
2017-08-30 17:23:01 +02:00
|
|
|
DEFUN(no_ip_address_peer,
|
|
|
|
no_ip_address_peer_cmd,
|
|
|
|
"no ip address A.B.C.D peer A.B.C.D/M",
|
|
|
|
NO_STR
|
|
|
|
"Interface Internet Protocol config commands\n"
|
|
|
|
"Set the IP address of an interface\n"
|
|
|
|
"Local IP (e.g. 10.0.0.1) for P-t-P address\n"
|
|
|
|
"Specify P-t-P address\n"
|
|
|
|
"Peer IP address (e.g. 10.0.0.1/8)\n")
|
2010-01-30 11:26:59 +01:00
|
|
|
{
|
|
|
|
VTY_DECLVAR_CONTEXT(interface, ifp);
|
|
|
|
return ip_address_uninstall(vty, ifp, argv[3]->arg, argv[5]->arg, NULL);
|
|
|
|
}
|
2016-04-22 00:39:38 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
#ifdef HAVE_NETLINK
|
|
|
|
DEFUN (ip_address_label,
|
|
|
|
ip_address_label_cmd,
|
|
|
|
"ip address A.B.C.D/M label LINE",
|
|
|
|
"Interface Internet Protocol config commands\n"
|
|
|
|
"Set the IP address of an interface\n"
|
|
|
|
"IP address (e.g. 10.0.0.1/8)\n"
|
|
|
|
"Label of this address\n"
|
|
|
|
"Label\n")
|
|
|
|
{
|
2016-09-23 21:26:31 +02:00
|
|
|
int idx_ipv4_prefixlen = 2;
|
|
|
|
int idx_line = 4;
|
2016-09-30 15:38:03 +02:00
|
|
|
VTY_DECLVAR_CONTEXT(interface, ifp);
|
2016-10-18 01:36:21 +02:00
|
|
|
return ip_address_install(vty, ifp, argv[idx_ipv4_prefixlen]->arg, NULL,
|
|
|
|
argv[idx_line]->arg);
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_ip_address_label,
|
|
|
|
no_ip_address_label_cmd,
|
|
|
|
"no ip address A.B.C.D/M label LINE",
|
|
|
|
NO_STR
|
|
|
|
"Interface Internet Protocol config commands\n"
|
|
|
|
"Set the IP address of an interface\n"
|
|
|
|
"IP address (e.g. 10.0.0.1/8)\n"
|
|
|
|
"Label of this address\n"
|
|
|
|
"Label\n")
|
|
|
|
{
|
2016-09-23 21:26:31 +02:00
|
|
|
int idx_ipv4_prefixlen = 3;
|
|
|
|
int idx_line = 5;
|
2016-09-30 15:38:03 +02:00
|
|
|
VTY_DECLVAR_CONTEXT(interface, ifp);
|
2016-10-18 01:36:21 +02:00
|
|
|
return ip_address_uninstall(vty, ifp, argv[idx_ipv4_prefixlen]->arg,
|
|
|
|
NULL, argv[idx_line]->arg);
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
|
|
|
#endif /* HAVE_NETLINK */
|
|
|
|
|
2020-02-25 03:40:29 +01:00
|
|
|
int if_ipv6_address_install(struct interface *ifp, struct prefix *prefix,
|
|
|
|
const char *label)
|
|
|
|
{
|
|
|
|
struct zebra_if *if_data;
|
|
|
|
struct prefix_ipv6 cp;
|
|
|
|
struct connected *ifc;
|
|
|
|
struct prefix_ipv6 *p;
|
|
|
|
enum zebra_dplane_result dplane_res;
|
|
|
|
|
|
|
|
if_data = ifp->info;
|
|
|
|
|
|
|
|
cp.family = prefix->family;
|
|
|
|
cp.prefixlen = prefix->prefixlen;
|
|
|
|
cp.prefix = prefix->u.prefix6;
|
|
|
|
apply_mask_ipv6(&cp);
|
|
|
|
|
|
|
|
ifc = connected_check(ifp, (struct prefix *)&cp);
|
|
|
|
if (!ifc) {
|
|
|
|
ifc = connected_new();
|
|
|
|
ifc->ifp = ifp;
|
|
|
|
|
|
|
|
/* Address. */
|
|
|
|
p = prefix_ipv6_new();
|
|
|
|
*p = cp;
|
|
|
|
ifc->address = (struct prefix *)p;
|
|
|
|
|
|
|
|
/* Label. */
|
|
|
|
if (label)
|
|
|
|
ifc->label = XSTRDUP(MTYPE_CONNECTED_LABEL, label);
|
|
|
|
|
|
|
|
/* Add to linked list. */
|
|
|
|
listnode_add(ifp->connected, ifc);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* This address is configured from zebra. */
|
|
|
|
if (!CHECK_FLAG(ifc->conf, ZEBRA_IFC_CONFIGURED))
|
|
|
|
SET_FLAG(ifc->conf, ZEBRA_IFC_CONFIGURED);
|
|
|
|
|
|
|
|
/* In case of this route need to install kernel. */
|
2022-06-29 15:05:17 +02:00
|
|
|
if (!CHECK_FLAG(ifc->conf, ZEBRA_IFC_QUEUED) &&
|
|
|
|
CHECK_FLAG(ifp->status, ZEBRA_INTERFACE_ACTIVE) &&
|
|
|
|
!(if_data && if_data->shutdown == IF_ZEBRA_DATA_ON)) {
|
2020-02-25 03:40:29 +01:00
|
|
|
/* Some system need to up the interface to set IP address. */
|
|
|
|
if (!if_is_up(ifp)) {
|
|
|
|
if_set_flags(ifp, IFF_UP | IFF_RUNNING);
|
|
|
|
if_refresh(ifp);
|
|
|
|
}
|
|
|
|
|
|
|
|
dplane_res = dplane_intf_addr_set(ifp, ifc);
|
|
|
|
if (dplane_res == ZEBRA_DPLANE_REQUEST_FAILURE) {
|
|
|
|
zlog_debug(
|
2021-02-14 15:35:07 +01:00
|
|
|
"dplane can't set interface IP address: %s.",
|
2020-02-25 03:40:29 +01:00
|
|
|
dplane_res2str(dplane_res));
|
|
|
|
return NB_ERR;
|
|
|
|
}
|
|
|
|
|
|
|
|
SET_FLAG(ifc->conf, ZEBRA_IFC_QUEUED);
|
|
|
|
/* The address will be advertised to zebra clients when the
|
|
|
|
* notification
|
|
|
|
* from the kernel has been received. */
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2004-10-12 22:50:58 +02:00
|
|
|
static int ipv6_address_install(struct vty *vty, struct interface *ifp,
|
|
|
|
const char *addr_str, const char *peer_str,
|
2018-10-28 08:19:59 +01:00
|
|
|
const char *label)
|
2002-12-13 21:15:29 +01:00
|
|
|
{
|
|
|
|
struct zebra_if *if_data;
|
|
|
|
struct prefix_ipv6 cp;
|
2005-09-12 18:58:52 +02:00
|
|
|
struct connected *ifc;
|
2002-12-13 21:15:29 +01:00
|
|
|
struct prefix_ipv6 *p;
|
|
|
|
int ret;
|
2019-01-25 17:31:51 +01:00
|
|
|
enum zebra_dplane_result dplane_res;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
if_data = ifp->info;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
ret = str2prefix_ipv6(addr_str, &cp);
|
|
|
|
if (ret <= 0) {
|
|
|
|
vty_out(vty, "%% Malformed address \n");
|
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ipv6_martian(&cp.prefix)) {
|
|
|
|
vty_out(vty, "%% Invalid address\n");
|
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
2002-12-13 21:15:29 +01:00
|
|
|
|
|
|
|
ifc = connected_check(ifp, (struct prefix *)&cp);
|
|
|
|
if (!ifc) {
|
2017-07-13 17:49:13 +02:00
|
|
|
ifc = connected_new();
|
|
|
|
ifc->ifp = ifp;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-07-13 17:49:13 +02:00
|
|
|
/* Address. */
|
|
|
|
p = prefix_ipv6_new();
|
2017-07-17 14:03:14 +02:00
|
|
|
*p = cp;
|
2017-06-21 05:10:57 +02:00
|
|
|
ifc->address = (struct prefix *)p;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* Label. */
|
|
|
|
if (label)
|
2017-07-13 21:56:08 +02:00
|
|
|
ifc->label = XSTRDUP(MTYPE_CONNECTED_LABEL, label);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-07-13 21:56:08 +02:00
|
|
|
/* Add to linked list. */
|
2002-12-13 21:15:29 +01:00
|
|
|
listnode_add(ifp->connected, ifc);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* This address is configured from zebra. */
|
2013-01-24 15:04:48 +01:00
|
|
|
if (!CHECK_FLAG(ifc->conf, ZEBRA_IFC_CONFIGURED))
|
2002-12-13 21:15:29 +01:00
|
|
|
SET_FLAG(ifc->conf, ZEBRA_IFC_CONFIGURED);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* In case of this route need to install kernel. */
|
2022-06-29 15:05:17 +02:00
|
|
|
if (!CHECK_FLAG(ifc->conf, ZEBRA_IFC_QUEUED) &&
|
|
|
|
CHECK_FLAG(ifp->status, ZEBRA_INTERFACE_ACTIVE) &&
|
|
|
|
!(if_data && if_data->shutdown == IF_ZEBRA_DATA_ON)) {
|
2002-12-13 21:15:29 +01:00
|
|
|
/* Some system need to up the interface to set IP address. */
|
|
|
|
if (!if_is_up(ifp)) {
|
|
|
|
if_set_flags(ifp, IFF_UP | IFF_RUNNING);
|
|
|
|
if_refresh(ifp);
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
|
|
|
|
2019-01-25 17:31:51 +01:00
|
|
|
dplane_res = dplane_intf_addr_set(ifp, ifc);
|
|
|
|
if (dplane_res == ZEBRA_DPLANE_REQUEST_FAILURE) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "%% Can't set interface IP address: %s.\n",
|
2019-01-25 17:31:51 +01:00
|
|
|
dplane_res2str(dplane_res));
|
2017-07-13 21:56:08 +02:00
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
|
|
|
|
2013-01-24 15:04:48 +01:00
|
|
|
SET_FLAG(ifc->conf, ZEBRA_IFC_QUEUED);
|
2013-01-24 15:04:49 +01:00
|
|
|
/* The address will be advertised to zebra clients when the
|
|
|
|
* notification
|
|
|
|
* from the kernel has been received. */
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2015-12-07 22:05:34 +01:00
|
|
|
/* Return true if an ipv6 address is configured on ifp */
|
|
|
|
int ipv6_address_configured(struct interface *ifp)
|
|
|
|
{
|
|
|
|
struct connected *connected;
|
|
|
|
struct listnode *node;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2015-12-07 22:05:34 +01:00
|
|
|
for (ALL_LIST_ELEMENTS_RO(ifp->connected, node, connected))
|
|
|
|
if (CHECK_FLAG(connected->conf, ZEBRA_IFC_REAL)
|
|
|
|
&& (connected->address->family == AF_INET6))
|
|
|
|
return 1;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2015-12-07 22:05:34 +01:00
|
|
|
return 0;
|
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2004-10-12 22:50:58 +02:00
|
|
|
static int ipv6_address_uninstall(struct vty *vty, struct interface *ifp,
|
|
|
|
const char *addr_str, const char *peer_str,
|
2018-10-28 08:19:59 +01:00
|
|
|
const char *label)
|
2002-12-13 21:15:29 +01:00
|
|
|
{
|
|
|
|
struct prefix_ipv6 cp;
|
|
|
|
struct connected *ifc;
|
|
|
|
int ret;
|
2019-01-25 17:31:51 +01:00
|
|
|
enum zebra_dplane_result dplane_res;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* Convert to prefix structure. */
|
|
|
|
ret = str2prefix_ipv6(addr_str, &cp);
|
|
|
|
if (ret <= 0) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "%% Malformed address \n");
|
2017-07-13 21:56:08 +02:00
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* Check current interface address. */
|
2005-09-12 18:58:52 +02:00
|
|
|
ifc = connected_check(ifp, (struct prefix *)&cp);
|
2002-12-13 21:15:29 +01:00
|
|
|
if (!ifc) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "%% Can't find address\n");
|
2017-07-13 21:56:08 +02:00
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* This is not configured address. */
|
|
|
|
if (!CHECK_FLAG(ifc->conf, ZEBRA_IFC_CONFIGURED))
|
2017-07-13 21:56:08 +02:00
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2013-01-24 15:04:45 +01:00
|
|
|
UNSET_FLAG(ifc->conf, ZEBRA_IFC_CONFIGURED);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* This is not real address or interface is not active. */
|
2013-01-24 15:04:48 +01:00
|
|
|
if (!CHECK_FLAG(ifc->conf, ZEBRA_IFC_QUEUED)
|
2002-12-13 21:15:29 +01:00
|
|
|
|| !CHECK_FLAG(ifp->status, ZEBRA_INTERFACE_ACTIVE)) {
|
|
|
|
listnode_delete(ifp->connected, ifc);
|
2019-10-30 01:16:28 +01:00
|
|
|
connected_free(&ifc);
|
2017-07-13 21:56:08 +02:00
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* This is real route. */
|
2019-01-25 17:31:51 +01:00
|
|
|
dplane_res = dplane_intf_addr_unset(ifp, ifc);
|
|
|
|
if (dplane_res == ZEBRA_DPLANE_REQUEST_FAILURE) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "%% Can't unset interface IP address: %s.\n",
|
2019-01-25 17:31:51 +01:00
|
|
|
dplane_res2str(dplane_res));
|
2017-07-13 21:56:08 +02:00
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2013-01-24 15:04:48 +01:00
|
|
|
UNSET_FLAG(ifc->conf, ZEBRA_IFC_QUEUED);
|
2013-01-24 15:04:49 +01:00
|
|
|
/* This information will be propagated to the zclients when the
|
|
|
|
* kernel notification is received. */
|
2002-12-13 21:15:29 +01:00
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (ipv6_address,
|
|
|
|
ipv6_address_cmd,
|
|
|
|
"ipv6 address X:X::X:X/M",
|
2004-03-11 16:54:02 +01:00
|
|
|
"Interface IPv6 config commands\n"
|
2002-12-13 21:15:29 +01:00
|
|
|
"Set the IP address of an interface\n"
|
|
|
|
"IPv6 address (e.g. 3ffe:506::1/48)\n")
|
|
|
|
{
|
2016-09-23 21:26:31 +02:00
|
|
|
int idx_ipv6_prefixlen = 2;
|
2016-09-30 15:38:03 +02:00
|
|
|
VTY_DECLVAR_CONTEXT(interface, ifp);
|
2016-10-18 01:36:21 +02:00
|
|
|
return ipv6_address_install(vty, ifp, argv[idx_ipv6_prefixlen]->arg,
|
2018-10-28 08:19:59 +01:00
|
|
|
NULL, NULL);
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_ipv6_address,
|
|
|
|
no_ipv6_address_cmd,
|
|
|
|
"no ipv6 address X:X::X:X/M",
|
|
|
|
NO_STR
|
2004-03-11 16:54:02 +01:00
|
|
|
"Interface IPv6 config commands\n"
|
2002-12-13 21:15:29 +01:00
|
|
|
"Set the IP address of an interface\n"
|
|
|
|
"IPv6 address (e.g. 3ffe:506::1/48)\n")
|
|
|
|
{
|
2016-09-23 21:26:31 +02:00
|
|
|
int idx_ipv6_prefixlen = 3;
|
2016-09-30 15:38:03 +02:00
|
|
|
VTY_DECLVAR_CONTEXT(interface, ifp);
|
2016-12-01 16:49:22 +01:00
|
|
|
return ipv6_address_uninstall(vty, ifp, argv[idx_ipv6_prefixlen]->arg,
|
2018-10-28 08:19:59 +01:00
|
|
|
NULL, NULL);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-07-13 17:49:13 +02:00
|
|
|
static int link_params_config_write(struct vty *vty, struct interface *ifp)
|
2002-12-13 21:15:29 +01:00
|
|
|
{
|
2022-11-08 17:59:33 +01:00
|
|
|
const struct lyd_node *dnode;
|
|
|
|
char xpath[XPATH_MAXLEN];
|
2002-12-13 21:15:29 +01:00
|
|
|
int i;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2016-10-29 18:37:11 +02:00
|
|
|
if ((ifp == NULL) || !HAS_LINK_PARAMS(ifp))
|
2017-07-13 17:49:13 +02:00
|
|
|
return -1;
|
2016-04-22 00:39:38 +02:00
|
|
|
|
|
|
|
struct if_link_params *iflp = ifp->link_params;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, " link-params\n");
|
|
|
|
vty_out(vty, " enable\n");
|
2016-04-22 00:39:38 +02:00
|
|
|
if (IS_PARAM_SET(iflp, LP_TE_METRIC) && iflp->te_metric != ifp->metric)
|
|
|
|
vty_out(vty, " metric %u\n", iflp->te_metric);
|
2016-12-01 16:49:22 +01:00
|
|
|
if (IS_PARAM_SET(iflp, LP_MAX_BW) && iflp->max_bw != iflp->default_bw)
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, " max-bw %g\n", iflp->max_bw);
|
2016-12-01 16:49:22 +01:00
|
|
|
if (IS_PARAM_SET(iflp, LP_MAX_RSV_BW)
|
|
|
|
&& iflp->max_rsv_bw != iflp->default_bw)
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, " max-rsv-bw %g\n", iflp->max_rsv_bw);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
if (IS_PARAM_SET(iflp, LP_UNRSV_BW)) {
|
|
|
|
for (i = 0; i < 8; i++)
|
2016-12-01 16:49:22 +01:00
|
|
|
if (iflp->unrsv_bw[i] != iflp->default_bw)
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, " unrsv-bw %d %g\n", i,
|
2017-06-21 05:10:57 +02:00
|
|
|
iflp->unrsv_bw[i]);
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
2022-11-08 17:59:33 +01:00
|
|
|
|
|
|
|
snprintf(
|
|
|
|
xpath, sizeof(xpath),
|
|
|
|
"/frr-interface:lib/interface[name='%s']/frr-zebra:zebra/link-params",
|
|
|
|
ifp->name);
|
|
|
|
dnode = yang_dnode_get(running_config->dnode, xpath);
|
|
|
|
if (dnode)
|
|
|
|
nb_cli_show_dnode_cmds(vty, dnode, false);
|
|
|
|
|
2016-04-22 00:39:38 +02:00
|
|
|
if (IS_PARAM_SET(iflp, LP_DELAY)) {
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
vty_out(vty, " delay %u", iflp->av_delay);
|
|
|
|
if (IS_PARAM_SET(iflp, LP_MM_DELAY)) {
|
|
|
|
vty_out(vty, " min %u", iflp->min_delay);
|
|
|
|
vty_out(vty, " max %u", iflp->max_delay);
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
2017-07-13 19:04:25 +02:00
|
|
|
vty_out(vty, "\n");
|
2013-01-24 15:04:50 +01:00
|
|
|
}
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
if (IS_PARAM_SET(iflp, LP_DELAY_VAR))
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, " delay-variation %u\n", iflp->delay_var);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
if (IS_PARAM_SET(iflp, LP_PKT_LOSS))
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, " packet-loss %g\n", iflp->pkt_loss);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
if (IS_PARAM_SET(iflp, LP_AVA_BW))
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, " ava-bw %g\n", iflp->ava_bw);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
if (IS_PARAM_SET(iflp, LP_RES_BW))
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, " res-bw %g\n", iflp->res_bw);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
if (IS_PARAM_SET(iflp, LP_USE_BW))
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, " use-bw %g\n", iflp->use_bw);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
if (IS_PARAM_SET(iflp, LP_RMT_AS))
|
2020-10-21 19:57:06 +02:00
|
|
|
vty_out(vty, " neighbor %pI4 as %u\n", &iflp->rmt_ip,
|
2017-06-21 05:10:57 +02:00
|
|
|
iflp->rmt_as);
|
2022-11-08 17:59:33 +01:00
|
|
|
|
2021-08-08 21:38:50 +02:00
|
|
|
vty_out(vty, " exit-link-params\n");
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
return 0;
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
|
|
|
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
static int if_config_write(struct vty *vty)
|
2017-07-17 14:03:14 +02:00
|
|
|
{
|
2021-10-13 14:06:38 +02:00
|
|
|
struct vrf *vrf;
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
struct interface *ifp;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2015-05-20 02:40:44 +02:00
|
|
|
zebra_ptm_write(vty);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2021-10-13 14:06:38 +02:00
|
|
|
RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name)
|
|
|
|
FOR_ALL_INTERFACES (vrf, ifp) {
|
2017-09-15 17:47:35 +02:00
|
|
|
struct zebra_if *if_data;
|
|
|
|
struct listnode *addrnode;
|
|
|
|
struct connected *ifc;
|
|
|
|
struct prefix *p;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-09-15 17:47:35 +02:00
|
|
|
if_data = ifp->info;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2022-01-23 22:07:20 +01:00
|
|
|
if_vty_config_start(vty, ifp);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-09-15 17:47:35 +02:00
|
|
|
if (if_data) {
|
2022-06-29 15:05:17 +02:00
|
|
|
if (if_data->shutdown == IF_ZEBRA_DATA_ON)
|
2017-09-15 17:47:35 +02:00
|
|
|
vty_out(vty, " shutdown\n");
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-09-15 17:47:35 +02:00
|
|
|
zebra_ptm_if_write(vty, if_data);
|
|
|
|
}
|
2013-01-24 15:04:50 +01:00
|
|
|
|
2017-09-15 17:47:35 +02:00
|
|
|
if (ifp->desc)
|
|
|
|
vty_out(vty, " description %s\n", ifp->desc);
|
|
|
|
|
|
|
|
/* Assign bandwidth here to avoid unnecessary interface
|
|
|
|
flap
|
|
|
|
while processing config script */
|
|
|
|
if (ifp->bandwidth != 0)
|
|
|
|
vty_out(vty, " bandwidth %u\n", ifp->bandwidth);
|
|
|
|
|
|
|
|
if (!CHECK_FLAG(ifp->status,
|
|
|
|
ZEBRA_INTERFACE_LINKDETECTION))
|
|
|
|
vty_out(vty, " no link-detect\n");
|
|
|
|
|
|
|
|
for (ALL_LIST_ELEMENTS_RO(ifp->connected, addrnode,
|
|
|
|
ifc)) {
|
|
|
|
if (CHECK_FLAG(ifc->conf,
|
|
|
|
ZEBRA_IFC_CONFIGURED)) {
|
|
|
|
char buf[INET6_ADDRSTRLEN];
|
|
|
|
p = ifc->address;
|
|
|
|
vty_out(vty, " ip%s address %s",
|
|
|
|
p->family == AF_INET ? ""
|
|
|
|
: "v6",
|
2010-01-30 11:26:59 +01:00
|
|
|
inet_ntop(p->family,
|
2017-08-30 17:23:01 +02:00
|
|
|
&p->u.prefix, buf,
|
|
|
|
sizeof(buf)));
|
2017-09-15 17:47:35 +02:00
|
|
|
if (CONNECTED_PEER(ifc)) {
|
|
|
|
p = ifc->destination;
|
|
|
|
vty_out(vty, " peer %s",
|
|
|
|
inet_ntop(p->family,
|
|
|
|
&p->u.prefix,
|
|
|
|
buf,
|
|
|
|
sizeof(buf)));
|
|
|
|
}
|
|
|
|
vty_out(vty, "/%d", p->prefixlen);
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2017-09-15 17:47:35 +02:00
|
|
|
if (ifc->label)
|
|
|
|
vty_out(vty, " label %s",
|
|
|
|
ifc->label);
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2017-09-15 17:47:35 +02:00
|
|
|
vty_out(vty, "\n");
|
|
|
|
}
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|
|
|
|
|
2017-09-15 17:47:35 +02:00
|
|
|
if (if_data) {
|
2022-06-29 15:05:17 +02:00
|
|
|
if (if_data->multicast != IF_ZEBRA_DATA_UNSPEC)
|
2017-09-15 17:47:35 +02:00
|
|
|
vty_out(vty, " %smulticast\n",
|
2022-06-29 15:05:17 +02:00
|
|
|
if_data->multicast ==
|
|
|
|
IF_ZEBRA_DATA_ON
|
2017-09-15 17:47:35 +02:00
|
|
|
? ""
|
|
|
|
: "no ");
|
2023-04-26 21:55:32 +02:00
|
|
|
|
|
|
|
if (if_data->mpls_config == IF_ZEBRA_DATA_ON)
|
2022-11-28 10:14:06 +01:00
|
|
|
vty_out(vty, " mpls enable\n");
|
2017-09-15 17:47:35 +02:00
|
|
|
}
|
2002-12-13 21:15:29 +01:00
|
|
|
|
2017-09-15 17:47:35 +02:00
|
|
|
hook_call(zebra_if_config_wr, vty, ifp);
|
2020-03-28 01:14:45 +01:00
|
|
|
zebra_evpn_mh_if_write(vty, ifp);
|
2017-09-15 17:47:35 +02:00
|
|
|
link_params_config_write(vty, ifp);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
|
2022-01-23 22:07:20 +01:00
|
|
|
if_vty_config_end(vty);
|
2017-09-15 17:47:35 +02:00
|
|
|
}
|
2002-12-13 21:15:29 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Allocate and initialize interface vector. */
|
2005-06-28 19:17:12 +02:00
|
|
|
void zebra_if_init(void)
|
2002-12-13 21:15:29 +01:00
|
|
|
{
|
|
|
|
/* Initialize interface and new hook. */
|
2017-08-08 10:50:43 +02:00
|
|
|
hook_register_prio(if_add, 0, if_zebra_new_hook);
|
|
|
|
hook_register_prio(if_del, 0, if_zebra_delete_hook);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
/* Install configuration write function. */
|
2021-07-29 20:34:56 +02:00
|
|
|
if_cmd_init(if_config_write);
|
2018-09-08 22:31:43 +02:00
|
|
|
install_node(&link_params_node);
|
2019-09-18 22:20:04 +02:00
|
|
|
/*
|
|
|
|
* This is *intentionally* setting this to NULL, signaling
|
|
|
|
* that interface creation for zebra acts differently
|
|
|
|
*/
|
|
|
|
if_zapi_callbacks(NULL, NULL, NULL, NULL);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2002-12-13 21:15:29 +01:00
|
|
|
install_element(VIEW_NODE, &show_interface_cmd);
|
2015-05-22 11:40:01 +02:00
|
|
|
install_element(VIEW_NODE, &show_interface_vrf_all_cmd);
|
|
|
|
install_element(VIEW_NODE, &show_interface_name_vrf_cmd);
|
|
|
|
install_element(VIEW_NODE, &show_interface_name_vrf_all_cmd);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2005-03-13 20:17:21 +01:00
|
|
|
install_element(ENABLE_NODE, &show_interface_desc_cmd);
|
2015-05-22 11:40:01 +02:00
|
|
|
install_element(ENABLE_NODE, &show_interface_desc_vrf_all_cmd);
|
2002-12-13 21:15:29 +01:00
|
|
|
install_element(INTERFACE_NODE, &multicast_cmd);
|
|
|
|
install_element(INTERFACE_NODE, &no_multicast_cmd);
|
2022-06-29 13:43:50 +02:00
|
|
|
install_element(INTERFACE_NODE, &mpls_cmd);
|
2002-12-13 22:03:13 +01:00
|
|
|
install_element(INTERFACE_NODE, &linkdetect_cmd);
|
|
|
|
install_element(INTERFACE_NODE, &no_linkdetect_cmd);
|
2002-12-13 21:15:29 +01:00
|
|
|
install_element(INTERFACE_NODE, &shutdown_if_cmd);
|
|
|
|
install_element(INTERFACE_NODE, &no_shutdown_if_cmd);
|
|
|
|
install_element(INTERFACE_NODE, &bandwidth_if_cmd);
|
|
|
|
install_element(INTERFACE_NODE, &no_bandwidth_if_cmd);
|
|
|
|
install_element(INTERFACE_NODE, &ip_address_cmd);
|
|
|
|
install_element(INTERFACE_NODE, &no_ip_address_cmd);
|
2010-01-30 11:26:59 +01:00
|
|
|
install_element(INTERFACE_NODE, &ip_address_peer_cmd);
|
|
|
|
install_element(INTERFACE_NODE, &no_ip_address_peer_cmd);
|
2002-12-13 21:15:29 +01:00
|
|
|
install_element(INTERFACE_NODE, &ipv6_address_cmd);
|
|
|
|
install_element(INTERFACE_NODE, &no_ipv6_address_cmd);
|
|
|
|
#ifdef HAVE_NETLINK
|
|
|
|
install_element(INTERFACE_NODE, &ip_address_label_cmd);
|
|
|
|
install_element(INTERFACE_NODE, &no_ip_address_label_cmd);
|
|
|
|
#endif /* HAVE_NETLINK */
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
install_element(INTERFACE_NODE, &link_params_cmd);
|
|
|
|
install_default(LINK_PARAMS_NODE);
|
|
|
|
install_element(LINK_PARAMS_NODE, &link_params_enable_cmd);
|
|
|
|
install_element(LINK_PARAMS_NODE, &no_link_params_enable_cmd);
|
|
|
|
install_element(LINK_PARAMS_NODE, &link_params_metric_cmd);
|
2016-12-05 20:28:24 +01:00
|
|
|
install_element(LINK_PARAMS_NODE, &no_link_params_metric_cmd);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
install_element(LINK_PARAMS_NODE, &link_params_maxbw_cmd);
|
|
|
|
install_element(LINK_PARAMS_NODE, &link_params_max_rsv_bw_cmd);
|
|
|
|
install_element(LINK_PARAMS_NODE, &link_params_unrsv_bw_cmd);
|
|
|
|
install_element(LINK_PARAMS_NODE, &link_params_admin_grp_cmd);
|
2016-11-12 09:43:15 +01:00
|
|
|
install_element(LINK_PARAMS_NODE, &no_link_params_admin_grp_cmd);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
install_element(LINK_PARAMS_NODE, &link_params_inter_as_cmd);
|
|
|
|
install_element(LINK_PARAMS_NODE, &no_link_params_inter_as_cmd);
|
|
|
|
install_element(LINK_PARAMS_NODE, &link_params_delay_cmd);
|
2016-11-12 09:43:15 +01:00
|
|
|
install_element(LINK_PARAMS_NODE, &no_link_params_delay_cmd);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
install_element(LINK_PARAMS_NODE, &link_params_delay_var_cmd);
|
2016-11-12 09:43:15 +01:00
|
|
|
install_element(LINK_PARAMS_NODE, &no_link_params_delay_var_cmd);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
install_element(LINK_PARAMS_NODE, &link_params_pkt_loss_cmd);
|
2016-11-12 09:43:15 +01:00
|
|
|
install_element(LINK_PARAMS_NODE, &no_link_params_pkt_loss_cmd);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
install_element(LINK_PARAMS_NODE, &link_params_ava_bw_cmd);
|
2016-11-12 09:43:15 +01:00
|
|
|
install_element(LINK_PARAMS_NODE, &no_link_params_ava_bw_cmd);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
install_element(LINK_PARAMS_NODE, &link_params_res_bw_cmd);
|
2016-11-12 09:43:15 +01:00
|
|
|
install_element(LINK_PARAMS_NODE, &no_link_params_res_bw_cmd);
|
Update Traffic Engineering Support for OSPFD
NOTE: I am squashing several commits together because they
do not independently compile and we need this ability to
do any type of sane testing on the patches. Since this
series builds together I am doing this. -DBS
This new structure is the basis to get new link parameters for
Traffic Engineering from Zebra/interface layer to OSPFD and ISISD
for the support of Traffic Engineering
* lib/if.[c,h]: link parameters struture and get/set functions
* lib/command.[c,h]: creation of a new link-node
* lib/zclient.[c,h]: modification to the ZBUS message to convey the
link parameters structure
* lib/zebra.h: New ZBUS message
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support for IEEE 754 format
* lib/stream.[c,h]: Add stream_get{f,d} and stream_put{f,d}) demux and muxers to
safely convert between big-endian IEEE-754 single and double binary
format, as used in IETF RFCs, and C99. Implementation depends on host
using __STDC_IEC_559__, which should be everything we care about. Should
correctly error out otherwise.
* lib/network.[c,h]: Add ntohf and htonf converter
* lib/memtypes.c: Add new memeory type for Traffic Engineering support
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Add support of new link-params CLI to vtysh
In vtysh_config.c/vtysh_config_parse_line(), it is not possible to continue
to use the ordered version for adding line i.e. config_add_line_uniq() to print
Interface CLI commands as it completely break the new LINK_PARAMS_NODE.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Update Traffic Engineering support for OSPFD
These patches update original code to RFC3630 (OSPF-TE) and add support of
RFC5392 (Inter-AS v2) & RFC7471 (TE metric extensions) and partial support
of RFC6827 (ASON - GMPLS).
* ospfd/ospf_dump.[c,h]: Add new dump functions for Traffic Engineering
* ospfd/ospf_opaque.[c,h]: Add new TLV code points for RFC5392
* ospfd/ospf_packet.c: Update checking of OSPF_OPTION
* ospfd/ospf_vty.[c,h]: Update ospf_str2area_id
* ospfd/ospf_zebra.c: Add new function ospf_interface_link_params() to get
Link Parameters information from the interface to populate Traffic Engineering
metrics
* ospfd/ospfd.[c,h]: Update OSPF_OPTION flags (T -> MT and new DN)
* ospfd/ospf_te.[c,h]: Major modifications to update the code to new
link parameters structure and new RFCs
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
tmp
2016-04-19 16:21:46 +02:00
|
|
|
install_element(LINK_PARAMS_NODE, &link_params_use_bw_cmd);
|
2016-11-12 09:43:15 +01:00
|
|
|
install_element(LINK_PARAMS_NODE, &no_link_params_use_bw_cmd);
|
2022-11-08 17:59:33 +01:00
|
|
|
install_element(LINK_PARAMS_NODE, &link_params_affinity_cmd);
|
|
|
|
install_element(LINK_PARAMS_NODE, &link_params_affinity_mode_cmd);
|
|
|
|
install_element(LINK_PARAMS_NODE, &no_link_params_affinity_mode_cmd);
|
2016-11-18 21:42:41 +01:00
|
|
|
install_element(LINK_PARAMS_NODE, &exit_link_params_cmd);
|
2020-03-28 01:14:45 +01:00
|
|
|
|
|
|
|
/* setup EVPN MH elements */
|
|
|
|
zebra_evpn_interface_init();
|
2002-12-13 21:15:29 +01:00
|
|
|
}
|