summaryrefslogtreecommitdiffstats
path: root/src/vnet/adj
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/adj')
-rw-r--r--src/vnet/adj/adj.c2
-rw-r--r--src/vnet/adj/adj_mcast.c11
-rw-r--r--src/vnet/adj/adj_mcast.h11
3 files changed, 21 insertions, 3 deletions
diff --git a/src/vnet/adj/adj.c b/src/vnet/adj/adj.c
index f3d483ac13f..9a01e89d660 100644
--- a/src/vnet/adj/adj.c
+++ b/src/vnet/adj/adj.c
@@ -360,7 +360,7 @@ adj_get_sw_if_index (adj_index_t ai)
}
/**
- * @brief Return the link type of the adjacency
+ * @brief Return the rewrite string of the adjacency
*/
const u8*
adj_get_rewrite (adj_index_t ai)
diff --git a/src/vnet/adj/adj_mcast.c b/src/vnet/adj/adj_mcast.c
index a3ba4d6ab18..4f678e43e80 100644
--- a/src/vnet/adj/adj_mcast.c
+++ b/src/vnet/adj/adj_mcast.c
@@ -100,7 +100,9 @@ adj_mcast_add_or_lock (fib_protocol_t proto,
*/
void
adj_mcast_update_rewrite (adj_index_t adj_index,
- u8 *rewrite)
+ u8 *rewrite,
+ u8 offset,
+ u32 mask)
{
ip_adjacency_t *adj;
@@ -118,6 +120,13 @@ adj_mcast_update_rewrite (adj_index_t adj_index,
vnet_get_main(),
adj->rewrite_header.sw_if_index),
rewrite);
+ /*
+ * set the fields corresponding to the mcast IP address rewrite
+ * The mask must be stored in network byte order, since the packet's
+ * IP address will also be in network order.
+ */
+ adj->rewrite_header.dst_mcast_offset = offset;
+ adj->rewrite_header.dst_mcast_mask = clib_host_to_net_u32(mask);
}
void
diff --git a/src/vnet/adj/adj_mcast.h b/src/vnet/adj/adj_mcast.h
index 21c5a1417dd..40d44313357 100644
--- a/src/vnet/adj/adj_mcast.h
+++ b/src/vnet/adj/adj_mcast.h
@@ -55,9 +55,18 @@ extern adj_index_t adj_mcast_add_or_lock(fib_protocol_t proto,
*
* @param
* The new rewrite
+ *
+ * @param
+ * The offset in the rewrite a which to write in packet's
+ * IP Address
+ *
+ * @param
+ * The mask to apply to the packet berfore the rewrite.
*/
extern void adj_mcast_update_rewrite(adj_index_t adj_index,
- u8 *rewrite);
+ u8 *rewrite,
+ u8 offset,
+ u32 mask);
/**
* @brief Format/display a mcast adjacency.