Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
protocol.h
00001 /* 00002 * Copyright (c) 2014-2017, Arm Limited and affiliates. 00003 * SPDX-License-Identifier: Apache-2.0 00004 * 00005 * Licensed under the Apache License, Version 2.0 (the "License"); 00006 * you may not use this file except in compliance with the License. 00007 * You may obtain a copy of the License at 00008 * 00009 * http://www.apache.org/licenses/LICENSE-2.0 00010 * 00011 * Unless required by applicable law or agreed to in writing, software 00012 * distributed under the License is distributed on an "AS IS" BASIS, 00013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00014 * See the License for the specific language governing permissions and 00015 * limitations under the License. 00016 */ 00017 /** 00018 * 00019 * \file protocol.h 00020 * \brief Protocol support functions. 00021 * 00022 * Protocol core support functions. 00023 * 00024 */ 00025 00026 #ifndef _NS_PROTOCOL_H 00027 #define _NS_PROTOCOL_H 00028 00029 #ifndef _NANOSTACK_SOURCE_CONFIG_H 00030 #error "Why haven't you included config.h before all other headers?" 00031 #endif 00032 00033 #include "NWK_INTERFACE/Include/protocol_abstract.h" 00034 00035 // Users of protocol.h can assume it includes these headers 00036 #include "Core/include/address.h" 00037 #include "Core/include/ns_buffer.h" 00038 00039 // Headers below this are implementation details - users of protocol.h shouldn't rely on them 00040 #include "6LoWPAN/IPHC_Decode/lowpan_context.h" 00041 #include "platform/arm_hal_phy.h" 00042 #include "net_nwk_scan.h" 00043 #include "net_interface.h" 00044 #include "multicast_api.h" 00045 #include "Service_Libs/Neighbor_cache/neighbor_table_definition.h" 00046 #include "Service_Libs/Trickle/trickle.h" 00047 #include "Service_Libs/pan_blacklist/pan_blacklist_api.h" 00048 #include "net_polling_api.h" 00049 #include "ipv6_stack/ipv6_routing_table.h" 00050 00051 struct mlme_scan_s; 00052 struct mlme_scan_conf_s; 00053 struct mac_api_s; 00054 struct eth_mac_api_s; 00055 struct arm_device_driver_list; 00056 struct mlme_security_s; 00057 struct load_balance_api; 00058 struct nwk_wpan_nvm_api; 00059 00060 #define SLEEP_MODE_REQ 0x80 00061 #define SLEEP_PERIOD_ACTIVE 0x40 00062 #define ICMP_ACTIVE 0x08 00063 00064 extern void set_power_state(uint8_t mode); 00065 extern void clear_power_state(uint8_t mode); 00066 extern uint8_t check_power_state(uint8_t mode); 00067 00068 #define BUFFER_DATA_FIXED_SIZE 0 00069 extern void protocol_push(buffer_t *buf); 00070 extern void protocol_init(void); 00071 extern void protocol_core_init(void); 00072 00073 #define INTERFACE_BOOTSTRAP_DEFINED 1 00074 #define INTERFACE_SECURITY_DEFINED 2 00075 #define INTERFACE_NETWORK_DRIVER_SETUP_DEFINED 4 00076 #define INTERFACE_ND_BORDER_ROUTER_DEFINED 8 00077 00078 00079 #define INTERFACE_SETUP_MASK 3 00080 #define INTERFACE_SETUP_READY 3 00081 #define INTERFACE_SETUP_NETWORK_DRIVER_MASK 5 00082 #define INTERFACE_SETUP_NETWORK_DRIVER_READY 5 00083 00084 #define INTERFACE_SETUP_BORDER_ROUTER_MASK 11 00085 #define INTERFACE_SETUP_BORDER_ROUTER_READY 11 00086 typedef enum icmp_state { 00087 ER_ACTIVE_SCAN = 0, 00088 ER_WARM_ACTIVE_SCAN = 1, 00089 ER_SCAN = 2, 00090 ER_ADDRESS_REQ = 3, 00091 ER_BIND_COMP = 4, 00092 #ifdef HAVE_RPL 00093 ER_RPL_MC = 5, 00094 ER_RPL_SCAN = 6, 00095 ER_RPL_UNICAST = 7, 00096 ER_DAO_TX = 8, 00097 #endif 00098 ER_PANA_AUTH = 9, 00099 ER_PANA_AUTH_DONE = 10, 00100 ER_PANA_AUTH_ERROR = 11, 00101 ER_BIND_FAIL = 12, 00102 ER_MLE_LINK_REQ = 13, 00103 ER_MLE_LINK_SHORT_SYNCH = 14, 00104 ER_MLE_LINK_ADDRESS_SYNCH = 15, 00105 #ifdef HAVE_RPL 00106 ER_ROUTER_SYNCH = 17, 00107 #endif 00108 ER_PANA_PING = 18, 00109 ER_PARENT_SYNCH_LOST = 19, 00110 ER_MLE_SCAN = 20, 00111 ER_MLE_SYNCH = 21, 00112 ER_MLE_ATTACH_READY = 22, 00113 ER_DHCP_ROUTER_ID_REQ = 23, 00114 ER_DHCP_ROUTER_ID_RELEASE = 24, 00115 ER_CHILD_ID_REQ, 00116 ER_BOOTSRAP_DONE , 00117 ER_BOOTSTRAP_CONNECTION_DOWN, 00118 ER_BOOTSTRAP_IP_ADDRESS_ALLOC_FAIL, 00119 ER_BOOTSTRAP_DAD_FAIL, 00120 ER_BOOTSTRAP_SCAN_FAIL, 00121 ER_BOOTSTRAP_LEADER_UP, 00122 ER_BOOTSTRAP_NEW_FRAGMENT_START, 00123 ER_RPL_LOCAL_REPAIR, 00124 } icmp_state_t; 00125 00126 typedef enum { 00127 INTERFACE_IDLE = 0, 00128 INTERFACE_UP = 1 00129 } interface_mode_t; 00130 00131 typedef enum arm_internal_event_type { 00132 ARM_IN_TASKLET_INIT_EVENT = 0, /**< Tasklet Init come always when generate tasklet*/ 00133 ARM_IN_NWK_INTERFACE_EVENT = 1, /**< Interface Bootstrap or state update event */ 00134 ARM_IN_PROTOCOL_TIMER_EVENT = 2, /*!*< System Timer event */ 00135 ARM_IN_SOCKET_EVENT = 5, /**< Interface Bootstrap or state update event */ 00136 ARM_IN_INTERFACE_BOOTSTRAP_CB, /** call net_bootsrap_cb_run */ 00137 ARM_IN_INTERFACE_CORE_TIMER_CB, /** call net_bootsrap_cb_run */ 00138 ARM_IN_INTERFACE_PROTOCOL_HANDLE, /** protocol_buffer_poll */ 00139 ARM_IN_SECURITY_ECC_CALLER 00140 } arm_internal_event_type_e; 00141 00142 typedef enum { 00143 ARM_NWK_BOOTSRAP_MODE_6LoWPAN_ROUTER = 0, 00144 ARM_NWK_BOOTSRAP_MODE_6LoWPAN_HOST, 00145 ARM_NWK_BOOTSRAP_MODE_6LoWPAN_SLEEPY_HOST, 00146 ARM_NWK_BOOTSRAP_MODE_6LoWPAN_BORDER_ROUTER, 00147 ARM_NWK_BOOTSRAP_MODE_6LoWPAN_RF_ACCESPOINT, 00148 ARM_NWK_BOOTSRAP_MODE_6LoWPAN_RF_SNIFFER, 00149 ARM_NWK_BOOTSRAP_MODE_ETHERNET_ROUTER, 00150 ARM_NWK_BOOTSRAP_MODE_ETHERNET_HOST, 00151 } arm_nwk_bootsrap_mode_e; 00152 00153 typedef enum { 00154 ARM_NWK_IDLE_MODE = 0, 00155 ARM_NWK_GP_IP_MODE, 00156 ARM_NWK_LL_IP_MODE, 00157 ARM_NWK_MAC_MODE, 00158 ARM_NWK_RAW_PHY_MODE, 00159 ARM_NWK_SNIFFER_MODE, 00160 } arm_nwk_interface_mode_e; 00161 00162 #define INTERFACE_NWK_BOOTSRAP_ADDRESS_REGISTER_READY 1 00163 #define INTERFACE_NWK_BOOTSRAP_ACTIVE 2 00164 #define INTERFACE_NWK_BOOTSRAP_PANA_AUTHENTICATION 4 00165 #define INTERFACE_NWK_ACTIVE 8 00166 #define INTERFACE_NWK_ROUTER_DEVICE 16 00167 #define INTERFACE_NWK_CONF_MAC_RX_OFF_IDLE 64 00168 #define INTERFACE_NWK_BOOTSRAP_MLE 128 00169 00170 struct nd_router; 00171 struct nd_router_setup; 00172 00173 typedef struct { 00174 channel_list_s *chanlist; 00175 uint8_t channel; 00176 int8_t radio_tx_power; 00177 uint32_t channel_list; 00178 uint16_t mac_short_adr; 00179 uint16_t mac_panid; 00180 uint8_t border_router_gp_adr[16]; 00181 bool initActive; 00182 struct nd_router *nd_nwk; 00183 struct nd_router_setup *nd_border_router_configure; 00184 } br_info_t; 00185 00186 typedef struct nwk_scan_params { 00187 uint8_t energy_treshold; 00188 uint8_t nwk_scan_res_size; 00189 channel_list_s stack_chan_list; 00190 uint8_t scan_duration; 00191 nwk_pan_descriptor_t *nwk_response_info; 00192 nwk_pan_descriptor_t *nwk_cur_active; 00193 bool active_scan_active; 00194 } nwk_scan_params_t; 00195 00196 typedef struct nwk_filter_params { 00197 uint8_t nwk_active_scan_level; 00198 uint8_t beacon_protocol_id_filter; 00199 uint16_t net_pan_id_filter; 00200 uint8_t *beacon_nwk_id_filter; 00201 } nwk_filter_params_s; 00202 00203 typedef struct mac_cordinator { 00204 unsigned cord_adr_mode:2; 00205 uint8_t mac_mlme_coord_address[8]; 00206 } mac_cordinator_s; 00207 00208 typedef struct arm_15_4_mac_parameters_t { 00209 /* Security API USE */ 00210 unsigned mac_configured_sec_level:3; 00211 unsigned mac_security_level:3; 00212 unsigned mac_key_id_mode:2; 00213 uint8_t mac_prev_key_index; 00214 uint8_t mac_next_key_index; 00215 uint8_t mac_default_key_index; 00216 /* security mlme attribute */ 00217 uint8_t mac_prev_key_attribute_id; 00218 uint8_t mac_default_key_attribute_id; 00219 uint8_t mac_next_key_attribute_id; 00220 uint32_t security_frame_counter; 00221 bool shortAdressValid:1; 00222 /* MAC PIB boolean */ 00223 bool SecurityEnabled:1; 00224 bool RxOnWhenIdle:1; 00225 bool PromiscuousMode:1; 00226 bool GTSPermit:1; 00227 bool AssociationPermit:1; 00228 bool AssociatedPANCoord:1; 00229 bool TimestampSupported:1; 00230 bool BattLifeExt:1; 00231 bool AutoRequest:1; 00232 bool MacUnsusecured_2003_cab:1; 00233 /* MAC PIB boolean */ 00234 channel_list_s mac_channel_list; 00235 uint8_t mac_channel; 00236 uint16_t pan_id; 00237 uint16_t mac_short_address; 00238 mac_cordinator_s mac_cordinator_info; 00239 uint8_t number_of_fhss_channel_retries; 00240 /* MAC Beacon info */ 00241 uint8_t *mac_beacon_payload; 00242 uint8_t mac_beacon_payload_size; 00243 nwk_scan_params_t nwk_scan_params; 00244 nwk_filter_params_s nwk_filter_params; 00245 uint16_t mac_in_direct_entry_timeout; 00246 beacon_compare_rx_cb *beacon_compare_rx_cb_ptr; 00247 beacon_join_priority_tx_cb *beacon_join_priority_tx_cb_ptr; 00248 uint8_t (*beacon_ind)(uint8_t *ptr, uint8_t len, protocol_interface_info_entry_t *cur); 00249 }arm_15_4_mac_parameters_t; 00250 00251 typedef void mac_poll_fail_cb(int8_t nwk_interface_id); 00252 00253 typedef struct nwk_rfd_poll_setups { 00254 uint32_t nwk_app_poll_time; 00255 net_host_mode_t host_mode; 00256 uint32_t slow_poll_rate_seconds; 00257 uint32_t timeOutInSeconds; 00258 uint8_t nwk_parent_poll_fail; 00259 uint8_t protocol_poll; 00260 mlme_poll_t poll_req; 00261 bool pollActive:1; 00262 bool macDeepSleepEnabled:1; 00263 mac_poll_fail_cb *pollFailCb; 00264 } nwk_rfd_poll_setups_s; 00265 00266 typedef struct nwk_pana_params{ 00267 net_tls_cipher_e nwk_chipher_mode; 00268 net_pana_session_mode_e client_session_mode; 00269 uint32_t psk_key_id; 00270 uint8_t pana_client; 00271 } nwk_pana_params_s; 00272 00273 typedef struct gp_ipv6_address_entry { 00274 uint8_t address[16]; 00275 ns_list_link_t link; 00276 } gp_ipv6_address_entry_t; 00277 00278 typedef NS_LIST_HEAD (gp_ipv6_address_entry_t, link) gp_ipv6_address_list_t; 00279 00280 typedef struct if_6lowpan_dad_entry { 00281 uint8_t address[16]; // IPv6 00282 uint32_t state_timer; // ticks to state change - used by DAD, then can be used by protocol 00283 uint8_t count; // general count field - used by DAD, then can be used by protocol 00284 bool active; // RFC 4941 temporary address 00285 } if_6lowpan_dad_entry_t; 00286 00287 typedef struct if_6lowpan_security_info { 00288 nwk_pana_params_s *pana_params; 00289 net_link_layer_psk_security_info_s psk_key_info; 00290 uint32_t mle_security_frame_counter; 00291 net_6lowpan_link_layer_sec_mode_e nwk_security_mode; 00292 uint8_t security_level; 00293 } if_6lowpan_security_info_t; 00294 00295 typedef enum { 00296 IPV6_LL_CONFIG, 00297 IPV6_ROUTER_SOLICATION, 00298 IPV6_GP_GEN, 00299 IPV6_GP_CONFIG, 00300 IPV6_READY, 00301 IPV6_DHCPV6_SOLICATION, 00302 IPV6_DHCPV6_ADDRESS_REQUEST, 00303 IPV6_DHCPV6_ADDRESS_REQ_FAIL, 00304 //IPV6_DHCPV6_PREFIX_READY 00305 } IPv6_ND_STATE; 00306 00307 typedef struct { 00308 net_ipv6_mode_e ipv6_stack_mode; 00309 IPv6_ND_STATE IPv6_ND_state; 00310 net_ipv6_accept_ra_e accept_ra; 00311 uint8_t wb_table_ttl; 00312 uint16_t ND_TIMER; 00313 uint8_t static_prefix64[8]; 00314 uint8_t routerSolicationRetryCounter; 00315 bool temporaryUlaAddressState; 00316 } ipv6_interface_info_t; 00317 00318 struct thread_info_s; 00319 struct mesh_callbacks_s; 00320 struct auth_info; 00321 struct rpl_domain; 00322 00323 /* Structure to keep track of timing of multicast adverts - potentially 00324 * multiple required: one for our own adverts in the interface structure below, 00325 * and one for each ABRO that we relay (in nd_router_t). 00326 */ 00327 typedef struct ipv6_ra_timing { 00328 uint32_t rtr_adv_last_send_time; // monotonic time 00329 uint8_t initial_rtr_adv_count; 00330 } ipv6_ra_timing_t; 00331 00332 /** 00333 * @brief scan_confirm_cb Callback function for scanning results 00334 * @param if_id Protocol interface id 00335 * @param conf MLME-SCAN confirm object (ownership not passed) 00336 */ 00337 typedef void scan_confirm_cb(int8_t if_id, const mlme_scan_conf_t* conf); 00338 typedef void beacon_indication_cb(int8_t if_id, const mlme_beacon_ind_t* conf); 00339 typedef void comm_status_indication_cb(int8_t if_id, const mlme_comm_status_t* status); 00340 00341 00342 00343 struct protocol_interface_info_entry { 00344 beacon_indication_cb *beacon_cb; 00345 scan_confirm_cb *scan_cb; 00346 comm_status_indication_cb *comm_status_ind_cb; 00347 nwk_interface_id nwk_id; 00348 int8_t id; 00349 int8_t bootStrapId; 00350 uint8_t zone_index[16]; 00351 int8_t net_start_tasklet; 00352 const char *interface_name; 00353 ns_list_link_t link; 00354 arm_nwk_bootsrap_mode_e bootsrap_mode; 00355 net_6lowpan_gp_address_mode_e lowpan_address_mode; 00356 arm_nwk_interface_mode_e nwk_mode; 00357 uint8_t configure_flags; 00358 uint8_t lowpan_info; 00359 uint16_t bootsrap_state_machine_cnt; 00360 icmp_state_t nwk_bootstrap_state; 00361 if_address_list_t ip_addresses; 00362 uint8_t ip_addresses_max_slaac_entries; 00363 if_group_list_t ip_groups; 00364 #ifdef MULTICAST_FORWARDING /* Conventional (non-MPL) forwarding */ 00365 if_group_fwd_list_t ip_groups_fwd; 00366 uint8_t ip_mcast_fwd_for_scope; 00367 #endif 00368 #ifdef HAVE_MPL 00369 bool mpl_proactive_forwarding; 00370 multicast_mpl_seed_id_mode_e mpl_seed_id_mode; 00371 trickle_params_t mpl_data_trickle_params; 00372 trickle_params_t mpl_control_trickle_params; 00373 uint16_t mpl_seed_set_entry_lifetime; 00374 uint8_t mpl_seed_id[16]; 00375 #endif 00376 if_6lowpan_dad_entry_t if_6lowpan_dad_process; 00377 lowpan_context_list_t lowpan_contexts; 00378 uint16_t lowpan_desired_short_address; 00379 bool global_address_available : 1; 00380 bool reallocate_short_address_if_duplicate : 1; 00381 bool iids_map_to_mac : 1; 00382 bool opaque_slaac_iids : 1; 00383 bool ip_multicast_as_mac_unicast_to_parent : 1; 00384 uint8_t dad_failures; 00385 ipv6_neighbour_cache_t ipv6_neighbour_cache; 00386 uint8_t nwk_rpl_scan_counter; 00387 uint8_t nwk_nd_re_scan_count; 00388 00389 int8_t nwk_timer_id; 00390 uint16_t icmp_tokens; /* Token bucket for ICMP rate limiting */ 00391 uint16_t icmp_ra_tokens; /* Token bucket for RA receive rate limiting */ 00392 uint16_t mle_link_reject_tokens; /* Token bucket for Report wrong working device */ 00393 uint8_t iid_eui64[8]; // IID based on EUI-64 - used for link-local address 00394 uint8_t iid_slaac[8]; // IID to use for SLAAC addresses - may or may not be same as iid_eui64 00395 uint16_t max_link_mtu; 00396 /* RFC 4861 Host Variables */ 00397 uint8_t cur_hop_limit; 00398 uint16_t reachable_time_ttl; // s 00399 uint32_t base_reachable_time; // ms 00400 #ifdef HAVE_IPV6_ND 00401 bool recv_ra_routes : 1; 00402 bool recv_ra_prefixes: 1; 00403 #endif 00404 bool send_mld: 1; 00405 #ifdef HAVE_MPL 00406 bool mpl_seed: 1; 00407 bool mpl_treat_realm_domains_as_one: 1; 00408 bool mpl_auto_domain_on_group_join: 1; 00409 #endif 00410 /* RFC 4861 Router Variables */ 00411 bool ip_forwarding : 1; 00412 bool ip_multicast_forwarding : 1; 00413 #ifndef NO_RADV_TX 00414 bool adv_send_advertisements : 1; 00415 bool rtr_adv_unicast_to_rs : 1; 00416 bool adv_copy_heard_flags : 1; 00417 uint8_t rtr_adv_flags; 00418 uint8_t max_ra_delay_time; // 100ms ticks 00419 uint8_t min_delay_between_ras; // 100ms ticks 00420 uint8_t max_initial_rtr_advertisements; 00421 uint16_t max_initial_rtr_adv_interval; // 100ms ticks 00422 uint8_t adv_cur_hop_limit; 00423 uint32_t adv_reachable_time; 00424 uint32_t adv_retrans_timer; 00425 uint16_t adv_link_mtu; 00426 uint16_t min_rtr_adv_interval; // 100ms ticks 00427 uint16_t max_rtr_adv_interval; // 100ms ticks 00428 ipv6_ra_timing_t ra_timing; 00429 #endif 00430 /* RFC 4862 Node Configuration */ 00431 uint8_t dup_addr_detect_transmits; 00432 uint16_t pmtu_lifetime; // s 00433 00434 /* Link Layer Part */ 00435 uint8_t mac[8]; // MAC address (EUI-64 for LoWPAN, EUI-48 for Ethernet) 00436 00437 interface_mode_t interface_mode; 00438 ipv6_interface_info_t *ipv6_configure; 00439 struct auth_info *pana_sec_info_temp; 00440 br_info_t *border_router_setup; 00441 struct load_balance_api *lb_api; 00442 neigh_cache_s neigh_cache; 00443 pan_blaclist_cache_s pan_blaclist_cache; 00444 pan_coordinator_blaclist_cache_s pan_cordinator_black_list; 00445 #ifdef HAVE_THREAD 00446 struct thread_info_s *thread_info; 00447 #endif 00448 struct rpl_domain *rpl_domain; 00449 struct mesh_callbacks_s *mesh_callbacks; 00450 if_6lowpan_security_info_t *if_lowpan_security_params; //Security Parameters 00451 00452 struct mac_api_s *mac_api; 00453 arm_15_4_mac_parameters_t* mac_parameters; 00454 00455 struct eth_mac_api_s *eth_mac_api; 00456 00457 struct nwk_wpan_nvm_api *nwk_wpan_nvm_api; 00458 nwk_rfd_poll_setups_s *rfd_poll_info; 00459 struct arm_device_driver_list *dev_driver; 00460 int8_t (*if_down)(struct protocol_interface_info_entry *cur); 00461 int8_t (*if_up)(struct protocol_interface_info_entry *cur); 00462 void (*if_stack_buffer_handler)(buffer_t *); 00463 bool (*if_ns_transmit)(struct protocol_interface_info_entry *cur, ipv6_neighbour_t *neighCacheEntry, bool unicast, uint8_t seq); 00464 bool (*if_map_ip_to_link_addr)(struct protocol_interface_info_entry *cur, const uint8_t *ip_addr, addrtype_t *ll_type, const uint8_t **ll_addr_out); 00465 bool (*if_map_link_addr_to_ip)(struct protocol_interface_info_entry *cur, addrtype_t ll_type, const uint8_t *ll_addr, uint8_t *ip_addr_out); 00466 buffer_t *(*if_special_forwarding)(struct protocol_interface_info_entry *cur, buffer_t *buf, const sockaddr_t *ll_src, bool *bounce); 00467 void (*if_special_multicast_forwarding)(struct protocol_interface_info_entry *cur, buffer_t *buf); 00468 buffer_t *(*if_snoop)(struct protocol_interface_info_entry *cur, buffer_t *buf, const sockaddr_t *ll_dst, const sockaddr_t *ll_src, bool *bounce); 00469 buffer_t *(*if_icmp_handler)(struct protocol_interface_info_entry *cur, buffer_t *buf, bool *bounce); 00470 uint8_t (*if_llao_parse)(struct protocol_interface_info_entry *cur, const uint8_t *opt_in, sockaddr_t *ll_addr_out); 00471 uint8_t (*if_llao_write)(struct protocol_interface_info_entry *cur, uint8_t *opt_out, uint8_t opt_type, bool must, const uint8_t *ip_addr); 00472 void (*mac_security_key_usage_update_cb)(struct protocol_interface_info_entry *cur, const struct mlme_security_s *security_params); 00473 }; 00474 00475 typedef NS_LIST_HEAD (protocol_interface_info_entry_t, link) protocol_interface_list_t; 00476 00477 extern protocol_interface_list_t protocol_interface_info_list; 00478 00479 extern protocol_interface_info_entry_t *nwk_interface_get_ipv6_ptr(void); 00480 extern void nwk_interface_print_neigh_cache(route_print_fn_t *print_fn); 00481 extern void nwk_interface_flush_neigh_cache(void); 00482 00483 //void nwk_interface_dhcp_process_callback(int8_t interfaceID, bool status,uint8_t * routerId, dhcpv6_client_server_data_t *server, bool reply); 00484 00485 void protocol_core_interface_info_reset(protocol_interface_info_entry_t *entry); 00486 00487 extern void arm_net_protocol_packet_handler(buffer_t *buf, protocol_interface_info_entry_t *cur_interface); 00488 00489 protocol_interface_info_entry_t *protocol_stack_interface_sleep_possibility(void); 00490 extern uint8_t nwk_bootsrap_ready(protocol_interface_info_entry_t *cur); 00491 00492 extern protocol_interface_info_entry_t *protocol_stack_interface_info_get(nwk_interface_id nwk_id); 00493 extern bool nwk_interface_compare_mac_address(protocol_interface_info_entry_t *cur, uint_fast8_t addrlen, const uint8_t addr[/*addrlen*/]); 00494 extern protocol_interface_info_entry_t *protocol_stack_interface_generate_ethernet(struct eth_mac_api_s *api); 00495 extern protocol_interface_info_entry_t *protocol_stack_interface_generate_lowpan(struct mac_api_s *api); 00496 extern uint32_t protocol_stack_interface_set_reachable_time(protocol_interface_info_entry_t *cur, uint32_t base_reachable_time); 00497 extern void net_bootsrap_cb_run(uint8_t event); 00498 00499 extern void protocol_core_security_tick_update(uint16_t tick_update); 00500 00501 extern int8_t protocol_read_tasklet_id(void); 00502 extern void protocol_6lowpan_stack(buffer_t *b); 00503 extern void protocol_6lowpan_register_handlers(protocol_interface_info_entry_t *cur); 00504 extern void protocol_6lowpan_release_short_link_address_from_neighcache(protocol_interface_info_entry_t *cur, uint16_t shortAddress); 00505 extern void protocol_6lowpan_release_long_link_address_from_neighcache(protocol_interface_info_entry_t *cur, uint8_t *mac64); 00506 extern void protocol_core_dhcpv6_allocated_address_remove(protocol_interface_info_entry_t *cur, uint8_t *guaPrefix); 00507 00508 extern void nwk_bootsrap_state_update(arm_nwk_interface_status_type_e posted_event, protocol_interface_info_entry_t *cur); 00509 void bootsrap_next_state_kick(icmp_state_t new_state, protocol_interface_info_entry_t *cur); 00510 int8_t protcol_interface_address_compare(protocol_interface_info_entry_t *cur, const uint8_t *addr); 00511 #endif /* _NS_PROTOCOL_H */
Generated on Tue Jul 12 2022 14:24:32 by
