Skip to content
This repository was archived by the owner on May 23, 2023. It is now read-only.

Commit 3b9a4b0

Browse files
Juha Heiskanenjuhhei01
authored andcommitted
Base Integration for Mac neighbor table to WS
Added dummy functions for remove and NUD and table create to ws bootstrap init. Added definition for link and nud timeout.
1 parent 7729e20 commit 3b9a4b0

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

source/6LoWPAN/ws/ws_bootstrap.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
#include "6LoWPAN/ws/ws_common_defines.h"
4343
#include "6LoWPAN/ws/ws_llc.h"
4444
#include "6LoWPAN/lowpan_adaptation_interface.h"
45+
#include "Service_Libs/mac_neighbor_table/mac_neighbor_table.h"
4546

4647
#include "net_rpl.h"
4748
#include "mac_api.h"
@@ -443,6 +444,23 @@ static void ws_bootstrap_asynch_confirm(struct protocol_interface_info_entry *in
443444
(void)asynch_message;
444445
}
445446

447+
448+
static void ws_neighbor_entry_remove_notify(mac_neighbor_table_entry_t *entry_ptr, void *user_data)
449+
{
450+
//TODO Remove from MAC helper remove, ETX, WS Table entry
451+
(void) entry_ptr;
452+
(void) user_data;
453+
}
454+
455+
456+
static bool ws_neighbor_entry_nud_notify(mac_neighbor_table_entry_t *entry_ptr, void *user_data)
457+
{
458+
//TODO generate NS NUD
459+
(void) entry_ptr;
460+
(void) user_data;
461+
return true;
462+
}
463+
446464
int ws_bootstrap_init(int8_t interface_id, net_6lowpan_mode_e bootstrap_mode)
447465
{
448466
(void) bootstrap_mode;
@@ -481,6 +499,13 @@ int ws_bootstrap_init(int8_t interface_id, net_6lowpan_mode_e bootstrap_mode)
481499
//Disable allways by default
482500
lowpan_adaptation_interface_mpx_register(interface_id, NULL, 0);
483501

502+
mac_neighbor_table_delete(cur->mac_parameters->mac_neighbor_table);
503+
cur->mac_parameters->mac_neighbor_table = mac_neighbor_table_create(buffer.device_decription_table_size, ws_neighbor_entry_remove_notify
504+
, ws_neighbor_entry_nud_notify, cur, WS_NEIGHBOR_NUD_TIMEOUT);
505+
if (!cur->mac_parameters->mac_neighbor_table) {
506+
return -4;
507+
}
508+
484509
ws_llc_create(cur, &ws_bootstrap_asynch_ind, &ws_bootstrap_asynch_confirm);
485510

486511
mpx_api_t *mpx_api = ws_llc_mpx_api_get(cur);

source/6LoWPAN/ws/ws_common_defines.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,5 +91,8 @@ typedef struct ws_hoopping_schedule_s {
9191

9292
#define WS_FAN_VERSION_1_0 1
9393

94+
#define WS_NEIGHBOR_LINK_TIMEOUT 240
95+
#define WS_NEIGHBOR_NUD_TIMEOUT WS_NEIGHBOR_LINK_TIMEOUT / 2
96+
9497

9598
#endif /* WS_COMMON_DEFINES_H_ */

0 commit comments

Comments
 (0)