[ospfd] Add debug messages for a few zebra messages that had been overlooked
2006-11-30 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* ospf_zebra.c: (ospf_router_id_update_zebra,
ospf_interface_address_add, ospf_interface_address_delete)
If (IS_DEBUG_OSPF (zebra, ZEBRA_INTERFACE)) is enabled, then
add a debug message about what Zebra is telling us.
(ospf_zebra_add_discard) Add a debug message matching the one
already in ospf_zebra_delete_discard.
diff --git a/ospfd/ospf_zebra.c b/ospfd/ospf_zebra.c
index aaee31e..bdd0142 100644
--- a/ospfd/ospf_zebra.c
+++ b/ospfd/ospf_zebra.c
@@ -65,6 +65,13 @@
struct prefix router_id;
zebra_router_id_update_read(zclient->ibuf,&router_id);
+ if (IS_DEBUG_OSPF (zebra, ZEBRA_INTERFACE))
+ {
+ char buf[128];
+ prefix2str(&router_id, buf, sizeof(buf));
+ zlog_debug("Zebra rcvd: router id update %s", buf);
+ }
+
router_id_zebra = router_id.u.prefix4;
ospf = ospf_lookup ();
@@ -256,6 +263,13 @@
if (c == NULL)
return 0;
+ if (IS_DEBUG_OSPF (zebra, ZEBRA_INTERFACE))
+ {
+ char buf[128];
+ prefix2str(c->address, buf, sizeof(buf));
+ zlog_debug("Zebra: interface %s address add %s", c->ifp->name, buf);
+ }
+
ospf = ospf_lookup ();
if (ospf != NULL)
ospf_if_update (ospf);
@@ -283,6 +297,13 @@
if (c == NULL)
return 0;
+ if (IS_DEBUG_OSPF (zebra, ZEBRA_INTERFACE))
+ {
+ char buf[128];
+ prefix2str(c->address, buf, sizeof(buf));
+ zlog_debug("Zebra: interface %s address delete %s", c->ifp->name, buf);
+ }
+
ifp = c->ifp;
p = *c->address;
p.prefixlen = IPV4_MAX_PREFIXLEN;
@@ -470,6 +491,10 @@
api.ifindex_num = 0;
zapi_ipv4_route (ZEBRA_IPV4_ROUTE_ADD, zclient, p, &api);
+
+ if (IS_DEBUG_OSPF (zebra, ZEBRA_REDISTRIBUTE))
+ zlog_debug ("Zebra: Route add discard %s/%d",
+ inet_ntoa (p->prefix), p->prefixlen);
}
}