/* Inteface link up message processing. */
int
ripng_interface_up (int command, struct zclient *zclient, zebra_size_t length)
{
  struct stream *s;
  struct interface *ifp;

  /* zebra_interface_state_read() updates interface structure in iflist. */
  s = zclient->ibuf;
  ifp = zebra_interface_state_read (s);

  if (ifp == NULL)
    return 0;

  if (IS_RIPNG_DEBUG_ZEBRA)
    zlog_debug ("interface up %s index %d flags %#"PRIx64" metric %d mtu %d",
	       ifp->name, ifp->ifindex, ifp->flags, ifp->metric, ifp->mtu6);

  /* Check if this interface is RIPng enabled or not. */
  ripng_enable_apply (ifp);

  /* Check for a passive interface. */
  ripng_passive_interface_apply (ifp);

  /* Apply distribute list to the all interface. */
  ripng_distribute_update_interface (ifp);

  return 0;
}
Example #2
0
int
ripng_interface_address_add (int command, struct zclient *zclient,
			     zebra_size_t length)
{
  struct connected *c;
  struct prefix *p;

  c = zebra_interface_address_read (ZEBRA_INTERFACE_ADDRESS_ADD, 
                                    zclient->ibuf);

  if (c == NULL)
    return 0;

  p = c->address;

  if (p->family == AF_INET6)
    {
      if (IS_RIPNG_DEBUG_ZEBRA)
	zlog_debug ("RIPng connected address %s/%d add",
		   inet6_ntop(&p->u.prefix6),
		   p->prefixlen);
      
      /* Check is this prefix needs to be redistributed. */
      ripng_apply_address_add(c);

      /* Let's try once again whether the interface could be activated */
      if (c->ifp) {
        struct ripng_interface *ri = c->ifp->info;

        if (!ri->running) {
          /* Check if this interface is RIP enabled or not.*/
          ripng_enable_apply (c->ifp);

          /* Apply distribute list to the interface. */
          ripng_distribute_update_interface (c->ifp);

          /* Check interface routemap. */
          ripng_if_rmap_update_interface (c->ifp);
        }
      }

    }

  return 0;
}
/* Inteface addition message from zebra. */
int
ripng_interface_add (int command, struct zclient *zclient, zebra_size_t length)
{
  struct interface *ifp;

  ifp = zebra_interface_add_read (zclient->ibuf);

  if (IS_RIPNG_DEBUG_ZEBRA)
    zlog_debug ("RIPng interface add %s index %d flags %#"PRIx64" metric %d mtu %d",
		ifp->name, ifp->ifindex, ifp->flags, ifp->metric, ifp->mtu6);

  /* Check is this interface is RIP enabled or not.*/
  ripng_enable_apply (ifp);

  /* Apply distribute list to the interface. */
  ripng_distribute_update_interface (ifp);

  /* Check interface routemap. */
  ripng_if_rmap_update_interface (ifp);

  return 0;
}