diff options
author | hasso <hasso> | 2004-12-22 17:16:02 +0100 |
---|---|---|
committer | hasso <hasso> | 2004-12-22 17:16:02 +0100 |
commit | fe71a97da23e2282bc92f647227d5c97c73e3bc8 (patch) | |
tree | d812d9a1b98b0a1e9c1621194bf58dba097d6e3b /ospfd/ospf_lsdb.c | |
parent | 2004-12-22 Andrew J. Schorr <ajschorr@alumni.princeton.edu> (diff) | |
download | frr-fe71a97da23e2282bc92f647227d5c97c73e3bc8.tar.xz frr-fe71a97da23e2282bc92f647227d5c97c73e3bc8.zip |
Show sums of checksums in "show ip ospf" output. Okayed by Paul and James
R. Leu (author of original idea).
Diffstat (limited to 'ospfd/ospf_lsdb.c')
-rw-r--r-- | ospfd/ospf_lsdb.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/ospfd/ospf_lsdb.c b/ospfd/ospf_lsdb.c index 46d8d7050..4c6ed64eb 100644 --- a/ospfd/ospf_lsdb.c +++ b/ospfd/ospf_lsdb.c @@ -97,6 +97,7 @@ ospf_lsdb_add (struct ospf_lsdb *lsdb, struct ospf_lsa *lsa) if (IS_LSA_SELF (lsa)) lsdb->type[lsa->data->type].count_self++; lsdb->type[lsa->data->type].count++; + lsdb->type[lsa->data->type].checksum += ntohs(lsa->data->checksum); lsdb->total++; } else @@ -131,6 +132,7 @@ ospf_lsdb_delete (struct ospf_lsdb *lsdb, struct ospf_lsa *lsa) if (IS_LSA_SELF (lsa)) lsdb->type[lsa->data->type].count_self--; lsdb->type[lsa->data->type].count--; + lsdb->type[lsa->data->type].checksum -= ntohs(lsa->data->checksum); lsdb->total--; rn->info = NULL; route_unlock_node (rn); @@ -161,6 +163,7 @@ ospf_lsdb_delete_all (struct ospf_lsdb *lsdb) if (IS_LSA_SELF (lsa)) lsdb->type[i].count_self--; lsdb->type[i].count--; + lsdb->type[i].checksum -= ntohs(lsa->data->checksum); lsdb->total--; rn->info = NULL; route_unlock_node (rn); @@ -277,23 +280,14 @@ ospf_lsdb_count_self (struct ospf_lsdb *lsdb, int type) return lsdb->type[type].count_self; } -unsigned long -ospf_lsdb_isempty (struct ospf_lsdb *lsdb) +unsigned int +ospf_lsdb_checksum (struct ospf_lsdb *lsdb, int type) { - return (lsdb->total == 0); + return lsdb->type[type].checksum; } -struct ospf_lsa * -foreach_lsa (struct route_table *table, void *p_arg, int int_arg, - int (*callback) (struct ospf_lsa *, void *, int)) +unsigned long +ospf_lsdb_isempty (struct ospf_lsdb *lsdb) { - struct route_node *rn; - struct ospf_lsa *lsa; - - for (rn = route_top (table); rn; rn = route_next (rn)) - if ((lsa = rn->info) != NULL) - if (callback (lsa, p_arg, int_arg)) - return lsa; - - return NULL; + return (lsdb->total == 0); } |