Home
last modified time | relevance | path

Searched refs:hook (Results 1 – 25 of 195) sorted by relevance

12345678

/dflybsd-src/sys/netgraph7/
H A Dnetgraph.h96 typedef int ng_newhook_t(node_p node, hook_p hook, const char *name);
98 typedef int ng_connect_t(hook_p hook);
100 typedef int ng_rcvdata_t(hook_p hook, item_p item);
101 typedef int ng_disconnect_t(hook_p hook);
102 typedef int ng_rcvitem (node_p node, hook_p hook, item_p item);
140 void ng_unref_hook(hook_p hook); /* don't move this */
141 #define _NG_HOOK_REF(hook) atomic_add_int(&(hook)->hk_refs, 1) argument
142 #define _NG_HOOK_NAME(hook) ((hook)->hk_name) argument
143 #define _NG_HOOK_UNREF(hook) ng_unref_hook(hook) argument
144 #define _NG_HOOK_SET_PRIVATE(hook, val) do {(hook)->hk_private = val;} while (0) argument
[all …]
H A Dng_sample.c127 hook_p hook; member
186 ng_xxx_newhook(node_p node, hook_p hook, const char *name) in ng_xxx_newhook() argument
227 if (xxxp->channel[chan].hook != NULL) in ng_xxx_newhook()
229 NG_HOOK_SET_PRIVATE(hook, xxxp->channel + chan); in ng_xxx_newhook()
230 xxxp->channel[chan].hook = hook; in ng_xxx_newhook()
235 xxxp->downstream_hook.hook = hook; in ng_xxx_newhook()
236 NG_HOOK_SET_PRIVATE(hook, &xxxp->downstream_hook); in ng_xxx_newhook()
239 xxxp->debughook = hook; in ng_xxx_newhook()
240 NG_HOOK_SET_PRIVATE(hook, NULL); in ng_xxx_newhook()
329 ng_xxx_rcvdata(hook_p hook, item_p item ) in ng_xxx_rcvdata() argument
[all …]
H A Dng_vlan.c132 hook_p hook; member
175 ng_vlan_newhook(node_p node, hook_p hook, const char *name) in ng_vlan_newhook() argument
180 priv->downstream_hook = hook; in ng_vlan_newhook()
182 priv->nomatch_hook = hook; in ng_vlan_newhook()
189 NG_HOOK_SET_PRIVATE(hook, NULL); in ng_vlan_newhook()
201 hook_p hook; in ng_vlan_rcvmsg() local
223 hook = ng_findhook(node, vf->hook); in ng_vlan_rcvmsg()
224 if (hook == NULL) { in ng_vlan_rcvmsg()
229 if (hook == priv->downstream_hook || in ng_vlan_rcvmsg()
230 hook == priv->nomatch_hook) { in ng_vlan_rcvmsg()
[all …]
H A Dng_tag.c123 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
308 NG_HOOK_SET_PRIVATE(hook, hip); in ng_tag_newhook()
318 if ((error = ng_tag_setdata_in(hook, &ng_tag_default_in)) != 0) { in ng_tag_newhook()
324 if ((error = ng_tag_setdata_out(hook, &ng_tag_default_out)) != 0) { in ng_tag_newhook()
360 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 Dng_ipfw.c87 hook_p hook; member
143 ng_ipfw_newhook(node_p node, hook_p hook, const char *name) in ng_ipfw_newhook() argument
170 hpriv->hook = hook; in ng_ipfw_newhook()
173 NG_HOOK_SET_PRIVATE(hook, hpriv); in ng_ipfw_newhook()
183 ng_ipfw_connect(hook_p hook) in ng_ipfw_connect() argument
185 NG_HOOK_FORCE_QUEUE(hook); in ng_ipfw_connect()
206 hook_p hook; in ng_ipfw_findhook1() local
209 LIST_FOREACH(hook, &node->nd_hooks, hk_hooks) { in ng_ipfw_findhook1()
210 hpriv = NG_HOOK_PRIVATE(hook); in ng_ipfw_findhook1()
211 if (NG_HOOK_IS_VALID(hook) && (hpriv->rulenum == rulenum)) in ng_ipfw_findhook1()
[all …]
H A Dng_split.c103 ng_split_newhook(node_p node, hook_p hook, const char *name) in ng_split_newhook() argument
119 *localhook = hook; in ng_split_newhook()
120 NG_HOOK_SET_PRIVATE(hook, localhook); in ng_split_newhook()
129 ng_split_rcvdata(hook_p hook, item_p item) in ng_split_rcvdata() argument
131 const priv_p priv = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); in ng_split_rcvdata()
134 if (hook == priv->out) { in ng_split_rcvdata()
138 } else if ((hook == priv->in) && (priv->mixed != NULL)) { in ng_split_rcvdata()
140 } else if ((hook == priv->mixed) && (priv->out != NULL)) { in ng_split_rcvdata()
166 ng_split_disconnect(hook_p hook) in ng_split_disconnect() argument
168 hook_p *localhook = NG_HOOK_PRIVATE(hook); in ng_split_disconnect()
[all …]
/dflybsd-src/sys/netgraph/etf/
H A Dng_etf.c133 hook_p hook; member
210 ng_etf_newhook(node_p node, hook_p hook, const char *name) in ng_etf_newhook() argument
216 etfp->downstream_hook.hook = hook; in ng_etf_newhook()
217 NG_HOOK_SET_PRIVATE(hook, &etfp->downstream_hook); in ng_etf_newhook()
221 etfp->nomatch_hook.hook = hook; in ng_etf_newhook()
222 NG_HOOK_SET_PRIVATE(hook, &etfp->nomatch_hook); in ng_etf_newhook()
234 NG_HOOK_SET_PRIVATE(hook, hpriv); in ng_etf_newhook()
235 hpriv->hook = hook; in ng_etf_newhook()
294 hook_p hook; in ng_etf_rcvmsg() local
304 hook = ng_findhook(node, f->matchhook); in ng_etf_rcvmsg()
[all …]
/dflybsd-src/sys/netgraph/
H A Dnetgraph.h82 void ng_unref_hook(hook_p hook); /* don't move this */
83 #define NG_HOOK_REF(hook) atomic_add_int(&(hook)->refs, 1) argument
84 #define NG_HOOK_NAME(hook) ((hook)->name) argument
85 #define NG_HOOK_UNREF(hook) ng_unref_hook(hook) argument
86 #define NG_HOOK_SET_PRIVATE(hook, val) do {(hook)->private = val;} while (0) argument
87 #define NG_HOOK_SET_RCVMSG(hook, val) do {(hook)->rcvmsg = val;} while (0) argument
88 #define NG_HOOK_SET_RCVDATA(hook, val) do {(hook)->rcvdata = val;} while (0) argument
89 #define NG_HOOK_PRIVATE(hook) ((hook)->private) argument
90 #define NG_HOOK_NOT_VALID(hook) ((hook)->flags & HK_INVALID) argument
91 #define NG_HOOK_IS_VALID(hook) (!((hook)->flags & HK_INVALID)) argument
[all …]
H A Dng_sample.c120 hook_p hook; member
188 ng_xxx_newhook(node_p node, hook_p hook, const char *name) in ng_xxx_newhook() argument
228 if (xxxp->channel[chan].hook != NULL) in ng_xxx_newhook()
230 hook->private = xxxp->channel + chan; in ng_xxx_newhook()
231 xxxp->channel[chan].hook = hook; in ng_xxx_newhook()
236 xxxp->downstream_hook.hook = hook; in ng_xxx_newhook()
237 hook->private = &xxxp->downstream_hook; in ng_xxx_newhook()
240 xxxp->debughook = hook; in ng_xxx_newhook()
241 hook->private = NULL; in ng_xxx_newhook()
323 ng_xxx_rcvdata(hook_p hook, struct mbuf *m, meta_p meta) in ng_xxx_rcvdata() argument
[all …]
/dflybsd-src/sys/netgraph7/etf/
H A Dng_etf.c131 hook_p hook; member
203 ng_etf_newhook(node_p node, hook_p hook, const char *name) in ng_etf_newhook() argument
209 etfp->downstream_hook.hook = hook; in ng_etf_newhook()
210 NG_HOOK_SET_PRIVATE(hook, &etfp->downstream_hook); in ng_etf_newhook()
214 etfp->nomatch_hook.hook = hook; in ng_etf_newhook()
215 NG_HOOK_SET_PRIVATE(hook, &etfp->nomatch_hook); in ng_etf_newhook()
227 NG_HOOK_SET_PRIVATE(hook, hpriv); in ng_etf_newhook()
228 hpriv->hook = hook; in ng_etf_newhook()
288 hook_p hook; in ng_etf_rcvmsg() local
298 hook = ng_findhook(node, f->matchhook); in ng_etf_rcvmsg()
[all …]
/dflybsd-src/sys/netgraph7/netgraph/
H A Dng_base.c221 static int ng_con_part2(node_p node, item_p item, hook_p hook);
222 static int ng_con_part3(node_p node, item_p item, hook_p hook);
230 void ng_destroy_hook(hook_p hook);
235 int ng_path_parse(char *addr, char **node, char **path, char **hook);
249 #define _NG_ALLOC_HOOK(hook) \ argument
250 hook = kmalloc(sizeof(*hook), M_NETGRAPH_HOOK, \
268 hook_p hook; in ng_alloc_hook() local
271 hook = LIST_FIRST(&ng_freehooks); in ng_alloc_hook()
272 if (hook) { in ng_alloc_hook()
273 LIST_REMOVE(hook, hk_hooks); in ng_alloc_hook()
[all …]
/dflybsd-src/sys/netgraph/tee/
H A Dng_tee.c65 hook_p hook; member
173 ngt_newhook(node_p node, hook_p hook, const char *name) in ngt_newhook() argument
178 sc->right.hook = hook; in ngt_newhook()
180 hook->private = &sc->right; in ngt_newhook()
182 sc->left.hook = hook; in ngt_newhook()
184 hook->private = &sc->left; in ngt_newhook()
186 sc->right2left.hook = hook; in ngt_newhook()
188 hook->private = &sc->right2left; in ngt_newhook()
190 sc->left2right.hook = hook; in ngt_newhook()
192 hook->private = &sc->left2right; in ngt_newhook()
[all …]
/dflybsd-src/sys/netgraph7/bpf/
H A Dng_bpf.c84 hook_p hook; member
104 static int ng_bpf_setprog(hook_p hook, const struct ng_bpf_hookprog *hp);
237 ng_bpf_addrefs(hook_p hook, void* arg) in ng_bpf_addrefs() argument
239 hinfo_p hip = NG_HOOK_PRIVATE(hook); in ng_bpf_addrefs()
250 ng_bpf_remrefs(hook_p hook, void* arg) in ng_bpf_remrefs() argument
252 hinfo_p hip = NG_HOOK_PRIVATE(hook); in ng_bpf_remrefs()
266 ng_bpf_newhook(node_p node, hook_p hook, const char *name) in ng_bpf_newhook() argument
277 hip->hook = hook; in ng_bpf_newhook()
278 NG_HOOK_SET_PRIVATE(hook, hip); in ng_bpf_newhook()
281 NG_NODE_FOREACH_HOOK(node, ng_bpf_addrefs, hook, tmp); in ng_bpf_newhook()
[all …]
/dflybsd-src/sys/netgraph7/cisco/
H A Dng_cisco.c92 hook_p hook; /* the hook for this proto */ member
122 static void cisco_keepalive(node_p node, hook_p hook, void *arg1, int arg2);
210 cisco_newhook(node_p node, hook_p hook, const char *name) in cisco_newhook() argument
215 sc->downstream.hook = hook; in cisco_newhook()
216 NG_HOOK_SET_PRIVATE(hook, &sc->downstream); in cisco_newhook()
222 sc->inet.hook = hook; in cisco_newhook()
223 NG_HOOK_SET_PRIVATE(hook, &sc->inet); in cisco_newhook()
225 sc->inet6.hook = hook; in cisco_newhook()
226 NG_HOOK_SET_PRIVATE(hook, &sc->inet6); in cisco_newhook()
228 sc->ipx.hook = hook; in cisco_newhook()
[all …]
/dflybsd-src/sys/netgraph/netgraph/
H A Dng_base.c90 static void ng_disconnect_hook(hook_p hook);
456 hook_p hook; in ng_cutlinks() local
466 while ((hook = LIST_FIRST(&node->hooks)) != NULL) in ng_cutlinks()
467 ng_destroy_hook(hook); in ng_cutlinks()
688 ng_unref_hook(hook_p hook) in ng_unref_hook() argument
691 if (--hook->refs == 0) in ng_unref_hook()
692 kfree(hook, M_NETGRAPH); in ng_unref_hook()
702 hook_p hook; in ng_add_hook() local
716 hook = kmalloc(sizeof(*hook), M_NETGRAPH, M_NOWAIT | M_ZERO); in ng_add_hook()
717 if (hook == NULL) { in ng_add_hook()
[all …]
/dflybsd-src/sys/netgraph/bpf/
H A Dng_bpf.c75 hook_p hook; member
90 static int ng_bpf_setprog(hook_p hook, const struct ng_bpf_hookprog *hp);
230 ng_bpf_newhook(node_p node, hook_p hook, const char *name) in ng_bpf_newhook() argument
239 hip->hook = hook; in ng_bpf_newhook()
240 hook->private = hip; in ng_bpf_newhook()
244 if ((error = ng_bpf_setprog(hook, &ng_bpf_default_prog)) != 0) { in ng_bpf_newhook()
246 hook->private = NULL; in ng_bpf_newhook()
273 hook_p hook; in ng_bpf_rcvmsg() local
282 if ((hook = ng_findhook(node, hp->thisHook)) == NULL) in ng_bpf_rcvmsg()
286 if ((error = ng_bpf_setprog(hook, hp)) != 0) in ng_bpf_rcvmsg()
[all …]
/dflybsd-src/sys/netgraph/pppoe/
H A Dng_pppoe.c144 hook_p hook; member
237 hook_p hook; in get_new_sid() local
254 LIST_FOREACH(hook, &node->hooks, hooks) { in get_new_sid()
256 if ((hook->private == &privp->debug_hook) in get_new_sid()
257 || (hook->private == &privp->ethernet_hook)) in get_new_sid()
259 sp = hook->private; in get_new_sid()
406 hook_p hook; in pppoe_match_svc() local
409 LIST_FOREACH(hook, &node->hooks, hooks) { in pppoe_match_svc()
412 if ((hook->private == &privp->debug_hook) in pppoe_match_svc()
413 || (hook->private == &privp->ethernet_hook)) in pppoe_match_svc()
[all …]
/dflybsd-src/sys/netgraph7/frame_relay/
H A Dng_frame_relay.c74 hook_p hook; /* if there's a hook assigned.. */ member
234 ngfrm_newhook(node_p node, hook_p hook, const char *name) in ngfrm_newhook() argument
244 NG_HOOK_SET_PRIVATE(hook, NULL); /* paranoid */ in ngfrm_newhook()
261 if (sc->downstream.hook) in ngfrm_newhook()
265 NG_HOOK_SET_PRIVATE(hook, &sc->downstream); in ngfrm_newhook()
266 sc->downstream.hook = hook; in ngfrm_newhook()
295 if (sc->channel[ctxnum].hook != NULL) in ngfrm_newhook()
302 NG_HOOK_SET_PRIVATE(hook, sc->channel + ctxnum); in ngfrm_newhook()
303 sc->channel[ctxnum].hook = hook; in ngfrm_newhook()
329 ngfrm_rcvdata(hook_p hook, item_p item) in ngfrm_rcvdata() argument
[all …]
/dflybsd-src/sys/netgraph/frame_relay/
H A Dng_frame_relay.c74 hook_p hook; /* if there's a hook assigned.. */ member
245 ngfrm_newhook(node_p node, hook_p hook, const char *name) in ngfrm_newhook() argument
255 hook->private = NULL; /* paranoid */ in ngfrm_newhook()
272 if (sc->downstream.hook) in ngfrm_newhook()
276 hook->private = &sc->downstream; in ngfrm_newhook()
277 sc->downstream.hook = hook; in ngfrm_newhook()
306 if (sc->channel[ctxnum].hook != NULL) in ngfrm_newhook()
313 hook->private = sc->channel + ctxnum; in ngfrm_newhook()
314 sc->channel[ctxnum].hook = hook; in ngfrm_newhook()
340 ngfrm_rcvdata(hook_p hook, struct mbuf *m, meta_p meta) in ngfrm_rcvdata() argument
[all …]
/dflybsd-src/sys/netgraph7/tee/
H A Dng_tee.c67 hook_p hook; member
169 ng_tee_newhook(node_p node, hook_p hook, const char *name) in ng_tee_newhook() argument
201 hinfo->hook = hook; in ng_tee_newhook()
203 NG_HOOK_SET_PRIVATE(hook, hinfo); in ng_tee_newhook()
263 if (lasthook == sc->left.hook || lasthook == sc->right.hook) { in ng_tee_rcvmsg()
267 NG_FWD_ITEM_HOOK(error, item, hinfo->dest->hook); in ng_tee_rcvmsg()
293 ng_tee_rcvdata(hook_p hook, item_p item) in ng_tee_rcvdata() argument
295 const hi_p hinfo = NG_HOOK_PRIVATE(hook); in ng_tee_rcvdata()
315 NG_SEND_DATA_ONLY(error, h->hook, m2); in ng_tee_rcvdata()
327 NG_FWD_ITEM_HOOK(error, item, h->hook); in ng_tee_rcvdata()
[all …]
/dflybsd-src/sys/netgraph7/netflow/
H A Dng_netflow.c200 ng_netflow_newhook(node_p node, hook_p hook, const char *name) in ng_netflow_newhook() argument
220 if (priv->ifaces[ifnum].hook != NULL) in ng_netflow_newhook()
226 NG_HOOK_SET_PRIVATE(hook, iface); in ng_netflow_newhook()
227 iface->hook = hook; in ng_netflow_newhook()
258 NG_HOOK_SET_PRIVATE(hook, iface); in ng_netflow_newhook()
259 iface->out = hook; in ng_netflow_newhook()
266 priv->export = hook; in ng_netflow_newhook()
274 NG_HOOK_FORCE_QUEUE(NG_HOOK_PEER(hook)); in ng_netflow_newhook()
325 if (priv->ifaces[*index].hook == NULL) in ng_netflow_rcvmsg()
350 if (iface->hook == NULL) in ng_netflow_rcvmsg()
[all …]
/dflybsd-src/sys/netgraph7/hole/
H A Dng_hole.c131 ngh_newhook(node_p node, hook_p hook, const char *name) in ngh_newhook() argument
139 NG_HOOK_SET_PRIVATE(hook, hip); in ngh_newhook()
153 hook_p hook; in ngh_rcvmsg() local
168 hook = ng_findhook(node, (char *)msg->data); in ngh_rcvmsg()
169 if (hook == NULL) { in ngh_rcvmsg()
173 stats = &((hinfo_p)NG_HOOK_PRIVATE(hook))->stats; in ngh_rcvmsg()
206 ngh_rcvdata(hook_p hook, item_p item) in ngh_rcvdata() argument
208 const hinfo_p hip = NG_HOOK_PRIVATE(hook); in ngh_rcvdata()
220 ngh_disconnect(hook_p hook) in ngh_disconnect() argument
223 kfree(NG_HOOK_PRIVATE(hook), M_NETGRAPH); in ngh_disconnect()
[all …]
/dflybsd-src/sys/netgraph/one2many/
H A Dng_one2many.c65 hook_p hook; /* netgraph hook */ member
92 #define LINK_NUM(hook) (*(int16_t *)(&(hook)->private)) argument
216 ng_one2many_newhook(node_p node, hook_p hook, const char *name) in ng_one2many_newhook() argument
244 if (link->hook != NULL) in ng_one2many_newhook()
248 LINK_NUM(hook) = linkNum; in ng_one2many_newhook()
249 link->hook = hook; in ng_one2many_newhook()
385 ng_one2many_rcvdata(hook_p hook, struct mbuf *m, meta_p meta) in ng_one2many_rcvdata() argument
387 const node_p node = hook->node; in ng_one2many_rcvdata()
395 linkNum = LINK_NUM(hook); in ng_one2many_rcvdata()
403 KASSERT(src->hook != NULL, ("%s: no src%d", __func__, linkNum)); in ng_one2many_rcvdata()
[all …]
/dflybsd-src/sys/netgraph/rfc1490/
H A Dng_rfc1490.c147 ng_rfc1490_newhook(node_p node, hook_p hook, const char *name) in ng_rfc1490_newhook() argument
154 priv->downlink = hook; in ng_rfc1490_newhook()
158 priv->ppp = hook; in ng_rfc1490_newhook()
162 priv->inet = hook; in ng_rfc1490_newhook()
216 ng_rfc1490_rcvdata(hook_p hook, struct mbuf *m, meta_p meta) in ng_rfc1490_rcvdata() argument
218 const node_p node = hook->node; in ng_rfc1490_rcvdata()
222 if (hook == priv->downlink) { in ng_rfc1490_rcvdata()
285 } else if (hook == priv->ppp) { in ng_rfc1490_rcvdata()
292 } else if (hook == priv->inet) { in ng_rfc1490_rcvdata()
330 ng_rfc1490_disconnect(hook_p hook) in ng_rfc1490_disconnect() argument
[all …]
/dflybsd-src/sys/netgraph7/UI/
H A Dng_UI.c117 ng_UI_newhook(node_p node, hook_p hook, const char *name) in ng_UI_newhook() argument
124 priv->downlink = hook; in ng_UI_newhook()
128 priv->uplink = hook; in ng_UI_newhook()
170 ng_UI_rcvdata(hook_p hook, item_p item) in ng_UI_rcvdata() argument
172 const node_p node = NG_HOOK_NODE(hook); in ng_UI_rcvdata()
178 if (hook == priv->downlink) { in ng_UI_rcvdata()
192 } else if (hook == priv->uplink) { in ng_UI_rcvdata()
227 ng_UI_disconnect(hook_p hook) in ng_UI_disconnect() argument
229 const priv_p priv = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); in ng_UI_disconnect()
231 if (hook == priv->downlink) in ng_UI_disconnect()
[all …]

12345678