aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/interface_api.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2018-07-11 10:31:26 -0700
committerDamjan Marion <dmarion@me.com>2018-07-20 13:21:03 +0000
commit1855b8e48d95289cc9f0a6e339f2148d64ac705c (patch)
tree71e888d9aabc16a388c07a5f3c3089ade0fdadab /src/vnet/interface_api.c
parent631de0dffebf2633e32b55c5c9b4663867a50371 (diff)
IP directed broadcast
with ip direct broadcast enable a packet to the interface's subnet broadcast address with be sent L2 broadcast on the interface. dissabled, it will be dropped. it is disabled by default, which preserves current behaviour Change-Id: If154cb92e64834e97a541b32624354348a0eafb3 Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/interface_api.c')
-rw-r--r--src/vnet/interface_api.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/vnet/interface_api.c b/src/vnet/interface_api.c
index e2f4d8fd130..1d167c680fe 100644
--- a/src/vnet/interface_api.c
+++ b/src/vnet/interface_api.c
@@ -70,7 +70,9 @@ _(CREATE_LOOPBACK, create_loopback) \
_(CREATE_LOOPBACK_INSTANCE, create_loopback_instance) \
_(DELETE_LOOPBACK, delete_loopback) \
_(INTERFACE_NAME_RENUMBER, interface_name_renumber) \
-_(COLLECT_DETAILED_INTERFACE_STATS, collect_detailed_interface_stats)
+_(COLLECT_DETAILED_INTERFACE_STATS, collect_detailed_interface_stats) \
+_(SW_INTERFACE_SET_IP_DIRECTED_BROADCAST, \
+ sw_interface_set_ip_directed_broadcast)
static void
vl_api_sw_interface_set_flags_t_handler (vl_api_sw_interface_set_flags_t * mp)
@@ -164,6 +166,23 @@ vl_api_sw_interface_set_mtu_t_handler (vl_api_sw_interface_set_mtu_t * mp)
}
static void
+ vl_api_sw_interface_set_ip_directed_broadcast_t_handler
+ (vl_api_sw_interface_set_ip_directed_broadcast_t * mp)
+{
+ vl_api_sw_interface_set_ip_directed_broadcast_reply_t *rmp;
+ u32 sw_if_index = ntohl (mp->sw_if_index);
+ int rv = 0;
+
+ VALIDATE_SW_IF_INDEX (mp);
+
+ vnet_sw_interface_ip_directed_broadcast (vnet_get_main (),
+ sw_if_index, mp->enable);
+
+ BAD_SW_IF_INDEX_LABEL;
+ REPLY_MACRO (VL_API_SW_INTERFACE_SET_IP_DIRECTED_BROADCAST_REPLY);
+}
+
+static void
send_sw_interface_details (vpe_api_main_t * am,
vl_api_registration_t * rp,
vnet_sw_interface_t * swif,