No context in SW interface event
At this pointin the game, events do not have an associated context. they have the client_index and pid instead. Change-Id: I5052cab78f710bba630a61d2390acbaa1b3813ab Signed-off-by: Neale Ranns <nranns@cisco.com>
This commit is contained in:
src/vnet
@ -29,7 +29,8 @@ autoreply define sw_interface_set_mtu
|
||||
};
|
||||
|
||||
/** \brief Interface Event generated by want_interface_events
|
||||
@param context - sender context, to match reply w/ request
|
||||
@param client_index - opaque cookie to identify the sender
|
||||
@param pid - client pid registered to receive notification
|
||||
@param sw_if_index - index of the interface of the event
|
||||
@param admin_up_down - The administrative state; 1 = up, 0 = down
|
||||
@param link_up_down - The operational state; 1 = up, 0 = down
|
||||
@ -37,7 +38,8 @@ autoreply define sw_interface_set_mtu
|
||||
*/
|
||||
define sw_interface_event
|
||||
{
|
||||
u32 context;
|
||||
u32 client_index;
|
||||
u32 pid;
|
||||
u32 sw_if_index;
|
||||
u8 admin_up_down;
|
||||
u8 link_up_down;
|
||||
|
@ -572,6 +572,7 @@ event_data_cmp (void *a1, void *a2)
|
||||
|
||||
static void
|
||||
send_sw_interface_event (vpe_api_main_t * am,
|
||||
vpe_client_registration_t * reg,
|
||||
unix_shared_memory_queue_t * q,
|
||||
vnet_sw_interface_t * swif)
|
||||
{
|
||||
@ -584,6 +585,8 @@ send_sw_interface_event (vpe_api_main_t * am,
|
||||
memset (mp, 0, sizeof (*mp));
|
||||
mp->_vl_msg_id = ntohs (VL_API_SW_INTERFACE_EVENT);
|
||||
mp->sw_if_index = ntohl (swif->sw_if_index);
|
||||
mp->client_index = reg->client_index;
|
||||
mp->pid = reg->client_pid;
|
||||
|
||||
mp->admin_up_down = (swif->flags & VNET_SW_INTERFACE_FLAG_ADMIN_UP) ? 1 : 0;
|
||||
mp->link_up_down = (hi->flags & VNET_HW_INTERFACE_FLAG_LINK_UP) ? 1 : 0;
|
||||
@ -638,7 +641,7 @@ link_state_process (vlib_main_t * vm,
|
||||
event_data[i]))
|
||||
{
|
||||
swif = vnet_get_sw_interface (vnm, event_data[i]);
|
||||
send_sw_interface_event (vam, q, swif);
|
||||
send_sw_interface_event (vam, reg, q, swif);
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
Reference in New Issue
Block a user