Files
Parth SarthiandgVisor bot 0724b3e842 Nftables: Support xt_NAT compatibility targets.
Added:
- NAT(SNAT/DNAT) targets to perform network address and port translation.
- XTNATTargetV0, XTNATTargetV1, and XTNATTargetV2 ABI support.
- Fixed NFNATRange2(nf_nat_range2) struct and it's size.
- Unit and syscall tests.

Ref: net/netfilter/xt_nat.c
PiperOrigin-RevId: 966381482
2026-08-17 22:44:58 -07:00

85 lines
1.9 KiB
Python

load("//tools:defs.bzl", "go_library", "go_test")
package(
default_applicable_licenses = ["//:license"],
licenses = ["notice"],
)
go_library(
name = "nftables",
srcs = [
"nft_bitwise.go",
"nft_byteorder.go",
"nft_comparison.go",
"nft_counter.go",
"nft_ct.go",
"nft_fib.go",
"nft_immediate.go",
"nft_last.go",
"nft_lookup.go",
"nft_masq.go",
"nft_meta.go",
"nft_metaload.go",
"nft_metaset.go",
"nft_nat.go",
"nft_payload.go",
"nft_payload_load.go",
"nft_payload_set.go",
"nft_ranged.go",
"nft_route.go",
"nft_xt_addrtype.go",
"nft_xt_conntrack.go",
"nft_xt_masq.go",
"nft_xt_match.go",
"nft_xt_nat.go",
"nft_xt_target.go",
"nftables.go",
"nftables_attrs.go",
"nftables_compat.go",
"nftables_set.go",
"nftables_types.go",
"nftinterp.go",
],
visibility = [
"//:sandbox",
],
deps = [
"//pkg/abi/linux",
"//pkg/atomicbitops",
"//pkg/log",
"//pkg/marshal",
"//pkg/marshal/primitive",
"//pkg/rand",
"//pkg/sentry/socket/netlink/nlmsg",
"//pkg/syserr",
"//pkg/tcpip",
"//pkg/tcpip/checksum",
"//pkg/tcpip/header",
"//pkg/tcpip/stack",
],
)
go_test(
name = "nftables_test",
srcs = [
"nftables_test.go",
"nftinterp_test.go",
],
library = ":nftables",
deps = [
"//pkg/abi/linux",
"//pkg/atomicbitops",
"//pkg/buffer",
"//pkg/marshal/primitive",
"//pkg/rand",
"//pkg/sentry/socket/netlink/nlmsg",
"//pkg/sync",
"//pkg/syserr",
"//pkg/tcpip",
"//pkg/tcpip/faketime",
"//pkg/tcpip/header",
"//pkg/tcpip/stack",
"@com_github_google_go_cmp//cmp:go_default_library",
],
)