+// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Copyright (C) 2016 by Open Source Routing.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; see the file COPYING; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
- * MA 02110-1301 USA
*/
#include <zebra.h>
rtr_id.s_addr = ldp_rtr_id_get(ldpd_conf);
vty_out (vty, "Local:\n");
vty_out (vty, " LSR Id: %pI4:0\n",&rtr_id);
- if (ldpd_conf->ipv4.flags & F_LDPD_AF_ENABLED)
+ if (CHECK_FLAG(ldpd_conf->ipv4.flags, F_LDPD_AF_ENABLED))
vty_out (vty, " Transport Address (IPv4): %s\n",
log_addr(AF_INET, &ldpd_conf->ipv4.trans_addr));
- if (ldpd_conf->ipv6.flags & F_LDPD_AF_ENABLED)
+ if (CHECK_FLAG(ldpd_conf->ipv6.flags, F_LDPD_AF_ENABLED))
vty_out (vty, " Transport Address (IPv6): %s\n",
log_addr(AF_INET6, &ldpd_conf->ipv6.trans_addr));
vty_out (vty, "Discovery Sources:\n");
case IMSG_CTL_SHOW_DISCOVERY:
rtr_id.s_addr = ldp_rtr_id_get(ldpd_conf);
json_object_string_addf(json, "lsrId", "%pI4", &rtr_id);
- if (ldpd_conf->ipv4.flags & F_LDPD_AF_ENABLED)
+ if (CHECK_FLAG(ldpd_conf->ipv4.flags, F_LDPD_AF_ENABLED))
json_object_string_add(json, "transportAddressIPv4",
log_addr(AF_INET, &ldpd_conf->ipv4.trans_addr));
- if (ldpd_conf->ipv6.flags & F_LDPD_AF_ENABLED)
+ if (CHECK_FLAG(ldpd_conf->ipv6.flags, F_LDPD_AF_ENABLED))
json_object_string_add(json, "transportAddressIPv6",
log_addr(AF_INET6, &ldpd_conf->ipv6.trans_addr));
json_interfaces = json_object_new_object();
" - Typed Wildcard (0x050B)\n"
" - Unrecognized Notification (0x0603)\n");
vty_out (vty, " Capabilities Received:\n");
- if (nbr->flags & F_NBR_CAP_DYNAMIC)
+ if (CHECK_FLAG(nbr->flags, F_NBR_CAP_DYNAMIC))
vty_out (vty," - Dynamic Announcement (0x0506)\n");
- if (nbr->flags & F_NBR_CAP_TWCARD)
+ if (CHECK_FLAG(nbr->flags, F_NBR_CAP_TWCARD))
vty_out (vty, " - Typed Wildcard (0x050B)\n");
- if (nbr->flags & F_NBR_CAP_UNOTIF)
+ if (CHECK_FLAG(nbr->flags, F_NBR_CAP_UNOTIF))
vty_out (vty," - Unrecognized Notification (0x0603)\n");
}
json_object_object_add(json_nbr, "receivedCapabilities", json_array);
/* Dynamic Announcement (0x0506) */
- if (nbr->flags & F_NBR_CAP_DYNAMIC) {
+ if (CHECK_FLAG(nbr->flags, F_NBR_CAP_DYNAMIC)) {
json_cap = json_object_new_object();
json_object_string_add(json_cap, "description",
"Dynamic Announcement");
}
/* Typed Wildcard (0x050B) */
- if (nbr->flags & F_NBR_CAP_TWCARD) {
+ if (CHECK_FLAG(nbr->flags, F_NBR_CAP_TWCARD)) {
json_cap = json_object_new_object();
json_object_string_add(json_cap, "description",
"Typed Wildcard");
}
/* Unrecognized Notification (0x0603) */
- if (nbr->flags & F_NBR_CAP_UNOTIF) {
+ if (CHECK_FLAG(nbr->flags, F_NBR_CAP_UNOTIF)) {
json_cap = json_object_new_object();
json_object_string_add(json_cap, "description",
"Unrecognized Notification");
json_pw = json_object_new_object();
json_object_string_addf(json_pw, "peerId", "%pI4", &pw->lsr_id);
json_object_int_add(json_pw, "vcId", pw->pwid);
-#if CONFDATE > 20230131
-CPP_NOTICE("Remove JSON object commands with keys starting with capital")
-#endif
- json_object_string_add(json_pw, "VpnName", pw->l2vpn_name);
json_object_string_add(json_pw, "vpnName", pw->l2vpn_name);
if (pw->status == PW_FORWARDING)
json_object_string_add(json_pw, "status", "up");