int8_t mle_class_set_new_key_pending(struct protocol_interface_info_entry *cur) { mac_neighbor_table_list_t *mac_table_list = &mac_neighbor_info(cur)->neighbour_list; ns_list_foreach_safe(mac_neighbor_table_entry_t, cur_entry, mac_table_list) { mle_service_frame_counter_entry_new_key_pending_set(cur->id, cur_entry->index); }
static mac_neighbor_table_entry_t *neighbor_data_poll_referesh(protocol_interface_info_entry_t *cur, const uint8_t *address, addrtype_t type) { mac_neighbor_table_entry_t *entry = mac_neighbor_table_address_discover(mac_neighbor_info(cur), address, type); if (!entry || !entry->connected_device) { return NULL; } entry->lifetime = entry->link_lifetime; return entry; }
int16_t mle_class_rfd_entry_count_get(struct protocol_interface_info_entry *cur) { mac_neighbor_table_list_t *mac_table_list = &mac_neighbor_info(cur)->neighbour_list; uint16_t count = 0; ns_list_foreach(mac_neighbor_table_entry_t, entry, mac_table_list) { if (!entry->ffd_device) { count++; } } return count; }
static void lowpan_adaptation_etx_update_cb(protocol_interface_info_entry_t *cur, buffer_t *buf, const mcps_data_conf_t *confirm) { switch (confirm->status) { case MLME_TX_NO_ACK: case MLME_NO_DATA: case MLME_SUCCESS: if (buf->link_specific.ieee802_15_4.requestAck) { if (cur->lowpan_info & INTERFACE_NWK_BOOTSRAP_MLE) { bool success = false; if (confirm->status == MLME_SUCCESS) { success = true; } // Gets table entry mac_neighbor_table_entry_t *neigh_table_ptr = mac_neighbor_table_address_discover(mac_neighbor_info(cur), buf->dst_sa.address + PAN_ID_LEN, buf->dst_sa.addr_type); if (neigh_table_ptr) { etx_transm_attempts_update(cur->id, 1 + confirm->tx_retries , success, neigh_table_ptr->index); // Updates ETX statistics etx_storage_t * etx_entry = etx_storage_entry_get(cur->id, neigh_table_ptr->index); if (etx_entry) { if (neigh_table_ptr->link_role == PRIORITY_PARENT_NEIGHBOUR) { protocol_stats_update(STATS_ETX_1ST_PARENT, etx_entry->etx >> 4); } else if (neigh_table_ptr->link_role == SECONDARY_PARENT_NEIGHBOUR) { protocol_stats_update(STATS_ETX_2ND_PARENT, etx_entry->etx >> 4); } } }
uint16_t mle_class_active_neigh_counter(protocol_interface_info_entry_t *cur) { mac_neighbor_table_list_t *mac_table_list = &mac_neighbor_info(cur)->neighbour_list; return ns_list_count(mac_table_list); }
int16_t mle_class_free_entry_count_get(struct protocol_interface_info_entry *cur) { mac_neighbor_table_list_t *mac_table_free_list = &mac_neighbor_info(cur)->free_list; return ns_list_count(mac_table_free_list); }