Beispiel #1
0
int
isis_zebra_if_del (int command, struct zclient *zclient, zebra_size_t length)
{
    struct interface *ifp;
    struct stream *s;

    s = zclient->ibuf;
    ifp = zebra_interface_state_read (s);

    if (!ifp)
        return 0;

    if (if_is_operative (ifp))
        zlog_warn ("Zebra: got delete of %s, but interface is still up",
                   ifp->name);

    zlog_debug ("Zebra I/F delete: %s index %d flags %ld metric %d mtu %d",
                ifp->name, ifp->ifindex, ifp->flags, ifp->metric, ifp->mtu);

    if_delete (ifp);

    isis_csm_state_change (IF_DOWN_FROM_Z, circuit_scan_by_ifp (ifp), ifp);

    return 0;
}
Beispiel #2
0
static int
isis_zebra_if_del (int command, struct zclient *zclient, zebra_size_t length)
{
  struct interface *ifp;
  struct stream *s;

  s = zclient->ibuf;
  ifp = zebra_interface_state_read (s);

  if (!ifp)
    return 0;

  if (if_is_operative (ifp))
    zlog_warn ("Zebra: got delete of %s, but interface is still up",
	       ifp->name);

  if (isis->debugs & DEBUG_ZEBRA)
    zlog_debug ("Zebra I/F delete: %s index %d flags %ld metric %d mtu %d",
		ifp->name, ifp->ifindex, (long)ifp->flags, ifp->metric, ifp->mtu);


  /* Cannot call if_delete because we should retain the pseudo interface
     in case there is configuration info attached to it. */
  if_delete_retain(ifp);

  isis_csm_state_change (IF_DOWN_FROM_Z, circuit_scan_by_ifp (ifp), ifp);

  ifp->ifindex = IFINDEX_INTERNAL;

  return 0;
}
Beispiel #3
0
int
isis_zebra_if_state_up (int command, struct zclient *zclient,
                        zebra_size_t length)
{
    struct interface *ifp;

    ifp = zebra_interface_if_lookup (zclient->ibuf);

    if (!ifp)
        return 0;

    if (if_is_operative (ifp))
    {
        zebra_interface_if_set_value (zclient->ibuf, ifp);
        /* HT: This is wrong actually. We can't assume that circuit exist
         * if we delete circuit during if_state_down event. Needs rethink.
         * TODO */
        isis_circuit_update_params (circuit_scan_by_ifp (ifp), ifp);
        return 0;
    }

    zebra_interface_if_set_value (zclient->ibuf, ifp);
    isis_csm_state_change (IF_UP_FROM_Z, circuit_scan_by_ifp (ifp), ifp);

    return 0;
}
Beispiel #4
0
static int
isis_zebra_if_state_up (int command, struct zclient *zclient,
			zebra_size_t length, vrf_id_t vrf_id)
{
  struct interface *ifp;

  ifp = zebra_interface_state_read (zclient->ibuf, vrf_id);

  if (ifp == NULL)
    return 0;

  isis_csm_state_change (IF_UP_FROM_Z, circuit_scan_by_ifp (ifp), ifp);

  return 0;
}
Beispiel #5
0
static int
isis_kroute_if_state_up (int command, struct zclient *zclient,
			kroute_size_t length)
{
  struct interface *ifp;

  ifp = kroute_interface_state_read (zclient->ibuf);

  if (ifp == NULL)
    return 0;

  isis_csm_state_change (IF_UP_FROM_Z, circuit_scan_by_ifp (ifp), ifp);

  return 0;
}
Beispiel #6
0
int
isis_zebra_if_add (int command, struct zclient *zclient, zebra_size_t length)
{
    struct interface *ifp;

    ifp = zebra_interface_add_read (zclient->ibuf);


    zlog_debug ("Zebra I/F add: %s index %d flags %ld metric %d mtu %d",
                ifp->name, ifp->ifindex, ifp->flags, ifp->metric, ifp->mtu);

    if (if_is_operative (ifp))
        isis_csm_state_change (IF_UP_FROM_Z, circuit_scan_by_ifp (ifp), ifp);

    return 0;
}
Beispiel #7
0
static int
isis_kroute_if_add (int command, struct zclient *zclient, kroute_size_t length)
{
  struct interface *ifp;

  ifp = kroute_interface_add_read (zclient->ibuf);

  if (isis->debugs & DEBUG_KROUTE)
    zlog_debug ("Kroute I/F add: %s index %d flags %ld metric %d mtu %d",
		ifp->name, ifp->ifindex, (long)ifp->flags, ifp->metric, ifp->mtu);

  if (if_is_operative (ifp))
    isis_csm_state_change (IF_UP_FROM_Z, circuit_scan_by_ifp (ifp), ifp);

  return 0;
}
Beispiel #8
0
int
isis_zebra_if_state_down (int command, struct zclient *zclient,
                          zebra_size_t length)
{
    struct interface *ifp;

    ifp = zebra_interface_if_lookup (zclient->ibuf);

    if (ifp == NULL)
        return 0;

    if (if_is_operative (ifp))
    {
        zebra_interface_if_set_value (zclient->ibuf, ifp);
        isis_csm_state_change (IF_DOWN_FROM_Z, circuit_scan_by_ifp (ifp), ifp);
    }

    return 0;
}
Beispiel #9
0
static int
isis_zebra_if_state_down (int command, struct zclient *zclient,
			  zebra_size_t length, vrf_id_t vrf_id)
{
  struct interface *ifp;
  struct isis_circuit *circuit;

  ifp = zebra_interface_state_read (zclient->ibuf, vrf_id);

  if (ifp == NULL)
    return 0;

  circuit = isis_csm_state_change (IF_DOWN_FROM_Z, circuit_scan_by_ifp (ifp),
                                   ifp);
  if (circuit)
    SET_FLAG(circuit->flags, ISIS_CIRCUIT_FLAPPED_AFTER_SPF);

  return 0;
}
Beispiel #10
0
int
isis_area_destroy (const char *area_tag)
{
  struct isis_area *area;
  struct listnode *node, *nnode;
  struct isis_circuit *circuit;

  area = isis_area_lookup (area_tag);

  if (area == NULL)
    {
      Log(LOG_WARNING, "WARN ( %s/core/ISIS ): Can't find ISIS instance %s\n", config.name, area_tag);
      return TRUE;
    }

  if (area->circuit_list)
    {
      for (ALL_LIST_ELEMENTS (area->circuit_list, node, nnode, circuit))
	{
	  /* The fact that it's in circuit_list means that it was configured */
	  isis_csm_state_change (ISIS_DISABLE, circuit, area);
	  isis_circuit_down (circuit);
	  isis_circuit_deconfigure (circuit, area);
	}
      
      isis_list_delete (area->circuit_list);
    }
  isis_listnode_delete (isis->area_list, area);

  if (area->t_remove_aged)
    thread_cancel (area->t_remove_aged);

  THREAD_TIMER_OFF (area->spftree[0]->t_spf);
  THREAD_TIMER_OFF (area->spftree[1]->t_spf);

  free(area);

  isis->sysid_set=0;

  return FALSE;
}