+// SPDX-License-Identifier: GPL-2.0-or-later
/*
* ISIS SNMP support
* Copyright (C) 2020 Volta Networks, Inc.
* Aleksey Romanov
- *
- * 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 "smux.h"
#include "libfrr.h"
#include "lib/version.h"
+#include "lib/zclient.h"
#include "isisd/isis_constants.h"
#include "isisd/isis_common.h"
break;
case ISIS_SNMP_ADJ_DATA_IP_ADDR:
- if (data_off
- >= (adj->ipv4_address_count + adj->ipv6_address_count))
+ if (data_off >= (adj->ipv4_address_count + adj->ll_ipv6_count))
return 0;
if (data_off >= adj->ipv4_address_count) {
- data = (uint8_t *)&adj->ipv6_addresses
+ data = (uint8_t *)&adj->ll_ipv6_addrs
[data_off - adj->ipv4_address_count];
- data_len = sizeof(adj->ipv6_addresses[0]);
+ data_len = sizeof(adj->ll_ipv6_addrs[0]);
} else {
data = (uint8_t *)&adj->ipv4_addresses[data_off];
data_len = sizeof(adj->ipv4_addresses[0]);
switch (v->magic) {
case ISIS_CIRC_IFINDEX:
- if (circuit->interface == 0)
+ if (circuit->interface == NULL)
return SNMP_INTEGER(0);
return SNMP_INTEGER(circuit->interface->ifindex);
*/
if (adj->last_upd != 0) {
val = time(NULL);
- if (val < ((time_t)adj->last_upd + (time_t)adj->hold_time))
+ if (val < (adj->last_upd + adj->hold_time))
return SNMP_INTEGER(adj->last_upd
+ adj->hold_time - val);
}