Kenji Arai / mbed-os_TYBLE16

Dependents:   TYBLE16_simple_data_logger TYBLE16_MP3_Air

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers protocol.h Source File

protocol.h

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