netgraph: Enable support for EIM NAT

Enable support for endpoint-independent mapping ("full cone NAT") via
Libalias's UDP NAT.

Reviewed by:    igoro, thj
Differential Revision:  https://reviews.freebsd.org/D46689
This commit is contained in:
Damjan Jovanovic
2024-12-06 09:31:58 +00:00
committed by Tom Jones
parent cb21fa3d0d
commit f132be9bac
3 changed files with 5 additions and 1 deletions
+2 -1
View File
@@ -22,7 +22,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd January 24, 2021
.Dd December 6, 2024
.Dt NG_NAT 4
.Os
.Sh NAME
@@ -74,6 +74,7 @@ struct ng_nat_mode {
#define NG_NAT_PROXY_ONLY 0x40
#define NG_NAT_REVERSE 0x80
#define NG_NAT_UNREGISTERED_CGN 0x100
#define NG_NAT_UDP_EIM 0x200
.Ed
.Pp
The corresponding libalias flags can be found by replacing the
+2
View File
@@ -967,6 +967,8 @@ ng_nat_translate_flags(unsigned int x)
res |= PKT_ALIAS_REVERSE;
if (x & NG_NAT_UNREGISTERED_CGN)
res |= PKT_ALIAS_UNREGISTERED_CGN;
if (x & NG_NAT_UDP_EIM)
res |= PKT_ALIAS_UDP_EIM;
return (res);
}
+1
View File
@@ -53,6 +53,7 @@ struct ng_nat_mode {
#define NG_NAT_PROXY_ONLY 0x40
#define NG_NAT_REVERSE 0x80
#define NG_NAT_UNREGISTERED_CGN 0x100
#define NG_NAT_UDP_EIM 0x200
#define NG_NAT_DESC_LENGTH 64
#define NG_NAT_REDIRPROTO_ADDR (IPPROTO_MAX + 3) /* LibAlias' LINK_ADDR, also unused in in.h */