97#include <sys/kernel.h>
98#include <sys/limits.h>
101#include <sys/malloc.h>
102#include <sys/endian.h>
103#include <sys/errno.h>
104#include <sys/ctype.h>
112#ifdef NG_SEPARATE_MALLOC
115#define M_NETGRAPH_PPP M_NETGRAPH
118#define PROT_VALID(p) (((p) & 0x0101) == 0x0001)
119#define PROT_COMPRESSABLE(p) (((p) & 0xff00) == 0x0000)
122#define PROT_ATALK 0x0029
123#define PROT_COMPD 0x00fd
124#define PROT_CRYPTD 0x0053
125#define PROT_IP 0x0021
126#define PROT_IPV6 0x0057
127#define PROT_IPX 0x002b
128#define PROT_LCP 0xc021
129#define PROT_MP 0x003d
130#define PROT_VJCOMP 0x002d
131#define PROT_VJUNCOMP 0x002f
134#define MP_INITIAL_SEQ 0
135#define MP_MIN_LINK_MRU 32
137#define MP_SHORT_SEQ_MASK 0x00000fff
138#define MP_SHORT_SEQ_HIBIT 0x00000800
139#define MP_SHORT_FIRST_FLAG 0x00008000
140#define MP_SHORT_LAST_FLAG 0x00004000
142#define MP_LONG_SEQ_MASK 0x00ffffff
143#define MP_LONG_SEQ_HIBIT 0x00800000
144#define MP_LONG_FIRST_FLAG 0x80000000
145#define MP_LONG_LAST_FLAG 0x40000000
147#define MP_NOSEQ 0x7fffffff
150#define MP_SHORT_EXTEND(s) (((s) & MP_SHORT_SEQ_HIBIT) ? \
151 ((s) | ~MP_SHORT_SEQ_MASK) \
152 : ((s) & MP_SHORT_SEQ_MASK))
153#define MP_LONG_EXTEND(s) (((s) & MP_LONG_SEQ_HIBIT) ? \
154 ((s) | ~MP_LONG_SEQ_MASK) \
155 : ((s) & MP_LONG_SEQ_MASK))
159#define MP_SHORT_SEQ_DIFF(x,y) MP_SHORT_EXTEND((x) - (y))
160#define MP_LONG_SEQ_DIFF(x,y) MP_LONG_EXTEND((x) - (y))
162#define MP_RECV_SEQ_DIFF(priv,x,y) \
163 ((priv)->conf.recvShortSeq ? \
164 MP_SHORT_SEQ_DIFF((x), (y)) : \
165 MP_LONG_SEQ_DIFF((x), (y)))
168#define MP_NEXT_RECV_SEQ(priv,seq) \
169 ((priv)->conf.recvShortSeq ? \
170 MP_SHORT_EXTEND((seq) + 1) : \
171 MP_LONG_EXTEND((seq) + 1))
174#define MP_MIN_FRAG_LEN 32
177#define MP_MAX_QUEUE_LEN 128
180#define MP_FRAGTIMER_INTERVAL (hz/2)
183#define MP_AVERAGE_LINK_OVERHEAD 16
186#define HOOK_INDEX_MAX 13
227 struct callout fragTimer;
264#define HOOK_INDEX_ATALK 0
266#define HOOK_INDEX_BYPASS 1
268#define HOOK_INDEX_COMPRESS 2
270#define HOOK_INDEX_ENCRYPT 3
272#define HOOK_INDEX_DECOMPRESS 4
274#define HOOK_INDEX_DECRYPT 5
276#define HOOK_INDEX_INET 6
278#define HOOK_INDEX_IPX 7
280#define HOOK_INDEX_VJC_COMP 8
282#define HOOK_INDEX_VJC_IP 9
284#define HOOK_INDEX_VJC_UNCOMP 10
286#define HOOK_INDEX_VJC_VJIP 11
288#define HOOK_INDEX_IPV6 12
309 uint16_t linkNum,
int plen);
325static int ng_ppp_intcmp(
void *latency,
const void *v1,
const void *v2);
326static struct mbuf *
ng_ppp_addproto(
struct mbuf *m, uint16_t proto,
int compOK);
328static struct mbuf *
ng_ppp_prepend(
struct mbuf *m,
const void *buf,
int len);
480#define ERROUT(x) do { error = (x); goto done; } while (0)
501 TAILQ_INIT(&
priv->frags);
502 TAILQ_INIT(&
priv->fragsfree);
504 TAILQ_INSERT_TAIL(&
priv->fragsfree, &
priv->fragsmem[i], f_qent);
509 mtx_init(&
priv->rmtx,
"ng_ppp_recv", NULL, MTX_DEF);
510 mtx_init(&
priv->xmtx,
"ng_ppp_xmit", NULL, MTX_DEF);
534 if (!isdigit(*cp) || (cp[0] ==
'0' && cp[1] !=
'\0'))
536 linkNum = (int)strtoul(cp, &eptr, 10);
539 hookPtr = &
priv->links[linkNum].hook;
540 hookIndex = ~linkNum;
543 if (*hookPtr != NULL)
547 if (
priv->links[linkNum].conf.enableLink &&
548 !
priv->conf.enableMultilink &&
priv->numActiveLinks >= 1)
556 hookPtr = &
priv->hooks[i];
565 if (*hookPtr != NULL)
636 bzero(info,
sizeof(*info));
657 linkNum = *((uint16_t *) msg->
data);
744 mtx_destroy(&
priv->rmtx);
745 mtx_destroy(&
priv->xmtx);
765 priv->links[~index].hook = NULL;
767 priv->hooks[index] = NULL;
791 if (!
priv->conf.enableIP) {
808 NGI_M(item)->m_pkthdr.len));
820 if (!
priv->conf.enableIPv6) {
836 if (!
priv->conf.enableAtalk) {
852 if (!
priv->conf.enableIPX) {
870 if (m->m_pkthdr.len < 4) {
874 if (m->m_len < 4 && (m = m_pullup(m, 4)) == NULL) {
878 linkNum = be16dec(mtod(m, uint8_t *));
879 proto = be16dec(mtod(m, uint8_t *) + 2);
904 hdr[0] = htons(linkNum);
905 hdr[1] = htons(proto);
925#ifdef ALIGNED_POINTER
929 if (!ALIGNED_POINTER(mtod(m, caddr_t), uint32_t)) {
930 n = m_defrag(m, M_NOWAIT);
942 if (
priv->conf.enableIP)
946 if (
priv->conf.enableIPv6)
950 if (
priv->conf.enableAtalk)
954 if (
priv->conf.enableIPX)
977 priv->conf.enableVJCompression &&
978 priv->vjCompHooked) {
998 if (!
priv->conf.enableVJCompression) {
1014 if (!
priv->conf.enableVJCompression) {
1030 if (!
priv->conf.enableVJCompression) {
1042 if (
priv->conf.enableVJDecompression &&
priv->vjCompHooked) {
1075 if (!
priv->conf.enableVJDecompression) {
1091 if (
priv->conf.enableCompression &&
1124 switch (
priv->conf.enableCompression) {
1156 if (proto < 0x4000 &&
1196 if (!
priv->conf.enableDecompression) {
1207 priv->bundleStats.badProtos++;
1223 if (
priv->conf.enableEncryption &&
1254 if (!
priv->conf.enableEncryption) {
1267 if (
priv->conf.enableDecryption &&
1296 if (!
priv->conf.enableDecryption) {
1307 priv->bundleStats.badProtos++;
1333 link = &
priv->links[linkNum];
1336 if (link->
hook == NULL) {
1345 if (mru != 0 && m->m_pkthdr.len > mru) {
1363 len = m->m_pkthdr.len;
1366 mtx_lock(&
priv->xmtx);
1374 priv->bundleStats.xmitFrames++;
1375 priv->bundleStats.xmitOctets += plen;
1381 if (
priv->conf.enableMultilink && !
priv->allLinksEqual &&
1382 !
priv->conf.enableRoundRobin) {
1393 mtx_unlock(&
priv->xmtx);
1410 const uint16_t linkNum = (uint16_t)~index;
1417 (
"%s: bogus index 0x%x", __func__, index));
1421 mtx_lock(&
priv->rmtx);
1428 if (m->m_len < 2 && (m = m_pullup(m, 2)) == NULL)
1430 if (mtod(m, uint8_t *)[0] == 0xff &&
1431 mtod(m, uint8_t *)[1] == 0x03)
1445 if (proto >= 0xB000) {
1446 mtx_unlock(&
priv->rmtx);
1456 mtx_assert(&
priv->rmtx, MA_NOTOWNED);
1460 mtx_unlock(&
priv->rmtx);
1528 int i, diff, inserted;
1532 if ((!
priv->conf.enableMultilink) || proto !=
PROT_MP) {
1534 priv->bundleStats.recvFrames++;
1535 priv->bundleStats.recvOctets +=
NGI_M(item)->m_pkthdr.len;
1537 mtx_unlock(&
priv->rmtx);
1544 if ((frag = TAILQ_FIRST(&
priv->fragsfree)) == NULL) {
1545 printf(
"No free fragments headers in ng_ppp!\n");
1551 if (
priv->conf.recvShortSeq) {
1554 if (m->m_pkthdr.len < 2) {
1559 if (m->m_len < 2 && (m = m_pullup(m, 2)) == NULL)
1562 shdr = be16dec(mtod(m,
void *));
1571 if (m->m_pkthdr.len < 4) {
1576 if (m->m_len < 4 && (m = m_pullup(m, 4)) == NULL)
1579 lhdr = be32dec(mtod(m,
void *));
1599 for (i = 0; i <
priv->numActiveLinks; i++) {
1601 &
priv->links[
priv->activeLinks[i]];
1608 TAILQ_REMOVE(&
priv->fragsfree, frag, f_qent);
1612 TAILQ_FOREACH_REVERSE(qent, &
priv->frags, ng_ppp_fraglist, f_qent) {
1615 TAILQ_INSERT_AFTER(&
priv->frags, qent, frag, f_qent);
1618 }
else if (diff == 0) {
1621 TAILQ_INSERT_HEAD(&
priv->fragsfree, frag, f_qent);
1626 TAILQ_INSERT_HEAD(&
priv->frags, frag, f_qent);
1632 mtx_unlock(&
priv->rmtx);
1636 mtx_unlock(&
priv->rmtx);
1655 priv->mseq = new_mseq;
1656 for (i = 0; i <
priv->numActiveLinks; i++) {
1658 &
priv->links[
priv->activeLinks[i]];
1661 alink->
seq, new_mseq) < 0)
1662 alink->
seq = new_mseq;
1679 if (TAILQ_EMPTY(&
priv->frags))
1683 qent = TAILQ_FIRST(&
priv->frags);
1688 while (!qent->
last) {
1689 qnext = TAILQ_NEXT(qent, f_qent);
1710 struct mbuf *m = NULL, *tail;
1712 qent = TAILQ_FIRST(&
priv->frags);
1713 KASSERT(!TAILQ_EMPTY(&
priv->frags) && qent->
first,
1714 (
"%s: no packet", __func__));
1715 for (tail = NULL; qent != NULL; qent = qnext) {
1716 qnext = TAILQ_NEXT(qent, f_qent);
1717 KASSERT(!TAILQ_EMPTY(&
priv->frags),
1718 (
"%s: empty q", __func__));
1719 TAILQ_REMOVE(&
priv->frags, qent, f_qent);
1721 tail = m = qent->
data;
1723 m->m_pkthdr.len += qent->
data->m_pkthdr.len;
1724 tail->m_next = qent->
data;
1726 while (tail->m_next != NULL)
1727 tail = tail->m_next;
1733 TAILQ_INSERT_HEAD(&
priv->fragsfree, qent, f_qent);
1755 if (TAILQ_EMPTY(&
priv->frags))
1759 TAILQ_FOREACH(qent, &
priv->frags, f_qent) {
1762 qnext = TAILQ_NEXT(qent, f_qent);
1763 KASSERT(qnext != NULL,
1764 (
"%s: last frag < MSEQ?", __func__));
1775 while ((qent = TAILQ_FIRST(&
priv->frags)) != qnext) {
1776 KASSERT(!TAILQ_EMPTY(&
priv->frags),
1777 (
"%s: empty q", __func__));
1778 priv->bundleStats.dropFragments++;
1779 TAILQ_REMOVE(&
priv->frags, qent, f_qent);
1781 TAILQ_INSERT_HEAD(&
priv->fragsfree, qent, f_qent);
1798 if (TAILQ_EMPTY(&
priv->fragsfree)) {
1802 KASSERT(!TAILQ_EMPTY(&
priv->frags),
1803 (
"%s: empty q", __func__));
1804 qent = TAILQ_FIRST(&
priv->frags);
1810 priv->bundleStats.dropFragments++;
1811 TAILQ_REMOVE(&
priv->frags, qent, f_qent);
1813 TAILQ_INSERT_HEAD(&
priv->fragsfree, qent, f_qent);
1838 priv->bundleStats.badProtos++;
1851 priv->bundleStats.recvFrames++;
1852 priv->bundleStats.recvOctets +=
1853 NGI_M(item)->m_pkthdr.len;
1858 mtx_unlock(&
priv->rmtx);
1861 mtx_lock(&
priv->rmtx);
1891 struct timeval now, age;
1901 if (TAILQ_EMPTY(&
priv->frags))
1906 seq = TAILQ_FIRST(&
priv->frags)->
seq;
1907 TAILQ_FOREACH(qent, &
priv->frags, f_qent) {
1910 else if (qent->
seq != seq)
1912 if (beg != NULL && qent->
last) {
1924 if (now.tv_sec == 0)
1925 getmicrouptime(&now);
1934 while ((qent = TAILQ_FIRST(&
priv->frags)) != beg) {
1935 KASSERT(!TAILQ_EMPTY(&
priv->frags),
1936 (
"%s: empty q", __func__));
1937 priv->bundleStats.dropFragments++;
1938 TAILQ_REMOVE(&
priv->frags, qent, f_qent);
1940 TAILQ_INSERT_HEAD(&
priv->fragsfree, qent, f_qent);
1950 priv->bundleStats.badProtos++;
1958 priv->bundleStats.recvFrames++;
1959 priv->bundleStats.recvOctets +=
NGI_M(item)->m_pkthdr.len;
1992 const int hdr_len =
priv->conf.xmitShortSeq ? 2 : 4;
2002 if (
priv->numActiveLinks == 0) {
2008 plen =
NGI_M(item)->m_pkthdr.len;
2010 if (!
priv->conf.enableMultilink) {
2012 priv->activeLinks[0], plen));
2016 if (plen >
priv->conf.mrru) {
2031 bzero(&distrib,
priv->numActiveLinks *
sizeof(distrib[0]));
2033 mtx_lock(&
priv->xmtx);
2036 if (
priv->conf.enableRoundRobin) {
2037 activeLinkNum =
priv->lastLink++ %
priv->numActiveLinks;
2038 distrib[activeLinkNum] = m->m_pkthdr.len;
2043 if (
priv->allLinksEqual) {
2044 int numFrags, fraction, remain;
2048 numFrags =
priv->numActiveLinks;
2054 fraction = m->m_pkthdr.len / numFrags;
2055 remain = m->m_pkthdr.len - (fraction * numFrags);
2058 for (i = 0; i < numFrags; i++) {
2059 distrib[
priv->lastLink++ %
priv->numActiveLinks]
2060 = fraction + (((remain--) > 0)?1:0);
2071 for (activeLinkNum =
priv->numActiveLinks - 1;
2072 activeLinkNum >= 0; activeLinkNum--) {
2073 const uint16_t linkNum =
priv->activeLinks[activeLinkNum];
2076 frags += (distrib[activeLinkNum] + link->
conf.
mru - hdr_len - 1) /
2084 if (
priv->conf.xmitShortSeq) {
2090 mtx_unlock(&
priv->xmtx);
2093 for (firstFragment = 1, activeLinkNum =
priv->numActiveLinks - 1;
2094 activeLinkNum >= 0; activeLinkNum--) {
2095 const uint16_t linkNum =
priv->activeLinks[activeLinkNum];
2099 for ( ; distrib[activeLinkNum] > 0; firstFragment = 0) {
2100 int len, lastFragment, error;
2104 len = distrib[activeLinkNum];
2105 if (len > link->
conf.
mru - hdr_len)
2106 len = link->
conf.
mru - hdr_len;
2107 distrib[activeLinkNum] -= len;
2108 lastFragment = (len == m->m_pkthdr.len);
2112 if (!lastFragment) {
2113 struct mbuf *n = m_split(m, len, M_NOWAIT);
2121 m_tag_copy_chain(n, m, M_NOWAIT);
2126 if (
priv->conf.xmitShortSeq) {
2158 if (firstFragment) {
2165 linkNum, (firstFragment?plen:0));
2268 int t0, total, topSum, botSum;
2270 int i, numFragments;
2273 if (
priv->numActiveLinks == 1) {
2279 getmicrouptime(&now);
2282 for (activeLinkNum = 0;
2283 activeLinkNum <
priv->numActiveLinks; activeLinkNum++) {
2285 struct timeval diff;
2289 alink = &
priv->links[
priv->activeLinks[activeLinkNum]];
2290 latency[activeLinkNum] = alink->
latency;
2291 sortByLatency[activeLinkNum] = activeLinkNum;
2304 if (now.tv_sec < 0 || diff.tv_sec >= 10) {
2316 latency[activeLinkNum] +=
2321 qsort_r(sortByLatency,
2325 for (numFragments = 1;
2326 numFragments <
priv->numActiveLinks; numFragments++) {
2327 for (total = i = 0; i < numFragments; i++) {
2330 flowTime = latency[sortByLatency[numFragments]]
2331 - latency[sortByLatency[i]];
2332 total += ((flowTime *
priv->links[
2333 priv->activeLinks[sortByLatency[i]]].conf.bandwidth)
2341 for (topSum = botSum = i = 0; i < numFragments; i++) {
2342 int bw =
priv->links[
2343 priv->activeLinks[sortByLatency[i]]].conf.bandwidth;
2345 topSum += latency[sortByLatency[i]] * bw;
2348 t0 = ((len * 100) + topSum + botSum / 2) / botSum;
2351 for (total = i = 0; i < numFragments; i++) {
2352 int bw =
priv->links[
2353 priv->activeLinks[sortByLatency[i]]].conf.bandwidth;
2355 distrib[sortByLatency[i]] =
2356 (bw * (t0 - latency[sortByLatency[i]]) + 50) / 100;
2357 total += distrib[sortByLatency[i]];
2363 &
priv->links[
priv->activeLinks[sortByLatency[0]]];
2367 for (i = 1; i < numFragments; i++) {
2369 &
priv->links[
priv->activeLinks[sortByLatency[i]]];
2376 distrib[sortByLatency[fast]] += len - total;
2377 }
else while (total > len) {
2379 &
priv->links[
priv->activeLinks[sortByLatency[0]]];
2380 int delta, slow = 0;
2383 for (i = 1; i < numFragments; i++) {
2385 &
priv->links[
priv->activeLinks[sortByLatency[i]]];
2387 if (distrib[sortByLatency[slow]] == 0 ||
2388 (distrib[sortByLatency[i]] > 0 &&
2394 delta = total - len;
2395 if (delta > distrib[sortByLatency[slow]])
2396 delta = distrib[sortByLatency[slow]];
2397 distrib[sortByLatency[slow]] -= delta;
2408 const int index1 = *((
const int *) v1);
2409 const int index2 = *((
const int *) v2);
2421 uint8_t pbyte = (uint8_t)proto;
2425 uint16_t pword = htons((uint16_t)proto);
2439 if (m->m_len < 1 && (m = m_pullup(m, 1)) == NULL)
2442 *proto = *mtod(m, uint8_t *);
2446 if (m->m_len < 1 && (m = m_pullup(m, 1)) == NULL)
2449 *proto = (*proto << 8) + *mtod(m, uint8_t *);
2462 M_PREPEND(m, len, M_NOWAIT);
2463 if (m == NULL || (m->m_len < len && (m = m_pullup(m, len)) == NULL))
2465 bcopy(buf, mtod(m, uint8_t *), len);
2489 if (
priv->links[i].conf.bandwidth == 0)
2493 + (
priv->links[i].conf.enableACFComp ? 0 : 2)
2494 + (
priv->links[i].conf.enableProtoComp ? 1 : 2)
2495 + (
priv->conf.xmitShortSeq ? 2 : 4);
2496 priv->links[i].latency =
2497 priv->links[i].conf.latency +
2498 (hdrBytes /
priv->links[i].conf.bandwidth + 50) / 100;
2503 bzero(&
priv->activeLinks,
sizeof(
priv->activeLinks));
2504 priv->numActiveLinks = 0;
2505 priv->allLinksEqual = 1;
2514 priv->activeLinks[
priv->numActiveLinks++] = i;
2515 link0 = &
priv->links[
priv->activeLinks[0]];
2520 priv->allLinksEqual = 0;
2524 link->
seq = (link == link0) ?
2532 if (
priv->conf.enableMultilink &&
priv->numActiveLinks > 0)
2549 if (
priv->conf.enableIP == 1 &&
2550 priv->numActiveLinks == 1 &&
2551 priv->conf.enableMultilink == 0 &&
2552 priv->conf.enableCompression == 0 &&
2553 priv->conf.enableEncryption == 0 &&
2554 priv->conf.enableVJCompression == 0)
2571 int i, newNumLinksActive;
2576 newNumLinksActive++;
2590 if (
priv->numActiveLinks > 0 && newNumLinksActive > 0) {
2591 if (!
priv->conf.enableMultilink
2615 for (qent = TAILQ_FIRST(&
priv->frags); qent; qent = qnext) {
2616 qnext = TAILQ_NEXT(qent, f_qent);
2618 TAILQ_INSERT_HEAD(&
priv->fragsfree, qent, f_qent);
2620 TAILQ_INIT(&
priv->frags);
2631 if (!(callout_pending(&
priv->fragTimer)))
2644 if (callout_pending(&
priv->fragTimer))
#define NG_HOOK_NODE(hook)
#define NG_NODE_NOT_VALID(node)
int ng_rcvmsg_t(node_p node, item_p item, hook_p lasthook)
#define NG_FWD_ITEM_HOOK(error, item, hook)
int ng_disconnect_t(hook_p hook)
#define NG_NODE_SET_PRIVATE(node, val)
#define NG_RESPOND_MSG(error, here, item, resp)
#define NG_NODE_IS_VALID(node)
#define NG_NODE_UNREF(node)
#define NG_HOOK_SET_PRIVATE(hook, val)
int ng_rmnode_self(node_p here)
#define ng_callout_init(c)
item_p ng_package_data(struct mbuf *m, int flags)
#define NG_FWD_NEW_DATA(error, item, hook, m)
int ng_rcvdata_t(hook_p hook, item_p item)
int ng_shutdown_t(node_p node)
int ng_uncallout(struct callout *c, node_p node)
#define NG_FREE_ITEM(item)
#define NG_HOOK_SET_RCVDATA(hook, val)
int ng_constructor_t(node_p node)
#define NG_NODE_NUMHOOKS(node)
#define NGI_GET_MSG(i, m)
#define NG_NODE_PRIVATE(node)
int ng_callout(struct callout *c, node_p node, hook_p hook, int ticks, ng_item_fn *fn, void *arg1, int arg2)
int ng_newhook_t(node_p node, hook_p hook, const char *name)
#define NG_HOOK_PRIVATE(hook)
MALLOC_DEFINE(M_NG_CCATM, "ng_ccatm", "netgraph uni api node")
#define NG_MKRESPONSE(rsp, msg, len, how)
const struct ng_parse_type ng_parse_fixedarray_type
const struct ng_parse_type ng_parse_struct_type
const struct ng_parse_type ng_parse_hint32_type
const struct ng_parse_type ng_parse_int16_type
static struct ng_type ng_ppp_typestruct
static ng_rcvdata_t ng_ppp_rcvdata_inet_fast
#define MP_RECV_SEQ_DIFF(priv, x, y)
static void ng_ppp_mp_strategy(node_p node, int len, int *distrib)
#define HOOK_INDEX_VJC_VJIP
static ng_rcvdata_t ng_ppp_rcvdata_encrypt
static const struct @55 ng_ppp_hook_names[]
static const struct timeval ng_ppp_max_staleness
static ng_constructor_t ng_ppp_constructor
static int ng_ppp_intcmp(void *latency, const void *v1, const void *v2)
#define MP_LONG_SEQ_DIFF(x, y)
static int ng_ppp_proto_recv(node_p node, item_p item, uint16_t proto, uint16_t linkNum)
#define HOOK_INDEX_VJC_UNCOMP
#define MP_SHORT_EXTEND(s)
static const struct ng_parse_type ng_ppp_stats_type
static const struct ng_parse_type ng_ppp_link_array_type
static ng_rcvdata_t ng_ppp_rcvdata_vjc_vjip
#define MP_LONG_LAST_FLAG
static int ng_ppp_link_xmit(node_p node, item_p item, uint16_t proto, uint16_t linkNum, int plen)
static const struct ng_parse_type ng_ppp_link_type
#define MP_SHORT_SEQ_DIFF(x, y)
#define MP_FRAGTIMER_INTERVAL
struct ng_ppp_private * priv_p
static const struct ng_parse_struct_field ng_ppp_mp_state_type_fields[]
static ng_rcvdata_t ng_ppp_rcvdata_bypass
static struct mbuf * ng_ppp_cutproto(struct mbuf *m, uint16_t *proto)
#define MP_LONG_FIRST_FLAG
static ng_rcvdata_t ng_ppp_rcvdata_atalk
#define MP_AVERAGE_LINK_OVERHEAD
static int ng_ppp_config_valid(node_p node, const struct ng_ppp_node_conf *newConf)
#define HOOK_INDEX_VJC_IP
static ng_rcvdata_t ng_ppp_rcvdata_vjc_uncomp
static int ng_ppp_crypt_recv(node_p node, item_p item, uint16_t proto, uint16_t linkNum)
static int ng_ppp_frag_trim(node_p node)
static const uint8_t ng_ppp_acf[2]
#define HOOK_INDEX_VJC_COMP
static ng_shutdown_t ng_ppp_shutdown
static ng_rcvdata_t ng_ppp_rcvdata_ipv6
static void ng_ppp_stop_frag_timer(node_p node)
#define MP_LONG_EXTEND(s)
static int ng_ppp_comp_xmit(node_p node, item_p item, uint16_t proto)
static ng_rcvdata_t ng_ppp_rcvdata_vjc_ip
static int ng_ppp_hcomp_recv(node_p node, item_p item, uint16_t proto, uint16_t linkNum)
#define HOOK_INDEX_COMPRESS
static const struct ng_parse_type ng_ppp_bund_type
static ng_rcvdata_t ng_ppp_rcvdata_decompress
static const struct ng_parse_fixedarray_info ng_ppp_array_info
static ng_rcvdata_t ng_ppp_rcvdata_inet
#define MP_SHORT_SEQ_MASK
static void ng_ppp_start_frag_timer(node_p node)
static const struct ng_parse_struct_field ng_ppp_stats_type_fields[]
static struct mbuf * ng_ppp_prepend(struct mbuf *m, const void *buf, int len)
static void ng_ppp_bump_mseq(node_p node, int32_t new_mseq)
#define MP_SHORT_LAST_FLAG
static const struct ng_parse_fixedarray_info ng_ppp_rseq_array_info
static int ng_ppp_hcomp_xmit(node_p node, item_p item, uint16_t proto)
#define HOOK_INDEX_DECOMPRESS
static const struct ng_parse_type ng_ppp_stats64_type
static void ng_ppp_frag_checkstale(node_p node)
static ng_rcvdata_t ng_ppp_rcvdata_ipx
static const struct ng_parse_type ng_ppp_conf_type
#define HOOK_INDEX_ENCRYPT
static int ng_ppp_frag_drop(node_p node)
static const struct ng_parse_struct_field ng_ppp_bund_type_fields[]
static int ng_ppp_check_packet(node_p node)
static ng_rcvmsg_t ng_ppp_rcvmsg
static ng_newhook_t ng_ppp_newhook
static const struct ng_parse_struct_field ng_ppp_link_type_fields[]
static const struct ng_cmdlist ng_ppp_cmds[]
static void ng_ppp_frag_reset(node_p node)
static int ng_ppp_crypt_xmit(node_p node, item_p item, uint16_t proto)
static const struct ng_parse_type ng_ppp_rseq_array_type
static int ng_ppp_mp_xmit(node_p node, item_p item, uint16_t proto)
#define HOOK_INDEX_DECRYPT
#define MP_NEXT_RECV_SEQ(priv, seq)
static const struct ng_parse_struct_field ng_ppp_stats64_type_fields[]
static int ng_ppp_comp_recv(node_p node, item_p item, uint16_t proto, uint16_t linkNum)
static ng_rcvdata_t ng_ppp_rcvdata
static void ng_ppp_get_packet(node_p node, struct mbuf **mp)
static const struct ng_parse_struct_field ng_ppp_conf_type_fields[]
#define HOOK_INDEX_BYPASS
#define PROT_COMPRESSABLE(p)
static void ng_ppp_update(node_p node, int newConf)
static int ng_ppp_mp_recv(node_p node, item_p item, uint16_t proto, uint16_t linkNum)
static ng_rcvdata_t ng_ppp_rcvdata_compress
static const struct ng_parse_type ng_ppp_mp_state_type
static int ng_ppp_frag_process(node_p node, item_p oitem)
static ng_rcvdata_t ng_ppp_rcvdata_vjc_comp
#define MP_SHORT_FIRST_FLAG
NETGRAPH_INIT(ppp, &ng_ppp_typestruct)
static int ng_ppp_bypass(node_p node, item_p item, uint16_t proto, uint16_t linkNum)
static struct mbuf * ng_ppp_addproto(struct mbuf *m, uint16_t proto, int compOK)
static ng_disconnect_t ng_ppp_disconnect
static ng_rcvdata_t ng_ppp_rcvdata_decrypt
static void ng_ppp_frag_timeout(node_p node, hook_p hook, void *arg1, int arg2)
#define NG_PPP_STATS_TYPE_INFO
#define NG_PPP_LINK_TYPE_INFO
#define NG_PPP_HOOK_VJC_COMP
#define NG_PPP_HOOK_DECOMPRESS
#define NG_PPP_CONFIG_TYPE_INFO(bctype, arytype)
#define NG_PPP_BUND_TYPE_INFO
#define NG_PPP_HOOK_DECRYPT
#define NG_PPP_HOOK_VJC_VJIP
#define NG_PPP_HOOK_VJC_IP
#define NG_PPP_BUNDLE_LINKNUM
#define NG_PPP_HOOK_VJC_UNCOMP
#define NG_PPP_HOOK_ENCRYPT
#define NG_PPP_HOOK_COMPRESS
#define NG_PPP_HOOK_BYPASS
#define NG_PPP_STATS64_TYPE_INFO
#define NG_PPP_HOOK_LINK_PREFIX
#define NG_PPP_MAX_BANDWIDTH
#define NG_PPP_HOOK_ATALK
#define NG_PPP_MAX_LATENCY
@ NGM_PPP_GETCLR_LINK_STATS
@ NGM_PPP_GETCLR_LINK_STATS64
@ NGM_PPP_GET_LINK_STATS64
#define NG_PPP_MP_STATE_TYPE_INFO(atype)
typedef TAILQ_HEAD(sscfu_sigq, sscfu_sig) sscfu_sigq_head_t
typedef TAILQ_ENTRY(sscfu_sig) sscfu_sigq_link_t
struct ng_mesg::ng_msghdr header
struct ng_ppp_link_stat64 stats
struct ng_ppp_link_conf conf
int32_t rseq[NG_PPP_MAX_LINKS]
struct ng_ppp_link_conf links[NG_PPP_MAX_LINKS]
struct ng_ppp_bund_conf bund
struct ng_ppp_link_stat64 bundleStats
uint16_t activeLinks[NG_PPP_MAX_LINKS]
struct ng_ppp_link links[NG_PPP_MAX_LINKS]
struct ng_ppp_frag fragsmem[MP_MAX_QUEUE_LEN]
hook_p hooks[HOOK_INDEX_MAX]
struct ng_ppp_bund_conf conf