FreeBSD kernel netgraph code
ng_vjc.c
Go to the documentation of this file.
1
2/*
3 * ng_vjc.c
4 */
5
6/*-
7 * Copyright (c) 1996-1999 Whistle Communications, Inc.
8 * All rights reserved.
9 *
10 * Subject to the following obligations and disclaimer of warranty, use and
11 * redistribution of this software, in source or object code forms, with or
12 * without modifications are expressly permitted by Whistle Communications;
13 * provided, however, that:
14 * 1. Any and all reproductions of the source or object code must include the
15 * copyright notice above and the following disclaimer of warranties; and
16 * 2. No rights are granted, in any manner or form, to use Whistle
17 * Communications, Inc. trademarks, including the mark "WHISTLE
18 * COMMUNICATIONS" on advertising, endorsements, or otherwise except as
19 * such appears in the above copyright notice or in the software.
20 *
21 * THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND
22 * TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO
23 * REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE,
24 * INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF
25 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
26 * WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY
27 * REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS
28 * SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE.
29 * IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES
30 * RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING
31 * WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
32 * PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR
33 * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY
34 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
35 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
36 * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY
37 * OF SUCH DAMAGE.
38 *
39 * Author: Archie Cobbs <archie@freebsd.org>
40 *
41 * $FreeBSD$
42 * $Whistle: ng_vjc.c,v 1.17 1999/11/01 09:24:52 julian Exp $
43 */
44
45/*
46 * This node performs Van Jacobson IP header (de)compression.
47 * You must have included net/slcompress.c in your kernel compilation.
48 */
49
50#include <sys/param.h>
51#include <sys/systm.h>
52#include <sys/errno.h>
53#include <sys/kernel.h>
54#include <sys/mbuf.h>
55#include <sys/malloc.h>
56#include <sys/errno.h>
57
58#include <netgraph/ng_message.h>
59#include <netgraph/netgraph.h>
60#include <netgraph/ng_parse.h>
61#include <netgraph/ng_vjc.h>
62
63#include <netinet/in.h>
64#include <netinet/in_systm.h>
65#include <netinet/ip.h>
66#include <netinet/tcp.h>
67
68#include <net/slcompress.h>
69
70/* Check agreement with slcompress.c */
71#if MAX_STATES != NG_VJC_MAX_CHANNELS
72#error NG_VJC_MAX_CHANNELS must be the same as MAX_STATES
73#endif
74
75/* Maximum length of a compressed TCP VJ header */
76#define MAX_VJHEADER 19
77
78/* Node private data */
81 struct slcompress slc;
86};
87typedef struct ng_vjc_private *priv_p;
88
89#define ERROUT(x) do { error = (x); goto done; } while (0)
90
91/* Netgraph node methods */
98
99/* Helper stuff */
100static struct mbuf *ng_vjc_pulluphdrs(struct mbuf *m, int knownTCP);
101
102/* Parse type for struct ngm_vjc_config */
105static const struct ng_parse_type ng_vjc_config_type = {
108};
109
110/* Parse type for the 'last_cs' and 'cs_next' fields in struct slcompress,
111 which are pointers converted to integer indices, so parse them that way. */
112#ifndef __LP64__
113#define NG_VJC_TSTATE_PTR_TYPE &ng_parse_uint32_type
114#else
115#define NG_VJC_TSTATE_PTR_TYPE &ng_parse_uint64_type
116#endif
117
118/* Parse type for the 'cs_hdr' field in a struct cstate. Ideally we would
119 like to use a 'struct ip' type instead of a simple array of bytes. */
122 MAX_HDR
123};
124static const struct ng_parse_type ng_vjc_cs_hdr_type = {
127};
128
129/* Parse type for a struct cstate */
131 { "cs_next", NG_VJC_TSTATE_PTR_TYPE },
132 { "cs_hlen", &ng_parse_uint16_type },
133 { "cs_id", &ng_parse_uint8_type },
134 { "cs_filler", &ng_parse_uint8_type },
135 { "cs_hdr", &ng_vjc_cs_hdr_type },
136 { NULL }
137};
138static const struct ng_parse_type ng_vjc_cstate_type = {
141};
142
143/* Parse type for an array of MAX_STATES struct cstate's, ie, tstate & rstate */
146 MAX_STATES
147};
151};
152
153/* Parse type for struct slcompress. Keep this in sync with the
154 definition of struct slcompress defined in <net/slcompress.h> */
156 { "last_cs", NG_VJC_TSTATE_PTR_TYPE },
157 { "last_recv", &ng_parse_uint8_type },
158 { "last_xmit", &ng_parse_uint8_type },
159 { "flags", &ng_parse_hint16_type },
160#ifndef SL_NO_STATS
161 { "sls_packets", &ng_parse_uint32_type },
162 { "sls_compressed", &ng_parse_uint32_type },
163 { "sls_searches", &ng_parse_uint32_type },
164 { "sls_misses", &ng_parse_uint32_type },
165 { "sls_uncompressedin", &ng_parse_uint32_type },
166 { "sls_compressedin", &ng_parse_uint32_type },
167 { "sls_errorin", &ng_parse_uint32_type },
168 { "sls_tossed", &ng_parse_uint32_type },
169#endif
170 { "tstate", &ng_vjc_cstatearray_type },
171 { "rstate", &ng_vjc_cstatearray_type },
172 { NULL }
173};
177};
178
179/* List of commands and how to convert arguments to/from ASCII */
180static const struct ng_cmdlist ng_vjc_cmds[] = {
181 {
184 "setconfig",
186 NULL
187 },
188 {
191 "getconfig",
192 NULL,
194 },
195 {
198 "getstate",
199 NULL,
201 },
202 {
205 "clrstats",
206 NULL,
207 NULL,
208 },
209 {
212 "recverror",
213 NULL,
214 NULL,
215 },
216 { 0 }
217};
218
219/* Node type descriptor */
220static struct ng_type ng_vjc_typestruct = {
222 .name = NG_VJC_NODE_TYPE,
223 .constructor = ng_vjc_constructor,
224 .rcvmsg = ng_vjc_rcvmsg,
225 .shutdown = ng_vjc_shutdown,
226 .newhook = ng_vjc_newhook,
227 .rcvdata = ng_vjc_rcvdata,
228 .disconnect = ng_vjc_disconnect,
229 .cmdlist = ng_vjc_cmds,
230};
232
233/************************************************************************
234 NETGRAPH NODE METHODS
235 ************************************************************************/
236
237/*
238 * Create a new node
239 */
240static int
242{
243 priv_p priv;
244
245 /* Allocate private structure */
246 priv = malloc(sizeof(*priv), M_NETGRAPH, M_WAITOK | M_ZERO);
247
249
250 /* slcompress is not thread-safe. Protect it's state here. */
252
253 /* Done */
254 return (0);
255}
256
257/*
258 * Add a new hook
259 */
260static int
261ng_vjc_newhook(node_p node, hook_p hook, const char *name)
262{
263 const priv_p priv = NG_NODE_PRIVATE(node);
264 hook_p *hookp;
265
266 /* Get hook */
267 if (strcmp(name, NG_VJC_HOOK_IP) == 0)
268 hookp = &priv->ip;
269 else if (strcmp(name, NG_VJC_HOOK_VJCOMP) == 0)
270 hookp = &priv->vjcomp;
271 else if (strcmp(name, NG_VJC_HOOK_VJUNCOMP) == 0)
272 hookp = &priv->vjuncomp;
273 else if (strcmp(name, NG_VJC_HOOK_VJIP) == 0)
274 hookp = &priv->vjip;
275 else
276 return (EINVAL);
277
278 /* See if already connected */
279 if (*hookp)
280 return (EISCONN);
281
282 /* OK */
283 *hookp = hook;
284 return (0);
285}
286
287/*
288 * Receive a control message
289 */
290static int
291ng_vjc_rcvmsg(node_p node, item_p item, hook_p lasthook)
292{
293 const priv_p priv = NG_NODE_PRIVATE(node);
294 struct ng_mesg *resp = NULL;
295 int error = 0;
296 struct ng_mesg *msg;
297
298 NGI_GET_MSG(item, msg);
299 /* Check type cookie */
300 switch (msg->header.typecookie) {
301 case NGM_VJC_COOKIE:
302 switch (msg->header.cmd) {
304 {
305 struct ngm_vjc_config *const c =
306 (struct ngm_vjc_config *) msg->data;
307
308 if (msg->header.arglen != sizeof(*c))
309 ERROUT(EINVAL);
310 if ((priv->conf.enableComp || priv->conf.enableDecomp)
311 && (c->enableComp || c->enableDecomp))
312 ERROUT(EALREADY);
313 if (c->enableComp) {
316 ERROUT(EINVAL);
317 } else
319 if (c->enableComp != 0 || c->enableDecomp != 0) {
320 bzero(&priv->slc, sizeof(priv->slc));
321 sl_compress_init(&priv->slc, c->maxChannel);
322 }
323 priv->conf = *c;
324 break;
325 }
327 {
328 struct ngm_vjc_config *conf;
329
330 NG_MKRESPONSE(resp, msg, sizeof(*conf), M_NOWAIT);
331 if (resp == NULL)
332 ERROUT(ENOMEM);
333 conf = (struct ngm_vjc_config *)resp->data;
334 *conf = priv->conf;
335 break;
336 }
338 {
339 const struct slcompress *const sl0 = &priv->slc;
340 struct slcompress *sl;
341 u_int16_t index;
342 int i;
343
344 /* Get response structure */
345 NG_MKRESPONSE(resp, msg, sizeof(*sl), M_NOWAIT);
346 if (resp == NULL)
347 ERROUT(ENOMEM);
348 sl = (struct slcompress *)resp->data;
349 *sl = *sl0;
350
351 /* Replace pointers with integer indices */
352 if (sl->last_cs != NULL) {
353 index = sl0->last_cs - sl0->tstate;
354 bzero(&sl->last_cs, sizeof(sl->last_cs));
355 *((u_int16_t *)&sl->last_cs) = index;
356 }
357 for (i = 0; i < MAX_STATES; i++) {
358 struct cstate *const cs = &sl->tstate[i];
359
360 index = sl0->tstate[i].cs_next - sl0->tstate;
361 bzero(&cs->cs_next, sizeof(cs->cs_next));
362 *((u_int16_t *)&cs->cs_next) = index;
363 }
364 break;
365 }
367 priv->slc.sls_packets = 0;
368 priv->slc.sls_compressed = 0;
369 priv->slc.sls_searches = 0;
370 priv->slc.sls_misses = 0;
371 priv->slc.sls_uncompressedin = 0;
372 priv->slc.sls_compressedin = 0;
373 priv->slc.sls_errorin = 0;
374 priv->slc.sls_tossed = 0;
375 break;
377 sl_uncompress_tcp(NULL, 0, TYPE_ERROR, &priv->slc);
378 break;
379 default:
380 error = EINVAL;
381 break;
382 }
383 break;
384 default:
385 error = EINVAL;
386 break;
387 }
388done:
389 NG_RESPOND_MSG(error, node, item, resp);
390 NG_FREE_MSG(msg);
391 return (error);
392}
393
394/*
395 * Receive data
396 */
397static int
399{
400 const node_p node = NG_HOOK_NODE(hook);
401 const priv_p priv = NG_NODE_PRIVATE(node);
402 int error = 0;
403 struct mbuf *m;
404
405 NGI_GET_M(item, m);
406 if (hook == priv->ip) { /* outgoing packet */
407 u_int type = TYPE_IP;
408
409 /* Compress packet if enabled and proto is TCP */
410 if (priv->conf.enableComp) {
411 struct ip *ip;
412
413 if ((m = ng_vjc_pulluphdrs(m, 0)) == NULL) {
414 NG_FREE_ITEM(item);
415 return (ENOBUFS);
416 }
417 ip = mtod(m, struct ip *);
418 if (ip->ip_p == IPPROTO_TCP) {
419 const int origLen = m->m_len;
420
421 type = sl_compress_tcp(m, ip,
422 &priv->slc, priv->conf.compressCID);
423 m->m_pkthdr.len += m->m_len - origLen;
424 }
425 }
426
427 /* Dispatch to the appropriate outgoing hook */
428 switch (type) {
429 case TYPE_IP:
430 hook = priv->vjip;
431 break;
432 case TYPE_UNCOMPRESSED_TCP:
433 hook = priv->vjuncomp;
434 break;
435 case TYPE_COMPRESSED_TCP:
436 hook = priv->vjcomp;
437 break;
438 default:
439 panic("%s: type=%d", __func__, type);
440 }
441 } else if (hook == priv->vjcomp) { /* incoming compressed packet */
442 int vjlen, need2pullup;
443 struct mbuf *hm;
444 u_char *hdr;
445 u_int hlen;
446
447 /* Are we decompressing? */
448 if (!priv->conf.enableDecomp) {
449 NG_FREE_M(m);
450 NG_FREE_ITEM(item);
451 return (ENXIO);
452 }
453
454 /* Pull up the necessary amount from the mbuf */
455 need2pullup = MAX_VJHEADER;
456 if (need2pullup > m->m_pkthdr.len)
457 need2pullup = m->m_pkthdr.len;
458 if (m->m_len < need2pullup
459 && (m = m_pullup(m, need2pullup)) == NULL) {
460 priv->slc.sls_errorin++;
461 NG_FREE_ITEM(item);
462 return (ENOBUFS);
463 }
464
465 /* Uncompress packet to reconstruct TCP/IP header */
466 vjlen = sl_uncompress_tcp_core(mtod(m, u_char *),
467 m->m_len, m->m_pkthdr.len, TYPE_COMPRESSED_TCP,
468 &priv->slc, &hdr, &hlen);
469 if (vjlen <= 0) {
470 NG_FREE_M(m);
471 NG_FREE_ITEM(item);
472 return (EINVAL);
473 }
474 m_adj(m, vjlen);
475
476 /* Copy the reconstructed TCP/IP headers into a new mbuf */
477 MGETHDR(hm, M_NOWAIT, MT_DATA);
478 if (hm == NULL) {
479 priv->slc.sls_errorin++;
480 NG_FREE_M(m);
481 NG_FREE_ITEM(item);
482 return (ENOBUFS);
483 }
484 hm->m_len = 0;
485 hm->m_pkthdr.rcvif = NULL;
486 if (hlen > MHLEN) { /* unlikely, but can happen */
487 if (!(MCLGET(hm, M_NOWAIT))) {
488 m_freem(hm);
489 priv->slc.sls_errorin++;
490 NG_FREE_M(m);
491 NG_FREE_ITEM(item);
492 return (ENOBUFS);
493 }
494 }
495 bcopy(hdr, mtod(hm, u_char *), hlen);
496 hm->m_len = hlen;
497
498 /* Glue TCP/IP headers and rest of packet together */
499 hm->m_next = m;
500 hm->m_pkthdr.len = hlen + m->m_pkthdr.len;
501 m = hm;
502 hook = priv->ip;
503 } else if (hook == priv->vjuncomp) { /* incoming uncompressed pkt */
504 u_char *hdr;
505 u_int hlen;
506
507 /* Are we decompressing? */
508 if (!priv->conf.enableDecomp) {
509 NG_FREE_M(m);
510 NG_FREE_ITEM(item);
511 return (ENXIO);
512 }
513
514 /* Pull up IP+TCP headers */
515 if ((m = ng_vjc_pulluphdrs(m, 1)) == NULL) {
516 NG_FREE_ITEM(item);
517 return (ENOBUFS);
518 }
519
520 /* Run packet through uncompressor */
521 if (sl_uncompress_tcp_core(mtod(m, u_char *),
522 m->m_len, m->m_pkthdr.len, TYPE_UNCOMPRESSED_TCP,
523 &priv->slc, &hdr, &hlen) < 0) {
524 NG_FREE_M(m);
525 NG_FREE_ITEM(item);
526 return (EINVAL);
527 }
528 hook = priv->ip;
529 } else if (hook == priv->vjip) /* incoming regular packet (bypass) */
530 hook = priv->ip;
531 else
532 panic("%s: unknown hook", __func__);
533
534 /* Send result back out */
535 NG_FWD_NEW_DATA(error, item, hook, m);
536 return (error);
537}
538
539/*
540 * Shutdown node
541 */
542static int
544{
545 const priv_p priv = NG_NODE_PRIVATE(node);
546
547 bzero(priv, sizeof(*priv));
548 free(priv, M_NETGRAPH);
549 NG_NODE_SET_PRIVATE(node, NULL);
550 NG_NODE_UNREF(node);
551 return (0);
552}
553
554/*
555 * Hook disconnection
556 */
557static int
559{
560 const node_p node = NG_HOOK_NODE(hook);
561 const priv_p priv = NG_NODE_PRIVATE(node);
562
563 /* Zero out hook pointer */
564 if (hook == priv->ip)
565 priv->ip = NULL;
566 else if (hook == priv->vjcomp)
567 priv->vjcomp = NULL;
568 else if (hook == priv->vjuncomp)
569 priv->vjuncomp = NULL;
570 else if (hook == priv->vjip)
571 priv->vjip = NULL;
572 else
573 panic("%s: unknown hook", __func__);
574
575 /* Go away if no hooks left */
576 if ((NG_NODE_NUMHOOKS(node) == 0)
577 && (NG_NODE_IS_VALID(node)))
578 ng_rmnode_self(node);
579 return (0);
580}
581
582/************************************************************************
583 HELPER STUFF
584 ************************************************************************/
585
586/*
587 * Pull up the full IP and TCP headers of a packet. If packet is not
588 * a TCP packet, just pull up the IP header.
589 */
590static struct mbuf *
591ng_vjc_pulluphdrs(struct mbuf *m, int knownTCP)
592{
593 struct ip *ip;
594 struct tcphdr *tcp;
595 int ihlen, thlen;
596
597 if (m->m_len < sizeof(*ip) && (m = m_pullup(m, sizeof(*ip))) == NULL)
598 return (NULL);
599 ip = mtod(m, struct ip *);
600 if (!knownTCP && ip->ip_p != IPPROTO_TCP)
601 return (m);
602 ihlen = ip->ip_hl << 2;
603 if (m->m_len < ihlen + sizeof(*tcp)) {
604 if ((m = m_pullup(m, ihlen + sizeof(*tcp))) == NULL)
605 return (NULL);
606 ip = mtod(m, struct ip *);
607 }
608 tcp = (struct tcphdr *)((u_char *)ip + ihlen);
609 thlen = tcp->th_off << 2;
610 if (m->m_len < ihlen + thlen)
611 m = m_pullup(m, ihlen + thlen);
612 return (m);
613}
#define NG_HOOK_NODE(hook)
Definition: netgraph.h:339
#define NG_FREE_M(m)
Definition: netgraph.h:946
int ng_rcvmsg_t(node_p node, item_p item, hook_p lasthook)
Definition: netgraph.h:105
int ng_disconnect_t(hook_p hook)
Definition: netgraph.h:107
#define NG_NODE_SET_PRIVATE(node, val)
Definition: netgraph.h:608
#define NG_RESPOND_MSG(error, here, item, resp)
Definition: netgraph.h:1025
#define NG_NODE_IS_VALID(node)
Definition: netgraph.h:610
#define NG_NODE_FORCE_WRITER(node)
Definition: netgraph.h:612
#define NG_NODE_UNREF(node)
Definition: netgraph.h:607
int ng_rmnode_self(node_p here)
Definition: ng_base.c:1609
#define NG_FWD_NEW_DATA(error, item, hook, m)
Definition: netgraph.h:914
int ng_rcvdata_t(hook_p hook, item_p item)
Definition: netgraph.h:106
int ng_shutdown_t(node_p node)
Definition: netgraph.h:101
#define NG_FREE_ITEM(item)
Definition: netgraph.h:847
int ng_constructor_t(node_p node)
Definition: netgraph.h:99
#define NGI_GET_M(i, m)
Definition: netgraph.h:852
#define NG_FREE_MSG(msg)
Definition: netgraph.h:938
#define NG_ABI_VERSION
Definition: netgraph.h:77
#define NG_NODE_NUMHOOKS(node)
Definition: netgraph.h:615
#define NGI_GET_MSG(i, m)
Definition: netgraph.h:858
#define NG_NODE_PRIVATE(node)
Definition: netgraph.h:609
int ng_newhook_t(node_p node, hook_p hook, const char *name)
Definition: netgraph.h:102
u_int8_t type
#define NG_MKRESPONSE(rsp, msg, len, how)
Definition: ng_message.h:396
const struct ng_parse_type ng_parse_uint16_type
Definition: ng_parse.c:509
const struct ng_parse_type ng_parse_fixedarray_type
Definition: ng_parse.c:271
const struct ng_parse_type ng_parse_struct_type
Definition: ng_parse.c:222
const struct ng_parse_type ng_parse_hint8_type
Definition: ng_parse.c:418
const struct ng_parse_type ng_parse_uint32_type
Definition: ng_parse.c:608
const struct ng_parse_type ng_parse_uint8_type
Definition: ng_parse.c:413
const struct ng_parse_type ng_parse_hint16_type
Definition: ng_parse.c:514
char *const name
Definition: ng_ppp.c:261
static const struct ng_parse_type ng_vjc_cstatearray_type
Definition: ng_vjc.c:148
static ng_rcvdata_t ng_vjc_rcvdata
Definition: ng_vjc.c:96
static const struct ng_parse_type ng_vjc_config_type
Definition: ng_vjc.c:105
static struct ng_type ng_vjc_typestruct
Definition: ng_vjc.c:220
static const struct ng_parse_type ng_vjc_cs_hdr_type
Definition: ng_vjc.c:124
NETGRAPH_INIT(vjc, &ng_vjc_typestruct)
static const struct ng_parse_fixedarray_info ng_vjc_cs_hdr_type_info
Definition: ng_vjc.c:120
#define ERROUT(x)
Definition: ng_vjc.c:89
static ng_rcvmsg_t ng_vjc_rcvmsg
Definition: ng_vjc.c:93
struct ng_vjc_private * priv_p
Definition: ng_vjc.c:87
#define NG_VJC_TSTATE_PTR_TYPE
Definition: ng_vjc.c:113
static ng_disconnect_t ng_vjc_disconnect
Definition: ng_vjc.c:97
static const struct ng_parse_type ng_vjc_cstate_type
Definition: ng_vjc.c:138
static const struct ng_parse_struct_field ng_vjc_cstate_type_fields[]
Definition: ng_vjc.c:130
static ng_constructor_t ng_vjc_constructor
Definition: ng_vjc.c:92
static const struct ng_parse_fixedarray_info ng_vjc_cstatearray_type_info
Definition: ng_vjc.c:144
static const struct ng_cmdlist ng_vjc_cmds[]
Definition: ng_vjc.c:180
#define MAX_VJHEADER
Definition: ng_vjc.c:76
static const struct ng_parse_struct_field ng_vjc_config_type_fields[]
Definition: ng_vjc.c:104
static ng_shutdown_t ng_vjc_shutdown
Definition: ng_vjc.c:94
static const struct ng_parse_struct_field ng_vjc_slcompress_type_fields[]
Definition: ng_vjc.c:155
static struct mbuf * ng_vjc_pulluphdrs(struct mbuf *m, int knownTCP)
Definition: ng_vjc.c:591
static const struct ng_parse_type ng_vjc_slcompress_type
Definition: ng_vjc.c:174
static ng_newhook_t ng_vjc_newhook
Definition: ng_vjc.c:95
#define NG_VJC_HOOK_VJCOMP
Definition: ng_vjc.h:54
#define NG_VJC_HOOK_IP
Definition: ng_vjc.h:53
@ NGM_VJC_CLR_STATS
Definition: ng_vjc.h:84
@ NGM_VJC_SET_CONFIG
Definition: ng_vjc.h:81
@ NGM_VJC_GET_CONFIG
Definition: ng_vjc.h:82
@ NGM_VJC_RECV_ERROR
Definition: ng_vjc.h:85
@ NGM_VJC_GET_STATE
Definition: ng_vjc.h:83
#define NG_VJC_NODE_TYPE
Definition: ng_vjc.h:49
#define NG_VJC_HOOK_VJUNCOMP
Definition: ng_vjc.h:55
#define NG_VJC_CONFIG_TYPE_INFO
Definition: ng_vjc.h:71
#define NG_VJC_HOOK_VJIP
Definition: ng_vjc.h:56
#define NG_VJC_MAX_CHANNELS
Definition: ng_vjc.h:60
#define NGM_VJC_COOKIE
Definition: ng_vjc.h:50
#define NG_VJC_MIN_CHANNELS
Definition: ng_vjc.h:59
u_int32_t arglen
Definition: ng_message.h:62
u_int32_t typecookie
Definition: ng_message.h:66
struct ng_mesg::ng_msghdr header
char data[]
Definition: ng_message.h:69
u_int32_t version
Definition: netgraph.h:1077
hook_p ip
Definition: ng_vjc.c:82
hook_p vjuncomp
Definition: ng_vjc.c:84
hook_p vjip
Definition: ng_vjc.c:85
hook_p vjcomp
Definition: ng_vjc.c:83
struct ngm_vjc_config conf
Definition: ng_vjc.c:80
struct slcompress slc
Definition: ng_vjc.c:81
u_char maxChannel
Definition: ng_vjc.h:66
u_char enableDecomp
Definition: ng_vjc.h:65
u_char enableComp
Definition: ng_vjc.h:64
Definition: ng_sscfu.c:66