summaryrefslogtreecommitdiffstats
path: root/plugins/snat-plugin/snat/out2in.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2016-11-09 19:54:20 +0100
committerDave Barach <openvpp@barachs.net>2016-11-11 14:39:00 +0000
commit8b3191e6d715760deefe550b59c7d92be4b5cda9 (patch)
tree721dd977986d12864346081fec6b245ea5a250e0 /plugins/snat-plugin/snat/out2in.c
parent0178d52384e0428368f1acf3163e664ecda7b64c (diff)
feature: convert all feature nodes to new feature infra
Change-Id: I34c527ba910fb282a95458b78d1d684eb337905e Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'plugins/snat-plugin/snat/out2in.c')
-rw-r--r--plugins/snat-plugin/snat/out2in.c27
1 files changed, 7 insertions, 20 deletions
diff --git a/plugins/snat-plugin/snat/out2in.c b/plugins/snat-plugin/snat/out2in.c
index 190350ada2b..35edcc5f7b3 100644
--- a/plugins/snat-plugin/snat/out2in.c
+++ b/plugins/snat-plugin/snat/out2in.c
@@ -284,8 +284,6 @@ snat_out2in_node_fn (vlib_main_t * vm,
snat_out2in_next_t next_index;
u32 pkts_processed = 0;
snat_main_t * sm = &snat_main;
- ip_lookup_main_t * lm = sm->ip4_lookup_main;
- vnet_feature_config_main_t * cm = &lm->feature_config_mains[VNET_IP_RX_UNICAST_FEAT];
f64 now = vlib_time_now (vm);
from = vlib_frame_vector_args (frame);
@@ -355,10 +353,7 @@ snat_out2in_node_fn (vlib_main_t * vm,
rx_fib_index0 = vec_elt (sm->ip4_main->fib_index_by_sw_if_index,
sw_if_index0);
- vnet_get_config_data (&cm->config_main,
- &b0->current_config_index,
- &next0,
- 0 /* sizeof config data */);
+ vnet_feature_next (sw_if_index0, &next0, b0);
proto0 = ~0;
proto0 = (ip0->protocol == IP_PROTOCOL_UDP)
? SNAT_PROTOCOL_UDP : proto0;
@@ -474,10 +469,8 @@ snat_out2in_node_fn (vlib_main_t * vm,
rx_fib_index1 = vec_elt (sm->ip4_main->fib_index_by_sw_if_index,
sw_if_index1);
- vnet_get_config_data (&cm->config_main,
- &b1->current_config_index,
- &next1,
- 0 /* sizeof config data */);
+ vnet_feature_next (sw_if_index1, &next1, b1);
+
proto1 = ~0;
proto1 = (ip1->protocol == IP_PROTOCOL_UDP)
? SNAT_PROTOCOL_UDP : proto1;
@@ -628,10 +621,8 @@ snat_out2in_node_fn (vlib_main_t * vm,
rx_fib_index0 = vec_elt (sm->ip4_main->fib_index_by_sw_if_index,
sw_if_index0);
- vnet_get_config_data (&cm->config_main,
- &b0->current_config_index,
- &next0,
- 0 /* sizeof config data */);
+ vnet_feature_next (sw_if_index0, &next0, b0);
+
proto0 = ~0;
proto0 = (ip0->protocol == IP_PROTOCOL_UDP)
? SNAT_PROTOCOL_UDP : proto0;
@@ -853,8 +844,6 @@ snat_out2in_fast_node_fn (vlib_main_t * vm,
snat_out2in_next_t next_index;
u32 pkts_processed = 0;
snat_main_t * sm = &snat_main;
- ip_lookup_main_t * lm = sm->ip4_lookup_main;
- vnet_feature_config_main_t * cm = &lm->feature_config_mains[VNET_IP_RX_UNICAST_FEAT];
from = vlib_frame_vector_args (frame);
n_left_from = frame->n_vectors;
@@ -902,10 +891,8 @@ snat_out2in_fast_node_fn (vlib_main_t * vm,
sw_if_index0 = vnet_buffer(b0)->sw_if_index[VLIB_RX];
rx_fib_index0 = ip4_fib_table_get_index_for_sw_if_index(sw_if_index0);
- vnet_get_config_data (&cm->config_main,
- &b0->current_config_index,
- &next0,
- 0 /* sizeof config data */);
+ vnet_feature_next (sw_if_index0, &next0, b0);
+
proto0 = ~0;
proto0 = (ip0->protocol == IP_PROTOCOL_UDP)
? SNAT_PROTOCOL_UDP : proto0;