summaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/nat44-ed/nat44_ed.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/nat/nat44-ed/nat44_ed.h')
-rw-r--r--src/plugins/nat/nat44-ed/nat44_ed.h29
1 files changed, 22 insertions, 7 deletions
diff --git a/src/plugins/nat/nat44-ed/nat44_ed.h b/src/plugins/nat/nat44-ed/nat44_ed.h
index 10d1207fec8..902e5e34b14 100644
--- a/src/plugins/nat/nat44-ed/nat44_ed.h
+++ b/src/plugins/nat/nat44-ed/nat44_ed.h
@@ -204,15 +204,22 @@ typedef CLIB_PACKED(struct
}) per_vrf_sessions_t;
/* *INDENT-ON* */
-typedef struct
+typedef union
{
- ip4_address_t saddr, daddr;
- u32 fib_index;
- u16 sport, dport;
- u16 icmp_id;
- u8 proto;
+ struct
+ {
+ ip4_address_t saddr, daddr;
+ u16 sport; // ICMP id for ICMP case
+ u16 dport;
+ u32 fib_index : 24;
+ u8 proto;
+ };
+ u64 as_u64[2];
+ u64x2u as_u128;
} nat_6t_t;
+STATIC_ASSERT_SIZEOF (nat_6t_t, 2 * sizeof (u64));
+
typedef struct
{
#define NAT_FLOW_OP_SADDR_REWRITE (1 << 1)
@@ -223,7 +230,15 @@ typedef struct
#define NAT_FLOW_OP_TXFIB_REWRITE (1 << 6)
int ops;
nat_6t_t match;
- nat_6t_t rewrite;
+ struct
+ {
+ ip4_address_t saddr, daddr;
+ u16 sport;
+ u16 dport;
+ u32 fib_index;
+ u8 proto;
+ u16 icmp_id;
+ } rewrite;
uword l3_csum_delta;
uword l4_csum_delta;
} nat_6t_flow_t;