#define f64_endian(a)
#define f64_print(a,b)
+#ifndef REPLY_MSG_ID_BASE
+#define REPLY_MSG_ID_BASE 0
+#endif
+
#define REPLY_MACRO(t) \
do { \
unix_shared_memory_queue_t * q; \
return; \
\
rmp = vl_msg_api_alloc (sizeof (*rmp)); \
- rmp->_vl_msg_id = ntohs((t)); \
+ rmp->_vl_msg_id = htons((t)+(REPLY_MSG_ID_BASE)); \
rmp->context = mp->context; \
rmp->retval = ntohl(rv); \
\
return; \
\
rmp = vl_msg_api_alloc (sizeof (*rmp)); \
- rmp->_vl_msg_id = ntohs((t)); \
+ rmp->_vl_msg_id = htons((t)+(REPLY_MSG_ID_BASE)); \
rmp->context = mp->context; \
rmp->retval = ntohl(rv); \
do {body;} while (0); \
return; \
\
rmp = vl_msg_api_alloc (sizeof (*rmp) + n); \
- rmp->_vl_msg_id = ntohs((t)); \
+ rmp->_vl_msg_id = htons((t)+(REPLY_MSG_ID_BASE)); \
rmp->context = mp->context; \
rmp->retval = ntohl(rv); \
do {body;} while (0); \
rv = VNET_API_ERROR_TABLE_TOO_BIG; \
is_error = 1; \
} \
- rmp->_vl_msg_id = ntohs((t)); \
+ rmp->_vl_msg_id = htons((t)+(REPLY_MSG_ID_BASE)); \
rmp->context = mp->context; \
rmp->retval = ntohl(rv); \
if (!is_error) \
; \
} while (0);
+#define VALIDATE_BD_ID(mp) \
+ do { u32 __rx_bd_id = ntohl(mp->bd_id); \
+ if (__rx_bd_id > L2_BD_ID_MAX) { \
+ rv = VNET_API_ERROR_BD_ID_EXCEED_MAX; \
+ goto bad_bd_id; \
+ } \
+} while(0);
+
+#define BAD_BD_ID_LABEL \
+do { \
+bad_bd_id: \
+ ; \
+} while (0);
+
#define pub_sub_handler(lca,UCA) \
static void vl_api_want_##lca##_t_handler ( \
vl_api_want_##lca##_t *mp) \
_(to_netconf_client) \
_(from_netconf_client) \
_(oam_events) \
-_(bfd_events)
+_(bfd_events) \
+_(wc_ip4_arp_events)
-/* WARNING: replicated in vpp/stats.h */
typedef struct
{
u32 client_index; /* in memclnt registration pool */