#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/mbuf.h>
#include <sys/malloc.h>
#include <sys/errno.h>
#include <sys/syslog.h>
#include <netgraph/ng_message.h>
#include <netgraph/netgraph.h>
#include <netgraph/ng_parse.h>
#include <netgraph/ng_pred1.h>
#include "opt_netgraph.h"
Go to the source code of this file.
|
static | MALLOC_DEFINE (M_NETGRAPH_PRED1, "netgraph_pred1", "netgraph pred1 node") |
|
static int | ng_pred1_compress (node_p node, struct mbuf *m, struct mbuf **resultp) |
|
static int | ng_pred1_decompress (node_p node, struct mbuf *m, struct mbuf **resultp) |
|
static void | Pred1Init (node_p node) |
|
static int | Pred1Compress (node_p node, u_char *source, u_char *dest, int len) |
|
static int | Pred1Decompress (node_p node, u_char *source, u_char *dest, int slen, int dlen) |
|
static void | Pred1SyncTable (node_p node, u_char *source, int len) |
|
static uint16_t | Crc16 (uint16_t fcs, u_char *cp, int len) |
|
| NETGRAPH_INIT (pred1, &ng_pred1_typestruct) |
|
static int | ng_pred1_constructor (node_p node) |
|
static int | ng_pred1_newhook (node_p node, hook_p hook, const char *name) |
|
static int | ng_pred1_rcvmsg (node_p node, item_p item, hook_p lasthook) |
|
static int | ng_pred1_rcvdata (hook_p hook, item_p item) |
|
static int | ng_pred1_shutdown (node_p node) |
|
static int | ng_pred1_disconnect (hook_p hook) |
|
◆ ERROUT
#define ERROUT |
( |
|
x | ) |
do { error = (x); goto done; } while (0) |
◆ HASH
#define HASH |
( |
|
x | ) |
priv->Hash = (priv->Hash << 4) ^ (x) |
◆ PPP_GOODFCS
#define PPP_GOODFCS 0xf0b8 /* Good final FCS value */ |
◆ PPP_INITFCS
#define PPP_INITFCS 0xffff /* Initial FCS value */ |
◆ PRED1_BUF_SIZE
#define PRED1_BUF_SIZE 4096 |
◆ PRED1_HDRLEN
◆ PRED1_TABLE_SIZE
#define PRED1_TABLE_SIZE 0x10000 |
◆ priv_p
◆ Crc16()
static uint16_t Crc16 |
( |
uint16_t |
fcs, |
|
|
u_char * |
cp, |
|
|
int |
len |
|
) |
| |
|
static |
◆ MALLOC_DEFINE()
static MALLOC_DEFINE |
( |
M_NETGRAPH_PRED1 |
, |
|
|
"netgraph_pred1" |
, |
|
|
"netgraph pred1 node" |
|
|
) |
| |
|
static |
◆ NETGRAPH_INIT()
NETGRAPH_INIT |
( |
pred1 |
, |
|
|
& |
ng_pred1_typestruct |
|
) |
| |
◆ ng_pred1_compress()
static int ng_pred1_compress |
( |
node_p |
node, |
|
|
struct mbuf * |
m, |
|
|
struct mbuf ** |
resultp |
|
) |
| |
|
static |
◆ ng_pred1_constructor()
static int ng_pred1_constructor |
( |
node_p |
node | ) |
|
|
static |
◆ ng_pred1_decompress()
static int ng_pred1_decompress |
( |
node_p |
node, |
|
|
struct mbuf * |
m, |
|
|
struct mbuf ** |
resultp |
|
) |
| |
|
static |
◆ ng_pred1_disconnect()
static int ng_pred1_disconnect |
( |
hook_p |
hook | ) |
|
|
static |
◆ ng_pred1_newhook()
static int ng_pred1_newhook |
( |
node_p |
node, |
|
|
hook_p |
hook, |
|
|
const char * |
name |
|
) |
| |
|
static |
◆ ng_pred1_rcvdata()
Definition at line 299 of file ng_pred1.c.
References NG_FREE_ITEM, NG_FWD_NEW_DATA, NG_HOOK_NODE, NG_MKMESSAGE, NG_NODE_PRIVATE, ng_pred1_compress(), ng_pred1_decompress(), NG_SEND_MSG_ID, NGI_GET_M, NGM_PRED1_COOKIE, and NGM_PRED1_RESETREQ.
◆ ng_pred1_rcvmsg()
Definition at line 229 of file ng_pred1.c.
References ng_mesg::ng_msghdr::arglen, ng_mesg::ng_msghdr::cmd, ng_mesg::data, ERROUT, ng_mesg::header, NG_FREE_MSG, NG_MKRESPONSE, NG_NODE_PRIVATE, NG_RESPOND_MSG, NGI_GET_MSG, NGI_RETADDR, NGM_PRED1_CLR_STATS, NGM_PRED1_CONFIG, NGM_PRED1_COOKIE, NGM_PRED1_GET_STATS, NGM_PRED1_GETCLR_STATS, NGM_PRED1_RESETREQ, Pred1Init(), priv::stats, and ng_mesg::ng_msghdr::typecookie.
◆ ng_pred1_shutdown()
static int ng_pred1_shutdown |
( |
node_p |
node | ) |
|
|
static |
◆ Pred1Compress()
static int Pred1Compress |
( |
node_p |
node, |
|
|
u_char * |
source, |
|
|
u_char * |
dest, |
|
|
int |
len |
|
) |
| |
|
static |
◆ Pred1Decompress()
static int Pred1Decompress |
( |
node_p |
node, |
|
|
u_char * |
source, |
|
|
u_char * |
dest, |
|
|
int |
slen, |
|
|
int |
dlen |
|
) |
| |
|
static |
◆ Pred1Init()
static void Pred1Init |
( |
node_p |
node | ) |
|
|
static |
◆ Pred1SyncTable()
static void Pred1SyncTable |
( |
node_p |
node, |
|
|
u_char * |
source, |
|
|
int |
len |
|
) |
| |
|
static |
◆ Crc16Table
static const uint16_t Crc16Table |
|
static |
◆ ng_pred1_cmds
◆ ng_pred1_config_type
Initial value:= {
}
const struct ng_parse_type ng_parse_struct_type
static const struct ng_parse_struct_field ng_pred1_config_type_fields[]
Definition at line 111 of file ng_pred1.c.
◆ ng_pred1_config_type_fields
◆ ng_pred1_constructor
◆ ng_pred1_disconnect
◆ ng_pred1_newhook
◆ ng_pred1_rcvdata
◆ ng_pred1_rcvmsg
◆ ng_pred1_shutdown
◆ ng_pred1_stat_type
Initial value:= {
}
static const struct ng_parse_struct_field ng_pred1_stats_type_fields[]
Definition at line 119 of file ng_pred1.c.
◆ ng_pred1_stats_type_fields
◆ ng_pred1_typestruct
Initial value:= {
}
static ng_rcvdata_t ng_pred1_rcvdata
static ng_disconnect_t ng_pred1_disconnect
static ng_constructor_t ng_pred1_constructor
static ng_rcvmsg_t ng_pred1_rcvmsg
static const struct ng_cmdlist ng_pred1_cmds[]
static ng_shutdown_t ng_pred1_shutdown
static ng_newhook_t ng_pred1_newhook
#define NG_PRED1_NODE_TYPE
Definition at line 165 of file ng_pred1.c.