ip_address_decode (&mp->endpoint.ips[ii], &ips[ii]);
}
}
- mac_address_decode (&mp->endpoint.mac, &mac);
+ mac_address_decode (mp->endpoint.mac, &mac);
if (GBP_ENDPOINT_FLAG_REMOTE & gef)
{
mp->endpoint.flags = gbp_endpoint_flags_encode (gef->gef_flags);
mp->handle = htonl (gei);
mp->age = vlib_time_now (vlib_get_main ()) - ge->ge_last_time;
- mac_address_encode (&ge->ge_key.gek_mac, &mp->endpoint.mac);
+ mac_address_encode (&ge->ge_key.gek_mac, mp->endpoint.mac);
vec_foreach_index (ii, ge->ge_key.gek_ips)
{
mp->epg.uplink_sw_if_index = ntohl (gg->gg_uplink_sw_if_index);
mp->epg.epg_id = ntohs (gg->gg_id);
mp->epg.bd_id = ntohl (gbp_endpoint_group_get_bd_id (gg));
- mp->epg.rd_id = ntohl (gg->gg_rd);
+ mp->epg.rd_id = ntohl (gbp_route_domain_get_rd_id (gg->gg_rd));
vl_api_send_msg (ctx->reg, (u8 *) mp);
mp->recirc.epg_id = ntohs (gr->gr_epg);
mp->recirc.sw_if_index = ntohl (gr->gr_sw_if_index);
- mp->recirc.is_ext = ntohl (gr->gr_is_ext);
+ mp->recirc.is_ext = gr->gr_is_ext;
vl_api_send_msg (ctx->reg, (u8 *) mp);
return (VNET_API_ERROR_NO_SUCH_FIB);
ip_address_decode (&in->ip, &ip);
- mac_address_decode (&in->mac, &mac);
+ mac_address_decode (in->mac, &mac);
*gnhi = gbp_next_hop_alloc (&ip, grd, &mac, gbd);
vl_api_gbp_contract_add_del_t_handler (vl_api_gbp_contract_add_del_t * mp)
{
vl_api_gbp_contract_add_del_reply_t *rmp;
+ u16 *allowed_ethertypes;
index_t *rules;
- int rv = 0;
+ int ii, rv = 0;
+ u8 *data, n_et;
+ u16 *et;
if (mp->is_add)
{
if (0 != rv)
goto out;
+ allowed_ethertypes = NULL;
+
+ /*
+ * move past the variable legnth array of rules to get to the
+ * allowed ether types
+ */
+ data = (((u8 *) & mp->contract.n_ether_types) +
+ (sizeof (mp->contract.rules[0]) * mp->contract.n_rules));
+ n_et = *data;
+ et = (u16 *) (++data);
+ vec_validate (allowed_ethertypes, n_et - 1);
+
+ for (ii = 0; ii < n_et; ii++)
+ {
+ /* leave the ether types in network order */
+ allowed_ethertypes[ii] = et[ii];
+ }
+
rv = gbp_contract_update (ntohs (mp->contract.src_epg),
ntohs (mp->contract.dst_epg),
- ntohl (mp->contract.acl_index), rules);
+ ntohl (mp->contract.acl_index),
+ rules, allowed_ethertypes);
}
else
rv = gbp_contract_delete (ntohs (mp->contract.src_epg),