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

Function ng_bridge_remove_hosts

freebsd/netgraph/ng_bridge.c:996–1015  ·  view source on GitHub ↗

* Remove all hosts associated with a specific link from the hashtable. * If linkNum == -1, then remove all hosts in the table. */

Source from the content-addressed store, hash-verified

994 * If linkNum == -1, then remove all hosts in the table.
995 */
996static void
997ng_bridge_remove_hosts(priv_p priv, link_p link)
998{
999 int bucket;
1000
1001 for (bucket = 0; bucket < priv->numBuckets; bucket++) {
1002 struct ng_bridge_hent **hptr = &SLIST_FIRST(&priv->tab[bucket]);
1003
1004 while (*hptr != NULL) {
1005 struct ng_bridge_hent *const hent = *hptr;
1006
1007 if (link == NULL || hent->host.link == link) {
1008 *hptr = SLIST_NEXT(hent, next);
1009 free(hent, M_NETGRAPH_BRIDGE);
1010 priv->numHosts--;
1011 } else
1012 hptr = &SLIST_NEXT(hent, next);
1013 }
1014 }
1015}
1016
1017/*
1018 * Handle our once-per-second timeout event. We do two things:

Callers 3

ng_bridge_rcvmsgFunction · 0.85
ng_bridge_rcvdataFunction · 0.85
ng_bridge_disconnectFunction · 0.85

Calls 1

freeFunction · 0.50

Tested by

no test coverage detected