Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
MAP: Convert from DPO to input feature.
[vpp.git]
/
src
/
plugins
/
map
/
ip6_map.c
diff --git
a/src/plugins/map/ip6_map.c
b/src/plugins/map/ip6_map.c
index
35b5811
..
d9db602
100644
(file)
--- a/
src/plugins/map/ip6_map.c
+++ b/
src/plugins/map/ip6_map.c
@@
-244,8
+244,7
@@
ip6_map (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame)
&& clib_net_to_host_u16 (ip60->payload_length) > 20))
{
d0 =
&& clib_net_to_host_u16 (ip60->payload_length) > 20))
{
d0 =
- ip6_map_get_domain (vnet_buffer (p0)->ip.adj_index[VLIB_TX],
- (ip4_address_t *) & ip40->
+ ip4_map_get_domain ((ip4_address_t *) & ip40->
src_address.as_u32, &map_domain_index0,
&error0);
}
src_address.as_u32, &map_domain_index0,
&error0);
}
@@
-272,8
+271,7
@@
ip6_map (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame)
&& clib_net_to_host_u16 (ip61->payload_length) > 20))
{
d1 =
&& clib_net_to_host_u16 (ip61->payload_length) > 20))
{
d1 =
- ip6_map_get_domain (vnet_buffer (p1)->ip.adj_index[VLIB_TX],
- (ip4_address_t *) & ip41->
+ ip4_map_get_domain ((ip4_address_t *) & ip41->
src_address.as_u32, &map_domain_index1,
&error1);
}
src_address.as_u32, &map_domain_index1,
&error1);
}
@@
-455,8
+453,7
@@
ip6_map (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame)
&& clib_net_to_host_u16 (ip60->payload_length) > 20))
{
d0 =
&& clib_net_to_host_u16 (ip60->payload_length) > 20))
{
d0 =
- ip6_map_get_domain (vnet_buffer (p0)->ip.adj_index[VLIB_TX],
- (ip4_address_t *) & ip40->
+ ip4_map_get_domain ((ip4_address_t *) & ip40->
src_address.as_u32, &map_domain_index0,
&error0);
}
src_address.as_u32, &map_domain_index0,
&error0);
}
@@
-478,7
+475,10
@@
ip6_map (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame)
}
else
{
}
else
{
- error0 = MAP_ERROR_BAD_PROTOCOL;
+ /* XXX: Move get_domain to ip6_get_domain lookup on source */
+ //error0 = MAP_ERROR_BAD_PROTOCOL;
+ vlib_buffer_advance (p0, -sizeof (ip6_header_t));
+ vnet_feature_next (&next0, p0);
}
if (d0)
}
if (d0)
@@
-811,7
+811,7
@@
ip6_map_ip6_reass (vlib_main_t * vm,
}
/*
}
/*
- * ip6_
ip4_virt
_reass
+ * ip6_
map_ip4
_reass
*/
static uword
ip6_map_ip4_reass (vlib_main_t * vm,
*/
static uword
ip6_map_ip4_reass (vlib_main_t * vm,
@@
-858,8
+858,7
@@
ip6_map_ip4_reass (vlib_main_t * vm,
ip60 = ((ip6_header_t *) ip40) - 1;
d0 =
ip60 = ((ip6_header_t *) ip40) - 1;
d0 =
- ip6_map_get_domain (vnet_buffer (p0)->ip.adj_index[VLIB_TX],
- (ip4_address_t *) & ip40->src_address.as_u32,
+ ip4_map_get_domain ((ip4_address_t *) & ip40->src_address.as_u32,
&map_domain_index0, &error0);
map_ip4_reass_lock ();
&map_domain_index0, &error0);
map_ip4_reass_lock ();
@@
-1172,6
+1171,13
@@
static char *map_error_strings[] = {
};
/* *INDENT-OFF* */
};
/* *INDENT-OFF* */
+VNET_FEATURE_INIT (ip6_map_feature, static) =
+{
+ .arc_name = "ip6-unicast",
+ .node_name = "ip6-map",
+ .runs_before = VNET_FEATURES ("ip6-flow-classify"),
+};
+
VLIB_REGISTER_NODE(ip6_map_node) = {
.function = ip6_map,
.name = "ip6-map",
VLIB_REGISTER_NODE(ip6_map_node) = {
.function = ip6_map,
.name = "ip6-map",