Licensing Information

Open Source Used In Cisco FXOS 1.1(3) 869
dbuf.dptr = data + rec.key_len;
dbuf.dsize = rec.data_len;
count++;
if (fn && fn(tdb, key, dbuf, state) != 0) {
/* they want us to stop traversing */
free(data);
tdb_unlock(tdb, BUCKET(h));
return count;
}
/* a miss - drat */
free(data);
/* move to the next record */
rec_ptr = rec.next;
}
tdb_unlock(tdb, BUCKET(h));
}
/* return the number traversed */
return count;
fail:
tdb_unlock(tdb, BUCKET(h));
return -1;
}
/* find the first entry in the database and return its key */
TDB_DATA tdb_firstkey(TDB_CONTEXT *tdb)
{
tdb_off offset, rec_ptr;
struct list_struct rec;
unsigned hash;
TDB_DATA ret;
if (tdb == NULL) {
#ifdef TDB_DEBUG
printf("tdb_firstkey() called with null context\n");
#endif
return null_data;
}
/* look for a non-empty hash chain */
for (hash = 0, rec_ptr = 0;
 hash < tdb->header.hash_size;
 hash++) {