Changeset View
Changeset View
Standalone View
Standalone View
sys/netgraph/ng_deflate.c
Show All 35 Lines | |||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <sys/systm.h> | #include <sys/systm.h> | ||||
#include <sys/kernel.h> | #include <sys/kernel.h> | ||||
#include <sys/mbuf.h> | #include <sys/mbuf.h> | ||||
#include <sys/malloc.h> | #include <sys/malloc.h> | ||||
#include <sys/endian.h> | #include <sys/endian.h> | ||||
#include <sys/errno.h> | #include <sys/errno.h> | ||||
#include <sys/syslog.h> | #include <sys/syslog.h> | ||||
#include <sys/zlib.h> | |||||
#include <netgraph/ng_message.h> | #include <netgraph/ng_message.h> | ||||
#include <netgraph/netgraph.h> | #include <netgraph/netgraph.h> | ||||
#include <netgraph/ng_parse.h> | #include <netgraph/ng_parse.h> | ||||
#include <netgraph/ng_deflate.h> | #include <netgraph/ng_deflate.h> | ||||
#include "opt_netgraph.h" | #include "opt_netgraph.h" | ||||
static MALLOC_DEFINE(M_NETGRAPH_DEFLATE, "netgraph_deflate", | static MALLOC_DEFINE(M_NETGRAPH_DEFLATE, "netgraph_deflate", | ||||
"netgraph deflate node"); | "netgraph deflate node"); | ||||
#include "netgraph/zlib.c" | |||||
ota_j.email.ne.jp: Is it better to move this above line 52, static MALLOC_DEFINE? | |||||
/* DEFLATE header length */ | /* DEFLATE header length */ | ||||
#define DEFLATE_HDRLEN 2 | #define DEFLATE_HDRLEN 2 | ||||
#define PROT_COMPD 0x00fd | #define PROT_COMPD 0x00fd | ||||
#define DEFLATE_BUF_SIZE 4096 | #define DEFLATE_BUF_SIZE 4096 | ||||
/* Node private data */ | /* Node private data */ | ||||
▲ Show 20 Lines • Show All 628 Lines • ▼ Show 20 Lines | ng_deflate_reset_req(node_p node) | ||||
priv->seqnum = 0; | priv->seqnum = 0; | ||||
if (priv->cfg.enable) { | if (priv->cfg.enable) { | ||||
if (priv->compress) | if (priv->compress) | ||||
deflateReset(&priv->cx); | deflateReset(&priv->cx); | ||||
else | else | ||||
inflateReset(&priv->cx); | inflateReset(&priv->cx); | ||||
} | } | ||||
} | } | ||||
Is it better to move this above line 52, static MALLOC_DEFINE?