Lines Matching refs:priv
160 #define MP_RECV_SEQ_DIFF(priv,x,y) \ argument
161 ((priv)->conf.recvShortSeq ? \
166 #define MP_NEXT_RECV_SEQ(priv,seq) \ argument
167 ((priv)->conf.recvShortSeq ? \
490 priv_p priv; in ng_ppp_constructor() local
494 priv = malloc(sizeof(*priv), M_NETGRAPH_PPP, M_WAITOK | M_ZERO); in ng_ppp_constructor()
496 NG_NODE_SET_PRIVATE(node, priv); in ng_ppp_constructor()
499 TAILQ_INIT(&priv->frags); in ng_ppp_constructor()
500 TAILQ_INIT(&priv->fragsfree); in ng_ppp_constructor()
502 TAILQ_INSERT_TAIL(&priv->fragsfree, &priv->fragsmem[i], f_qent); in ng_ppp_constructor()
504 priv->links[i].seq = MP_NOSEQ; in ng_ppp_constructor()
505 ng_callout_init(&priv->fragTimer); in ng_ppp_constructor()
507 mtx_init(&priv->rmtx, "ng_ppp_recv", NULL, MTX_DEF); in ng_ppp_constructor()
508 mtx_init(&priv->xmtx, "ng_ppp_xmit", NULL, MTX_DEF); in ng_ppp_constructor()
520 const priv_p priv = NG_NODE_PRIVATE(node); in ng_ppp_newhook() local
537 hookPtr = &priv->links[linkNum].hook; in ng_ppp_newhook()
545 if (priv->links[linkNum].conf.enableLink && in ng_ppp_newhook()
546 !priv->conf.enableMultilink && priv->numActiveLinks >= 1) in ng_ppp_newhook()
554 hookPtr = &priv->hooks[i]; in ng_ppp_newhook()
583 const priv_p priv = NG_NODE_PRIVATE(node); in ng_ppp_rcvmsg() local
605 priv->conf = conf->bund; in ng_ppp_rcvmsg()
607 priv->links[i].conf = conf->links[i]; in ng_ppp_rcvmsg()
620 conf->bund = priv->conf; in ng_ppp_rcvmsg()
622 conf->links[i] = priv->links[i].conf; in ng_ppp_rcvmsg()
636 if (priv->links[i].seq != MP_NOSEQ) in ng_ppp_rcvmsg()
637 info->rseq[i] = priv->links[i].seq; in ng_ppp_rcvmsg()
639 info->mseq = priv->mseq; in ng_ppp_rcvmsg()
640 info->xseq = priv->xseq; in ng_ppp_rcvmsg()
660 &priv->bundleStats : &priv->links[linkNum].stats; in ng_ppp_rcvmsg()
714 if ((lasthook = priv->hooks[HOOK_INDEX_VJC_IP])) { in ng_ppp_rcvmsg()
735 const priv_p priv = NG_NODE_PRIVATE(node); in ng_ppp_shutdown() local
742 mtx_destroy(&priv->rmtx); in ng_ppp_shutdown()
743 mtx_destroy(&priv->xmtx); in ng_ppp_shutdown()
744 bzero(priv, sizeof(*priv)); in ng_ppp_shutdown()
745 free(priv, M_NETGRAPH_PPP); in ng_ppp_shutdown()
758 const priv_p priv = NG_NODE_PRIVATE(node); in ng_ppp_disconnect() local
763 priv->links[~index].hook = NULL; in ng_ppp_disconnect()
765 priv->hooks[index] = NULL; in ng_ppp_disconnect()
787 const priv_p priv = NG_NODE_PRIVATE(node); in ng_ppp_rcvdata_inet() local
789 if (!priv->conf.enableIP) { in ng_ppp_rcvdata_inet()
803 const priv_p priv = NG_NODE_PRIVATE(node); in ng_ppp_rcvdata_inet_fast() local
805 return (ng_ppp_link_xmit(node, item, PROT_IP, priv->activeLinks[0], in ng_ppp_rcvdata_inet_fast()
816 const priv_p priv = NG_NODE_PRIVATE(node); in ng_ppp_rcvdata_ipv6() local
818 if (!priv->conf.enableIPv6) { in ng_ppp_rcvdata_ipv6()
832 const priv_p priv = NG_NODE_PRIVATE(node); in ng_ppp_rcvdata_atalk() local
834 if (!priv->conf.enableAtalk) { in ng_ppp_rcvdata_atalk()
848 const priv_p priv = NG_NODE_PRIVATE(node); in ng_ppp_rcvdata_ipx() local
850 if (!priv->conf.enableIPX) { in ng_ppp_rcvdata_ipx()
891 const priv_p priv = NG_NODE_PRIVATE(node); in ng_ppp_bypass() local
896 if (priv->hooks[HOOK_INDEX_BYPASS] == NULL) { in ng_ppp_bypass()
913 NG_FWD_ITEM_HOOK(error, item, priv->hooks[HOOK_INDEX_BYPASS]); in ng_ppp_bypass()
920 const priv_p priv = NG_NODE_PRIVATE(node); in ng_ppp_proto_recv() local
940 if (priv->conf.enableIP) in ng_ppp_proto_recv()
941 outHook = priv->hooks[HOOK_INDEX_INET]; in ng_ppp_proto_recv()
944 if (priv->conf.enableIPv6) in ng_ppp_proto_recv()
945 outHook = priv->hooks[HOOK_INDEX_IPV6]; in ng_ppp_proto_recv()
948 if (priv->conf.enableAtalk) in ng_ppp_proto_recv()
949 outHook = priv->hooks[HOOK_INDEX_ATALK]; in ng_ppp_proto_recv()
952 if (priv->conf.enableIPX) in ng_ppp_proto_recv()
953 outHook = priv->hooks[HOOK_INDEX_IPX]; in ng_ppp_proto_recv()
972 const priv_p priv = NG_NODE_PRIVATE(node); in ng_ppp_hcomp_xmit() local
975 priv->conf.enableVJCompression && in ng_ppp_hcomp_xmit()
976 priv->vjCompHooked) { in ng_ppp_hcomp_xmit()
980 NG_FWD_ITEM_HOOK(error, item, priv->hooks[HOOK_INDEX_VJC_IP]); in ng_ppp_hcomp_xmit()
994 const priv_p priv = NG_NODE_PRIVATE(node); in ng_ppp_rcvdata_vjc_comp() local
996 if (!priv->conf.enableVJCompression) { in ng_ppp_rcvdata_vjc_comp()
1010 const priv_p priv = NG_NODE_PRIVATE(node); in ng_ppp_rcvdata_vjc_uncomp() local
1012 if (!priv->conf.enableVJCompression) { in ng_ppp_rcvdata_vjc_uncomp()
1026 const priv_p priv = NG_NODE_PRIVATE(node); in ng_ppp_rcvdata_vjc_vjip() local
1028 if (!priv->conf.enableVJCompression) { in ng_ppp_rcvdata_vjc_vjip()
1038 const priv_p priv = NG_NODE_PRIVATE(node); in ng_ppp_hcomp_recv() local
1040 if (priv->conf.enableVJDecompression && priv->vjCompHooked) { in ng_ppp_hcomp_recv()
1045 outHook = priv->hooks[HOOK_INDEX_VJC_COMP]; in ng_ppp_hcomp_recv()
1048 outHook = priv->hooks[HOOK_INDEX_VJC_UNCOMP]; in ng_ppp_hcomp_recv()
1071 const priv_p priv = NG_NODE_PRIVATE(node); in ng_ppp_rcvdata_vjc_ip() local
1073 if (!priv->conf.enableVJDecompression) { in ng_ppp_rcvdata_vjc_ip()
1087 const priv_p priv = NG_NODE_PRIVATE(node); in ng_ppp_comp_xmit() local
1089 if (priv->conf.enableCompression && in ng_ppp_comp_xmit()
1093 priv->hooks[HOOK_INDEX_COMPRESS] != NULL) { in ng_ppp_comp_xmit()
1105 NG_FWD_ITEM_HOOK(error, item, priv->hooks[HOOK_INDEX_COMPRESS]); in ng_ppp_comp_xmit()
1119 const priv_p priv = NG_NODE_PRIVATE(node); in ng_ppp_rcvdata_compress() local
1122 switch (priv->conf.enableCompression) { in ng_ppp_rcvdata_compress()
1152 const priv_p priv = NG_NODE_PRIVATE(node); in ng_ppp_comp_recv() local
1155 ((proto == PROT_COMPD && priv->conf.enableDecompression) || in ng_ppp_comp_recv()
1156 priv->conf.enableDecompression == NG_PPP_DECOMPRESS_FULL) && in ng_ppp_comp_recv()
1157 priv->hooks[HOOK_INDEX_DECOMPRESS] != NULL) { in ng_ppp_comp_recv()
1160 if (priv->conf.enableDecompression == NG_PPP_DECOMPRESS_FULL) { in ng_ppp_comp_recv()
1172 priv->hooks[HOOK_INDEX_DECOMPRESS]); in ng_ppp_comp_recv()
1190 const priv_p priv = NG_NODE_PRIVATE(node); in ng_ppp_rcvdata_decompress() local
1194 if (!priv->conf.enableDecompression) { in ng_ppp_rcvdata_decompress()
1205 priv->bundleStats.badProtos++; in ng_ppp_rcvdata_decompress()
1219 const priv_p priv = NG_NODE_PRIVATE(node); in ng_ppp_crypt_xmit() local
1221 if (priv->conf.enableEncryption && in ng_ppp_crypt_xmit()
1224 priv->hooks[HOOK_INDEX_ENCRYPT] != NULL) { in ng_ppp_crypt_xmit()
1236 NG_FWD_ITEM_HOOK(error, item, priv->hooks[HOOK_INDEX_ENCRYPT]); in ng_ppp_crypt_xmit()
1250 const priv_p priv = NG_NODE_PRIVATE(node); in ng_ppp_rcvdata_encrypt() local
1252 if (!priv->conf.enableEncryption) { in ng_ppp_rcvdata_encrypt()
1262 const priv_p priv = NG_NODE_PRIVATE(node); in ng_ppp_crypt_recv() local
1265 if (priv->conf.enableDecryption && in ng_ppp_crypt_recv()
1266 priv->hooks[HOOK_INDEX_DECRYPT] != NULL) { in ng_ppp_crypt_recv()
1271 priv->hooks[HOOK_INDEX_DECRYPT]); in ng_ppp_crypt_recv()
1290 const priv_p priv = NG_NODE_PRIVATE(node); in ng_ppp_rcvdata_decrypt() local
1294 if (!priv->conf.enableDecryption) { in ng_ppp_rcvdata_decrypt()
1305 priv->bundleStats.badProtos++; in ng_ppp_rcvdata_decrypt()
1319 const priv_p priv = NG_NODE_PRIVATE(node); in ng_ppp_link_xmit() local
1331 link = &priv->links[linkNum]; in ng_ppp_link_xmit()
1364 mtx_lock(&priv->xmtx); in ng_ppp_link_xmit()
1372 priv->bundleStats.xmitFrames++; in ng_ppp_link_xmit()
1373 priv->bundleStats.xmitOctets += plen; in ng_ppp_link_xmit()
1379 if (priv->conf.enableMultilink && !priv->allLinksEqual && in ng_ppp_link_xmit()
1380 !priv->conf.enableRoundRobin) { in ng_ppp_link_xmit()
1391 mtx_unlock(&priv->xmtx); in ng_ppp_link_xmit()
1406 const priv_p priv = NG_NODE_PRIVATE(node); in ng_ppp_rcvdata() local
1409 struct ng_ppp_link * const link = &priv->links[linkNum]; in ng_ppp_rcvdata()
1419 mtx_lock(&priv->rmtx); in ng_ppp_rcvdata()
1444 mtx_unlock(&priv->rmtx); in ng_ppp_rcvdata()
1454 mtx_assert(&priv->rmtx, MA_NOTOWNED); in ng_ppp_rcvdata()
1458 mtx_unlock(&priv->rmtx); in ng_ppp_rcvdata()
1522 const priv_p priv = NG_NODE_PRIVATE(node); in ng_ppp_mp_recv() local
1523 struct ng_ppp_link *const link = &priv->links[linkNum]; in ng_ppp_mp_recv()
1530 if ((!priv->conf.enableMultilink) || proto != PROT_MP) { in ng_ppp_mp_recv()
1532 priv->bundleStats.recvFrames++; in ng_ppp_mp_recv()
1533 priv->bundleStats.recvOctets += NGI_M(item)->m_pkthdr.len; in ng_ppp_mp_recv()
1535 mtx_unlock(&priv->rmtx); in ng_ppp_mp_recv()
1542 if ((frag = TAILQ_FIRST(&priv->fragsfree)) == NULL) { in ng_ppp_mp_recv()
1549 if (priv->conf.recvShortSeq) { in ng_ppp_mp_recv()
1564 diff = MP_SHORT_SEQ_DIFF(frag->seq, priv->mseq); in ng_ppp_mp_recv()
1581 diff = MP_LONG_SEQ_DIFF(frag->seq, priv->mseq); in ng_ppp_mp_recv()
1596 priv->mseq = link->seq = frag->seq; in ng_ppp_mp_recv()
1597 for (i = 0; i < priv->numActiveLinks; i++) { in ng_ppp_mp_recv()
1599 &priv->links[priv->activeLinks[i]]; in ng_ppp_mp_recv()
1601 if (MP_RECV_SEQ_DIFF(priv, alink->seq, priv->mseq) < 0) in ng_ppp_mp_recv()
1602 priv->mseq = alink->seq; in ng_ppp_mp_recv()
1606 TAILQ_REMOVE(&priv->fragsfree, frag, f_qent); in ng_ppp_mp_recv()
1610 TAILQ_FOREACH_REVERSE(qent, &priv->frags, ng_ppp_fraglist, f_qent) { in ng_ppp_mp_recv()
1611 diff = MP_RECV_SEQ_DIFF(priv, frag->seq, qent->seq); in ng_ppp_mp_recv()
1613 TAILQ_INSERT_AFTER(&priv->frags, qent, frag, f_qent); in ng_ppp_mp_recv()
1619 TAILQ_INSERT_HEAD(&priv->fragsfree, frag, f_qent); in ng_ppp_mp_recv()
1624 TAILQ_INSERT_HEAD(&priv->frags, frag, f_qent); in ng_ppp_mp_recv()
1630 mtx_unlock(&priv->rmtx); in ng_ppp_mp_recv()
1634 mtx_unlock(&priv->rmtx); in ng_ppp_mp_recv()
1649 const priv_p priv = NG_NODE_PRIVATE(node); in ng_ppp_bump_mseq() local
1652 if (MP_RECV_SEQ_DIFF(priv, priv->mseq, new_mseq) < 0) { in ng_ppp_bump_mseq()
1653 priv->mseq = new_mseq; in ng_ppp_bump_mseq()
1654 for (i = 0; i < priv->numActiveLinks; i++) { in ng_ppp_bump_mseq()
1656 &priv->links[priv->activeLinks[i]]; in ng_ppp_bump_mseq()
1658 if (MP_RECV_SEQ_DIFF(priv, in ng_ppp_bump_mseq()
1673 const priv_p priv = NG_NODE_PRIVATE(node); in ng_ppp_check_packet() local
1677 if (TAILQ_EMPTY(&priv->frags)) in ng_ppp_check_packet()
1681 qent = TAILQ_FIRST(&priv->frags); in ng_ppp_check_packet()
1682 if (!qent->first || MP_RECV_SEQ_DIFF(priv, qent->seq, priv->mseq) > 1) in ng_ppp_check_packet()
1690 if (qnext->seq != MP_NEXT_RECV_SEQ(priv, qent->seq)) in ng_ppp_check_packet()
1706 const priv_p priv = NG_NODE_PRIVATE(node); in ng_ppp_get_packet() local
1710 qent = TAILQ_FIRST(&priv->frags); in ng_ppp_get_packet()
1711 KASSERT(!TAILQ_EMPTY(&priv->frags) && qent->first, in ng_ppp_get_packet()
1715 KASSERT(!TAILQ_EMPTY(&priv->frags), in ng_ppp_get_packet()
1717 TAILQ_REMOVE(&priv->frags, qent, f_qent); in ng_ppp_get_packet()
1731 TAILQ_INSERT_HEAD(&priv->fragsfree, qent, f_qent); in ng_ppp_get_packet()
1744 const priv_p priv = NG_NODE_PRIVATE(node); in ng_ppp_frag_trim() local
1753 if (TAILQ_EMPTY(&priv->frags)) in ng_ppp_frag_trim()
1757 TAILQ_FOREACH(qent, &priv->frags, f_qent) { in ng_ppp_frag_trim()
1758 if (MP_RECV_SEQ_DIFF(priv, qent->seq, priv->mseq) >= 0) in ng_ppp_frag_trim()
1763 if (qnext->seq != MP_NEXT_RECV_SEQ(priv, qent->seq) in ng_ppp_frag_trim()
1773 while ((qent = TAILQ_FIRST(&priv->frags)) != qnext) { in ng_ppp_frag_trim()
1774 KASSERT(!TAILQ_EMPTY(&priv->frags), in ng_ppp_frag_trim()
1776 priv->bundleStats.dropFragments++; in ng_ppp_frag_trim()
1777 TAILQ_REMOVE(&priv->frags, qent, f_qent); in ng_ppp_frag_trim()
1779 TAILQ_INSERT_HEAD(&priv->fragsfree, qent, f_qent); in ng_ppp_frag_trim()
1793 const priv_p priv = NG_NODE_PRIVATE(node); in ng_ppp_frag_drop() local
1796 if (TAILQ_EMPTY(&priv->fragsfree)) { in ng_ppp_frag_drop()
1800 KASSERT(!TAILQ_EMPTY(&priv->frags), in ng_ppp_frag_drop()
1802 qent = TAILQ_FIRST(&priv->frags); in ng_ppp_frag_drop()
1808 priv->bundleStats.dropFragments++; in ng_ppp_frag_drop()
1809 TAILQ_REMOVE(&priv->frags, qent, f_qent); in ng_ppp_frag_drop()
1811 TAILQ_INSERT_HEAD(&priv->fragsfree, qent, f_qent); in ng_ppp_frag_drop()
1824 const priv_p priv = NG_NODE_PRIVATE(node); in ng_ppp_frag_process() local
1836 priv->bundleStats.badProtos++; in ng_ppp_frag_process()
1849 priv->bundleStats.recvFrames++; in ng_ppp_frag_process()
1850 priv->bundleStats.recvOctets += in ng_ppp_frag_process()
1856 mtx_unlock(&priv->rmtx); in ng_ppp_frag_process()
1859 mtx_lock(&priv->rmtx); in ng_ppp_frag_process()
1887 const priv_p priv = NG_NODE_PRIVATE(node); in ng_ppp_frag_checkstale() local
1898 if (TAILQ_EMPTY(&priv->frags)) in ng_ppp_frag_checkstale()
1903 seq = TAILQ_FIRST(&priv->frags)->seq; in ng_ppp_frag_checkstale()
1904 TAILQ_FOREACH(qent, &priv->frags, f_qent) { in ng_ppp_frag_checkstale()
1913 seq = MP_NEXT_RECV_SEQ(priv, seq); in ng_ppp_frag_checkstale()
1931 while ((qent = TAILQ_FIRST(&priv->frags)) != beg) { in ng_ppp_frag_checkstale()
1932 KASSERT(!TAILQ_EMPTY(&priv->frags), in ng_ppp_frag_checkstale()
1934 priv->bundleStats.dropFragments++; in ng_ppp_frag_checkstale()
1935 TAILQ_REMOVE(&priv->frags, qent, f_qent); in ng_ppp_frag_checkstale()
1937 TAILQ_INSERT_HEAD(&priv->fragsfree, qent, f_qent); in ng_ppp_frag_checkstale()
1946 priv->bundleStats.badProtos++; in ng_ppp_frag_checkstale()
1954 priv->bundleStats.recvFrames++; in ng_ppp_frag_checkstale()
1955 priv->bundleStats.recvOctets += NGI_M(item)->m_pkthdr.len; in ng_ppp_frag_checkstale()
1987 const priv_p priv = NG_NODE_PRIVATE(node); in ng_ppp_mp_xmit() local
1988 const int hdr_len = priv->conf.xmitShortSeq ? 2 : 4; in ng_ppp_mp_xmit()
1998 if (priv->numActiveLinks == 0) { in ng_ppp_mp_xmit()
2006 if (!priv->conf.enableMultilink) { in ng_ppp_mp_xmit()
2008 priv->activeLinks[0], plen)); in ng_ppp_mp_xmit()
2012 if (plen > priv->conf.mrru) { in ng_ppp_mp_xmit()
2027 bzero(&distrib, priv->numActiveLinks * sizeof(distrib[0])); in ng_ppp_mp_xmit()
2029 mtx_lock(&priv->xmtx); in ng_ppp_mp_xmit()
2032 if (priv->conf.enableRoundRobin) { in ng_ppp_mp_xmit()
2033 activeLinkNum = priv->lastLink++ % priv->numActiveLinks; in ng_ppp_mp_xmit()
2039 if (priv->allLinksEqual) { in ng_ppp_mp_xmit()
2044 numFrags = priv->numActiveLinks; in ng_ppp_mp_xmit()
2055 distrib[priv->lastLink++ % priv->numActiveLinks] in ng_ppp_mp_xmit()
2067 for (activeLinkNum = priv->numActiveLinks - 1; in ng_ppp_mp_xmit()
2069 const uint16_t linkNum = priv->activeLinks[activeLinkNum]; in ng_ppp_mp_xmit()
2070 struct ng_ppp_link *const link = &priv->links[linkNum]; in ng_ppp_mp_xmit()
2077 seq = priv->xseq; in ng_ppp_mp_xmit()
2080 if (priv->conf.xmitShortSeq) { in ng_ppp_mp_xmit()
2081 priv->xseq = (seq + frags) & MP_SHORT_SEQ_MASK; in ng_ppp_mp_xmit()
2083 priv->xseq = (seq + frags) & MP_LONG_SEQ_MASK; in ng_ppp_mp_xmit()
2086 mtx_unlock(&priv->xmtx); in ng_ppp_mp_xmit()
2089 for (firstFragment = 1, activeLinkNum = priv->numActiveLinks - 1; in ng_ppp_mp_xmit()
2091 const uint16_t linkNum = priv->activeLinks[activeLinkNum]; in ng_ppp_mp_xmit()
2092 struct ng_ppp_link *const link = &priv->links[linkNum]; in ng_ppp_mp_xmit()
2122 if (priv->conf.xmitShortSeq) { in ng_ppp_mp_xmit()
2260 const priv_p priv = NG_NODE_PRIVATE(node); in ng_ppp_mp_strategy() local
2269 if (priv->numActiveLinks == 1) { in ng_ppp_mp_strategy()
2279 activeLinkNum < priv->numActiveLinks; activeLinkNum++) { in ng_ppp_mp_strategy()
2285 alink = &priv->links[priv->activeLinks[activeLinkNum]]; in ng_ppp_mp_strategy()
2317 qsort_r(sortByLatency, priv->numActiveLinks, sizeof(*sortByLatency), in ng_ppp_mp_strategy()
2322 numFragments < priv->numActiveLinks; numFragments++) { in ng_ppp_mp_strategy()
2328 total += ((flowTime * priv->links[ in ng_ppp_mp_strategy()
2329 priv->activeLinks[sortByLatency[i]]].conf.bandwidth) in ng_ppp_mp_strategy()
2338 int bw = priv->links[ in ng_ppp_mp_strategy()
2339 priv->activeLinks[sortByLatency[i]]].conf.bandwidth; in ng_ppp_mp_strategy()
2348 int bw = priv->links[ in ng_ppp_mp_strategy()
2349 priv->activeLinks[sortByLatency[i]]].conf.bandwidth; in ng_ppp_mp_strategy()
2359 &priv->links[priv->activeLinks[sortByLatency[0]]]; in ng_ppp_mp_strategy()
2365 &priv->links[priv->activeLinks[sortByLatency[i]]]; in ng_ppp_mp_strategy()
2375 &priv->links[priv->activeLinks[sortByLatency[0]]]; in ng_ppp_mp_strategy()
2381 &priv->links[priv->activeLinks[sortByLatency[i]]]; in ng_ppp_mp_strategy()
2471 const priv_p priv = NG_NODE_PRIVATE(node); in ng_ppp_update() local
2475 priv->vjCompHooked = priv->hooks[HOOK_INDEX_VJC_IP] != NULL in ng_ppp_update()
2476 && priv->hooks[HOOK_INDEX_VJC_COMP] != NULL in ng_ppp_update()
2477 && priv->hooks[HOOK_INDEX_VJC_UNCOMP] != NULL in ng_ppp_update()
2478 && priv->hooks[HOOK_INDEX_VJC_VJIP] != NULL; in ng_ppp_update()
2485 if (priv->links[i].conf.bandwidth == 0) in ng_ppp_update()
2489 + (priv->links[i].conf.enableACFComp ? 0 : 2) in ng_ppp_update()
2490 + (priv->links[i].conf.enableProtoComp ? 1 : 2) in ng_ppp_update()
2491 + (priv->conf.xmitShortSeq ? 2 : 4); in ng_ppp_update()
2492 priv->links[i].latency = in ng_ppp_update()
2493 priv->links[i].conf.latency + in ng_ppp_update()
2494 (hdrBytes / priv->links[i].conf.bandwidth + 50) / 100; in ng_ppp_update()
2499 bzero(&priv->activeLinks, sizeof(priv->activeLinks)); in ng_ppp_update()
2500 priv->numActiveLinks = 0; in ng_ppp_update()
2501 priv->allLinksEqual = 1; in ng_ppp_update()
2503 struct ng_ppp_link *const link = &priv->links[i]; in ng_ppp_update()
2510 priv->activeLinks[priv->numActiveLinks++] = i; in ng_ppp_update()
2511 link0 = &priv->links[priv->activeLinks[0]]; in ng_ppp_update()
2516 priv->allLinksEqual = 0; in ng_ppp_update()
2528 if (priv->conf.enableMultilink && priv->numActiveLinks > 0) in ng_ppp_update()
2533 priv->xseq = MP_INITIAL_SEQ; in ng_ppp_update()
2534 priv->mseq = MP_INITIAL_SEQ; in ng_ppp_update()
2536 struct ng_ppp_link *const link = &priv->links[i]; in ng_ppp_update()
2544 if (priv->hooks[HOOK_INDEX_INET] != NULL) { in ng_ppp_update()
2545 if (priv->conf.enableIP == 1 && in ng_ppp_update()
2546 priv->numActiveLinks == 1 && in ng_ppp_update()
2547 priv->conf.enableMultilink == 0 && in ng_ppp_update()
2548 priv->conf.enableCompression == 0 && in ng_ppp_update()
2549 priv->conf.enableEncryption == 0 && in ng_ppp_update()
2550 priv->conf.enableVJCompression == 0) in ng_ppp_update()
2551 NG_HOOK_SET_RCVDATA(priv->hooks[HOOK_INDEX_INET], in ng_ppp_update()
2554 NG_HOOK_SET_RCVDATA(priv->hooks[HOOK_INDEX_INET], in ng_ppp_update()
2566 const priv_p priv = NG_NODE_PRIVATE(node); in ng_ppp_config_valid() local
2571 if (newConf->links[i].enableLink && priv->links[i].hook != NULL) in ng_ppp_config_valid()
2586 if (priv->numActiveLinks > 0 && newNumLinksActive > 0) { in ng_ppp_config_valid()
2587 if (!priv->conf.enableMultilink in ng_ppp_config_valid()
2589 || !priv->conf.xmitShortSeq != !newConf->bund.xmitShortSeq in ng_ppp_config_valid()
2590 || !priv->conf.recvShortSeq != !newConf->bund.recvShortSeq) in ng_ppp_config_valid()
2608 const priv_p priv = NG_NODE_PRIVATE(node); in ng_ppp_frag_reset() local
2611 for (qent = TAILQ_FIRST(&priv->frags); qent; qent = qnext) { in ng_ppp_frag_reset()
2614 TAILQ_INSERT_HEAD(&priv->fragsfree, qent, f_qent); in ng_ppp_frag_reset()
2616 TAILQ_INIT(&priv->frags); in ng_ppp_frag_reset()
2625 const priv_p priv = NG_NODE_PRIVATE(node); in ng_ppp_start_frag_timer() local
2627 if (!(callout_pending(&priv->fragTimer))) in ng_ppp_start_frag_timer()
2628 ng_callout(&priv->fragTimer, node, NULL, MP_FRAGTIMER_INTERVAL, in ng_ppp_start_frag_timer()
2638 const priv_p priv = NG_NODE_PRIVATE(node); in ng_ppp_stop_frag_timer() local
2640 if (callout_pending(&priv->fragTimer)) in ng_ppp_stop_frag_timer()
2641 ng_uncallout(&priv->fragTimer, node); in ng_ppp_stop_frag_timer()