/* Get the API version number */
#define vl_api_version(n,v) static u32 api_version=(v);
-#include <acl/acl_all_api_h.h>
+#include <gbp/gbp_all_api_h.h>
#undef vl_api_version
#include <vlibapi/api_helper_macros.h>
_(GBP_CONTRACT_ADD_DEL, gbp_contract_add_del) \
_(GBP_CONTRACT_DUMP, gbp_contract_dump)
-/**
- * L2 Emulation Main
- */
-typedef struct gbp_main_t_
-{
- u16 msg_id_base;
-} gbp_main_t;
+gbp_main_t gbp_main;
-static gbp_main_t gbp_main;
+static u16 msg_id_base;
-#define GBP_MSG_BASE gbp_main.msg_id_base
+#define GBP_MSG_BASE msg_id_base
static void
vl_api_gbp_endpoint_add_del_t_handler (vl_api_gbp_endpoint_add_del_t * mp)
if (mp->is_add)
{
rv =
- gbp_endpoint_update (sw_if_index, &ip, ntohl (mp->endpoint.epg_id));
+ gbp_endpoint_update (sw_if_index, &ip, ntohs (mp->endpoint.epg_id));
}
else
{
&gbpe->ge_key->gek_ip.ip4,
sizeof (gbpe->ge_key->gek_ip.ip4));
- mp->endpoint.epg_id = ntohl (gbpe->ge_epg_id);
+ mp->endpoint.epg_id = ntohs (gbpe->ge_epg_id);
vl_api_send_msg (ctx->reg, (u8 *) mp);
if (mp->is_add)
{
- rv = gbp_endpoint_group_add (ntohl (mp->epg.epg_id),
+ rv = gbp_endpoint_group_add (ntohs (mp->epg.epg_id),
ntohl (mp->epg.bd_id),
ntohl (mp->epg.ip4_table_id),
ntohl (mp->epg.ip6_table_id),
}
else
{
- gbp_endpoint_group_delete (ntohl (mp->epg.epg_id));
+ gbp_endpoint_group_delete (ntohs (mp->epg.epg_id));
}
BAD_SW_IF_INDEX_LABEL;
rv = gbp_subnet_add_del (ntohl (mp->subnet.table_id),
&pfx,
ntohl (mp->subnet.sw_if_index),
- ntohl (mp->subnet.epg_id),
+ ntohs (mp->subnet.epg_id),
mp->is_add, mp->subnet.is_internal);
REPLY_MACRO (VL_API_GBP_SUBNET_ADD_DEL_REPLY + GBP_MSG_BASE);
mp->subnet.is_internal = is_internal;
mp->subnet.sw_if_index = ntohl (sw_if_index);
- mp->subnet.epg_id = ntohl (epg);
+ mp->subnet.epg_id = ntohs (epg);
mp->subnet.is_ip6 = (pfx->fp_proto == FIB_PROTOCOL_IP6);
mp->subnet.address_length = pfx->fp_len;
mp->subnet.table_id = ntohl (table_id);
mp->context = ctx->context;
mp->epg.uplink_sw_if_index = ntohl (gepg->gepg_uplink_sw_if_index);
- mp->epg.epg_id = ntohl (gepg->gepg_id);
+ mp->epg.epg_id = ntohs (gepg->gepg_id);
mp->epg.bd_id = ntohl (gepg->gepg_bd);
mp->epg.ip4_table_id = ntohl (gepg->gepg_rd[FIB_PROTOCOL_IP4]);
mp->epg.ip6_table_id = ntohl (gepg->gepg_rd[FIB_PROTOCOL_IP6]);
if (mp->is_add)
gbp_recirc_add (sw_if_index,
- ntohl (mp->recirc.epg_id), mp->recirc.is_ext);
+ ntohs (mp->recirc.epg_id), mp->recirc.is_ext);
else
gbp_recirc_delete (sw_if_index);
mp->_vl_msg_id = ntohs (VL_API_GBP_RECIRC_DETAILS + GBP_MSG_BASE);
mp->context = ctx->context;
- mp->recirc.epg_id = ntohl (gr->gr_epg);
+ 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);
int rv = 0;
if (mp->is_add)
- gbp_contract_update (ntohl (mp->contract.src_epg),
- ntohl (mp->contract.dst_epg),
+ gbp_contract_update (ntohs (mp->contract.src_epg),
+ ntohs (mp->contract.dst_epg),
ntohl (mp->contract.acl_index));
else
- gbp_contract_delete (ntohl (mp->contract.src_epg),
- ntohl (mp->contract.dst_epg));
+ gbp_contract_delete (ntohs (mp->contract.src_epg),
+ ntohs (mp->contract.dst_epg));
REPLY_MACRO (VL_API_GBP_CONTRACT_ADD_DEL_REPLY + GBP_MSG_BASE);
}
mp->_vl_msg_id = ntohs (VL_API_GBP_CONTRACT_DETAILS + GBP_MSG_BASE);
mp->context = ctx->context;
- mp->contract.src_epg = ntohl (gbpc->gc_key.gck_src);
- mp->contract.dst_epg = ntohl (gbpc->gc_key.gck_dst);
- mp->contract.acl_index = ntohl (gbpc->gc_acl_index);
+ mp->contract.src_epg = ntohs (gbpc->gc_key.gck_src);
+ mp->contract.dst_epg = ntohs (gbpc->gc_key.gck_dst);
+ mp->contract.acl_index = ntohl (gbpc->gc_value.gc_acl_index);
vl_api_send_msg (ctx->reg, (u8 *) mp);
gbp_main_t *gbpm = &gbp_main;
u8 *name = format (0, "gbp_%08x%c", api_version, 0);
- /* Ask for a correctly-sized block of API message decode slots */
- gbpm->msg_id_base = vl_msg_api_get_msg_ids ((char *) name,
- VL_MSG_FIRST_AVAILABLE);
+ gbpm->gbp_acl_user_id = ~0;
+ /* Ask for a correctly-sized block of API message decode slots */
+ msg_id_base = vl_msg_api_get_msg_ids ((char *) name,
+ VL_MSG_FIRST_AVAILABLE);
gbp_api_hookup (vm);
/* Add our API messages to the global name_crc hash table */