summaryrefslogtreecommitdiff
path: root/ospfd/ospf_zebra.c
diff options
context:
space:
mode:
Diffstat (limited to 'ospfd/ospf_zebra.c')
-rw-r--r--ospfd/ospf_zebra.c40
1 files changed, 16 insertions, 24 deletions
diff --git a/ospfd/ospf_zebra.c b/ospfd/ospf_zebra.c
index b0ff5d0e3c..4df49db9b2 100644
--- a/ospfd/ospf_zebra.c
+++ b/ospfd/ospf_zebra.c
@@ -14,10 +14,9 @@
* 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 GNU Zebra; see the file COPYING. If not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * 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,11 +49,11 @@
#include "ospfd/ospf_neighbor.h"
#include "ospfd/ospf_nsm.h"
#include "ospfd/ospf_zebra.h"
-#ifdef HAVE_SNMP
-#include "ospfd/ospf_snmp.h"
-#endif /* HAVE_SNMP */
#include "ospfd/ospf_te.h"
+DEFINE_HOOK(ospf_if_update, (struct interface *ifp), (ifp))
+DEFINE_HOOK(ospf_if_delete, (struct interface *ifp), (ifp))
+
/* Zebra structure to hold current status. */
struct zclient *zclient = NULL;
@@ -112,9 +111,7 @@ ospf_interface_add (int command, struct zclient *zclient, zebra_size_t length,
ospf_if_update (NULL, ifp);
-#ifdef HAVE_SNMP
- ospf_snmp_if_update (ifp);
-#endif /* HAVE_SNMP */
+ hook_call(ospf_if_update, ifp);
return 0;
}
@@ -143,9 +140,7 @@ ospf_interface_delete (int command, struct zclient *zclient,
("Zebra: interface delete %s[%u] index %d flags %llx metric %d mtu %d",
ifp->name, ifp->vrf_id, ifp->ifindex, (unsigned long long)ifp->flags, ifp->metric, ifp->mtu);
-#ifdef HAVE_SNMP
- ospf_snmp_if_delete (ifp);
-#endif /* HAVE_SNMP */
+ hook_call(ospf_if_delete, ifp);
for (rn = route_top (IF_OIFS (ifp)); rn; rn = route_next (rn))
if (rn->info)
@@ -165,7 +160,8 @@ zebra_interface_if_lookup (struct stream *s, vrf_id_t vrf_id)
/* And look it up. */
return if_lookup_by_name_len(ifname_tmp,
- strnlen(ifname_tmp, INTERFACE_NAMSIZ));
+ strnlen(ifname_tmp, INTERFACE_NAMSIZ),
+ VRF_DEFAULT);
}
static int
@@ -276,9 +272,7 @@ ospf_interface_address_add (int command, struct zclient *zclient,
ospf_if_update (NULL, c->ifp);
-#ifdef HAVE_SNMP
- ospf_snmp_if_update (c->ifp);
-#endif /* HAVE_SNMP */
+ hook_call(ospf_if_update, c->ifp);
return 0;
}
@@ -323,9 +317,7 @@ ospf_interface_address_delete (int command, struct zclient *zclient,
/* Call interface hook functions to clean up */
ospf_if_free (oi);
-#ifdef HAVE_SNMP
- ospf_snmp_if_update (c->ifp);
-#endif /* HAVE_SNMP */
+ hook_call(ospf_if_update, c->ifp);
connected_free (c);
@@ -890,7 +882,7 @@ ospf_redistribute_default_set (struct ospf *ospf, int originate,
if (ospf->router_id.s_addr == 0)
ospf->external_origin |= (1 << DEFAULT_ROUTE);
else
- thread_add_timer (master, ospf_default_originate_timer, ospf, 1);
+ thread_add_timer(master, ospf_default_originate_timer, ospf, 1, NULL);
ospf_asbr_status_update (ospf, ++ospf->redistribute);
@@ -1285,9 +1277,9 @@ ospf_distribute_list_update (struct ospf *ospf, uintptr_t type,
return;
/* Set timer. */
- ospf->t_distribute_update =
- thread_add_timer_msec (master, ospf_distribute_list_update_timer,
- (void *) type, ospf->min_ls_interval);
+ ospf->t_distribute_update = NULL;
+ thread_add_timer_msec(master, ospf_distribute_list_update_timer, (void *)type, ospf->min_ls_interval,
+ &ospf->t_distribute_update);
}
/* If access-list is updated, apply some check. */