Lines Matching refs:priv

89 static void		ng_one2many_update_many(priv_p priv);
90 static void ng_one2many_notify(priv_p priv, uint32_t cmd);
185 priv_p priv; in ng_one2many_constructor() local
188 priv = malloc(sizeof(*priv), M_NETGRAPH, M_WAITOK | M_ZERO); in ng_one2many_constructor()
189 priv->conf.xmitAlg = NG_ONE2MANY_XMIT_ROUNDROBIN; in ng_one2many_constructor()
190 priv->conf.failAlg = NG_ONE2MANY_FAIL_MANUAL; in ng_one2many_constructor()
193 NG_NODE_SET_PRIVATE(node, priv); in ng_one2many_constructor()
194 priv->node = node; in ng_one2many_constructor()
206 const priv_p priv = NG_NODE_PRIVATE(node); in ng_one2many_newhook() local
224 link = &priv->many[linkNum]; in ng_one2many_newhook()
227 link = &priv->one; in ng_one2many_newhook()
240 priv->conf.enabledLinks[linkNum] = 1; /* auto-enable link */ in ng_one2many_newhook()
241 ng_one2many_update_many(priv); in ng_one2many_newhook()
254 const priv_p priv = NG_NODE_PRIVATE(node); in ng_one2many_rcvmsg() local
299 bcopy(conf, &priv->conf, sizeof(*conf)); in ng_one2many_rcvmsg()
300 ng_one2many_update_many(priv); in ng_one2many_rcvmsg()
313 bcopy(&priv->conf, conf, sizeof(priv->conf)); in ng_one2many_rcvmsg()
330 link = &priv->one; in ng_one2many_rcvmsg()
333 link = &priv->many[linkNum]; in ng_one2many_rcvmsg()
368 if (priv->conf.failAlg != NG_ONE2MANY_FAIL_NOTIFY) in ng_one2many_rcvmsg()
383 priv->conf.enabledLinks[linkNum] = 1; in ng_one2many_rcvmsg()
384 ng_one2many_update_many(priv); in ng_one2many_rcvmsg()
387 priv->conf.enabledLinks[linkNum] = 0; in ng_one2many_rcvmsg()
388 ng_one2many_update_many(priv); in ng_one2many_rcvmsg()
413 const priv_p priv = NG_NODE_PRIVATE(node); in ng_one2many_rcvdata() local
430 &priv->one : &priv->many[linkNum]; in ng_one2many_rcvdata()
439 if (priv->numActiveMany == 0) { in ng_one2many_rcvdata()
443 switch(priv->conf.xmitAlg) { in ng_one2many_rcvdata()
445 dst = &priv->many[priv->activeMany[priv->nextMany]]; in ng_one2many_rcvdata()
446 priv->nextMany = (priv->nextMany + 1) % priv->numActiveMany; in ng_one2many_rcvdata()
450 dst = &priv->many[priv->activeMany[0]]; in ng_one2many_rcvdata()
455 for (i = 1; i < priv->numActiveMany; i++) { in ng_one2many_rcvdata()
459 mdst = &priv->many[priv->activeMany[i]]; in ng_one2many_rcvdata()
474 dst = &priv->many[priv->activeMany[0]]; in ng_one2many_rcvdata()
482 dst = &priv->one; in ng_one2many_rcvdata()
500 const priv_p priv = NG_NODE_PRIVATE(node); in ng_one2many_shutdown() local
502 KASSERT(priv->numActiveMany == 0, in ng_one2many_shutdown()
503 ("%s: numActiveMany=%d", __func__, priv->numActiveMany)); in ng_one2many_shutdown()
504 free(priv, M_NETGRAPH); in ng_one2many_shutdown()
516 const priv_p priv = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); in ng_one2many_disconnect() local
527 priv->one.hook = NULL; in ng_one2many_disconnect()
529 priv->many[linkNum].hook = NULL; in ng_one2many_disconnect()
530 priv->conf.enabledLinks[linkNum] = 0; in ng_one2many_disconnect()
531 ng_one2many_update_many(priv); in ng_one2many_disconnect()
549 ng_one2many_update_many(priv_p priv) in ng_one2many_update_many() argument
551 uint16_t saveActive = priv->numActiveMany; in ng_one2many_update_many()
555 priv->numActiveMany = 0; in ng_one2many_update_many()
557 switch (priv->conf.failAlg) { in ng_one2many_update_many()
560 if (priv->many[linkNum].hook != NULL in ng_one2many_update_many()
561 && priv->conf.enabledLinks[linkNum]) { in ng_one2many_update_many()
562 priv->activeMany[priv->numActiveMany] = linkNum; in ng_one2many_update_many()
563 priv->numActiveMany++; in ng_one2many_update_many()
573 if (priv->numActiveMany == 0 && saveActive > 0) in ng_one2many_update_many()
574 ng_one2many_notify(priv, NGM_LINK_IS_DOWN); in ng_one2many_update_many()
576 if (saveActive == 0 && priv->numActiveMany > 0) in ng_one2many_update_many()
577 ng_one2many_notify(priv, NGM_LINK_IS_UP); in ng_one2many_update_many()
580 switch (priv->conf.xmitAlg) { in ng_one2many_update_many()
582 if (priv->numActiveMany > 0) in ng_one2many_update_many()
583 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()