Skip to content

Commit 7a0aaa5

Browse files
Juha Heiskanenjuhhei01
authored andcommitted
Rename some parameters which will help integration to new neighbor table.
Change-Id: Idccaa012f4593585885316a4a5b320d5c7178774
1 parent fde5104 commit 7a0aaa5

File tree

9 files changed

+26
-26
lines changed

9 files changed

+26
-26
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ int8_t protocol_6lowpan_neighbor_address_state_synch(protocol_interface_info_ent
577577
mle_entry->short_adr = common_read_16_bit(iid);
578578
}
579579
if ((mle_entry->mode & MLE_DEV_MASK) == MLE_RFD_DEV) {
580-
if (mle_entry->handshakeReady) {
580+
if (mle_entry->connected_device) {
581581
mle_entry_timeout_refresh(mle_entry);
582582
}
583583
ret_val = 1;

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ static uint8_t *mle_table_set_neighbours(int8_t interface_id, uint8_t *ptr)
449449

450450
loop_list = false;
451451

452-
if ((cur->handshakeReady) && (cur->link_q_adv_sent == false)) {
452+
if ((cur->connected_device) && (cur->link_q_adv_sent == false)) {
453453

454454
// If looping list, stops adding entries when at first sent entry again
455455
if (first_entry_ptr == cur) {
@@ -1086,7 +1086,7 @@ void mle_6lowpan_message_handler(int8_t interface_id, mle_message_t *mle_msg, ml
10861086

10871087
incoming_idr = mle_calculate_idr(interface_id, mle_msg, entry_temp);
10881088

1089-
if (entry_temp && entry_temp->handshakeReady) {
1089+
if (entry_temp && entry_temp->connected_device) {
10901090
response_type = MLE_COMMAND_ACCEPT;
10911091
} else {
10921092
response_type = MLE_COMMAND_ACCEPT_AND_REQUEST;
@@ -1128,7 +1128,7 @@ void mle_6lowpan_message_handler(int8_t interface_id, mle_message_t *mle_msg, ml
11281128

11291129
//Response state set now timeout know positive state
11301130
mle_service_set_msg_response_true(responseId);
1131-
entry_temp->handshakeReady = 1;
1131+
entry_temp->connected_device = 1;
11321132

11331133
mac_data_poll_protocol_poll_mode_decrement(cur);
11341134

@@ -1221,7 +1221,7 @@ void mle_6lowpan_message_handler(int8_t interface_id, mle_message_t *mle_msg, ml
12211221
//UPDATE
12221222
mle_neigh_entry_update_by_mle_tlv_list(cur->id,entry_temp, mle_msg->data_ptr, mle_msg->data_length, cur->mac, own_mac16);
12231223
mle_neigh_entry_frame_counter_update(entry_temp, mle_msg->data_ptr, mle_msg->data_length, cur, security_headers->KeyIndex);
1224-
if (entry_temp->handshakeReady) {
1224+
if (entry_temp->connected_device) {
12251225
mle_entry_timeout_refresh(entry_temp);
12261226
}
12271227
}

source/6LoWPAN/MAC/mac_pairwise_key.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ int mac_pairwise_key_add(int8_t interface_id, uint32_t valid_life_time, const ui
271271
return -1;
272272
}
273273

274-
mle_entry->thread_commission = true;
274+
mle_entry->trusted_device = true;
275275
mle_entry->short_adr = 0xffff;
276276
mle_entry->ttl = 20;
277277

source/6LoWPAN/Thread/thread_host_bootstrap.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ static int thread_end_device_synch_response_validate(protocol_interface_info_ent
341341
342342
*/
343343
entry_temp->short_adr = srcAddress;
344-
entry_temp->handshakeReady = 1;
344+
entry_temp->connected_device = 1;
345345
entry_temp->priorityFlag = true; // Make this our parent
346346
common_write_16_bit(entry_temp->short_adr, shortAddress);
347347

@@ -845,7 +845,7 @@ static void thread_mle_child_request_receive_cb(int8_t interface_id, mle_message
845845
//Update possible reed address by real router address
846846
scan_result->shortAddress = entry_temp->short_adr;
847847

848-
entry_temp->handshakeReady = 1;
848+
entry_temp->connected_device = 1;
849849
entry_temp->priorityFlag = true;
850850

851851
mac_helper_coordinator_address_set(cur, ADDR_802_15_4_SHORT, shortAddress);
@@ -964,7 +964,7 @@ void thread_endevice_synch_start(protocol_interface_info_entry_t *cur)
964964
thread_neighbor_last_communication_time_update(&cur->thread_info->neighbor_class, entry_temp->attribute_index);
965965

966966
entry_temp->short_adr = cur->thread_info->thread_endnode_parent->shortAddress;
967-
entry_temp->handshakeReady = 1;
967+
entry_temp->connected_device = 1;
968968

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

source/6LoWPAN/Thread/thread_mle_message_handler.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ static bool thread_router_leader_data_process(protocol_interface_info_entry_t *c
222222
int leaderDataUpdate = thread_leader_data_validation(cur, leaderData, routeTlv);
223223

224224
if (leaderDataUpdate == 1) {
225-
if (neighbor && neighbor->handshakeReady == 1) {
225+
if (neighbor && neighbor->connected_device == 1) {
226226
// Request network data if we have a 2-way link
227227
tr_debug("Request New Network Data from %s", trace_ipv6(src_address));
228228
thread_network_data_request_send(cur, src_address, true);
@@ -486,10 +486,10 @@ static void thread_parse_accept(protocol_interface_info_entry_t *cur, mle_messag
486486

487487
if (thread_i_am_router(cur) && thread_is_router_addr(entry_temp->short_adr)) {
488488
// If we both are routers, mark the link as 2-way
489-
entry_temp->handshakeReady = 1;
490-
tr_debug("Marked link as 2-way, handshakeReady=%d", entry_temp->handshakeReady);
489+
entry_temp->connected_device = 1;
490+
tr_debug("Marked link as 2-way, handshakeReady=%d", entry_temp->connected_device);
491491
} else {
492-
tr_debug("Marked link as 1-way, handshakeReady=%d", entry_temp->handshakeReady);
492+
tr_debug("Marked link as 1-way, handshakeReady=%d", entry_temp->connected_device);
493493
}
494494

495495
blacklist_update(mle_msg->packet_src_address, true);

source/6LoWPAN/Thread/thread_router_bootstrap.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ static void thread_router_synch_receive_cb(int8_t interface_id, mle_message_t *m
380380
}
381381

382382
if (thread_is_router_addr(shortAddress)) {
383-
entry_temp->handshakeReady = 1;
383+
entry_temp->connected_device = 1;
384384
}
385385

386386
entry_temp->mode |= MLE_THREAD_REQ_FULL_DATA_SET;
@@ -1331,7 +1331,7 @@ void thread_router_bootstrap_child_id_handler(protocol_interface_info_entry_t *c
13311331

13321332
mle_entry_timeout_update(entry_temp, req->timeout);
13331333
entry_temp->mode = req->mode;
1334-
entry_temp->handshakeReady = 1;
1334+
entry_temp->connected_device = 1;
13351335
mle_service_frame_counter_entry_add(cur->id, entry_temp->attribute_index, req->mleFrameCounter);
13361336

13371337
if (req->shortAddressReq) {
@@ -1747,7 +1747,7 @@ void thread_router_bootstrap_mle_receive_cb(int8_t interface_id, mle_message_t *
17471747
*
17481748
*/
17491749

1750-
if (entry_temp && entry_temp->handshakeReady) {
1750+
if (entry_temp && entry_temp->connected_device) {
17511751
mle_entry_timeout_refresh(entry_temp);
17521752
thread_neighbor_class_update_link(&cur->thread_info->neighbor_class, entry_temp->attribute_index,linkMargin, false);
17531753
thread_neighbor_last_communication_time_update(&cur->thread_info->neighbor_class, entry_temp->attribute_index);
@@ -1785,7 +1785,7 @@ void thread_router_bootstrap_mle_receive_cb(int8_t interface_id, mle_message_t *
17851785
update_mac_mib = true;
17861786
entry_temp->short_adr = shortAddress; // short address refreshed
17871787

1788-
if (entry_temp->handshakeReady) {
1788+
if (entry_temp->connected_device) {
17891789
if (mle_tlv_read_tlv(MLE_TYPE_ADDRESS_REGISTRATION, mle_msg->data_ptr, mle_msg->data_length, &addressRegisteredTlv)) {
17901790
if (thread_rfd_device(entry_temp->mode)) {
17911791
thread_address_registration_tlv_parse(addressRegisteredTlv.dataPtr, addressRegisteredTlv.tlvLen, cur, entry_temp->short_adr, entry_temp->mac64);
@@ -1886,7 +1886,7 @@ void thread_router_bootstrap_mle_receive_cb(int8_t interface_id, mle_message_t *
18861886
}
18871887

18881888
if (thread_is_router_addr(shortAddress)) {
1889-
entry_temp->handshakeReady = 1;
1889+
entry_temp->connected_device = 1;
18901890
}
18911891

18921892
entry_temp->mode |= MLE_THREAD_REQ_FULL_DATA_SET;
@@ -2282,7 +2282,7 @@ int thread_router_bootstrap_route_tlv_push(protocol_interface_info_entry_t *cur,
22822282

22832283
/* XXX Is short_src_adr ever reset? Is it undefined if info not in msg? */
22842284
/* Don't add routing link if MLE link is NOT bi-directional (i.e. we can only hear) */
2285-
if (entry->handshakeReady) {
2285+
if (entry->connected_device) {
22862286
thread_routing_add_link(cur, entry->short_adr, linkMargin, route_id_seq, router_id_mask, route_data, false);
22872287
}
22882288

source/6LoWPAN/adaptation_interface.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ buffer_t * lowpan_adaptation_data_process_tx_preprocess(protocol_interface_info_
625625
//Validate neighbour
626626
if (!buf->options.ll_security_bypass_tx && mle_entry) {
627627

628-
if (mle_entry->handshakeReady || mle_entry->thread_commission) {
628+
if (mle_entry->connected_device || mle_entry->trusted_device) {
629629

630630
} else {
631631
//tr_warn("Drop TX to unassociated %s", trace_sockaddr(&buf->dst_sa, true));
@@ -651,7 +651,7 @@ buffer_t * lowpan_adaptation_data_process_tx_preprocess(protocol_interface_info_
651651

652652
if (!buf->link_specific.ieee802_15_4.requestAck ) {
653653
buf->link_specific.ieee802_15_4.key_id_mode = B_SECURITY_KEY_ID_MODE_DEFAULT;
654-
} else if (ws_info(cur) || (mle_entry && !mle_entry->thread_commission)) {
654+
} else if (ws_info(cur) || (mle_entry && !mle_entry->trusted_device)) {
655655
buf->link_specific.ieee802_15_4.key_id_mode = B_SECURITY_KEY_ID_MODE_DEFAULT;
656656
} else {
657657
buf->link_specific.ieee802_15_4.key_id_mode = B_SECURITY_KEY_ID_IMPLICIT;
@@ -1165,7 +1165,7 @@ static bool mcps_data_indication_neighbor_validate(int8_t interface_id, const so
11651165
return true;
11661166
}
11671167
mle_neigh_table_entry_t *mle_entry = mle_class_get_by_link_address(interface_id, addr->address + 2, addr->addr_type);
1168-
if (mle_entry && (mle_entry->handshakeReady || mle_entry->thread_commission)) {
1168+
if (mle_entry && (mle_entry->connected_device || mle_entry->trusted_device)) {
11691169
return true;
11701170
}
11711171

source/MLE/mle.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,7 @@ static void mle_refresh_entry(mle_neigh_table_entry_t *neig_info, bool dataPollC
808808
if (!neig_info) {
809809
return;
810810
}
811-
if (!neig_info->handshakeReady) {
811+
if (!neig_info->connected_device) {
812812
tr_debug("refresh:Link Handshake not ready yet");
813813
return;
814814
}

source/MLE/mle.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,12 @@ typedef struct mle_neigh_table_entry_t {
152152
uint16_t short_adr;
153153
uint8_t mode;
154154
unsigned link_q_adv_sent: 1;
155+
unsigned medium_ttl_challenge: 1;
155156
unsigned priority_child_flag: 1; /* Is using our node as preferred parent */
156157
unsigned second_priority_flag: 1; /* Is secondary parent */
157-
unsigned thread_commission: 1;
158158
unsigned priorityFlag: 1;
159-
unsigned handshakeReady: 1;
160-
unsigned medium_ttl_challenge: 1;
159+
unsigned trusted_device: 1; /*!< True mean use normal group key, false for enable pairwise key */
160+
unsigned connected_device: 1; /*!< True Link is connected and data rx is accepted , False RX data is not accepted */
161161
ns_list_link_t link;
162162
} mle_neigh_table_entry_t ;
163163

0 commit comments

Comments
 (0)