nftables-napi 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +144 -24
- package/binding.gyp +4 -2
- package/lib/index.d.ts +126 -9
- package/lib/index.js +2 -2
- package/package.json +4 -5
- package/prebuilds/linux-arm64/nftables-napi.node +0 -0
- package/prebuilds/linux-x64/nftables-napi.node +0 -0
- package/src/netlink/constants.h +25 -0
- package/src/netlink/nft_config.h +19 -8
- package/src/netlink/nftnl_raii.h +14 -4
- package/src/netlink/nl_batch.h +4 -4
- package/src/netlink/nl_result.h +1 -1
- package/src/netlink/nl_socket.cpp +20 -16
- package/src/netlink/nl_socket.h +2 -2
- package/src/netlink/operation.h +1 -1
- package/src/netlink/set_ops.cpp +88 -0
- package/src/netlink/set_ops.h +31 -0
- package/src/netlink/table_ops.cpp +196 -20
- package/src/nft_manager.cpp +364 -46
- package/src/nft_manager.h +5 -0
- package/src/validation.cpp +12 -0
- package/src/validation.h +10 -1
package/src/validation.h
CHANGED
|
@@ -18,4 +18,13 @@ struct IpAddr {
|
|
|
18
18
|
|
|
19
19
|
// Parse IP string, validate via inet_pton, store binary form.
|
|
20
20
|
// Returns IpAddr with family=Invalid on failure.
|
|
21
|
-
IpAddr parse_ip(const std::string& ip);
|
|
21
|
+
[[nodiscard]] IpAddr parse_ip(const std::string& ip);
|
|
22
|
+
|
|
23
|
+
struct PortVal {
|
|
24
|
+
uint16_t port;
|
|
25
|
+
bool valid;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
// Parse port number. Returns {port, valid=true} on success.
|
|
29
|
+
// Valid range: 0-65535.
|
|
30
|
+
[[nodiscard]] PortVal parse_port(double value);
|