MCPcopy Create free account
hub / github.com/F-Stack/f-stack / key_getspbyid

Function key_getspbyid

freebsd/netipsec/key.c:1425–1440  ·  view source on GitHub ↗

* get SP by index. * OUT: NULL : not found * others : found, pointer to referenced SP. */

Source from the content-addressed store, hash-verified

1423 * others : found, pointer to referenced SP.
1424 */
1425static struct secpolicy *
1426key_getspbyid(uint32_t id)
1427{
1428 SPTREE_RLOCK_TRACKER;
1429 struct secpolicy *sp;
1430
1431 SPTREE_RLOCK();
1432 LIST_FOREACH(sp, SPHASH_HASH(id), idhash) {
1433 if (sp->id == id) {
1434 SP_ADDREF(sp);
1435 break;
1436 }
1437 }
1438 SPTREE_RUNLOCK();
1439 return (sp);
1440}
1441
1442struct secpolicy *
1443key_newsp(void)

Callers 2

key_spddelete2Function · 0.85
key_spdgetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected