Esempio n. 1
0
/*
 * Add this IS to the root of SPT
 */
static void
isis_spf_add_self (struct isis_spftree *spftree, struct isis_area *area,
		   int level)
{
  struct isis_vertex *vertex;
  struct isis_lsp *lsp;
  u_char lspid[ISIS_SYS_ID_LEN + 2];
  memcpy (lspid, isis->sysid, ISIS_SYS_ID_LEN);
  LSP_PSEUDO_ID (lspid) = 0;
  LSP_FRAGMENT (lspid) = 0;

  lsp = lsp_search (lspid, area->lspdb[level - 1]);

  if (lsp == NULL)
    Log(LOG_WARNING, "WARN ( default/core/ISIS ): ISIS-Spf: could not find own l%d LSP!\n", level);

  if (!area->oldmetric)
    vertex = isis_vertex_new (isis->sysid, VTYPE_NONPSEUDO_TE_IS);
  else 
    vertex = isis_vertex_new (isis->sysid, VTYPE_NONPSEUDO_IS);

  vertex->lsp = lsp;

  listnode_add (spftree->paths, vertex);

  return;
}
Esempio n. 2
0
/* 
 * Find the system LSP: returns the LSP in our LSP database 
 * associated with the given system ID.
 */
static struct isis_lsp *
isis_root_system_lsp (struct isis_area *area, int level, u_char *sysid)
{
  struct isis_lsp *lsp;
  u_char lspid[ISIS_SYS_ID_LEN + 2];

  memcpy (lspid, sysid, ISIS_SYS_ID_LEN);
  LSP_PSEUDO_ID (lspid) = 0;
  LSP_FRAGMENT (lspid) = 0;
  lsp = lsp_search (lspid, area->lspdb[level - 1]);
  if (lsp && lsp->lsp_header->rem_lifetime != 0)
    return lsp;
  return NULL;
}
Esempio n. 3
0
/*
 * Add this IS to the root of SPT
 */
static void
isis_spf_add_self (struct isis_spftree *spftree, struct isis_area *area,
		   int level)
{
  struct isis_vertex *vertex;
  struct isis_lsp *lsp;
  u_char lspid[ISIS_SYS_ID_LEN + 2];
#ifdef EXTREME_DEBUG
  u_char buff[BUFSIZ];
#endif /* EXTREME_DEBUG */
  memcpy (lspid, isis->sysid, ISIS_SYS_ID_LEN);
  LSP_PSEUDO_ID (lspid) = 0;
  LSP_FRAGMENT (lspid) = 0;

  lsp = lsp_search (lspid, area->lspdb[level - 1]);

  if (lsp == NULL)
    zlog_warn ("ISIS-Spf: could not find own l%d LSP!", level);

  if (!area->oldmetric)
    vertex = isis_vertex_new (isis->sysid, VTYPE_NONPSEUDO_TE_IS);
  else
    vertex = isis_vertex_new (isis->sysid, VTYPE_NONPSEUDO_IS);

  vertex->lsp = lsp;

  listnode_add (spftree->paths, vertex);

#ifdef EXTREME_DEBUG
  zlog_debug ("ISIS-Spf: added this IS  %s %s depth %d dist %d to PATHS",
	      vtype2string (vertex->type), vid2string (vertex, buff),
	      vertex->depth, vertex->d_N);
#endif /* EXTREME_DEBUG */

  return;
}