/* Dump if address information to vty. */ static void connected_dump_vty (struct vty *vty, struct connected *connected) { struct prefix *p; /* Print interface address. */ p = connected->address; vty_out (vty, " %s ", prefix_family_str (p)); prefix_vty_out (vty, p); vty_out (vty, "/%d", p->prefixlen); /* If there is destination address, print it. */ if (connected->destination) { vty_out (vty, (CONNECTED_PEER(connected) ? " peer " : " broadcast ")); prefix_vty_out (vty, connected->destination); } if (CHECK_FLAG (connected->flags, ZEBRA_IFA_SECONDARY)) vty_out (vty, " secondary"); if (connected->label) vty_out (vty, " %s", connected->label); vty_out (vty, "%s", VTY_NEWLINE); }
/* Dump if address information to vty. */ void connected_dump_vty (struct vty *vty, struct connected *connected) { struct prefix *p; struct interface *ifp; /* Set interface pointer. */ ifp = connected->ifp; /* Print interface address. */ p = connected->address; vty_out (vty, " %s ", prefix_family_str (p)); prefix_vty_out (vty, p); vty_out (vty, "/%d", p->prefixlen); /* If there is destination address, print it. */ p = connected->destination; if (p) { if (p->family == AF_INET) if (ifp->flags & IFF_BROADCAST) { vty_out (vty, " broadcast "); prefix_vty_out (vty, p); } if (ifp->flags & IFF_POINTOPOINT) { vty_out (vty, " pointopoint "); prefix_vty_out (vty, p); } } if (CHECK_FLAG (connected->flags, ZEBRA_IFA_SECONDARY)) vty_out (vty, " secondary"); if (connected->label) vty_out (vty, " %s", connected->label); vty_out (vty, "%s", VTY_NEWLINE); }
static int ospf6_zebra_if_address_update_delete (int command, struct zclient *zclient, zebra_size_t length) { struct connected *c; char buf[128]; c = zebra_interface_address_read (ZEBRA_INTERFACE_ADDRESS_DELETE, zclient->ibuf); if (c == NULL) return 0; if (IS_OSPF6_DEBUG_ZEBRA (RECV)) zlog_debug ("Zebra Interface address delete: %s %5s %s/%d", c->ifp->name, prefix_family_str (c->address), inet_ntop (c->address->family, &c->address->u.prefix, buf, sizeof (buf)), c->address->prefixlen); if (c->address->family == AF_INET6) ospf6_interface_connected_route_update (c->ifp); return 0; }
int ospf6_zebra_if_address_update_delete (int command, struct zclient *zclient, zebra_size_t length) { struct connected *c; char buf[128]; c = zebra_interface_address_delete_read (zclient->ibuf); if (c == NULL) return 0; if (IS_OSPF6_DUMP_ZEBRA) zlog_info ("ZEBRA: I/F %s address del: %5s %s/%d", c->ifp->name, prefix_family_str (c->address), inet_ntop (c->address->family, &c->address->u.prefix, buf, sizeof (buf)), c->address->prefixlen); if (c->address->family == AF_INET6) ospf6_interface_address_update (c->ifp); return 0; }
connected_log (struct connected *connected, char *str) { struct prefix *p; struct interface *ifp; char logbuf[BUFSIZ]; char buf[BUFSIZ]; ifp = connected->ifp; p = connected->address; snprintf (logbuf, BUFSIZ, "%s interface %s %s %s/%d ", str, ifp->ifDescr, prefix_family_str (p), inet_ntop (p->family, &p->u.prefix, buf, BUFSIZ), p->prefixlen); p = connected->destination; if (p) { strncat (logbuf, inet_ntop (p->family, &p->u.prefix, buf, BUFSIZ), BUFSIZ - strlen(logbuf)); } //zlog (NULL, LOG_INFO, "%s", logbuf); }