Lines Matching refs:priv

91 static void		ng_one2many_update_many(priv_p priv);
92 static void ng_one2many_notify(priv_p priv, uint32_t cmd);
187 priv_p priv; in ng_one2many_constructor() local
190 priv = kmalloc(sizeof(*priv), M_NETGRAPH, in ng_one2many_constructor()
192 if (priv == NULL) in ng_one2many_constructor()
194 priv->conf.xmitAlg = NG_ONE2MANY_XMIT_ROUNDROBIN; in ng_one2many_constructor()
195 priv->conf.failAlg = NG_ONE2MANY_FAIL_MANUAL; in ng_one2many_constructor()
198 NG_NODE_SET_PRIVATE(node, priv); in ng_one2many_constructor()
199 priv->node = node; in ng_one2many_constructor()
211 const priv_p priv = NG_NODE_PRIVATE(node); in ng_one2many_newhook() local
229 link = &priv->many[linkNum]; in ng_one2many_newhook()
232 link = &priv->one; in ng_one2many_newhook()
245 priv->conf.enabledLinks[linkNum] = 1; /* auto-enable link */ in ng_one2many_newhook()
246 ng_one2many_update_many(priv); in ng_one2many_newhook()
259 const priv_p priv = NG_NODE_PRIVATE(node); in ng_one2many_rcvmsg() local
303 bcopy(conf, &priv->conf, sizeof(*conf)); in ng_one2many_rcvmsg()
304 ng_one2many_update_many(priv); in ng_one2many_rcvmsg()
317 bcopy(&priv->conf, conf, sizeof(priv->conf)); in ng_one2many_rcvmsg()
334 link = &priv->one; in ng_one2many_rcvmsg()
337 link = &priv->many[linkNum]; in ng_one2many_rcvmsg()
372 if (priv->conf.failAlg != NG_ONE2MANY_FAIL_NOTIFY) in ng_one2many_rcvmsg()
387 priv->conf.enabledLinks[linkNum] = 1; in ng_one2many_rcvmsg()
388 ng_one2many_update_many(priv); in ng_one2many_rcvmsg()
391 priv->conf.enabledLinks[linkNum] = 0; in ng_one2many_rcvmsg()
392 ng_one2many_update_many(priv); in ng_one2many_rcvmsg()
417 const priv_p priv = NG_NODE_PRIVATE(node); in ng_one2many_rcvdata() local
434 &priv->one : &priv->many[linkNum]; in ng_one2many_rcvdata()
443 if (priv->numActiveMany == 0) { in ng_one2many_rcvdata()
447 switch(priv->conf.xmitAlg) { in ng_one2many_rcvdata()
449 dst = &priv->many[priv->activeMany[priv->nextMany]]; in ng_one2many_rcvdata()
450 priv->nextMany = (priv->nextMany + 1) % priv->numActiveMany; in ng_one2many_rcvdata()
454 dst = &priv->many[priv->activeMany[0]]; in ng_one2many_rcvdata()
459 for (i = 1; i < priv->numActiveMany; i++) { in ng_one2many_rcvdata()
463 mdst = &priv->many[priv->activeMany[i]]; in ng_one2many_rcvdata()
483 dst = &priv->one; in ng_one2many_rcvdata()
501 const priv_p priv = NG_NODE_PRIVATE(node); in ng_one2many_shutdown() local
503 KASSERT(priv->numActiveMany == 0, in ng_one2many_shutdown()
504 ("%s: numActiveMany=%d", __func__, priv->numActiveMany)); in ng_one2many_shutdown()
505 kfree(priv, M_NETGRAPH); in ng_one2many_shutdown()
517 const priv_p priv = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); in ng_one2many_disconnect() local
528 priv->one.hook = NULL; in ng_one2many_disconnect()
530 priv->many[linkNum].hook = NULL; in ng_one2many_disconnect()
531 priv->conf.enabledLinks[linkNum] = 0; in ng_one2many_disconnect()
532 ng_one2many_update_many(priv); in ng_one2many_disconnect()
550 ng_one2many_update_many(priv_p priv) in ng_one2many_update_many() argument
552 uint16_t saveActive = priv->numActiveMany; in ng_one2many_update_many()
556 priv->numActiveMany = 0; in ng_one2many_update_many()
558 switch (priv->conf.failAlg) { in ng_one2many_update_many()
561 if (priv->many[linkNum].hook != NULL in ng_one2many_update_many()
562 && priv->conf.enabledLinks[linkNum]) { in ng_one2many_update_many()
563 priv->activeMany[priv->numActiveMany] = linkNum; in ng_one2many_update_many()
564 priv->numActiveMany++; in ng_one2many_update_many()
574 if (priv->numActiveMany == 0 && saveActive > 0) in ng_one2many_update_many()
575 ng_one2many_notify(priv, NGM_LINK_IS_DOWN); in ng_one2many_update_many()
577 if (saveActive == 0 && priv->numActiveMany > 0) in ng_one2many_update_many()
578 ng_one2many_notify(priv, NGM_LINK_IS_UP); in ng_one2many_update_many()
581 switch (priv->conf.xmitAlg) { in ng_one2many_update_many()
583 if (priv->numActiveMany > 0) in ng_one2many_update_many()
584 priv->nextMany %= priv->numActiveMany; in ng_one2many_update_many()
599 ng_one2many_notify(priv_p priv, uint32_t cmd) in ng_one2many_notify() argument
604 if (priv->one.hook == NULL) in ng_one2many_notify()
609 NG_SEND_MSG_HOOK(dummy_error, priv->node, msg, priv->one.hook, 0); in ng_one2many_notify()