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

Function ng_findhook

freebsd/netgraph/ng_base.c:1124–1137  ·  view source on GitHub ↗

* Find a hook * * Node types may supply their own optimized routines for finding * hooks. If none is supplied, we just do a linear search. * XXX Possibly we should add a reference to the hook? */

Source from the content-addressed store, hash-verified

1122 * XXX Possibly we should add a reference to the hook?
1123 */
1124hook_p
1125ng_findhook(node_p node, const char *name)
1126{
1127 hook_p hook;
1128
1129 if (node->nd_type->findhook != NULL)
1130 return (*node->nd_type->findhook)(node, name);
1131 LIST_FOREACH(hook, &node->nd_hooks, hk_hooks) {
1132 if (NG_HOOK_IS_VALID(hook) &&
1133 (strcmp(NG_HOOK_NAME(hook), name) == 0))
1134 return (hook);
1135 }
1136 return (NULL);
1137}
1138
1139/*
1140 * Destroy a hook

Callers 15

ng_pppoe_rcvmsgFunction · 0.70
ng_bridge_rcvmsgFunction · 0.70
ng_tag_rcvmsgFunction · 0.70
ng_tag_setdata_inFunction · 0.70
ng_bpf_rcvmsgFunction · 0.70
ng_bpf_setprogFunction · 0.70
ng_etf_rcvmsgFunction · 0.70
ng_tcpmss_rcvmsgFunction · 0.70
ng_vlan_rcvmsgFunction · 0.70
ngd_sendFunction · 0.70
ngh_rcvmsgFunction · 0.70
ng_add_hookFunction · 0.70

Calls 1

strcmpFunction · 0.85

Tested by

no test coverage detected