u8 *msg_copy;
u32 length;
trace_cfg_t *cfgp;
- u16 msg_id = ntohs (*((u16 *) msg));
+ u16 msg_id = clib_net_to_host_u16 (*((u16 *) msg));
msgbuf_t *header = (msgbuf_t *) (((u8 *) msg) - offsetof (msgbuf_t, data));
cfgp = am->api_trace_cfg + msg_id;
msg_handler_internal (api_main_t * am,
void *the_msg, int trace_it, int do_it, int free_it)
{
- u16 id = ntohs (*((u16 *) the_msg));
+ u16 id = clib_net_to_host_u16 (*((u16 *) the_msg));
u8 *(*print_fp) (void *, void *);
if (id < vec_len (am->msg_handlers) && am->msg_handlers[id])
void *the_msg, vlib_main_t * vm,
vlib_node_runtime_t * node)
{
- u16 id = ntohs (*((u16 *) the_msg));
+ u16 id = clib_net_to_host_u16 (*((u16 *) the_msg));
u8 *(*handler) (void *, void *, void *);
u8 *(*print_fp) (void *, void *);
int is_mp_safe = 1;
vl_msg_api_cleanup_handler (void *the_msg)
{
api_main_t *am = &api_main;
- u16 id = ntohs (*((u16 *) the_msg));
+ u16 id = clib_net_to_host_u16 (*((u16 *) the_msg));
if (PREDICT_FALSE (id >= vec_len (am->msg_cleanup_handlers)))
{
{
api_main_t *am = &api_main;
- u16 id = ntohs (*((u16 *) the_msg));
+ u16 id = clib_net_to_host_u16 (*((u16 *) the_msg));
if (PREDICT_FALSE (id >= vec_len (am->msg_handlers)))
{
u32
vl_api_string_len (vl_api_string_t * astr)
{
- return ntohl (astr->length);
+ return clib_net_to_host_u32 (astr->length);
}
/*
vl_api_from_api_to_vec (vl_api_string_t * astr)
{
u8 *v = 0;
- vec_add (v, astr->buf, ntohl (astr->length));
+ vec_add (v, astr->buf, clib_net_to_host_u32 (astr->length));
return v;
}
void *garbage_ctx)
{
uword log2_nbuckets = max_log2 (nbuckets);
- nbuckets = 1 << (log2_nbuckets);
+ nbuckets = 1ULL << (log2_nbuckets);
CLIB_CUCKOO_DBG ("New cuckoo, adjusted nbuckets %wu", nbuckets);
CVT (clib_cuckoo_bucket) * buckets = NULL;
vec_validate_aligned (buckets, nbuckets - 1, CLIB_CACHE_LINE_BYTES);