[libnftnl PATCH 2/2] expr: nat: add masquerade support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch adds masquerade support for the nat expression.

Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@xxxxxxxxx>
---
 0 files changed

diff --git a/include/linux/netfilter/nf_tables.h b/include/linux/netfilter/nf_tables.h
index 92c211b..18c9365 100644
--- a/include/linux/netfilter/nf_tables.h
+++ b/include/linux/netfilter/nf_tables.h
@@ -758,10 +758,12 @@ enum nft_reject_attributes {
  *
  * @NFT_NAT_SNAT: source NAT
  * @NFT_NAT_DNAT: destination NAT
+ * @NFT_NAT_MASQUERADE: masquerade NAT
  */
 enum nft_nat_types {
 	NFT_NAT_SNAT,
 	NFT_NAT_DNAT,
+	NFT_NAT_MASQUERADE,
 };
 
 /**
diff --git a/src/expr/nat.c b/src/expr/nat.c
index 51188c1..092c871 100644
--- a/src/expr/nat.c
+++ b/src/expr/nat.c
@@ -205,6 +205,8 @@ static inline const char *nft_nat2str(uint16_t nat)
 		return "snat";
 	case NFT_NAT_DNAT:
 		return "dnat";
+	case NFT_NAT_MASQUERADE:
+		return "masquerade";
 	default:
 		return "unknown";
 	}
@@ -216,6 +218,8 @@ static inline int nft_str2nat(const char *nat)
 		return NFT_NAT_SNAT;
 	else if (strcmp(nat, "dnat") == 0)
 		return NFT_NAT_DNAT;
+	else if (strcmp(nat, "masquerade") == 0)
+		return NFT_NAT_MASQUERADE;
 	else {
 		errno = EINVAL;
 		return -1;

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux