X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Fnat%2Fnat.h;h=b65ad1b676f2a12eeaac6e99c7466065e59344c6;hb=9a6dc8a9376e7270331255861b3ead1045b40c6d;hp=f7ce5f977d6043fa0e9e9d1dbdba67b5b5164c0b;hpb=b15ad95124ca97dd9a800394b93f1fe19567d2e1;p=vpp.git diff --git a/src/plugins/nat/nat.h b/src/plugins/nat/nat.h index f7ce5f977d6..b65ad1b676f 100644 --- a/src/plugins/nat/nat.h +++ b/src/plugins/nat/nat.h @@ -43,6 +43,45 @@ /* NAT buffer flags */ #define SNAT_FLAG_HAIRPINNING (1 << 0) +typedef struct +{ + u32 arc_next; +} nat_buffer_opaque_t; + +typedef enum +{ + NAT_NEXT_DROP, + NAT_NEXT_ICMP_ERROR, + NAT_NEXT_IN2OUT_PRE, + NAT_NEXT_OUT2IN_PRE, + NAT_NEXT_IN2OUT_ED_FAST_PATH, + NAT_NEXT_IN2OUT_ED_SLOW_PATH, + NAT_NEXT_IN2OUT_ED_OUTPUT_SLOW_PATH, + NAT_NEXT_IN2OUT_ED_REASS, + NAT_NEXT_IN2OUT_ED_OUTPUT_REASS, + NAT_NEXT_OUT2IN_ED_FAST_PATH, + NAT_NEXT_OUT2IN_ED_SLOW_PATH, + NAT_NEXT_OUT2IN_ED_REASS, + NAT_N_NEXT, +} nat_next_t; + +typedef struct +{ + u32 next_index; +} nat_pre_trace_t; + +#define nat_buffer_opaque(b) \ + ((nat_buffer_opaque_t *)((vnet_buffer_opaque2_t *)b->opaque2)->__unused2) + +/* +STATIC_ASSERT (sizeof (nat_buffer_opaque_t) <= + STRUCT_SIZE_OF (vnet_buffer_opaque_t, unused), + "Custom meta-data too large for vnet_buffer_opaque_t"); + +#define nat_buffer_opaque(b) \ + ((nat_buffer_opaque_t *)((u8 *)((b)->opaque) + \ + STRUCT_OFFSET_OF (vnet_buffer_opaque_t, unused)))*/ + /* session key (4-tuple) */ typedef struct { @@ -575,6 +614,15 @@ typedef struct snat_main_s /* node indexes */ u32 error_node_index; + /* handoff fq nodes */ + u32 handoff_out2in_index; + u32 handoff_in2out_index; + u32 handoff_in2out_output_index; + + /* respect feature arc nodes */ + u32 pre_out2in_node_index; + u32 pre_in2out_node_index; + u32 in2out_node_index; u32 in2out_output_node_index; u32 in2out_fast_node_index; @@ -667,6 +715,12 @@ typedef struct } snat_runtime_t; extern snat_main_t snat_main; + +// nat pre ed next_node feature classification +extern vlib_node_registration_t nat_default_node; +extern vlib_node_registration_t nat_pre_in2out_node; +extern vlib_node_registration_t nat_pre_out2in_node; + extern vlib_node_registration_t snat_in2out_node; extern vlib_node_registration_t snat_in2out_output_node; extern vlib_node_registration_t snat_out2in_node;