dis_input(void)
{
  rpl_instance_t *instance;
  rpl_instance_t *end;

  /* DAG Information Solicitation */
  LOG_INFO("Received a DIS from ");
  LOG_INFO_6ADDR(&UIP_IP_BUF->srcipaddr);
  LOG_INFO_("\n");

  for(instance = &instance_table[0], end = instance + RPL_MAX_INSTANCES;
      instance < end; ++instance) {
    if(instance->used == 1) {
      if(uip_is_addr_mcast(&UIP_IP_BUF->destipaddr)) {
#if RPL_LEAF_ONLY
        LOG_INFO("LEAF ONLY Multicast DIS will NOT reset DIO timer\n");
#else /* !RPL_LEAF_ONLY */
        LOG_DBG("Multicast DIS => reset DIO timer\n");
        rpl_reset_dio_timer(instance);
#endif /* !RPL_LEAF_ONLY */
      } else {
        /* Check if this neighbor should be added according to the policy. */
        if(rpl_icmp6_update_nbr_table(&UIP_IP_BUF->srcipaddr,
                                      NBR_TABLE_REASON_RPL_DIS, NULL) == NULL) {
          LOG_ERR("Out of Memory, not sending unicast DIO, DIS from ");
          LOG_ERR_6ADDR(&UIP_IP_BUF->srcipaddr);
          LOG_ERR_(", ");
          LOG_ERR_LLADDR(packetbuf_addr(PACKETBUF_ADDR_SENDER));
          LOG_ERR_("\n");
        } else {
          LOG_DBG("Unicast DIS, reply to sender\n");
          dio_output(instance, &UIP_IP_BUF->srcipaddr);
        }
        /* } */
      }
    }
  }
  uipbuf_clear();
}
dis_input(void)
{
  rpl_instance_t *instance;
  rpl_instance_t *end;

   
  LOG_INFO("Received a DIS from ");
  LOG_INFO_6ADDR(&UIP_IP_BUF->srcipaddr);
  LOG_INFO_("\n");

  for(instance = &instance_table[0], end = instance + RPL_MAX_INSTANCES;
      instance < end; ++instance) {
    if(instance->used == 1) {
      if(uip_is_addr_mcast(&UIP_IP_BUF->destipaddr)) {
#if RPL_LEAF_ONLY
        LOG_INFO("LEAF ONLY Multicast DIS will NOT reset DIO timer\n");
#else  
        LOG_DBG("Multicast DIS => reset DIO timer\n");
        rpl_reset_dio_timer(instance);
#endif  
      } else {
         
        if(rpl_icmp6_update_nbr_table(&UIP_IP_BUF->srcipaddr,
                                      NBR_TABLE_REASON_RPL_DIS, NULL) == NULL) {
          LOG_ERR("Out of Memory, not sending unicast DIO, DIS from ");
          LOG_ERR_6ADDR(&UIP_IP_BUF->srcipaddr);
          LOG_ERR_(", ");
          LOG_ERR_LLADDR(packetbuf_addr(PACKETBUF_ADDR_SENDER));
          LOG_ERR_("\n");
        } else {
          LOG_DBG("Unicast DIS, reply to sender\n");
          dio_output(instance, &UIP_IP_BUF->srcipaddr);
        }
         
      }
    }
  }
  uipbuf_clear();
}