Skip to content

Commit 49ccb9d

Browse files
Juha Heiskanenjuhhei01
authored andcommitted
Removed threadNeighbour flag from mle_table_entry_t.
1 parent e142eec commit 49ccb9d

File tree

9 files changed

+15
-32
lines changed

9 files changed

+15
-32
lines changed

source/6LoWPAN/Bootstraps/Generic/protocol_6lowpan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ int8_t protocol_6lowpan_neighbor_address_state_synch(protocol_interface_info_ent
570570
#ifndef NO_MLE
571571
mle_neigh_table_entry_t *mle_entry = 0;
572572
mle_entry = mle_class_get_by_link_address(cur->id, eui64, ADDR_802_15_4_LONG);
573-
if (mle_entry && !mle_entry->threadNeighbor) {
573+
if (mle_entry) {
574574
if (memcmp(iid, ADDR_SHORT_ADR_SUFFIC, 6) == 0) {
575575
iid += 6;
576576
//Set Short Address to MLE

source/6LoWPAN/Bootstraps/Generic/protocol_6lowpan_bootstrap.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,8 +1140,6 @@ void mle_6lowpan_message_handler(int8_t interface_id, mle_message_t *mle_msg, ml
11401140

11411141
//Response state set now timeout know positive state
11421142
mle_service_set_msg_response_true(responseId);
1143-
1144-
entry_temp->threadNeighbor = false;
11451143
entry_temp->handshakeReady = 1;
11461144

11471145
mac_data_poll_protocol_poll_mode_decrement(cur);

source/6LoWPAN/Thread/thread_diagnostic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ static uint8_t *thread_diagnostic_child_table_tlv_build(uint8_t *data_ptr, proto
104104
*data_ptr++ = (3 * child_count); // Length
105105

106106
ns_list_foreach(mle_neigh_table_entry_t, cur_entry, mle_table) {
107-
if (cur_entry->threadNeighbor && thread_router_addr_from_addr(cur_entry->short_adr) == mac_helper_mac16_address_get(cur)){
107+
if (thread_router_addr_from_addr(cur_entry->short_adr) == mac_helper_mac16_address_get(cur)){
108108
/* |0|1|2|3|4|5|6|7|8|9|0|1|2|3|4|5|6|7|8|9|0|1|2|3| */
109109
/* |Timeout |Rsv| Child ID | Mode | */
110110
calculated_timeout = thread_log2_aprx((cur_entry->timeout_rx-1)*MLE_TIMER_TICKS_SECONDS) + 4;

source/6LoWPAN/Thread/thread_host_bootstrap.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ static bool thread_parent_discover_timeout_cb(int8_t interface_id, uint16_t msgI
161161
if (entry_temp == NULL) {
162162
return false;
163163
}
164-
entry_temp->threadNeighbor = true;
165164
entry_temp->short_adr = parent->shortAddress;
166165
entry_temp->priorityFlag = true;
167166

@@ -335,7 +334,6 @@ static int thread_end_device_synch_response_validate(protocol_interface_info_ent
335334
/*
336335
337336
*/
338-
entry_temp->threadNeighbor = true;
339337
entry_temp->short_adr = srcAddress;
340338
entry_temp->handshakeReady = 1;
341339
entry_temp->priorityFlag = true; // Make this our parent
@@ -841,7 +839,6 @@ static void thread_mle_child_request_receive_cb(int8_t interface_id, mle_message
841839

842840
entry_temp->handshakeReady = 1;
843841
entry_temp->priorityFlag = true;
844-
entry_temp->threadNeighbor = true;
845842

846843
mac_helper_coordinator_address_set(cur, ADDR_802_15_4_SHORT, shortAddress);
847844
mle_entry_timeout_update(entry_temp, thread_info(cur)->host_link_timeout);
@@ -956,7 +953,6 @@ void thread_endevice_synch_start(protocol_interface_info_entry_t *cur)
956953
if (entry_temp) {
957954
entry_temp->short_adr = cur->thread_info->thread_endnode_parent->shortAddress;
958955
entry_temp->handshakeReady = 1;
959-
entry_temp->threadNeighbor = true;
960956

961957
// In case we don't get response to sync; use temporary timeout here,
962958
// Child ID Response handler will set correct value later

source/6LoWPAN/Thread/thread_mle_message_handler.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,6 @@ static void thread_parse_accept(protocol_interface_info_entry_t *cur, mle_messag
460460
mleFrameCounter = llFrameCounter;
461461
}
462462

463-
entry_temp->threadNeighbor = true;
464463
entry_temp->short_adr = shortAddress;
465464
mle_service_frame_counter_table_add(cur->id, entry_temp->attribute_index, mleFrameCounter);
466465
// Set full data as REED needs full data and SED will not make links

source/6LoWPAN/Thread/thread_network_synch.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,6 @@ void thread_dynamic_storage_build_mle_table(int8_t interface_id)
269269
entry->short_adr = storeEntry->networ_dynamic_data_parameters.children[i].short_addr;
270270
mle_service_frame_counter_table_add(interface_id, entry->attribute_index, storeEntry->networ_dynamic_data_parameters.children[i].mle_frame_counter);
271271
entry->mode = storeEntry->networ_dynamic_data_parameters.children[i].mode;
272-
entry->threadNeighbor = true;
273272

274273
protocol_interface_info_entry_t *cur = protocol_stack_interface_info_get_by_id(interface_id);
275274

source/6LoWPAN/Thread/thread_router_bootstrap.c

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -239,10 +239,8 @@ static void mle_multicast_push_to_sleep_child(protocol_interface_info_entry_t *c
239239
return;
240240
}
241241
ns_list_foreach(mle_neigh_table_entry_t, cur_entry, mle_neigh_list) {
242-
if (cur_entry->threadNeighbor) {
243-
if (!(cur_entry->mode & MLE_RX_ON_IDLE)) {
244-
clone_multicast_to_unicast(cur, cur_entry, buf);
245-
}
242+
if (!(cur_entry->mode & MLE_RX_ON_IDLE)) {
243+
clone_multicast_to_unicast(cur, cur_entry, buf);
246244
}
247245
}
248246
}
@@ -261,7 +259,7 @@ static void thread_registered_mcast_forward_to_child(protocol_interface_info_ent
261259

262260
ns_list_foreach(thread_mcast_child_t, child, &addr->children) {
263261
mle_neigh_table_entry_t *mle_entry = mle_class_get_by_link_address(cur->id, child->mac64, ADDR_802_15_4_LONG);
264-
if (mle_entry && mle_entry->threadNeighbor && !(mle_entry->mode & MLE_RX_ON_IDLE)) {
262+
if (!(mle_entry->mode & MLE_RX_ON_IDLE)) {
265263
clone_multicast_to_unicast(cur, mle_entry, buffer);
266264
}
267265
}
@@ -361,7 +359,6 @@ static void thread_router_synch_receive_cb(int8_t interface_id, mle_message_t *m
361359

362360
//Free Response
363361
mle_service_msg_free(messageId);
364-
entry_temp->threadNeighbor = true;
365362
entry_temp->short_adr = shortAddress;
366363

367364
//when allocating neighbour entry, use MLE Frame counter if present to validate further advertisements from the neighbour
@@ -1328,7 +1325,6 @@ void thread_router_bootstrap_child_id_handler(protocol_interface_info_entry_t *c
13281325

13291326
mle_entry_timeout_update(entry_temp, req->timeout);
13301327
entry_temp->mode = req->mode;
1331-
entry_temp->threadNeighbor = true;
13321328
entry_temp->handshakeReady = 1;
13331329
mle_service_frame_counter_table_add(cur->id, entry_temp->attribute_index, req->mleFrameCounter);
13341330

@@ -1864,7 +1860,6 @@ void thread_router_bootstrap_mle_receive_cb(int8_t interface_id, mle_message_t *
18641860
thread_management_key_synch_req(cur->id, common_read_32_bit(security_headers->Keysource));
18651861
}
18661862

1867-
entry_temp->threadNeighbor = true;
18681863
entry_temp->short_adr = shortAddress;
18691864
mlme_device_descriptor_t device_desc;
18701865
mac_helper_device_description_write(cur, &device_desc, entry_temp->mac64, entry_temp->short_adr,llFrameCounter, false);
@@ -2469,7 +2464,6 @@ void thread_router_bootstrap_timer(protocol_interface_info_entry_t *cur, uint32_
24692464
void thread_router_bootstrap_advertiment_analyze(protocol_interface_info_entry_t *cur, uint8_t *src_address, mle_neigh_table_entry_t *entry_temp, uint16_t shortAddress)
24702465
{
24712466
if (entry_temp) {
2472-
entry_temp->threadNeighbor = true;
24732467

24742468
if (entry_temp->timeout_rx == 0 || thread_is_router_addr(shortAddress)) {
24752469
entry_temp->timeout_rx = THREAD_DEFAULT_LINK_LIFETIME / MLE_TIMER_TICKS_SECONDS;
@@ -2669,16 +2663,14 @@ static void thread_router_bootstrap_network_data_push_to_sleep_child(protocol_in
26692663
mle_neigh_table_list_t *mle_table = mle_class_active_list_get(cur->id);
26702664
memcpy(childLinkLocalAddress, ADDR_LINK_LOCAL_PREFIX, 8);
26712665
ns_list_foreach(mle_neigh_table_entry_t, cur_entry, mle_table) {
2672-
if (cur_entry->threadNeighbor) {
2673-
if (!(cur_entry->mode & MLE_RX_ON_IDLE)) {
2674-
memcpy(&childLinkLocalAddress[8], cur_entry->mac64, 8);
2675-
childLinkLocalAddress[8] ^= 2;
2676-
if (cur_entry->mode & MLE_THREAD_REQ_FULL_DATA_SET) {
2677-
thread_router_bootstrap_network_data_propagation(cur, childLinkLocalAddress, true);
2678-
} else {
2679-
if (stableDataUpdate) {
2680-
thread_router_bootstrap_network_data_propagation(cur, childLinkLocalAddress, false);
2681-
}
2666+
if (!(cur_entry->mode & MLE_RX_ON_IDLE)) {
2667+
memcpy(&childLinkLocalAddress[8], cur_entry->mac64, 8);
2668+
childLinkLocalAddress[8] ^= 2;
2669+
if (cur_entry->mode & MLE_THREAD_REQ_FULL_DATA_SET) {
2670+
thread_router_bootstrap_network_data_propagation(cur, childLinkLocalAddress, true);
2671+
} else {
2672+
if (stableDataUpdate) {
2673+
thread_router_bootstrap_network_data_propagation(cur, childLinkLocalAddress, false);
26822674
}
26832675
}
26842676
}

source/6LoWPAN/Thread/thread_test_api.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,7 +1124,7 @@ int8_t thread_test_child_info_get(int8_t interface_id, uint8_t index, uint16_t *
11241124
}
11251125

11261126
ns_list_foreach(mle_neigh_table_entry_t, cur_entry, mle_table) {
1127-
if (cur_entry->threadNeighbor && thread_router_addr_from_addr(cur_entry->short_adr) == thread_router_addr_from_addr(mac16)) {
1127+
if (thread_router_addr_from_addr(cur_entry->short_adr) == thread_router_addr_from_addr(mac16)) {
11281128
if (n == index) {
11291129
*short_addr = cur_entry->short_adr;
11301130
memcpy(mac64,cur_entry->mac64, 8);
@@ -1162,7 +1162,7 @@ int8_t thread_test_neighbour_info_get(int8_t interface_id, uint8_t index, uint16
11621162
}
11631163

11641164
ns_list_foreach(mle_neigh_table_entry_t, cur_entry, mle_table) {
1165-
if (cur_entry->threadNeighbor && thread_router_addr_from_addr(cur_entry->short_adr) != thread_router_addr_from_addr(mac16)) {
1165+
if (thread_router_addr_from_addr(cur_entry->short_adr) != thread_router_addr_from_addr(mac16)) {
11661166
if (n == index) {
11671167
*short_addr = cur_entry->short_adr;
11681168
memcpy(mac64,cur_entry->mac64, 8);

source/MLE/mle.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ typedef struct mle_neigh_table_entry_t {
158158
unsigned priority_child_flag: 1; /* Is using our node as preferred parent */
159159
unsigned second_priority_flag: 1; /* Is secondary parent */
160160
unsigned thread_commission: 1;
161-
unsigned threadNeighbor: 1;
162161
unsigned priorityFlag: 1;
163162
unsigned handshakeReady: 1;
164163
unsigned medium_ttl_challenge: 1;

0 commit comments

Comments
 (0)