summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
ce1b4c7)
When handling the IP_DETAILS and IP_ADDRESS_DETAILS replies,
it is almost certainly going to require having both the is_ipv6
and sw_if_index context to handle them properly. Placing these
values in an essentially global location as the current VAT does
isn't thread-safe. Fruthermore, rather than forcing every
API user to hoop-jump to establish these context values, simply
provide them in their DETAILS reply messages.
Change-Id: I6a9e0cb16ecdbf87fca8fc5c7663e98d3a53c26c
Signed-off-by: Jon Loeliger <jdl@netgate.com>
u32 context;
u8 ip[16];
u8 prefix_length;
u32 context;
u8 ip[16];
u8 prefix_length;
+ u32 sw_if_index;
+ u8 is_ipv6;
};
define ip_address_dump
};
define ip_address_dump
{
u32 sw_if_index;
u32 context;
{
u32 sw_if_index;
u32 context;
static void
send_ip_details (vpe_api_main_t * am,
static void
send_ip_details (vpe_api_main_t * am,
- unix_shared_memory_queue_t * q, u32 sw_if_index, u32 context)
+ unix_shared_memory_queue_t * q, u32 sw_if_index,
+ u8 is_ipv6, u32 context)
{
vl_api_ip_details_t *mp;
{
vl_api_ip_details_t *mp;
mp->_vl_msg_id = ntohs (VL_API_IP_DETAILS);
mp->sw_if_index = ntohl (sw_if_index);
mp->_vl_msg_id = ntohs (VL_API_IP_DETAILS);
mp->sw_if_index = ntohl (sw_if_index);
mp->context = context;
vl_msg_api_send_shmem (q, (u8 *) & mp);
mp->context = context;
vl_msg_api_send_shmem (q, (u8 *) & mp);
static void
send_ip_address_details (vpe_api_main_t * am,
unix_shared_memory_queue_t * q,
static void
send_ip_address_details (vpe_api_main_t * am,
unix_shared_memory_queue_t * q,
- u8 * ip, u16 prefix_length, u8 is_ipv6, u32 context)
+ u8 * ip, u16 prefix_length,
+ u32 sw_if_index, u8 is_ipv6, u32 context)
{
vl_api_ip_address_details_t *mp;
{
vl_api_ip_address_details_t *mp;
}
mp->prefix_length = prefix_length;
mp->context = context;
}
mp->prefix_length = prefix_length;
mp->context = context;
+ mp->sw_if_index = htonl (sw_if_index);
+ mp->is_ipv6 = is_ipv6;
vl_msg_api_send_shmem (q, (u8 *) & mp);
}
vl_msg_api_send_shmem (q, (u8 *) & mp);
}
({
r6 = ip_interface_address_get_address (lm6, ia);
u16 prefix_length = ia->address_length;
({
r6 = ip_interface_address_get_address (lm6, ia);
u16 prefix_length = ia->address_length;
- send_ip_address_details(am, q, (u8*)r6, prefix_length, 1, mp->context);
+ send_ip_address_details(am, q, (u8*)r6, prefix_length,
+ sw_if_index, 1, mp->context);
({
r4 = ip_interface_address_get_address (lm4, ia);
u16 prefix_length = ia->address_length;
({
r4 = ip_interface_address_get_address (lm4, ia);
u16 prefix_length = ia->address_length;
- send_ip_address_details(am, q, (u8*)r4, prefix_length, 0, mp->context);
+ send_ip_address_details(am, q, (u8*)r4, prefix_length,
+ sw_if_index, 0, mp->context);
continue;
}
sw_if_index = si->sw_if_index;
continue;
}
sw_if_index = si->sw_if_index;
- send_ip_details (am, q, sw_if_index, mp->context);
+ send_ip_details (am, q, sw_if_index, mp->is_ipv6, mp->context);