#include <sys/cdefs.h>
#include "opt_inet.h"
#include "opt_inet6.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/endian.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/socket.h>
#include <net/bpf.h>
#include <net/ethernet.h>
#include <net/if.h>
#include <net/if_vlan_var.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/ip6.h>
#include <netinet/tcp.h>
#include <netinet/udp.h>
#include <machine/in_cksum.h>
#include <netgraph/ng_message.h>
#include <netgraph/ng_parse.h>
#include <netgraph/netgraph.h>
#include <netgraph/ng_checksum.h>
Go to the source code of this file.
◆ ERROUT
#define ERROUT |
( |
|
x | ) |
{ error = (x); goto done; } |
◆ PULLUP_CHECK [1/2]
#define PULLUP_CHECK |
( |
|
mbuf, |
|
|
|
length |
|
) |
| |
Value: do { \
if (((mbuf)->m_pkthdr.len < pullup_len) || \
(pullup_len > MHLEN)) { \
return (EINVAL); \
} \
if ((mbuf)->m_len < pullup_len && \
(((mbuf) = m_pullup((mbuf), pullup_len)) == NULL)) { \
return (ENOBUFS); \
} \
} while (0)
Definition at line 293 of file ng_checksum.c.
◆ PULLUP_CHECK [2/2]
#define PULLUP_CHECK |
( |
|
mbuf, |
|
|
|
length |
|
) |
| |
Value: do { \
if (((mbuf)->m_pkthdr.len < pullup_len) || \
(pullup_len > MHLEN)) { \
error = EINVAL; \
goto bypass; \
} \
if ((mbuf)->m_len < pullup_len && \
(((mbuf) = m_pullup((mbuf), pullup_len)) == NULL)) { \
error = ENOBUFS; \
goto drop; \
} \
} while (0)
Definition at line 293 of file ng_checksum.c.
◆ priv_p
◆ __FBSDID()
◆ NETGRAPH_INIT()
NETGRAPH_INIT |
( |
checksum |
, |
|
|
& |
typestruct |
|
) |
| |
◆ ng_checksum_constructor()
static int ng_checksum_constructor |
( |
node_p |
node | ) |
|
|
static |
◆ ng_checksum_disconnect()
static int ng_checksum_disconnect |
( |
hook_p |
hook | ) |
|
|
static |
◆ ng_checksum_newhook()
static int ng_checksum_newhook |
( |
node_p |
node, |
|
|
hook_p |
hook, |
|
|
const char * |
name |
|
) |
| |
|
static |
◆ ng_checksum_rcvdata()
Definition at line 541 of file ng_checksum.c.
References ERROUT, ng_checksum_vlan_header::etype, NG_CHECKSUM_CSUM_IPV4, NG_CHECKSUM_CSUM_IPV6, NG_FREE_ITEM, NG_FREE_M, NG_FWD_NEW_DATA, NG_HOOK_NODE, NG_NODE_PRIVATE, NGI_GET_M, PULLUP_CHECK, and priv::stats.
◆ ng_checksum_rcvmsg()
Definition at line 190 of file ng_checksum.c.
References ng_mesg::ng_msghdr::arglen, ng_mesg::ng_msghdr::cmd, ng_checksum_config::csum_flags, ng_checksum_config::csum_offload, ng_mesg::data, ERROUT, ng_mesg::header, NG_CHECKSUM_CSUM_IPV4, NG_CHECKSUM_CSUM_IPV6, NG_FREE_MSG, NG_MKRESPONSE, NG_NODE_PRIVATE, NG_RESPOND_MSG, NGI_GET_MSG, NGM_CHECKSUM_CLR_STATS, NGM_CHECKSUM_COOKIE, NGM_CHECKSUM_GET_STATS, NGM_CHECKSUM_GETCLR_STATS, NGM_CHECKSUM_GETCONFIG, NGM_CHECKSUM_GETDLT, NGM_CHECKSUM_SETCONFIG, NGM_CHECKSUM_SETDLT, priv::stats, and ng_mesg::ng_msghdr::typecookie.
◆ ng_checksum_shutdown()
static int ng_checksum_shutdown |
( |
node_p |
node | ) |
|
|
static |
◆ ng_checksum_cmdlist
◆ ng_checksum_config_type
Initial value:= {
}
static const struct ng_parse_struct_field ng_checksum_config_type_fields[]
const struct ng_parse_type ng_parse_struct_type
Definition at line 82 of file ng_checksum.c.
◆ ng_checksum_config_type_fields
◆ ng_checksum_constructor
◆ ng_checksum_disconnect
◆ ng_checksum_newhook
◆ ng_checksum_rcvdata
◆ ng_checksum_rcvmsg
◆ ng_checksum_shutdown
◆ ng_checksum_stats_fields
◆ ng_checksum_stats_type
Initial value:= {
}
static const struct ng_parse_struct_field ng_checksum_stats_fields[]
Definition at line 89 of file ng_checksum.c.
◆ typestruct
Initial value:= {
}
static ng_shutdown_t ng_checksum_shutdown
static const struct ng_cmdlist ng_checksum_cmdlist[]
static ng_disconnect_t ng_checksum_disconnect
static ng_newhook_t ng_checksum_newhook
static ng_rcvmsg_t ng_checksum_rcvmsg
static ng_constructor_t ng_checksum_constructor
static ng_rcvdata_t ng_checksum_rcvdata
#define NG_CHECKSUM_NODE_TYPE
Definition at line 147 of file ng_checksum.c.