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