GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
NG_CHECKSUM(4) FreeBSD Kernel Interfaces Manual NG_CHECKSUM(4)

ng_checksum
reconstructing IP checksums node type

#include <netgraph/ng_checksum.h>

The checksum node can calculate, or prepare for calculation in hardware, IPv4 header, TCP and UDP checksums.

This node type has two hooks:
in
Packets received on this hook are processed according to settings specified in config and then forwarded to the out hook, if it exists and is connected. Otherwise they are reflected back to the in hook.
out
Packets received on this hook are forwarded to the in hook without any changes.

This node type supports the generic control messages, plus the following:
(setdlt)
Sets the data link type on the in hook. Currently, supported types are DLT_RAW (raw IP datagrams) and DLT_EN10MB (Ethernet). DLT_ definitions can be found in the <net/bpf.h> header. Currently used values are DLT_EN10MB = 1 and DLT_RAW = 12.
(getdlt)
This control message obtains the data link type on the in hook.
(setconfig)
Sets the node configuration. The following struct ng_checksum_config must be supplied as an argument:
struct ng_checksum_config {
	uint64_t	csum_flags;
	uint64_t	csum_offload;
};
    

The csum_flags can be set to any combination of CSUM_IP, CSUM_TCP, CSUM_UDP, CSUM_TCP_IPV6 and CSUM_UDP_IPV6 (other values are ignored) for instructing the node to calculate the corresponding checksum.

The csum_offload value can be set to any combination of CSUM_IP, CSUM_TCP, CSUM_UDP, CSUM_TCP_IPV6 and CSUM_UDP_IPV6 (other values are ignored) for instructing the node what checksums should be requested from the hardware.

The node also takes into account any combination of CSUM_IP, CSUM_TCP, CSUM_UDP, CSUM_TCP_IPV6 and CSUM_UDP_IPV6 already flagged on the mbuf.

(getconfig)
This control message obtains the current node configuration returned as a struct ng_checksum_config.
(getstats)
Returns node statistics as a struct ng_checksum_stats.
(clrstats)
Clear the node statistics.
(getclrstats)
This command is identical to NGM_CHECKSUM_GET_STATS, except that the statistics are also atomically cleared.

This node shuts down upon receipt of a NGM_SHUTDOWN control message, or when all hooks have been disconnected.

ngctl(8) script:
/usr/sbin/ngctl -f- <<-SEQ
	msg checksum-1: setdlt 1
	msg checksum-1: setconfig { csum_flags=0 csum_offload=6 }
SEQ

Set the data link type to DLT_EN10MB (Ethernet), do not set additional checksum flags and request that the hardware calculate CSUM_IP_UDP|CSUM_IP_TCP.

netgraph(4), ng_patch(4), ngctl(8)

The ng_checksum node type was implemented in FreeBSD 10.2 and first submitted in FreeBSD 12.0.

Dmitry Vagin ⟨daemon.hammer@ya.ru⟩.
October 29, 2015 FreeBSD 13.1-RELEASE

Search for    or go to Top of page |  Section 4 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.