summaryrefslogtreecommitdiff
path: root/ospfd/ospf_zebra.c
diff options
context:
space:
mode:
authorhasso <hasso>2004-10-03 18:18:34 +0000
committerhasso <hasso>2004-10-03 18:18:34 +0000
commit18a6dce6f83dd20caf1f36c8e840868ff0bf6dbd (patch)
treeff832cbf6fe2b239bde06268820587bec671ae6d /ospfd/ospf_zebra.c
parenta49c0ff6771975eeb1bd7da923a9dc830200cf65 (diff)
Common router id.
Diffstat (limited to 'ospfd/ospf_zebra.c')
-rw-r--r--ospfd/ospf_zebra.c37
1 files changed, 23 insertions, 14 deletions
diff --git a/ospfd/ospf_zebra.c b/ospfd/ospf_zebra.c
index 6a675a59..3172ebc5 100644
--- a/ospfd/ospf_zebra.c
+++ b/ospfd/ospf_zebra.c
@@ -54,6 +54,28 @@ struct zclient *zclient = NULL;
/* For registering threads. */
extern struct thread_master *master;
+struct in_addr router_id_zebra;
+
+/* Router-id update message from zebra. */
+int
+ospf_router_id_update_zebra (int command, struct zclient *zclient,
+ zebra_size_t length)
+{
+ struct ospf *ospf;
+ struct prefix router_id;
+ zebra_router_id_update_read(zclient->ibuf,&router_id);
+
+ router_id_zebra = router_id.u.prefix4;
+
+ ospf = ospf_lookup ();
+ if (ospf != NULL)
+ {
+ if (ospf->t_router_id_update == NULL)
+ OSPF_TIMER_ON (ospf->t_router_id_update, ospf_router_id_update_timer,
+ OSPF_ROUTER_ID_UPDATE_DELAY);
+ }
+ return 0;
+}
/* Inteface addition message from zebra. */
int
@@ -148,20 +170,6 @@ zebra_interface_if_lookup (struct stream *s)
return ifp;
}
-void
-zebra_interface_if_set_value (struct stream *s, struct interface *ifp)
-{
- /* Read interface's index. */
- ifp->ifindex = stream_getl (s);
-
- /* Read interface's value. */
- ifp->status = stream_getc (s);
- ifp->flags = stream_getl (s);
- ifp->metric = stream_getl (s);
- ifp->mtu = stream_getl (s);
- ifp->bandwidth = stream_getl (s);
-}
-
int
ospf_interface_state_up (int command, struct zclient *zclient,
zebra_size_t length)
@@ -1248,6 +1256,7 @@ ospf_zebra_init ()
/* Allocate zebra structure. */
zclient = zclient_new ();
zclient_init (zclient, ZEBRA_ROUTE_OSPF);
+ zclient->router_id_update = ospf_router_id_update_zebra;
zclient->interface_add = ospf_interface_add;
zclient->interface_delete = ospf_interface_delete;
zclient->interface_up = ospf_interface_state_up;