summaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/interface.api2
-rw-r--r--src/vnet/interface_api.c6
2 files changed, 8 insertions, 0 deletions
diff --git a/src/vnet/interface.api b/src/vnet/interface.api
index 02d7a505a51..1db5ef34c3a 100644
--- a/src/vnet/interface.api
+++ b/src/vnet/interface.api
@@ -131,6 +131,7 @@ autoreply define want_interface_events
@param pbb_b_vlanid - B-tag vlanid
@param pbb_i_sid - I-tag service id
@param interface_name - name of the interface
+ @param interface_dev_type - device type of the interface
@param tag - an ascii tag
*/
define sw_interface_details
@@ -186,6 +187,7 @@ define sw_interface_details
/* Interface name */
string interface_name[64];
+ string interface_dev_type[64];
string tag[64];
};
diff --git a/src/vnet/interface_api.c b/src/vnet/interface_api.c
index 4d5dab30f38..b24c2a1cb52 100644
--- a/src/vnet/interface_api.c
+++ b/src/vnet/interface_api.c
@@ -202,6 +202,8 @@ send_sw_interface_details (vpe_api_main_t * am,
{
vnet_hw_interface_t *hi =
vnet_get_sup_hw_interface (am->vnet_main, swif->sw_if_index);
+ vnet_device_class_t *dev_class =
+ vnet_get_device_class (am->vnet_main, hi->dev_class_index);
vl_api_sw_interface_details_t *mp = vl_msg_api_alloc (sizeof (*mp));
clib_memset (mp, 0, sizeof (*mp));
@@ -245,6 +247,10 @@ send_sw_interface_details (vpe_api_main_t * am,
strncpy ((char *) mp->interface_name,
(char *) interface_name, ARRAY_LEN (mp->interface_name) - 1);
+ if (dev_class && dev_class->name)
+ strncpy ((char *) mp->interface_dev_type, (char *) dev_class->name,
+ ARRAY_LEN (mp->interface_dev_type) - 1);
+
/* Send the L2 address for ethernet physical intfcs */
if (swif->sup_sw_if_index == swif->sw_if_index
&& hi->hw_class_index == ethernet_hw_interface_class.index)