ipfw3_nat: highspeed lockless in-kernel NAT

Operating Systems / DragonFlyBSD - Bill Yuan [dragonflybsd.org] - 12 May 2018 15:29 EDT

RB-Tree to stored the state for the outgoing packets, and multidimentional array of pointers to keep the state for the incoming packets.

4408d54857 ipfw3_nat: highspeed lockless in-kernel NAT
lib/libipfw3/basic/ipfw3_basic.c | 2 +-
lib/libipfw3/basic/ipfw3_basic.h | 6 +-
lib/libipfw3/dummynet/ipfw3_dummynet.c | 2 +-
lib/libipfw3/dummynet/ipfw3_dummynet.h | 6 +-
lib/libipfw3/layer2/ipfw3_layer2.c | 2 +-
lib/libipfw3/layer2/ipfw3_layer2.h | 6 +-
lib/libipfw3/layer4/ipfw3_layer4.c | 2 +-
lib/libipfw3/layer4/ipfw3_layer4.h | 6 +-
lib/libipfw3/nat/ipfw3_nat.c | 2 +-
lib/libipfw3/nat/ipfw3_nat.h | 6 +-
sbin/ipfw3/Makefile | 6 +
sbin/ipfw3/ipfw3.c | 2203 ++++---------------------
sbin/ipfw3/ipfw3.h | 44 +-
sbin/ipfw3/ipfw3basic.c | 148 ++
sbin/ipfw3/ipfw3basic.h | 44 +
sbin/ipfw3/ipfw3dummynet.c | 727 ++++++++
sbin/ipfw3/ipfw3dummynet.h | 52 +
sbin/ipfw3/ipfw3log.c | 138 ++
sbin/ipfw3/ipfw3log.h | 41 +
sbin/ipfw3/ipfw3nat.c | 6 +-
sbin/ipfw3/ipfw3set.c | 264 +++
sbin/ipfw3/ipfw3set.h | 47 +
sbin/ipfw3/ipfw3state.c | 205 +++
sbin/ipfw3/ipfw3state.h | 43 +
sbin/ipfw3/ipfw3sync.c | 80 +-
sbin/ipfw3/ipfw3sync.h | 27 +-
sbin/ipfw3/ipfw3table.c | 493 ++++++
sbin/ipfw3/ipfw3table.h | 51 +
sys/net/dummynet3/Makefile | 20 +-
sys/net/dummynet3/ip_dummynet3.c | 20 +-
sys/net/ipfw3/Makefile | 10 +-
sys/net/ipfw3/ip_fw3.c | 1225 ++++----------
sys/net/ipfw3/ip_fw3.h | 408 ++---
sys/net/ipfw3/ip_fw3_glue.c | 2 -
sys/net/ipfw3/ip_fw3_set.c | 286 ++++
sys/net/ipfw3/ip_fw3_set.h | 60 +
sys/net/ipfw3_basic/Makefile | 25 +-
sys/net/ipfw3_basic/ip_fw3_basic.c | 683 +-------
sys/net/ipfw3_basic/ip_fw3_basic.h | 110 +-
sys/net/{ipfw3 => ipfw3_basic}/ip_fw3_log.c | 63 +-
sys/net/{ipfw3 => ipfw3_basic}/ip_fw3_log.h | 7 +-
sys/net/ipfw3_basic/ip_fw3_state.c | 728 ++++++++
sys/net/ipfw3_basic/ip_fw3_state.h | 113 ++
sys/net/{ipfw3 => ipfw3_basic}/ip_fw3_sync.c | 210 +--
sys/net/{ipfw3 => ipfw3_basic}/ip_fw3_sync.h | 68 +-
sys/net/{ipfw3 => ipfw3_basic}/ip_fw3_table.c | 88 +-
sys/net/{ipfw3 => ipfw3_basic}/ip_fw3_table.h | 61 +-
sys/net/ipfw3_layer2/Makefile | 17 +
sys/net/ipfw3_layer2/ip_fw3_layer2.c | 44 +-
sys/net/ipfw3_layer2/ip_fw3_layer2.h | 4 +-
sys/net/ipfw3_layer4/Makefile | 17 +
sys/net/ipfw3_layer4/ip_fw3_layer4.c | 38 +-
sys/net/ipfw3_layer4/ip_fw3_layer4.h | 8 +-
sys/net/ipfw3_nat/Makefile | 17 +
sys/net/ipfw3_nat/ip_fw3_nat.c | 385 +++--
sys/net/ipfw3_nat/ip_fw3_nat.h | 33 +-
56 files changed, 5243 insertions(+), 4166 deletions(-)

Upstream: gitweb.dragonflybsd.org


  • Share