The example given in contiki named as udp-receiver has this code and it is receving the data and data lenght but I can't able to get the data from raw udp data.
static void
receiver(struct simple_udp_connection *c,
const uip_ipaddr_t *sender_addr,
uint16_t sender_port,
const uip_ipaddr_t *receiver_addr,
uint16_t receiver_port,
const uint8_t *data,
uint16_t datalen)
{
static int msg;
msg++;
printf("%d Data %d received length %d\n",,msg, datalen);
//What code should be here to get the data.
}