Skip to content

Commit 7ebaa8e

Browse files
author
Arto Kinnunen
authored
Add Nanostack configuration for WS (ARMmbed#1961)
-Add WS configuration files for border_router and router -Fix compilation warnings
1 parent e20028a commit 7ebaa8e

File tree

21 files changed

+156
-11
lines changed

21 files changed

+156
-11
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ clean-extra: $(CLEANTESTDIRS)
109109
# 3. TBD: importing to mbed OS
110110

111111
TARGET_DIR:=release
112-
CONFIGURATIONS_TO_BUILD:=lowpan_border_router lowpan_host lowpan_router nanostack_full thread_border_router thread_router thread_end_device ethernet_host
112+
CONFIGURATIONS_TO_BUILD:=lowpan_border_router lowpan_host lowpan_router nanostack_full thread_border_router thread_router thread_end_device ethernet_host ws_border_router ws_router
113113
TOOLCHAINS_TO_BUILD:=GCC ARM ARMC6 IAR
114114
CORES_TO_BUILD:=Cortex-M0 Cortex-M3
115115

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1408,6 +1408,8 @@ static void lowpan_mle_receive_security_bypass_cb(int8_t interface_id, mle_messa
14081408
pana_reset_client_session();
14091409
bootsrap_next_state_kick(ER_PANA_AUTH_ERROR, interface);
14101410
}
1411+
#else
1412+
(void)mle_msg;
14111413
#endif
14121414
}
14131415

source/6LoWPAN/ND/nd_router_object.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -831,6 +831,8 @@ buffer_t *nd_dar_parse(buffer_t *buf, protocol_interface_info_entry_t *cur_inter
831831
}
832832

833833
drop:
834+
#else
835+
(void)cur_interface;
834836
#endif
835837

836838
return buffer_free(buf);

source/6LoWPAN/Thread/thread_test_api.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,7 @@ int thread_test_version_set(int8_t interface_id, uint8_t version)
634634
return 0;
635635

636636
#else
637+
(void)version;
637638
(void)interface_id;
638639
return -1;
639640
#endif
@@ -1358,6 +1359,8 @@ int thread_test_mle_message_send(int8_t interface_id, uint8_t *dst_address, uint
13581359
(void)msg_id;
13591360
(void)write_src_addr;
13601361
(void)write_leader_data;
1362+
(void)write_network_data;
1363+
(void)write_timestamp;
13611364
(void)write_operational_set;
13621365
(void)write_challenge;
13631366
(void)msg_ptr;

source/6LoWPAN/ws/ws_bbr_api.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
#define RPL_INSTANCE_ID 1
4343

44-
#ifdef HAVE_WS
44+
#ifdef HAVE_WS_BORDER_ROUTER
4545

4646

4747
/* when creating BBR make ULA dodag ID always and when network becomes available add prefix to DHCP
@@ -426,15 +426,15 @@ uint16_t ws_bbr_pan_size(protocol_interface_info_entry_t *cur)
426426
}
427427

428428

429-
#endif //HAVE_WS
429+
#endif //HAVE_WS_BORDER_ROUTER
430430

431431
/* Public APIs
432432
*
433433
*/
434434

435435
int ws_bbr_start(int8_t interface_id, int8_t bb_interface_id)
436436
{
437-
#ifdef HAVE_WS
437+
#ifdef HAVE_WS_BORDER_ROUTER
438438

439439
(void)interface_id;
440440
protocol_interface_info_entry_t *bb_interface = protocol_stack_interface_info_get_by_id(bb_interface_id);
@@ -448,13 +448,14 @@ int ws_bbr_start(int8_t interface_id, int8_t bb_interface_id)
448448

449449
return 0;
450450
#else
451+
(void)interface_id;
451452
(void)bb_interface_id;
452453
return -1;
453454
#endif
454455
}
455456
void ws_bbr_stop(int8_t interface_id)
456457
{
457-
#ifdef HAVE_WS
458+
#ifdef HAVE_WS_BORDER_ROUTER
458459

459460
(void)interface_id;
460461
backbone_interface_id = -1;

source/6LoWPAN/ws/ws_bbr_api_internal.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#define WS_BBR_API_PRIVATE_H_
2020

2121

22-
#ifdef HAVE_WS
22+
#ifdef HAVE_WS_BORDER_ROUTER
2323

2424
extern uint16_t test_pan_size_override;
2525

@@ -34,9 +34,9 @@ void ws_bbr_rpl_config(uint8_t imin, uint8_t doubling, uint8_t redundancy);
3434
#else
3535

3636
#define ws_bbr_seconds_timer( cur, seconds)
37-
#define ws_bbr_pan_size(cur)
37+
#define ws_bbr_pan_size(cur) 0
3838
#define ws_bbr_rpl_config( imin, doubling, redundancy);
3939

40-
#endif //HAVE_WS
40+
#endif //HAVE_WS_BORDER_ROUTER
4141

4242
#endif /* WS_BBR_API_PRIVATE_H_ */

source/6LoWPAN/ws/ws_bootstrap.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,9 @@ static int8_t ws_bootstrap_down(protocol_interface_info_entry_t *cur)
681681
// Reset WS information
682682
// ws_common_reset(cur)
683683
ws_llc_reset(cur);
684-
nd_proxy_downstream_interface_unregister(cur->id);
684+
if (nd_proxy_downstream_interface_unregister(cur->id) != 0) {
685+
tr_warn("nd proxy unregister failed");
686+
}
685687
ws_nud_table_reset(cur);
686688
dhcp_client_delete(cur->id);
687689
ws_eapol_relay_delete(cur);

source/6LoWPAN/ws/ws_test_api.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,13 @@ int ws_test_pan_size_set(int8_t interface_id, uint16_t pan_size)
3838
{
3939

4040
(void) interface_id;
41+
#ifdef HAVE_WS_BORDER_ROUTER
4142
test_pan_size_override = pan_size;
4243
return 0;
44+
#else
45+
(void) pan_size;
46+
return -1;
47+
#endif
4348
}
4449

4550
int ws_test_max_child_count_set(int8_t interface_id, uint16_t child_count)

source/Core/address.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@ static bool addr_is_ipv4_mapped(const uint8_t addr[static 16])
176176
/* Scope(A), as defined in RFC 6724 plus RFC 4007 */
177177
uint_fast8_t addr_ipv6_scope(const uint8_t addr[static 16], const protocol_interface_info_entry_t *interface)
178178
{
179+
#ifndef HAVE_THREAD
180+
(void)interface;
181+
#endif
179182
if (addr_is_ipv6_multicast(addr)) {
180183
return addr_ipv6_multicast_scope(addr);
181184
}

source/MAC/IEEE802_15_4/mac_mcps_sap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1600,9 +1600,9 @@ static int8_t mcps_generic_packet_build(protocol_interface_rf_mac_setup_s *rf_pt
16001600
return 0;
16011601
}
16021602

1603-
16041603
int8_t mcps_generic_ack_build(protocol_interface_rf_mac_setup_s *rf_ptr, const mac_fcf_sequence_t *fcf, const uint8_t *data_ptr, const mcps_ack_data_payload_t *ack_payload, uint32_t rx_time)
16051604
{
1605+
(void)rx_time;
16061606
phy_device_driver_s *dev_driver = rf_ptr->dev_driver->phy_driver;
16071607
dev_driver_tx_buffer_s *tx_buf = &rf_ptr->dev_driver_tx_buffer;
16081608

source/Security/PANA/pana_server.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1742,6 +1742,8 @@ int8_t pana_server_restore_from_nvm(uint8_t *nvm_data, int8_t interface_id)
17421742
int8_t pana_server_nvm_callback_set(pana_server_update_cb *update_cb, pana_server_session_get_cb *nvm_get, pana_server_session_get_by_id_cb *nvm_session_get, uint8_t *nvm_static_buffer)
17431743
{
17441744
(void)update_cb;
1745+
(void)nvm_get;
1746+
(void)nvm_session_get;
17451747
(void)nvm_static_buffer;
17461748
return -1;
17471749
}

source/Service_Libs/mle_service/mle_service_api.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -804,6 +804,6 @@ void mle_service_frame_counter_entry_delete(int8_t interface_id, uint8_t attribu
804804
*/
805805
void mle_service_receive_filter_cb_set(mle_service_filter_cb *filter_cb);
806806
#else
807-
#define mle_service_receive_filter_cb_set(filter_cb) ((void) 0)
807+
#define mle_service_receive_filter_cb_set(filter_cb) ((void) filter_cb)
808808
#endif /* MLE_TEST */
809809
#endif /* MLE_SERVICE_API_H_ */

source/Service_Libs/whiteboard/whiteboard.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ extern uint16_t whiteboard_size_get(void);
3838
#define whiteboard_table_check_address(address) NULL
3939
#define whiteboard_table_update(address, eui64, status) NULL
4040
#define whiteboard_interface_unregister_all_address(nwk_id)
41+
#define whiteboard_interface_register(address, nwk_id)
4142
#define whiteboard_interface_address_cmp(address) false
4243
#endif
4344

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Copyright (c) 2019, Arm Limited and affiliates.
3+
* SPDX-License-Identifier: Apache-2.0
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
/* Config Flags for WS Border router */
19+
#include "cfg_ws_router.h"
20+
21+
#define HAVE_RPL_ROOT
22+
#define HAVE_RPL_DAO_HANDLING
23+
#define HAVE_6LOWPAN_BORDER_ROUTER
24+
#define HAVE_WS_BORDER_ROUTER
25+
#define HAVE_ND_PROXY
26+
#define MULTICAST_FORWARDING

source/configs/base/cfg_ws_router.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Copyright (c) 2019, Arm Limited and affiliates.
3+
* SPDX-License-Identifier: Apache-2.0
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
#define HAVE_6LOWPAN_ROUTER
19+
#define HAVE_WS_ROUTER
20+
#define HAVE_RPL
21+
#define HAVE_IPV6_ND
22+
#define HAVE_6LOWPAN_ND
23+
#define HAVE_MPL
24+
#define HAVE_WS

source/configs/cfg_generic.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "base/cfg_lowpan_border_router.h"
2121
#include "base/cfg_local_socket.h"
2222
#include "base/cfg_rf_tunnel.h"
23+
#include "base/cfg_ws_border_router.h"
2324

2425
#define FEA_TRACE_SUPPORT
2526
#define EXTRA_CONSISTENCY_CHECKS

source/configs/cfg_ws_border_router.h

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright (c) 2019, Arm Limited and affiliates.
3+
* SPDX-License-Identifier: Apache-2.0
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
#include "base/cfg_ethernet.h"
19+
#include "base/cfg_local_socket.h"
20+
#include "base/cfg_ws_border_router.h"
21+
22+
#define FEA_TRACE_SUPPORT
23+
#define HAVE_DHCPV6_SERVER
24+
#define EXTRA_CONSISTENCY_CHECKS
25+
26+
//#define HAVE_PAE_SUPP
27+
//#define HAVE_PAE_AUTH
28+
//#define HAVE_EAPOL_RELAY

source/configs/cfg_ws_router.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* Copyright (c) 2019, Arm Limited and affiliates.
3+
* SPDX-License-Identifier: Apache-2.0
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
19+
#include "base/cfg_ws_router.h"
20+
21+
#define FEA_TRACE_SUPPORT
22+
#define EXTRA_CONSISTENCY_CHECKS
23+

source/libNET/src/net_load_balance.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,13 @@ int8_t net_load_balance_load_level_update_enable(int8_t interface_id, uint16_t e
313313

314314
return load_balance_network_load_monitor_enable(interface_ptr->lb_api, expected_device_count, RPL_DODAG_PREF_MASK + 1, net_load_balance_api_get_node_count_cb, net_load_balance_api_get_set_load_level_cb);
315315
#else
316+
(void)interface_id;
317+
(void)expected_device_count;
316318
return -1;
317319
#endif
318320
#else
321+
(void)interface_id;
322+
(void)expected_device_count;
319323
return -1;
320324
#endif
321325
}
@@ -338,9 +342,11 @@ int8_t net_load_balance_load_level_update_disable(int8_t interface_id)
338342

339343
return load_balance_network_load_monitor_disable(interface_ptr->lb_api);
340344
#else
345+
(void)interface_id;
341346
return -1;
342347
#endif
343348
#else
349+
(void)interface_id;
344350
return -1;
345351
#endif
346352
}

source/libNET/src/net_rpl.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ int8_t arm_nwk_6lowpan_rpl_dodag_init(int8_t interface_id, const uint8_t *dodag_
7474
}
7575
return 0;
7676
#else // !HAVE_RPL_ROOT
77+
(void)dodag_id;
78+
(void)config;
79+
(void)instance_id;
80+
(void)flags;
81+
7782
return -1;
7883
#endif
7984
}

source/libNET/src/ns_net.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,8 @@ int8_t arm_nwk_interface_ethernet_init(eth_mac_api_t *api, const char *interface
693693
cur->interface_name = interface_name_ptr;
694694
return cur->id;
695695
#else
696+
(void)api;
697+
(void)interface_name_ptr;
696698
return -2;
697699
#endif
698700
}
@@ -1022,11 +1024,20 @@ int8_t arm_pana_client_library_init(int8_t interface_id, net_tls_cipher_e cipher
10221024

10231025
int8_t arm_nwk_interface_configure_ipv6_bootstrap_set(int8_t interface_id, net_ipv6_mode_e bootstrap_mode, const uint8_t *ipv6_prefix_pointer)
10241026
{
1027+
#ifndef HAVE_ETHERNET
1028+
(void)interface_id;
1029+
(void)bootstrap_mode;
1030+
(void)ipv6_prefix_pointer;
1031+
#endif
10251032
return ipv6_interface_configure_ipv6_bootstrap_set(interface_id, bootstrap_mode, ipv6_prefix_pointer);
10261033
}
10271034

10281035
int8_t arm_nwk_interface_accept_ipv6_ra(int8_t interface_id, net_ipv6_accept_ra_e accept_ra)
10291036
{
1037+
#ifndef HAVE_ETHERNET
1038+
(void)interface_id;
1039+
(void)accept_ra;
1040+
#endif
10301041
return ipv6_interface_accept_ra(interface_id, accept_ra);
10311042
}
10321043

0 commit comments

Comments
 (0)