Lines Matching +full:chan +full:- +full:name

5 /*-
6 * Copyright (c) 1996-1999 Whistle Communications, Inc.
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
107 .name = NG_XXX_NODE_TYPE,
122 int dlci; /* The DLCI it represents, -1 == downstream */
157 privdata->channel[i].dlci = -2; in ng_xxx_constructor()
158 privdata->channel[i].channel = i; in ng_xxx_constructor()
163 privdata->node = node; in ng_xxx_constructor()
170 * Possibly decode information out of the hook name.
180 ng_xxx_newhook(node_p node, hook_p hook, const char *name) in ng_xxx_newhook() argument
185 int chan; in ng_xxx_newhook() local
189 if ((xxxp->flags & SCF_RUNNING) == 0) { in ng_xxx_newhook()
198 if (strncmp(name, in ng_xxx_newhook()
202 cp = name + strlen(NG_XXX_HOOK_DLCI_LEADIN); in ng_xxx_newhook()
210 for (chan = 0; chan < XXX_NUM_DLCIS; chan++) in ng_xxx_newhook()
211 if (xxxp->channel[chan].dlci == dlci) in ng_xxx_newhook()
213 if (chan == XXX_NUM_DLCIS) { in ng_xxx_newhook()
214 for (chan = 0; chan < XXX_NUM_DLCIS; chan++) in ng_xxx_newhook()
215 if (xxxp->channel[chan].dlci == -2) in ng_xxx_newhook()
217 if (chan == XXX_NUM_DLCIS) in ng_xxx_newhook()
219 xxxp->channel[chan].dlci = dlci; in ng_xxx_newhook()
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()
226 } else if (strcmp(name, NG_XXX_HOOK_DOWNSTREAM) == 0) { 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()
231 } else if (strcmp(name, NG_XXX_HOOK_DEBUG) == 0) { in ng_xxx_newhook()
233 xxxp->debughook = hook; in ng_xxx_newhook()
266 switch (msg->header.typecookie) { in ng_xxx_rcvmsg()
268 switch (msg->header.cmd) { in ng_xxx_rcvmsg()
278 stats = (struct ngxxxstat *) resp->data; in ng_xxx_rcvmsg()
279 stats->packets_in = xxxp->packets_in; in ng_xxx_rcvmsg()
280 stats->packets_out = xxxp->packets_out; in ng_xxx_rcvmsg()
284 if (msg->header.arglen != sizeof(u_int32_t)) { in ng_xxx_rcvmsg()
288 xxxp->flags = *((u_int32_t *) msg->data); in ng_xxx_rcvmsg()
326 int chan = -2; in ng_xxx_rcvdata() local
327 int dlci = -2; in ng_xxx_rcvdata()
333 dlci = ((struct XXX_hookinfo *) NG_HOOK_PRIVATE(hook))->dlci; in ng_xxx_rcvdata()
334 chan = ((struct XXX_hookinfo *) NG_HOOK_PRIVATE(hook))->channel; in ng_xxx_rcvdata()
335 if (dlci != -1) { in ng_xxx_rcvdata()
341 /* mtod(m, xxxxxx)->dlci = dlci; */ in ng_xxx_rcvdata()
343 xxxp->downstream_hook.hook, m); in ng_xxx_rcvdata()
344 xxxp->packets_out++; in ng_xxx_rcvdata()
349 for (chan = 0; chan < XXX_NUM_DLCIS; chan++) in ng_xxx_rcvdata()
350 if (xxxp->channel[chan].dlci == dlci) in ng_xxx_rcvdata()
352 if (chan == XXX_NUM_DLCIS) { in ng_xxx_rcvdata()
360 xxxp->channel[chan].hook, m); in ng_xxx_rcvdata()
361 xxxp->packets_in++; in ng_xxx_rcvdata()
365 if (hook == xxxp->downstream_hook.hook) { in ng_xxx_rcvdata()
386 NG_SEND_DATA_ONLY(error, xxxp->upstream_hook.hook, m);
395 * All our links and the name have already been removed.
415 if (node->nd_flags & NGF_REALLY_DIE) { in ng_xxx_shutdown()
422 NG_NODE_UNREF(privdata->node); in ng_xxx_shutdown()
461 dlci = ((struct XXX_hookinfo *) NG_HOOK_PRIVATE(hook))->dlci;
479 ((struct XXX_hookinfo *) (NG_HOOK_PRIVATE(hook)))->hook = NULL;