Skip to content

Commit

Permalink
Base Integration for Mac neighbor table to WS
Browse files Browse the repository at this point in the history
Added dummy functions for remove and NUD and table create to ws
bootstrap init.

Added definition for link and nud timeout.
  • Loading branch information
Juha Heiskanen authored and juhhei01 committed Mar 1, 2018
1 parent 7729e20 commit 3b9a4b0
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
25 changes: 25 additions & 0 deletions source/6LoWPAN/ws/ws_bootstrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include "6LoWPAN/ws/ws_common_defines.h"
#include "6LoWPAN/ws/ws_llc.h"
#include "6LoWPAN/lowpan_adaptation_interface.h"
#include "Service_Libs/mac_neighbor_table/mac_neighbor_table.h"

#include "net_rpl.h"
#include "mac_api.h"
Expand Down Expand Up @@ -443,6 +444,23 @@ static void ws_bootstrap_asynch_confirm(struct protocol_interface_info_entry *in
(void)asynch_message;
}


static void ws_neighbor_entry_remove_notify(mac_neighbor_table_entry_t *entry_ptr, void *user_data)
{
//TODO Remove from MAC helper remove, ETX, WS Table entry
(void) entry_ptr;
(void) user_data;
}


static bool ws_neighbor_entry_nud_notify(mac_neighbor_table_entry_t *entry_ptr, void *user_data)
{
//TODO generate NS NUD
(void) entry_ptr;
(void) user_data;
return true;
}

int ws_bootstrap_init(int8_t interface_id, net_6lowpan_mode_e bootstrap_mode)
{
(void) bootstrap_mode;
Expand Down Expand Up @@ -481,6 +499,13 @@ int ws_bootstrap_init(int8_t interface_id, net_6lowpan_mode_e bootstrap_mode)
//Disable allways by default
lowpan_adaptation_interface_mpx_register(interface_id, NULL, 0);

mac_neighbor_table_delete(cur->mac_parameters->mac_neighbor_table);
cur->mac_parameters->mac_neighbor_table = mac_neighbor_table_create(buffer.device_decription_table_size, ws_neighbor_entry_remove_notify
, ws_neighbor_entry_nud_notify, cur, WS_NEIGHBOR_NUD_TIMEOUT);
if (!cur->mac_parameters->mac_neighbor_table) {
return -4;
}

ws_llc_create(cur, &ws_bootstrap_asynch_ind, &ws_bootstrap_asynch_confirm);

mpx_api_t *mpx_api = ws_llc_mpx_api_get(cur);
Expand Down
3 changes: 3 additions & 0 deletions source/6LoWPAN/ws/ws_common_defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,8 @@ typedef struct ws_hoopping_schedule_s {

#define WS_FAN_VERSION_1_0 1

#define WS_NEIGHBOR_LINK_TIMEOUT 240
#define WS_NEIGHBOR_NUD_TIMEOUT WS_NEIGHBOR_LINK_TIMEOUT / 2


#endif /* WS_COMMON_DEFINES_H_ */

0 comments on commit 3b9a4b0

Please sign in to comment.