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.
Dependents: cobaLCDJoyMotor_Thread odometry_omni_3roda_v3 odometry_omni_3roda_v1 odometry_omni_3roda_v2 ... more
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 ER_ROUTER_SYNCH = 17, 00106 ER_PANA_PING = 18, 00107 ER_PARENT_SYNCH_LOST = 19, 00108 ER_MLE_SCAN = 20, 00109 ER_MLE_SYNCH = 21, 00110 ER_MLE_ATTACH_READY = 22, 00111 ER_DHCP_ROUTER_ID_REQ = 23, 00112 ER_DHCP_ROUTER_ID_RELEASE = 24, 00113 ER_CHILD_ID_REQ, 00114 ER_BOOTSRAP_DONE , 00115 ER_BOOTSTRAP_CONNECTION_DOWN, 00116 ER_BOOTSTRAP_IP_ADDRESS_ALLOC_FAIL, 00117 ER_BOOTSTRAP_DAD_FAIL, 00118 ER_BOOTSTRAP_SCAN_FAIL, 00119 ER_BOOTSTRAP_LEADER_UP, 00120 ER_BOOTSTRAP_NEW_FRAGMENT_START, 00121 ER_RPL_LOCAL_REPAIR, 00122 } icmp_state_t; 00123 00124 typedef enum { 00125 INTERFACE_IDLE = 0, 00126 INTERFACE_UP = 1 00127 } interface_mode_t; 00128 00129 typedef enum arm_internal_event_type { 00130 ARM_IN_TASKLET_INIT_EVENT = 0, /**< Tasklet Init come always when generate tasklet*/ 00131 ARM_IN_NWK_INTERFACE_EVENT = 1, /**< Interface Bootstrap or state update event */ 00132 ARM_IN_PROTOCOL_TIMER_EVENT = 2, /*!*< System Timer event */ 00133 ARM_IN_SOCKET_EVENT = 5, /**< Interface Bootstrap or state update event */ 00134 ARM_IN_INTERFACE_BOOTSTRAP_CB, /** call net_bootsrap_cb_run */ 00135 ARM_IN_INTERFACE_CORE_TIMER_CB, /** call net_bootsrap_cb_run */ 00136 ARM_IN_INTERFACE_PROTOCOL_HANDLE, /** protocol_buffer_poll */ 00137 ARM_IN_SECURITY_ECC_CALLER 00138 } arm_internal_event_type_e; 00139 00140 typedef enum { 00141 ARM_NWK_BOOTSRAP_MODE_6LoWPAN_ROUTER = 0, 00142 ARM_NWK_BOOTSRAP_MODE_6LoWPAN_HOST, 00143 ARM_NWK_BOOTSRAP_MODE_6LoWPAN_SLEEPY_HOST, 00144 ARM_NWK_BOOTSRAP_MODE_6LoWPAN_BORDER_ROUTER, 00145 ARM_NWK_BOOTSRAP_MODE_6LoWPAN_RF_ACCESPOINT, 00146 ARM_NWK_BOOTSRAP_MODE_6LoWPAN_RF_SNIFFER, 00147 ARM_NWK_BOOTSRAP_MODE_ETHERNET_ROUTER, 00148 ARM_NWK_BOOTSRAP_MODE_ETHERNET_HOST, 00149 } arm_nwk_bootsrap_mode_e; 00150 00151 typedef enum { 00152 ARM_NWK_IDLE_MODE = 0, 00153 ARM_NWK_GP_IP_MODE, 00154 ARM_NWK_LL_IP_MODE, 00155 ARM_NWK_MAC_MODE, 00156 ARM_NWK_RAW_PHY_MODE, 00157 ARM_NWK_SNIFFER_MODE, 00158 } arm_nwk_interface_mode_e; 00159 00160 #define INTERFACE_NWK_BOOTSRAP_ADDRESS_REGISTER_READY 1 00161 #define INTERFACE_NWK_BOOTSRAP_ACTIVE 2 00162 #define INTERFACE_NWK_BOOTSRAP_PANA_AUTHENTICATION 4 00163 #define INTERFACE_NWK_ACTIVE 8 00164 #define INTERFACE_NWK_ROUTER_DEVICE 16 00165 #define INTERFACE_NWK_CONF_MAC_RX_OFF_IDLE 64 00166 #define INTERFACE_NWK_BOOTSRAP_MLE 128 00167 00168 struct nd_router; 00169 struct nd_router_setup; 00170 00171 typedef struct { 00172 channel_list_s *chanlist; 00173 uint8_t channel; 00174 int8_t radio_tx_power; 00175 uint32_t channel_list; 00176 uint16_t mac_short_adr; 00177 uint16_t mac_panid; 00178 uint8_t border_router_gp_adr[16]; 00179 bool initActive; 00180 struct nd_router *nd_nwk; 00181 struct nd_router_setup *nd_border_router_configure; 00182 } br_info_t; 00183 00184 typedef struct nwk_scan_params { 00185 uint8_t energy_treshold; 00186 uint8_t nwk_scan_res_size; 00187 channel_list_s stack_chan_list; 00188 uint8_t scan_duration; 00189 nwk_pan_descriptor_t *nwk_response_info; 00190 nwk_pan_descriptor_t *nwk_cur_active; 00191 bool active_scan_active; 00192 } nwk_scan_params_t; 00193 00194 typedef struct nwk_filter_params { 00195 uint8_t nwk_active_scan_level; 00196 uint8_t beacon_protocol_id_filter; 00197 uint16_t net_pan_id_filter; 00198 uint8_t *beacon_nwk_id_filter; 00199 } nwk_filter_params_s; 00200 00201 typedef struct mac_cordinator { 00202 unsigned cord_adr_mode:2; 00203 uint8_t mac_mlme_coord_address[8]; 00204 } mac_cordinator_s; 00205 00206 typedef struct arm_15_4_mac_parameters_t { 00207 /* Security API USE */ 00208 unsigned mac_configured_sec_level:3; 00209 unsigned mac_security_level:3; 00210 unsigned mac_key_id_mode:2; 00211 uint8_t mac_prev_key_index; 00212 uint8_t mac_next_key_index; 00213 uint8_t mac_default_key_index; 00214 /* security mlme attribute */ 00215 uint8_t mac_prev_key_attribute_id; 00216 uint8_t mac_default_key_attribute_id; 00217 uint8_t mac_next_key_attribute_id; 00218 uint32_t security_frame_counter; 00219 bool shortAdressValid:1; 00220 /* MAC PIB boolean */ 00221 bool SecurityEnabled:1; 00222 bool RxOnWhenIdle:1; 00223 bool PromiscuousMode:1; 00224 bool GTSPermit:1; 00225 bool AssociationPermit:1; 00226 bool AssociatedPANCoord:1; 00227 bool TimestampSupported:1; 00228 bool BattLifeExt:1; 00229 bool AutoRequest:1; 00230 bool MacUnsusecured_2003_cab:1; 00231 /* MAC PIB boolean */ 00232 channel_list_s mac_channel_list; 00233 uint8_t mac_channel; 00234 uint16_t pan_id; 00235 uint16_t mac_short_address; 00236 mac_cordinator_s mac_cordinator_info; 00237 uint8_t number_of_fhss_channel_retries; 00238 /* MAC Beacon info */ 00239 uint8_t *mac_beacon_payload; 00240 uint8_t mac_beacon_payload_size; 00241 nwk_scan_params_t nwk_scan_params; 00242 nwk_filter_params_s nwk_filter_params; 00243 uint16_t mac_in_direct_entry_timeout; 00244 beacon_compare_rx_cb *beacon_compare_rx_cb_ptr; 00245 beacon_join_priority_tx_cb *beacon_join_priority_tx_cb_ptr; 00246 uint8_t (*beacon_ind)(uint8_t *ptr, uint8_t len, protocol_interface_info_entry_t *cur); 00247 }arm_15_4_mac_parameters_t; 00248 00249 typedef void mac_poll_fail_cb(int8_t nwk_interface_id); 00250 00251 typedef struct nwk_rfd_poll_setups { 00252 uint32_t nwk_app_poll_time; 00253 net_host_mode_t host_mode; 00254 uint32_t slow_poll_rate_seconds; 00255 uint32_t timeOutInSeconds; 00256 uint8_t nwk_parent_poll_fail; 00257 uint8_t protocol_poll; 00258 mlme_poll_t poll_req; 00259 bool pollActive:1; 00260 bool macDeepSleepEnabled:1; 00261 mac_poll_fail_cb *pollFailCb; 00262 } nwk_rfd_poll_setups_s; 00263 00264 typedef struct nwk_pana_params{ 00265 net_tls_cipher_e nwk_chipher_mode; 00266 net_pana_session_mode_e client_session_mode; 00267 uint32_t psk_key_id; 00268 uint8_t pana_client; 00269 } nwk_pana_params_s; 00270 00271 typedef struct gp_ipv6_address_entry { 00272 uint8_t address[16]; 00273 ns_list_link_t link; 00274 } gp_ipv6_address_entry_t; 00275 00276 typedef NS_LIST_HEAD (gp_ipv6_address_entry_t, link) gp_ipv6_address_list_t; 00277 00278 typedef struct if_6lowpan_dad_entry { 00279 uint8_t address[16]; // IPv6 00280 uint32_t state_timer; // ticks to state change - used by DAD, then can be used by protocol 00281 uint8_t count; // general count field - used by DAD, then can be used by protocol 00282 bool active; // RFC 4941 temporary address 00283 } if_6lowpan_dad_entry_t; 00284 00285 typedef struct if_6lowpan_security_info { 00286 nwk_pana_params_s *pana_params; 00287 net_link_layer_psk_security_info_s psk_key_info; 00288 uint32_t mle_security_frame_counter; 00289 net_6lowpan_link_layer_sec_mode_e nwk_security_mode; 00290 uint8_t security_level; 00291 } if_6lowpan_security_info_t; 00292 00293 typedef enum { 00294 IPV6_LL_CONFIG, 00295 IPV6_ROUTER_SOLICATION, 00296 IPV6_GP_GEN, 00297 IPV6_GP_CONFIG, 00298 IPV6_READY, 00299 IPV6_DHCPV6_SOLICATION, 00300 IPV6_DHCPV6_ADDRESS_REQUEST, 00301 IPV6_DHCPV6_ADDRESS_REQ_FAIL, 00302 //IPV6_DHCPV6_PREFIX_READY 00303 } IPv6_ND_STATE; 00304 00305 typedef struct { 00306 net_ipv6_mode_e ipv6_stack_mode; 00307 IPv6_ND_STATE IPv6_ND_state; 00308 net_ipv6_accept_ra_e accept_ra; 00309 uint8_t wb_table_ttl; 00310 uint16_t ND_TIMER; 00311 uint8_t static_prefix64[8]; 00312 uint8_t routerSolicationRetryCounter; 00313 bool temporaryUlaAddressState; 00314 } ipv6_interface_info_t; 00315 00316 struct thread_info_s; 00317 struct mesh_callbacks_s; 00318 struct auth_info; 00319 struct rpl_domain; 00320 00321 /* Structure to keep track of timing of multicast adverts - potentially 00322 * multiple required: one for our own adverts in the interface structure below, 00323 * and one for each ABRO that we relay (in nd_router_t). 00324 */ 00325 typedef struct ipv6_ra_timing { 00326 uint32_t rtr_adv_last_send_time; // monotonic time 00327 uint8_t initial_rtr_adv_count; 00328 } ipv6_ra_timing_t; 00329 00330 /** 00331 * @brief scan_confirm_cb Callback function for scanning results 00332 * @param if_id Protocol interface id 00333 * @param conf MLME-SCAN confirm object (ownership not passed) 00334 */ 00335 typedef void scan_confirm_cb(int8_t if_id, const mlme_scan_conf_t* conf); 00336 typedef void beacon_indication_cb(int8_t if_id, const mlme_beacon_ind_t* conf); 00337 typedef void comm_status_indication_cb(int8_t if_id, const mlme_comm_status_t* status); 00338 00339 00340 00341 struct protocol_interface_info_entry { 00342 beacon_indication_cb *beacon_cb; 00343 scan_confirm_cb *scan_cb; 00344 comm_status_indication_cb *comm_status_ind_cb; 00345 nwk_interface_id nwk_id; 00346 int8_t id; 00347 int8_t bootStrapId; 00348 uint8_t zone_index[16]; 00349 int8_t net_start_tasklet; 00350 const char *interface_name; 00351 ns_list_link_t link; 00352 arm_nwk_bootsrap_mode_e bootsrap_mode; 00353 net_6lowpan_gp_address_mode_e lowpan_address_mode; 00354 arm_nwk_interface_mode_e nwk_mode; 00355 uint8_t configure_flags; 00356 uint8_t lowpan_info; 00357 uint16_t bootsrap_state_machine_cnt; 00358 icmp_state_t nwk_bootstrap_state; 00359 if_address_list_t ip_addresses; 00360 uint8_t ip_addresses_max_slaac_entries; 00361 if_group_list_t ip_groups; 00362 #ifdef MULTICAST_FORWARDING /* Conventional (non-MPL) forwarding */ 00363 if_group_fwd_list_t ip_groups_fwd; 00364 uint8_t ip_mcast_fwd_for_scope; 00365 #endif 00366 #ifdef HAVE_MPL 00367 bool mpl_proactive_forwarding; 00368 multicast_mpl_seed_id_mode_e mpl_seed_id_mode; 00369 trickle_params_t mpl_data_trickle_params; 00370 trickle_params_t mpl_control_trickle_params; 00371 uint16_t mpl_seed_set_entry_lifetime; 00372 uint8_t mpl_seed_id[16]; 00373 #endif 00374 if_6lowpan_dad_entry_t if_6lowpan_dad_process; 00375 lowpan_context_list_t lowpan_contexts; 00376 uint16_t lowpan_desired_short_address; 00377 bool global_address_available : 1; 00378 bool reallocate_short_address_if_duplicate : 1; 00379 bool iids_map_to_mac : 1; 00380 bool opaque_slaac_iids : 1; 00381 bool ip_multicast_as_mac_unicast_to_parent : 1; 00382 uint8_t dad_failures; 00383 ipv6_neighbour_cache_t ipv6_neighbour_cache; 00384 uint8_t nwk_rpl_scan_counter; 00385 uint8_t nwk_nd_re_scan_count; 00386 00387 int8_t nwk_timer_id; 00388 uint16_t icmp_tokens; /* Token bucket for ICMP rate limiting */ 00389 uint16_t icmp_ra_tokens; /* Token bucket for RA receive rate limiting */ 00390 uint16_t mle_link_reject_tokens; /* Token bucket for Report wrong working device */ 00391 uint8_t iid_eui64[8]; // IID based on EUI-64 - used for link-local address 00392 uint8_t iid_slaac[8]; // IID to use for SLAAC addresses - may or may not be same as iid_eui64 00393 uint16_t max_link_mtu; 00394 /* RFC 4861 Host Variables */ 00395 uint8_t cur_hop_limit; 00396 uint16_t reachable_time_ttl; // s 00397 uint32_t base_reachable_time; // ms 00398 #ifdef HAVE_IPV6_ND 00399 bool recv_ra_routes : 1; 00400 bool recv_ra_prefixes: 1; 00401 #endif 00402 bool send_mld: 1; 00403 #ifdef HAVE_MPL 00404 bool mpl_seed: 1; 00405 bool mpl_treat_realm_domains_as_one: 1; 00406 bool mpl_auto_domain_on_group_join: 1; 00407 #endif 00408 /* RFC 4861 Router Variables */ 00409 bool ip_forwarding : 1; 00410 bool ip_multicast_forwarding : 1; 00411 #ifndef NO_RADV_TX 00412 bool adv_send_advertisements : 1; 00413 bool rtr_adv_unicast_to_rs : 1; 00414 bool adv_copy_heard_flags : 1; 00415 uint8_t rtr_adv_flags; 00416 uint8_t max_ra_delay_time; // 100ms ticks 00417 uint8_t min_delay_between_ras; // 100ms ticks 00418 uint8_t max_initial_rtr_advertisements; 00419 uint16_t max_initial_rtr_adv_interval; // 100ms ticks 00420 uint8_t adv_cur_hop_limit; 00421 uint32_t adv_reachable_time; 00422 uint32_t adv_retrans_timer; 00423 uint16_t adv_link_mtu; 00424 uint16_t min_rtr_adv_interval; // 100ms ticks 00425 uint16_t max_rtr_adv_interval; // 100ms ticks 00426 ipv6_ra_timing_t ra_timing; 00427 #endif 00428 /* RFC 4862 Node Configuration */ 00429 uint8_t dup_addr_detect_transmits; 00430 uint16_t pmtu_lifetime; // s 00431 00432 /* Link Layer Part */ 00433 uint8_t mac[8]; // MAC address (EUI-64 for LoWPAN, EUI-48 for Ethernet) 00434 00435 interface_mode_t interface_mode; 00436 ipv6_interface_info_t *ipv6_configure; 00437 struct auth_info *pana_sec_info_temp; 00438 br_info_t *border_router_setup; 00439 struct load_balance_api *lb_api; 00440 neigh_cache_s neigh_cache; 00441 pan_blaclist_cache_s pan_blaclist_cache; 00442 pan_coordinator_blaclist_cache_s pan_cordinator_black_list; 00443 #ifdef HAVE_THREAD 00444 struct thread_info_s *thread_info; 00445 #endif 00446 struct rpl_domain *rpl_domain; 00447 struct mesh_callbacks_s *mesh_callbacks; 00448 if_6lowpan_security_info_t *if_lowpan_security_params; //Security Parameters 00449 00450 struct mac_api_s *mac_api; 00451 arm_15_4_mac_parameters_t* mac_parameters; 00452 00453 struct eth_mac_api_s *eth_mac_api; 00454 00455 struct nwk_wpan_nvm_api *nwk_wpan_nvm_api; 00456 nwk_rfd_poll_setups_s *rfd_poll_info; 00457 struct arm_device_driver_list *dev_driver; 00458 int8_t (*if_down)(struct protocol_interface_info_entry *cur); 00459 int8_t (*if_up)(struct protocol_interface_info_entry *cur); 00460 void (*if_stack_buffer_handler)(buffer_t *); 00461 bool (*if_ns_transmit)(struct protocol_interface_info_entry *cur, ipv6_neighbour_t *neighCacheEntry, bool unicast, uint8_t seq); 00462 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); 00463 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); 00464 buffer_t *(*if_special_forwarding)(struct protocol_interface_info_entry *cur, buffer_t *buf, const sockaddr_t *ll_src, bool *bounce); 00465 void (*if_special_multicast_forwarding)(struct protocol_interface_info_entry *cur, buffer_t *buf); 00466 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); 00467 buffer_t *(*if_icmp_handler)(struct protocol_interface_info_entry *cur, buffer_t *buf, bool *bounce); 00468 uint8_t (*if_llao_parse)(struct protocol_interface_info_entry *cur, const uint8_t *opt_in, sockaddr_t *ll_addr_out); 00469 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); 00470 void (*mac_security_key_usage_update_cb)(struct protocol_interface_info_entry *cur, const struct mlme_security_s *security_params); 00471 }; 00472 00473 typedef NS_LIST_HEAD (protocol_interface_info_entry_t, link) protocol_interface_list_t; 00474 00475 extern protocol_interface_list_t protocol_interface_info_list; 00476 00477 extern protocol_interface_info_entry_t *nwk_interface_get_ipv6_ptr(void); 00478 extern void nwk_interface_print_neigh_cache(route_print_fn_t *print_fn); 00479 extern void nwk_interface_flush_neigh_cache(void); 00480 00481 //void nwk_interface_dhcp_process_callback(int8_t interfaceID, bool status,uint8_t * routerId, dhcpv6_client_server_data_t *server, bool reply); 00482 00483 void protocol_core_interface_info_reset(protocol_interface_info_entry_t *entry); 00484 00485 extern void arm_net_protocol_packet_handler(buffer_t *buf, protocol_interface_info_entry_t *cur_interface); 00486 00487 protocol_interface_info_entry_t *protocol_stack_interface_sleep_possibility(void); 00488 extern uint8_t nwk_bootsrap_ready(protocol_interface_info_entry_t *cur); 00489 00490 extern protocol_interface_info_entry_t *protocol_stack_interface_info_get(nwk_interface_id nwk_id); 00491 extern bool nwk_interface_compare_mac_address(protocol_interface_info_entry_t *cur, uint_fast8_t addrlen, const uint8_t addr[/*addrlen*/]); 00492 extern protocol_interface_info_entry_t *protocol_stack_interface_generate_ethernet(struct eth_mac_api_s *api); 00493 extern protocol_interface_info_entry_t *protocol_stack_interface_generate_lowpan(struct mac_api_s *api); 00494 extern uint32_t protocol_stack_interface_set_reachable_time(protocol_interface_info_entry_t *cur, uint32_t base_reachable_time); 00495 extern void net_bootsrap_cb_run(uint8_t event); 00496 00497 extern void protocol_core_security_tick_update(uint16_t tick_update); 00498 00499 extern int8_t protocol_read_tasklet_id(void); 00500 extern void protocol_6lowpan_stack(buffer_t *b); 00501 extern void protocol_6lowpan_register_handlers(protocol_interface_info_entry_t *cur); 00502 extern void protocol_6lowpan_release_short_link_address_from_neighcache(protocol_interface_info_entry_t *cur, uint16_t shortAddress); 00503 extern void protocol_6lowpan_release_long_link_address_from_neighcache(protocol_interface_info_entry_t *cur, uint8_t *mac64); 00504 extern void protocol_core_dhcpv6_allocated_address_remove(protocol_interface_info_entry_t *cur, uint8_t *guaPrefix); 00505 00506 extern void nwk_bootsrap_state_update(arm_nwk_interface_status_type_e posted_event, protocol_interface_info_entry_t *cur); 00507 void bootsrap_next_state_kick(icmp_state_t new_state, protocol_interface_info_entry_t *cur); 00508 int8_t protcol_interface_address_compare(protocol_interface_info_entry_t *cur, const uint8_t *addr); 00509 #endif /* _NS_PROTOCOL_H */
Generated on Tue Jul 12 2022 13:03:11 by
