/freebsd/sys/netgraph/ |
H A D | netgraph.h | 109 typedef int ng_newhook_t(node_p node, hook_p hook, const char *name); 111 typedef int ng_connect_t(hook_p hook); 113 typedef int ng_rcvdata_t(hook_p hook, item_p item); 114 typedef int ng_disconnect_t(hook_p hook); 115 typedef int ng_rcvitem (node_p node, hook_p hook, item_p item); 154 void ng_unref_hook(hook_p hook); /* don't move this */ 155 #define _NG_HOOK_REF(hook) refcount_acquire(&(hook)->hk_refs) argument 156 #define _NG_HOOK_NAME(hook) ((hook)->hk_name) argument 157 #define _NG_HOOK_UNREF(hook) ng_unref_hook(hook) argument 158 #define _NG_HOOK_SET_PRIVATE(hook, val) do {(hook)->hk_private = val;} while (0) argument [all …]
|
H A D | ng_etf.c | 130 hook_p hook; member 197 ng_etf_newhook(node_p node, hook_p hook, const char *name) in ng_etf_newhook() argument 203 etfp->downstream_hook.hook = hook; in ng_etf_newhook() 204 NG_HOOK_SET_PRIVATE(hook, &etfp->downstream_hook); in ng_etf_newhook() 208 etfp->nomatch_hook.hook = hook; in ng_etf_newhook() 209 NG_HOOK_SET_PRIVATE(hook, &etfp->nomatch_hook); in ng_etf_newhook() 221 NG_HOOK_SET_PRIVATE(hook, hpriv); in ng_etf_newhook() 222 hpriv->hook = hook; in ng_etf_newhook() 282 hook_p hook; in ng_etf_rcvmsg() local 292 hook = ng_findhook(node, f->matchhook); in ng_etf_rcvmsg() [all …]
|
H A D | ng_sample.c | 124 hook_p hook; member 180 ng_xxx_newhook(node_p node, hook_p hook, const char *name) in ng_xxx_newhook() argument 221 if (xxxp->channel[chan].hook != NULL) in ng_xxx_newhook() 223 NG_HOOK_SET_PRIVATE(hook, xxxp->channel + chan); in ng_xxx_newhook() 224 xxxp->channel[chan].hook = hook; in ng_xxx_newhook() 229 xxxp->downstream_hook.hook = hook; in ng_xxx_newhook() 230 NG_HOOK_SET_PRIVATE(hook, &xxxp->downstream_hook); in ng_xxx_newhook() 233 xxxp->debughook = hook; in ng_xxx_newhook() 234 NG_HOOK_SET_PRIVATE(hook, NULL); in ng_xxx_newhook() 323 ng_xxx_rcvdata(hook_p hook, item_p item ) in ng_xxx_rcvdata() argument [all …]
|
H A D | ng_base.c | 234 static int ng_con_part2(node_p node, item_p item, hook_p hook); 235 static int ng_con_part3(node_p node, item_p item, hook_p hook); 242 void ng_destroy_hook(hook_p hook); 246 int ng_path_parse(char *addr, char **node, char **path, char **hook); 262 #define _NG_ALLOC_HOOK(hook) \ argument 263 hook = malloc(sizeof(*hook), M_NETGRAPH_HOOK, M_NOWAIT | M_ZERO) 296 hook_p hook; in ng_alloc_hook() local 299 hook = LIST_FIRST(&ng_freehooks); in ng_alloc_hook() 300 if (hook) { in ng_alloc_hook() 301 LIST_REMOVE(hook, hk_hooks); in ng_alloc_hook() [all …]
|
H A D | ng_vlan.c | 232 ng_vlan_newhook(node_p node, hook_p hook, const char *name) in ng_vlan_newhook() argument 237 priv->downstream_hook = hook; in ng_vlan_newhook() 239 priv->nomatch_hook = hook; in ng_vlan_newhook() 246 NG_HOOK_SET_PRIVATE(hook, NULL); in ng_vlan_newhook() 256 hook_p hook; in ng_vlan_rcvmsg() local 292 hook = ng_findhook(node, vf->hook_name); in ng_vlan_rcvmsg() 293 if (hook == NULL) { in ng_vlan_rcvmsg() 298 if (hook == priv->downstream_hook || in ng_vlan_rcvmsg() 299 hook == priv->nomatch_hook) { in ng_vlan_rcvmsg() 304 if (IS_HOOK_VLAN_SET(NG_HOOK_PRIVATE(hook))) { in ng_vlan_rcvmsg() [all …]
|
H A D | ng_tag.c | 123 static int ng_tag_setdata_in(hook_p hook, const struct ng_tag_hookin *hp); 124 static int ng_tag_setdata_out(hook_p hook, const struct ng_tag_hookout *hp); 300 ng_tag_newhook(node_p node, hook_p hook, const char *name) in ng_tag_newhook() argument 309 NG_HOOK_SET_PRIVATE(hook, hip); in ng_tag_newhook() 319 if ((error = ng_tag_setdata_in(hook, &ng_tag_default_in)) != 0) { in ng_tag_newhook() 325 if ((error = ng_tag_setdata_out(hook, &ng_tag_default_out)) != 0) { in ng_tag_newhook() 361 hook_p hook; in ng_tag_rcvmsg() local 369 if ((hook = ng_findhook(node, hp->thisHook)) == NULL) in ng_tag_rcvmsg() 373 if ((error = ng_tag_setdata_in(hook, hp)) != 0) in ng_tag_rcvmsg() 382 hook_p hook; in ng_tag_rcvmsg() local [all …]
|
H A D | ng_cisco.c | 90 hook_p hook; /* the hook for this proto */ member 121 static void cisco_keepalive(node_p node, hook_p hook, void *arg1, int arg2); 208 cisco_newhook(node_p node, hook_p hook, const char *name) in cisco_newhook() argument 213 sc->downstream.hook = hook; in cisco_newhook() 214 NG_HOOK_SET_PRIVATE(hook, &sc->downstream); in cisco_newhook() 220 sc->inet.hook = hook; in cisco_newhook() 221 NG_HOOK_SET_PRIVATE(hook, &sc->inet); in cisco_newhook() 223 sc->inet6.hook = hook; in cisco_newhook() 224 NG_HOOK_SET_PRIVATE(hook, &sc->inet6); in cisco_newhook() 226 sc->atalk.hook = hook; in cisco_newhook() [all …]
|
H A D | ng_bpf.c | 86 hook_p hook; member 109 static int ng_bpf_setprog(hook_p hook, const struct ng_bpf_hookprog *hp); 242 ng_bpf_addrefs(hook_p hook, void* arg) in ng_bpf_addrefs() argument 244 hinfo_p hip = NG_HOOK_PRIVATE(hook); in ng_bpf_addrefs() 255 ng_bpf_remrefs(hook_p hook, void* arg) in ng_bpf_remrefs() argument 257 hinfo_p hip = NG_HOOK_PRIVATE(hook); in ng_bpf_remrefs() 271 ng_bpf_newhook(node_p node, hook_p hook, const char *name) in ng_bpf_newhook() argument 280 hip->hook = hook; in ng_bpf_newhook() 281 NG_HOOK_SET_PRIVATE(hook, hip); in ng_bpf_newhook() 284 NG_NODE_FOREACH_HOOK(node, ng_bpf_addrefs, hook); in ng_bpf_newhook() [all …]
|
H A D | ng_ipfw.c | 96 hook_p hook; member 152 ng_ipfw_newhook(node_p node, hook_p hook, const char *name) in ng_ipfw_newhook() argument 178 hpriv->hook = hook; in ng_ipfw_newhook() 181 NG_HOOK_SET_PRIVATE(hook, hpriv); in ng_ipfw_newhook() 191 ng_ipfw_connect(hook_p hook) in ng_ipfw_connect() argument 193 NG_HOOK_FORCE_QUEUE(hook); in ng_ipfw_connect() 214 hook_p hook; in ng_ipfw_findhook1() local 217 LIST_FOREACH(hook, &node->nd_hooks, hk_hooks) { in ng_ipfw_findhook1() 218 hpriv = NG_HOOK_PRIVATE(hook); in ng_ipfw_findhook1() 219 if (NG_HOOK_IS_VALID(hook) && (hpriv->cookie == cookie)) in ng_ipfw_findhook1() [all …]
|
H A D | ng_frame_relay.c | 72 hook_p hook; /* if there's a hook assigned.. */ member 232 ngfrm_newhook(node_p node, hook_p hook, const char *name) in ngfrm_newhook() argument 242 NG_HOOK_SET_PRIVATE(hook, NULL); /* paranoid */ in ngfrm_newhook() 258 if (sc->downstream.hook) in ngfrm_newhook() 262 NG_HOOK_SET_PRIVATE(hook, &sc->downstream); in ngfrm_newhook() 263 sc->downstream.hook = hook; in ngfrm_newhook() 292 if (sc->channel[ctxnum].hook != NULL) in ngfrm_newhook() 299 NG_HOOK_SET_PRIVATE(hook, sc->channel + ctxnum); in ngfrm_newhook() 300 sc->channel[ctxnum].hook = hook; in ngfrm_newhook() 326 ngfrm_rcvdata(hook_p hook, item_p item) in ngfrm_rcvdata() argument [all …]
|
H A D | ng_split.c | 101 ng_split_newhook(node_p node, hook_p hook, const char *name) in ng_split_newhook() argument 117 *localhook = hook; in ng_split_newhook() 118 NG_HOOK_SET_PRIVATE(hook, localhook); in ng_split_newhook() 127 ng_split_rcvdata(hook_p hook, item_p item) in ng_split_rcvdata() argument 129 const priv_p priv = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); in ng_split_rcvdata() 132 if (hook == priv->out) { in ng_split_rcvdata() 136 } else if ((hook == priv->in) && (priv->mixed != NULL)) { in ng_split_rcvdata() 138 } else if ((hook == priv->mixed) && (priv->out != NULL)) { in ng_split_rcvdata() 164 ng_split_disconnect(hook_p hook) in ng_split_disconnect() argument 166 hook_p *localhook = NG_HOOK_PRIVATE(hook); in ng_split_disconnect() [all …]
|
H A D | ng_tee.c | 71 hook_p hook; member 170 ng_tee_newhook(node_p node, hook_p hook, const char *name) in ng_tee_newhook() argument 202 hinfo->hook = hook; in ng_tee_newhook() 204 NG_HOOK_SET_PRIVATE(hook, hinfo); in ng_tee_newhook() 264 if (lasthook == sc->left.hook || lasthook == sc->right.hook) { in ng_tee_rcvmsg() 268 NG_FWD_ITEM_HOOK(error, item, hinfo->dest->hook); in ng_tee_rcvmsg() 294 ng_tee_rcvdata(hook_p hook, item_p item) in ng_tee_rcvdata() argument 296 const hi_p hinfo = NG_HOOK_PRIVATE(hook); in ng_tee_rcvdata() 316 NG_SEND_DATA_ONLY(error, h->hook, m2); in ng_tee_rcvdata() 328 NG_FWD_ITEM_HOOK(error, item, h->hook); in ng_tee_rcvdata() [all …]
|
H A D | ng_hole.c | 128 ngh_newhook(node_p node, hook_p hook, const char *name) in ngh_newhook() argument 136 NG_HOOK_SET_PRIVATE(hook, hip); in ngh_newhook() 150 hook_p hook; in ngh_rcvmsg() local 165 hook = ng_findhook(node, (char *)msg->data); in ngh_rcvmsg() 166 if (hook == NULL) { in ngh_rcvmsg() 170 stats = &((hinfo_p)NG_HOOK_PRIVATE(hook))->stats; in ngh_rcvmsg() 203 ngh_rcvdata(hook_p hook, item_p item) in ngh_rcvdata() argument 205 const hinfo_p hip = NG_HOOK_PRIVATE(hook); in ngh_rcvdata() 217 ngh_disconnect(hook_p hook) in ngh_disconnect() argument 220 free(NG_HOOK_PRIVATE(hook), M_NETGRAPH); in ngh_disconnect() [all …]
|
H A D | ng_UI.c | 112 ng_UI_newhook(node_p node, hook_p hook, const char *name) in ng_UI_newhook() argument 119 priv->downlink = hook; in ng_UI_newhook() 123 priv->uplink = hook; in ng_UI_newhook() 165 ng_UI_rcvdata(hook_p hook, item_p item) in ng_UI_rcvdata() argument 167 const node_p node = NG_HOOK_NODE(hook); in ng_UI_rcvdata() 173 if (hook == priv->downlink) { in ng_UI_rcvdata() 187 } else if (hook == priv->uplink) { in ng_UI_rcvdata() 222 ng_UI_disconnect(hook_p hook) in ng_UI_disconnect() argument 224 const priv_p priv = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); in ng_UI_disconnect() 226 if (hook == priv->downlink) in ng_UI_disconnect() [all …]
|
H A D | ng_tty.c | 87 hook_p hook; /* Netgraph hook */ member 172 ngt_newhook(node_p node, hook_p hook, const char *name) in ngt_newhook() argument 179 if (sc->hook) in ngt_newhook() 183 sc->hook = hook; in ngt_newhook() 195 ngt_connect(hook_p hook) in ngt_connect() argument 197 NG_HOOK_FORCE_QUEUE(hook); in ngt_connect() 205 ngt_disconnect(hook_p hook) in ngt_disconnect() argument 207 const sc_p sc = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); in ngt_disconnect() 209 if (hook != sc->hook) in ngt_disconnect() 213 sc->hook = NULL; in ngt_disconnect() [all …]
|
H A D | ng_one2many.c | 64 hook_p hook; /* netgraph hook */ member 204 ng_one2many_newhook(node_p node, hook_p hook, const char *name) in ng_one2many_newhook() argument 232 if (link->hook != NULL) in ng_one2many_newhook() 236 NG_HOOK_SET_PRIVATE(hook, (void *)(intptr_t)linkNum); in ng_one2many_newhook() 237 link->hook = hook; in ng_one2many_newhook() 410 ng_one2many_rcvdata(hook_p hook, item_p item) in ng_one2many_rcvdata() argument 412 const node_p node = NG_HOOK_NODE(hook); in ng_one2many_rcvdata() 423 linkNum = (intptr_t)NG_HOOK_PRIVATE(hook); in ng_one2many_rcvdata() 431 KASSERT(src->hook != NULL, ("%s: no src%d", __func__, linkNum)); in ng_one2many_rcvdata() 470 NG_SEND_DATA_ONLY(error, mdst->hook, m2); in ng_one2many_rcvdata() [all …]
|
H A D | ng_rfc1490.c | 181 ng_rfc1490_newhook(node_p node, hook_p hook, const char *name) in ng_rfc1490_newhook() argument 188 priv->downlink = hook; in ng_rfc1490_newhook() 192 priv->ppp = hook; in ng_rfc1490_newhook() 196 priv->inet = hook; in ng_rfc1490_newhook() 200 priv->ethernet = hook; in ng_rfc1490_newhook() 304 ng_rfc1490_rcvdata(hook_p hook, item_p item) in ng_rfc1490_rcvdata() argument 306 const node_p node = NG_HOOK_NODE(hook); in ng_rfc1490_rcvdata() 312 if (hook == priv->downlink) { in ng_rfc1490_rcvdata() 385 } else if (hook == priv->ppp) { in ng_rfc1490_rcvdata() 392 } else if (hook == priv->inet) { in ng_rfc1490_rcvdata() [all …]
|
H A D | ng_lmi.c | 97 static int nglmi_checkdata(hook_p hook, struct mbuf *m); 143 static void LMI_ticker(node_p node, hook_p hook, void *arg1, int arg2); 144 static void nglmi_startup_fixed(sc_p sc, hook_p hook); 203 nglmi_newhook(node_p node, hook_p hook, const char *name) in nglmi_newhook() argument 208 NG_HOOK_SET_PRIVATE(hook, NULL); in nglmi_newhook() 216 sc->lmi_annexA = hook; in nglmi_newhook() 217 NG_HOOK_SET_PRIVATE(hook, NG_NODE_PRIVATE(node)); in nglmi_newhook() 221 nglmi_startup_fixed(sc, hook); in nglmi_newhook() 223 sc->lmi_annexD = hook; in nglmi_newhook() 224 NG_HOOK_SET_PRIVATE(hook, NG_NODE_PRIVATE(node)); in nglmi_newhook() [all …]
|
H A D | ng_pppoe.c | 270 hook_p hook; member 314 static void pppoe_ticker(node_p node, hook_p hook, void *arg1, int arg2); 479 sp?sp->hook:NULL, (const char *)(tag + 1)); in pppoe_match_svc() 481 return (sp?sp->hook:NULL); in pppoe_match_svc() 503 NG_SEND_DATA_ONLY(error, sp->hook, m); in pppoe_broadcast_padi() 525 return (sp->hook); in pppoe_find_svc() 538 const priv_p privp = NG_NODE_PRIVATE(NG_HOOK_NODE(sp->hook)); in pppoe_getnewsession() 574 const priv_p privp = NG_NODE_PRIVATE(NG_HOOK_NODE(sp->hook)); in pppoe_addsession() 586 const priv_p privp = NG_NODE_PRIVATE(NG_HOOK_NODE(sp->hook)); in pppoe_delsession() 611 CTR3(KTR_NET, "%20s: matched %p for %d", __func__, sp?sp->hook:NULL, in pppoe_findsession() [all …]
|
H A D | ng_bridge.c | 107 hook_p hook; /* netgraph hook */ member 175 static void ng_bridge_timeout(node_p node, hook_p hook, void *arg1, int arg2); 386 ng_bridge_newhook(node_p node, hook_p hook, const char *name) in ng_bridge_newhook() argument 419 snprintf(NG_HOOK_NAME(hook), NG_HOOKSIZ, "%s%u", pfx->prefix, in ng_bridge_newhook() 423 if (NG_PEER_NODE(hook) == node) { in ng_bridge_newhook() 454 link->hook = hook; in ng_bridge_newhook() 465 NG_HOOK_SET_PRIVATE(hook, link); in ng_bridge_newhook() 517 ng_bridge_reset_link(hook_p hook, void *arg __unused) in ng_bridge_reset_link() argument 519 link_p priv = NG_HOOK_PRIVATE(hook); in ng_bridge_reset_link() 578 hook_p hook; in ng_bridge_rcvmsg() local [all …]
|
/freebsd/sys/net/ |
H A D | pfil.c | 309 struct pfil_hook *hook, *list; in pfil_add_hook() local 313 hook = malloc(sizeof(struct pfil_hook), M_PFIL, M_WAITOK | M_ZERO); in pfil_add_hook() 314 hook->hook_mbuf_chk = pa->pa_mbuf_chk; in pfil_add_hook() 315 hook->hook_mem_chk = pa->pa_mem_chk; in pfil_add_hook() 316 hook->hook_ruleset = pa->pa_ruleset; in pfil_add_hook() 317 hook->hook_flags = pa->pa_flags; in pfil_add_hook() 318 hook->hook_type = pa->pa_type; in pfil_add_hook() 319 hook->hook_modname = pa->pa_modname; in pfil_add_hook() 320 hook->hook_rulname = pa->pa_rulname; in pfil_add_hook() 329 LIST_INSERT_HEAD(&V_pfil_hook_list, hook, hook_list); in pfil_add_hook() [all …]
|
/freebsd/sys/kern/ |
H A D | subr_autoconf.c | 183 config_intrhook_establish(struct intr_config_hook *hook) in config_intrhook_establish() argument 190 if (hook_entry == hook) in config_intrhook_establish() 198 STAILQ_INSERT_TAIL(&intr_config_hook_list, hook, ich_links); in config_intrhook_establish() 200 next_to_notify = hook; in config_intrhook_establish() 201 hook->ich_state = ICHS_QUEUED; in config_intrhook_establish() 230 config_intrhook_disestablish_locked(struct intr_config_hook *hook) in config_intrhook_disestablish_locked() argument 235 if (hook_entry == hook) in config_intrhook_disestablish_locked() 241 if (next_to_notify == hook) in config_intrhook_disestablish_locked() 242 next_to_notify = STAILQ_NEXT(hook, ich_links); in config_intrhook_disestablish_locked() 243 STAILQ_REMOVE(&intr_config_hook_list, hook, intr_config_hook, ich_links); in config_intrhook_disestablish_locked() [all …]
|
/freebsd/contrib/jemalloc/src/ |
H A D | hook.c | 77 char *hook = (char *)opaque; in hook_remove() local 78 assert(hooks_begin <= hook && hook < hooks_end in hook_remove() 79 && (hook - hooks_begin) % sizeof(seq_hooks_t) == 0); in hook_remove() 158 hooks_internal_t hook; in hook_invoke_alloc() local 159 FOR_EACH_HOOK_BEGIN(&hook) in hook_invoke_alloc() 160 hook_alloc h = hook.hooks.alloc_hook; in hook_invoke_alloc() 162 h(hook.hooks.extra, type, result, result_raw, args_raw); in hook_invoke_alloc() 172 hooks_internal_t hook; in hook_invoke_dalloc() local 173 FOR_EACH_HOOK_BEGIN(&hook) in hook_invoke_dalloc() 174 hook_dalloc h = hook.hooks.dalloc_hook; in hook_invoke_dalloc() [all …]
|
/freebsd/sys/netgraph/bluetooth/socket/ |
H A D | ng_btsocket_sco.c | 260 ng_btsocket_sco_node_newhook(node_p node, hook_p hook, char const *name) in ng_btsocket_sco_node_newhook() argument 270 ng_btsocket_sco_node_connect(hook_p hook) in ng_btsocket_sco_node_connect() argument 272 NG_HOOK_SET_PRIVATE(hook, NULL); in ng_btsocket_sco_node_connect() 273 NG_HOOK_REF(hook); /* Keep extra reference to the hook */ in ng_btsocket_sco_node_connect() 276 NG_HOOK_FORCE_QUEUE(NG_HOOK_PEER(hook)); in ng_btsocket_sco_node_connect() 277 NG_HOOK_FORCE_QUEUE(hook); in ng_btsocket_sco_node_connect() 288 ng_btsocket_sco_node_disconnect(hook_p hook) in ng_btsocket_sco_node_disconnect() argument 298 if (NG_HOOK_PRIVATE(hook) != NULL) in ng_btsocket_sco_node_disconnect() 301 NG_HOOK_UNREF(hook); /* Remove extra reference */ in ng_btsocket_sco_node_disconnect() 311 ng_btsocket_sco_node_rcvmsg(node_p node, item_p item, hook_p hook) in ng_btsocket_sco_node_rcvmsg() argument [all …]
|
/freebsd/contrib/llvm-project/compiler-rt/lib/hwasan/ |
H A D | hwasan_fuchsia.cpp | 117 static void ThreadCreateHook(void *hook, bool aborted) { in ThreadCreateHook() argument 118 Thread *thread = static_cast<Thread *>(hook); in ThreadCreateHook() 133 static void ThreadStartHook(void *hook, thrd_t self) { in ThreadStartHook() argument 134 Thread *thread = static_cast<Thread *>(hook); in ThreadStartHook() 152 static void ThreadExitHook(void *hook, thrd_t self) { in ThreadExitHook() argument 153 Thread *thread = static_cast<Thread *>(hook); in ThreadExitHook() 223 void __sanitizer_thread_create_hook(void *hook, thrd_t thread, int error) { in __sanitizer_thread_create_hook() argument 224 __hwasan::ThreadCreateHook(hook, error != thrd_success); in __sanitizer_thread_create_hook() 227 void __sanitizer_thread_start_hook(void *hook, thrd_t self) { in __sanitizer_thread_start_hook() argument 228 __hwasan::ThreadStartHook(hook, reinterpret_cast<uptr>(self)); in __sanitizer_thread_start_hook() [all …]
|