version 1.1.1.1, 2012/02/21 17:26:12
|
version 1.1.1.3, 2016/11/02 10:09:12
|
Line 31
|
Line 31
|
#include "ospfd/ospf_asbr.h" |
#include "ospfd/ospf_asbr.h" |
#include "ospfd/ospf_lsa.h" |
#include "ospfd/ospf_lsa.h" |
#include "ospfd/ospf_lsdb.h" |
#include "ospfd/ospf_lsdb.h" |
| |
struct ospf_lsdb * |
struct ospf_lsdb * |
ospf_lsdb_new () |
ospf_lsdb_new () |
{ |
{ |
Line 72 ospf_lsdb_cleanup (struct ospf_lsdb *lsdb)
|
Line 72 ospf_lsdb_cleanup (struct ospf_lsdb *lsdb)
|
route_table_finish (lsdb->type[i].db); |
route_table_finish (lsdb->type[i].db); |
} |
} |
|
|
static void | void |
lsdb_prefix_set (struct prefix_ls *lp, struct ospf_lsa *lsa) | ls_prefix_set (struct prefix_ls *lp, struct ospf_lsa *lsa) |
{ |
{ |
lp->family = 0; | if (lp && lsa && lsa->data) |
lp->prefixlen = 64; | { |
lp->id = lsa->data->id; | lp->family = 0; |
lp->adv_router = lsa->data->adv_router; | lp->prefixlen = 64; |
| lp->id = lsa->data->id; |
| lp->adv_router = lsa->data->adv_router; |
| } |
} |
} |
|
|
static void |
static void |
Line 115 ospf_lsdb_add (struct ospf_lsdb *lsdb, struct ospf_lsa
|
Line 118 ospf_lsdb_add (struct ospf_lsdb *lsdb, struct ospf_lsa
|
struct route_node *rn; |
struct route_node *rn; |
|
|
table = lsdb->type[lsa->data->type].db; |
table = lsdb->type[lsa->data->type].db; |
lsdb_prefix_set (&lp, lsa); | ls_prefix_set (&lp, lsa); |
rn = route_node_get (table, (struct prefix *)&lp); |
rn = route_node_get (table, (struct prefix *)&lp); |
|
|
/* nothing to do? */ |
/* nothing to do? */ |
Line 155 ospf_lsdb_delete (struct ospf_lsdb *lsdb, struct ospf_
|
Line 158 ospf_lsdb_delete (struct ospf_lsdb *lsdb, struct ospf_
|
if (lsa) |
if (lsa) |
zlog_warn ("LSA[Type%d:%s]: LSA %p, lsa->lsdb %p", |
zlog_warn ("LSA[Type%d:%s]: LSA %p, lsa->lsdb %p", |
lsa->data->type, inet_ntoa (lsa->data->id), |
lsa->data->type, inet_ntoa (lsa->data->id), |
lsa, lsa->lsdb); | (void *)lsa, (void *)lsa->lsdb); |
return; |
return; |
} |
} |
|
|
Line 167 ospf_lsdb_delete (struct ospf_lsdb *lsdb, struct ospf_
|
Line 170 ospf_lsdb_delete (struct ospf_lsdb *lsdb, struct ospf_
|
|
|
assert (lsa->data->type < OSPF_MAX_LSA); |
assert (lsa->data->type < OSPF_MAX_LSA); |
table = lsdb->type[lsa->data->type].db; |
table = lsdb->type[lsa->data->type].db; |
lsdb_prefix_set (&lp, lsa); | ls_prefix_set (&lp, lsa); |
if ((rn = route_node_lookup (table, (struct prefix *) &lp))) |
if ((rn = route_node_lookup (table, (struct prefix *) &lp))) |
{ |
{ |
if (rn->info == lsa) |
if (rn->info == lsa) |
Line 218 ospf_lsdb_lookup (struct ospf_lsdb *lsdb, struct ospf_
|
Line 221 ospf_lsdb_lookup (struct ospf_lsdb *lsdb, struct ospf_
|
struct ospf_lsa *find; |
struct ospf_lsa *find; |
|
|
table = lsdb->type[lsa->data->type].db; |
table = lsdb->type[lsa->data->type].db; |
lsdb_prefix_set (&lp, lsa); | ls_prefix_set (&lp, lsa); |
rn = route_node_lookup (table, (struct prefix *) &lp); |
rn = route_node_lookup (table, (struct prefix *) &lp); |
if (rn) |
if (rn) |
{ |
{ |