]> git.proxmox.com Git - mirror_frr.git/blobdiff - ospfd/ospf_snmp.c
Merge pull request #13455 from sri-mohan1/srib-ldpd
[mirror_frr.git] / ospfd / ospf_snmp.c
index 9727c7039c5ee0bf9c3c95000a5629de9c9f0ecc..fcc43e7311c2bae2ac7522bfa4ff91522543bfab 100644 (file)
@@ -1,24 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* OSPFv2 SNMP support
  * Copyright (C) 2005 6WIND <alain.ritoux@6wind.com>
  * Copyright (C) 2000 IP Infusion Inc.
  *
  * Written by Kunihiro Ishiguro <kunihiro@zebra.org>
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra 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>
@@ -50,6 +35,8 @@
 #include "ospfd/ospf_route.h"
 #include "ospfd/ospf_zebra.h"
 
+DEFINE_MTYPE_STATIC(OSPFD, SNMP, "OSPF SNMP");
+
 /* OSPF2-MIB. */
 #define OSPF2MIB 1,3,6,1,2,1,14
 
@@ -1125,7 +1112,7 @@ static struct ospf_area_range *ospfAreaRangeLookup(struct variable *v,
                oid2in_addr(offset, IN_ADDR_SIZE, range_net);
                p.prefix = *range_net;
 
-               return ospf_area_range_lookup(area, &p);
+               return ospf_area_range_lookup(area, area->ranges, &p);
        } else {
                /* Set OID offset for Area ID. */
                offset = name + v->namelen;
@@ -1321,12 +1308,12 @@ struct ospf_snmp_if {
 
 static struct ospf_snmp_if *ospf_snmp_if_new(void)
 {
-       return XCALLOC(MTYPE_TMP, sizeof(struct ospf_snmp_if));
+       return XCALLOC(MTYPE_SNMP, sizeof(struct ospf_snmp_if));
 }
 
 static void ospf_snmp_if_free(struct ospf_snmp_if *osif)
 {
-       XFREE(MTYPE_TMP, osif);
+       XFREE(MTYPE_SNMP, osif);
 }
 
 static int ospf_snmp_if_delete(struct interface *ifp)
@@ -2538,7 +2525,7 @@ static int ospf_snmp_ism_change(struct ospf_interface *oi, int state,
 }
 
 /* Register OSPF2-MIB. */
-static int ospf_snmp_init(struct thread_master *tm)
+static int ospf_snmp_init(struct event_loop *tm)
 {
        ospf_snmp_iflist = list_new();
        ospf_snmp_vl_table = route_table_init();