25 #include <vpp/app/version.h> 44 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 50 #define vl_api_version(n,v) static u32 api_version=(v); 56 #define foreach_gbp_api_msg \ 57 _(GBP_ENDPOINT_ADD_DEL, gbp_endpoint_add_del) \ 58 _(GBP_ENDPOINT_DUMP, gbp_endpoint_dump) \ 59 _(GBP_CONTRACT_ADD_DEL, gbp_contract_add_del) \ 60 _(GBP_CONTRACT_DUMP, gbp_contract_dump) 72 #define GBP_MSG_BASE gbp_main.msg_id_base 77 vl_api_gbp_endpoint_add_del_reply_t *rmp;
78 ip46_address_t ip = { };
126 memset (mp, 0,
sizeof (*mp));
127 mp->_vl_msg_id = ntohs (VL_API_GBP_ENDPOINT_DETAILS +
GBP_MSG_BASE);
168 vl_api_gbp_contract_add_del_reply_t *rmp;
193 memset (mp, 0,
sizeof (*mp));
194 mp->_vl_msg_id = ntohs (VL_API_GBP_CONTRACT_DETAILS +
GBP_MSG_BASE);
230 #define vl_msg_name_crc_list 232 #undef vl_msg_name_crc_list 237 #define _(id,n,crc) \ 238 vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id + GBP_MSG_BASE); 239 foreach_vl_msg_name_crc_gbp;
247 vl_msg_api_set_handlers(VL_API_##N + GBP_MSG_BASE, \ 249 vl_api_##n##_t_handler, \ 251 vl_api_##n##_t_endian, \ 252 vl_api_##n##_t_print, \ 253 sizeof(vl_api_##n##_t), 1); 263 u8 *name =
format (0,
"gbp_%08x%c", api_version, 0);
282 .version = VPP_BUILD_VER,
283 .description =
"Group Based Policy",
static int gbp_contract_send_details(gbp_contract_t *gbpc, void *args)
A Group Based Policy Endpoint.
gbp_contract_key_t gc_key
source and destination EPGs
static gbp_main_t gbp_main
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
gbp_endpoint_key_t * ge_key
The endpoint's interface and IP address.
void * vl_msg_api_alloc(int nbytes)
static void vl_api_gbp_contract_add_del_t_handler(vl_api_gbp_contract_add_del_t *mp)
void gbp_contract_walk(gbp_contract_cb_t cb, void *ctx)
u32 gek_sw_if_index
The interface on which the EP is connected.
static void setup_message_id_table(api_main_t *am)
void gbp_contract_delete(epg_id_t src_epg, epg_id_t dst_epg)
void gbp_endpoint_delete(u32 sw_if_index, const ip46_address_t *ip)
static void vl_api_gbp_contract_dump_t_handler(vl_api_gbp_contract_dump_t *mp)
API main structure, used by both vpp and binary API clients.
#define ip46_address_is_ip4(ip46)
struct gbp_main_t_ gbp_main_t
L2 Emulation Main.
An API client registration, only in vpp/vlib.
#define BAD_SW_IF_INDEX_LABEL
static uword vnet_sw_if_index_is_api_valid(u32 sw_if_index)
ip46_address_t gek_ip
The IP[46] address of the endpoint.
#define vec_free(V)
Free vector's memory (no header).
#define clib_memcpy(a, b, c)
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
epg_id_t gck_src
source and destination EPGs for which the ACL applies
static void vl_api_gbp_endpoint_dump_t_handler(vl_api_gbp_endpoint_dump_t *mp)
vl_api_gbp_contract_t contract
vl_api_gbp_endpoint_t endpoint
static clib_error_t * gbp_init(vlib_main_t *vm)
static void gbp_api_hookup(vlib_main_t *vm)
static void vl_api_gbp_endpoint_add_del_t_handler(vl_api_gbp_endpoint_add_del_t *mp)
static int gbp_endpoint_send_details(gbp_endpoint_t *gbpe, void *args)
vl_api_gbp_contract_t contract
void gbp_endpoint_update(u32 sw_if_index, const ip46_address_t *ip, epg_id_t epg_id)
vl_api_gbp_endpoint_t endpoint
epg_id_t ge_epg_id
The endpoint's designated EPG.
vl_api_registration_t * reg
u32 gc_acl_index
The ACL to apply for packets from the source to the destination EPG.
void gbp_endpoint_walk(gbp_endpoint_cb_t cb, void *ctx)
VLIB_API_INIT_FUNCTION(gbp_init)
struct gbp_walk_ctx_t_ gbp_walk_ctx_t
void gbp_contract_update(epg_id_t src_epg, epg_id_t dst_epg, u32 acl_index)
A Group Based Policy Contract.
u16 vl_msg_api_get_msg_ids(const char *name, int n)
#define foreach_gbp_api_msg