Rtos API example
net_interface.h File Reference
Network API. More...
Go to the source code of this file.
Data Structures | |
struct | link_layer_setups_s |
Network coordinator parameter list. More... | |
struct | link_layer_address_s |
Network MAC address info. More... | |
struct | network_layer_address_s |
Network layer parent address info. More... | |
struct | net_tls_psk_info_s |
TLS PSK info. More... | |
struct | net_link_layer_psk_security_info_s |
NETWORK PSK link key structure. More... | |
struct | arm_certificate_chain_entry_s |
Certificate chain structure. More... | |
struct | ns_keys_t |
Structure for the network keys used by net_network_key_get. More... | |
struct | border_router_setup_s |
6LoWPAN border router information structure. More... | |
struct | channel_list_s |
Channel list. More... | |
struct | network_driver_setup_s |
6LoWPAN radio interface setup. More... | |
Typedefs | |
typedef enum arm_nwk_interface_status_type_e | arm_nwk_interface_status_type_e |
Network Interface Status. | |
typedef enum arm_library_event_type_e | arm_library_event_type_e |
Event library type. | |
typedef enum net_security_t | net_security_t |
Network security levels. | |
typedef enum net_address_t | net_address_t |
Ipv6 address type. | |
typedef enum net_mac_address_t | net_mac_address_t |
MAC address type. | |
typedef struct link_layer_setups_s | link_layer_setups_s |
Network coordinator parameter list. | |
typedef struct link_layer_address_s | link_layer_address_s |
Network MAC address info. | |
typedef struct network_layer_address_s | network_layer_address_s |
Network layer parent address info. | |
typedef struct net_tls_psk_info_s | net_tls_psk_info_s |
TLS PSK info. | |
typedef struct ns_keys_t | ns_keys_t |
Structure for the network keys used by net_network_key_get. | |
typedef struct channel_list_s | channel_list_s |
Channel list. | |
typedef uint8_t | beacon_join_priority_tx_cb (int8_t interface_id) |
Beacon join priority transmit callback. | |
typedef uint8_t | beacon_compare_rx_cb (int8_t interface_id, uint8_t join_priority, uint8_t link_quality) |
Compare received beacon callback. | |
Enumerations | |
enum | arm_nwk_interface_status_type_e { ARM_NWK_BOOTSTRAP_READY = 0, ARM_NWK_RPL_INSTANCE_FLOODING_READY, ARM_NWK_SET_DOWN_COMPLETE, ARM_NWK_NWK_SCAN_FAIL, ARM_NWK_IP_ADDRESS_ALLOCATION_FAIL, ARM_NWK_DUPLICATE_ADDRESS_DETECTED, ARM_NWK_AUHTENTICATION_START_FAIL, ARM_NWK_AUHTENTICATION_FAIL, ARM_NWK_NWK_CONNECTION_DOWN, ARM_NWK_NWK_PARENT_POLL_FAIL, ARM_NWK_PHY_CONNECTION_DOWN } |
Network Interface Status. More... | |
enum | arm_library_event_type_e { ARM_LIB_TASKLET_INIT_EVENT = 0, ARM_LIB_NWK_INTERFACE_EVENT , APPLICATION_EVENT } |
Event library type. More... | |
enum | net_security_t { NW_NO_SECURITY = 0, NW_SECURITY_LEVEL_MIC32 = 1, NW_SECURITY_LEVEL_MIC64 = 2, NW_SECURITY_LEVEL_MIC128 = 3, NW_SECURITY_LEVEL_ENC = 4, NW_SECURITY_LEVEL_ENC_MIC32 = 5, NW_SECURITY_LEVEL_ENC_MIC64 = 6, NW_SECURITY_LEVEL_ENC_MIC128 = 7 } |
Network security levels. More... | |
enum | net_address_t { ADDR_IPV6_GP, ADDR_IPV6_GP_SEC, ADDR_IPV6_LL } |
Ipv6 address type. More... | |
enum | net_mac_address_t { ADDR_MAC_SHORT16, ADDR_MAC_LONG64 } |
MAC address type. More... | |
enum | net_tls_cipher_e { NET_TLS_PSK_CIPHER, NET_TLS_ECC_CIPHER, NET_TLS_PSK_AND_ECC_CIPHER } |
TLS cipher type. More... | |
enum | net_pana_session_mode_e { NET_PANA_SINGLE_SESSION, NET_PANA_MULTI_SESSION } |
PANA session type. More... | |
enum | net_6lowpan_link_layer_sec_mode_e { NET_SEC_MODE_NO_LINK_SECURITY, NET_SEC_MODE_PSK_LINK_SECURITY, NET_SEC_MODE_PANA_LINK_SECURITY } |
6LoWPAN network security & authentication modes. More... | |
enum | net_6lowpan_mode_e { NET_6LOWPAN_BORDER_ROUTER, NET_6LOWPAN_ROUTER, NET_6LOWPAN_HOST, NET_6LOWPAN_SLEEPY_HOST, NET_6LOWPAN_NETWORK_DRIVER, NET_6LOWPAN_SNIFFER } |
Bootstrap modes. More... | |
enum | net_6lowpan_mode_extension_e { NET_6LOWPAN_ND_WITHOUT_MLE, NET_6LOWPAN_ND_WITH_MLE, NET_6LOWPAN_THREAD, NET_6LOWPAN_ZIGBEE_IP } |
6LoWPAN Extension modes. More... | |
enum | net_ipv6_mode_e { NET_IPV6_BOOTSTRAP_STATIC, NET_IPV6_BOOTSTRAP_AUTONOMOUS } |
IPv6 bootstrap modes. More... | |
enum | net_ipv6_accept_ra_e { NET_IPV6_RA_ACCEPT_IF_AUTONOMOUS, NET_IPV6_RA_ACCEPT_ALWAYS } |
IPv6 accept RA behaviour. More... | |
enum | net_6lowpan_gp_address_mode_e { NET_6LOWPAN_GP64_ADDRESS, NET_6LOWPAN_GP16_ADDRESS, NET_6LOWPAN_MULTI_GP_ADDRESS } |
Different addressing modes for a network interface. More... | |
Functions | |
int8_t | net_init_core (void) |
Init 6LoWPAN library. | |
int8_t | arm_nwk_interface_ethernet_init (struct eth_mac_api_s *api, const char *interface_name_ptr) |
Create network interface base to IDLE state. | |
int8_t | arm_nwk_interface_lowpan_init (struct mac_api_s *api, char *interface_name_ptr) |
Create network interface base to IDLE state. | |
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) |
Set IPv6 interface setup. | |
int8_t | arm_nwk_interface_accept_ipv6_ra (int8_t interface_id, net_ipv6_accept_ra_e accept_ra) |
Accept Router Advertisements setting. | |
int8_t | arm_nwk_interface_configure_6lowpan_bootstrap_set (int8_t interface_id, net_6lowpan_mode_e bootstrap_mode, net_6lowpan_mode_extension_e net_6lowpan_mode_extension) |
Set network interface bootstrap setup. | |
int8_t | arm_nwk_interface_network_driver_set (int8_t interface_id, const channel_list_s *nwk_channel_list, network_driver_setup_s *link_setup) |
Set network interface link layer parameters. | |
int8_t | arm_nwk_6lowpan_gp_address_mode (int8_t interface_id, net_6lowpan_gp_address_mode_e mode, uint16_t short_address_base, uint8_t define_new_short_address_at_DAD) |
Set configured network interface global address mode (border router bootstrap mode cannot set this). | |
int8_t | arm_nwk_set_channel_list (int8_t interface_id, const channel_list_s *nwk_channel_list) |
Set the channel list configuration to be used on the network interface. | |
int8_t | arm_nwk_6lowpan_link_scan_parameter_set (int8_t interface_id, uint8_t scan_time) |
Set the link scan time used on network interface. | |
int8_t | arm_nwk_6lowpan_link_panid_filter_for_nwk_scan (int8_t interface_id, uint16_t pan_id_filter) |
A function to set the PAN ID filter. | |
int16_t | arm_net_get_current_channel (int8_t interface_id) |
Get current used channel. | |
uint16_t | arm_net_get_nwk_pan_id_filter (int8_t interface_id) |
A function to read the PAN ID filter. | |
int8_t | arm_nwk_6lowpan_link_nwk_id_filter_for_nwk_scan (int8_t interface_id, const uint8_t *nwk_id_filter) |
Enable/Disable network ID filter. | |
int8_t | arm_nwk_6lowpan_link_protocol_id_filter_for_nwk_scan (int8_t interface_id, uint8_t protocol_ID) |
Enable/Disable network protocol ID filter. | |
int8_t | arm_nwk_6lowpan_beacon_join_priority_tx_callback_set (int8_t interface_id, beacon_join_priority_tx_cb *beacon_join_priority_tx_cb_ptr) |
Set callback for beacon join priority transmit. | |
int8_t | arm_nwk_6lowpan_beacon_compare_rx_callback_set (int8_t interface_id, beacon_compare_rx_cb *beacon_compare_rx_cb_ptr) |
Set callback for comparing received beacon. | |
int8_t | arm_nwk_link_layer_security_mode (int8_t interface_id, net_6lowpan_link_layer_sec_mode_e mode, uint8_t sec_level, const net_link_layer_psk_security_info_s *psk_key_info) |
Initialize and configure the interface security mode. | |
int8_t | arm_pana_client_library_init (int8_t interface_id, net_tls_cipher_e cipher_mode, uint32_t psk_key_id) |
Initialize and configure interface PANA network client. | |
int8_t | arm_pana_server_library_init (int8_t interface_id, net_tls_cipher_e cipher_mode, const uint8_t *key_material, uint32_t time_period_before_activate_key) |
Initialize and Configure interface PANA network server. | |
int8_t | arm_pana_client_key_pull (int8_t interface_id) |
Manually initiate a PANA client key pull. | |
int8_t | arm_pana_server_key_update (int8_t interface_id, const uint8_t *network_key_material) |
Trigger network key update process. | |
int8_t | arm_pana_activate_new_key (int8_t interface_id) |
Activate new key material before standard timeout. | |
int8_t | arm_network_key_get (int8_t interface_id, ns_keys_t *key) |
Read PANA server security key material. | |
int8_t | arm_nwk_interface_up (int8_t interface_id) |
Start network interface bootstrap. | |
int8_t | arm_nwk_interface_down (int8_t interface_id) |
Stop and set interface to idle. | |
int8_t | arm_nwk_6lowpan_border_router_init (int8_t interface_id, const border_router_setup_s *border_router_setup_ptr) |
Define border router MAC and 6LoWPAN ND setup for selected interface. | |
int8_t | arm_nwk_6lowpan_border_router_context_update (int8_t interface_id, uint8_t c_id_flags, uint8_t context_len, uint16_t ttl, const uint8_t *context_ptr) |
Add context at 6LoWPAN interface configure state. | |
int8_t | arm_nwk_6lowpan_border_router_context_parameter_update (int8_t interface_id, uint8_t c_id, uint8_t compress_mode, uint16_t ttl) |
Update runtime configured context. | |
int8_t | arm_nwk_6lowpan_border_router_context_remove_by_id (int8_t interface_id, uint8_t c_id) |
Delete allocated context by ID. | |
int8_t | arm_nwk_6lowpan_border_router_configure_push (int8_t interface_id) |
Update ND ABRO version number. | |
int8_t | arm_nwk_6lowpan_border_route_nd_default_prefix_timeout_set (int8_t interface_id, uint32_t time) |
Set timeout for default prefix on cache. | |
int8_t | arm_nwk_param_read (int8_t interface_id, link_layer_setups_s *network_params) |
A function to read network layer configurations. | |
int8_t | arm_nwk_mac_address_read (int8_t interface_id, link_layer_address_s *mac_params) |
A function to read MAC PAN-ID, Short address and EUID64. | |
int8_t | arm_nwk_nd_address_read (int8_t interface_id, network_layer_address_s *nd_addr_info) |
A function to read 6LoWPAN ND border router address and NWK prefix. | |
int8_t | arm_net_address_get (int8_t interface_id, net_address_t addr_id, uint8_t *address) |
A function to read the networking address information. | |
int8_t | arm_net_address_list_get_next (int8_t interface_id, int *n, uint8_t address_buffer[16]) |
A function to read networking addresses one by one. | |
int8_t | arm_net_interface_address_list_size (int8_t interface_id, uint16_t *address_count) |
A function to read network interface address count. | |
int8_t | arm_net_interface_set_metric (int8_t interface_id, uint16_t metric) |
A function to set interface metric. | |
int8_t | arm_net_interface_get_metric (int8_t interface_id, uint16_t *metric) |
A function to read the interface metric value on an interface. | |
int8_t | arm_net_address_list_get (int8_t interface_id, uint8_t address_buf_size, uint8_t *address_buffer, int *writed_address_count) |
A function to read the network interface. | |
int8_t | arm_net_address_add_to_interface (int8_t interface_id, const uint8_t address[16], uint8_t prefix_len, uint32_t valid_lifetime, uint32_t preferred_lifetime) |
A function to add an address to an interface. | |
int8_t | arm_net_address_delete_from_interface (int8_t interface_id, const uint8_t address[16]) |
A function to remove an address from an interface. | |
int8_t | arm_net_route_add (const uint8_t *prefix, uint8_t prefix_len, const uint8_t *next_hop, uint32_t lifetime, uint8_t metric, int8_t interface_id) |
A function to add a route to the routing table. | |
int8_t | arm_net_route_delete (const uint8_t *prefix, uint8_t prefix_len, const uint8_t *next_hop, int8_t interface_id) |
A function to remove a route from the routing table. | |
int8_t | arm_nwk_6lowpan_border_router_nd_context_load (int8_t interface_id, uint8_t *contex_data) |
Load context from NVM at ZigBeeIP interface configure state. | |
int8_t | arm_network_certificate_chain_set (const arm_certificate_chain_entry_s *chain_info) |
Set certificate chain for PANA. | |
int8_t | arm_tls_add_psk_key (const uint8_t *key_ptr, uint16_t key_id) |
Add PSK key to TLS library. | |
int8_t | arm_tls_remove_psk_key (uint16_t key_id) |
Remove PSK key from TLS library. | |
int8_t | arm_tls_check_key (uint16_t key_id) |
Check if PSK key ID exists. | |
void | arm_print_routing_table (void) |
Print routing table. | |
void | arm_print_routing_table2 (void(*print_fn)(const char *fmt,...)) |
Print routing table. | |
void | arm_ncache_flush (void) |
Flush neighbor cache. | |
void | arm_print_neigh_cache (void) |
Print neighbor cache. | |
void | arm_print_neigh_cache2 (void(*print_fn)(const char *fmt,...)) |
Print neighbor cache. | |
void | arm_print_protocols (void) |
Print PCB list. | |
void | arm_print_protocols2 (void(*print_fn)(const char *fmt,...), char sep) |
Print PCB list. | |
void | net_get_version_information (uint8_t *ptr) |
Get the library version information. |
Detailed Description
Network API.
Definition in file net_interface.h.
Typedef Documentation
typedef enum arm_library_event_type_e arm_library_event_type_e |
Event library type.
Network Interface Status.
typedef uint8_t beacon_compare_rx_cb(int8_t interface_id, uint8_t join_priority, uint8_t link_quality) |
Compare received beacon callback.
Callback defines how preferred the node that has sent beacon is for connecting to the network.
- Parameters:
-
interface_id The network interface ID. join_priority Join priority that has been received in beacon. 0 to 255. link_quality Link quality. 0 to 255. 255 is best quality.
- Returns:
- Connect to preference. 0 to 255. 255 is highest connect to preference.
Definition at line 499 of file net_interface.h.
typedef uint8_t beacon_join_priority_tx_cb(int8_t interface_id) |
Beacon join priority transmit callback.
Callback defines join priority that is transmitted in beacon. Join priority is 8 bit field in beacon that can be set e.g. based on RPL protocol rank data.
- Parameters:
-
interface_id The network interface ID.
- Returns:
- Join priority to be transmitted in beacon. 0 to 255.
Definition at line 485 of file net_interface.h.
typedef struct channel_list_s channel_list_s |
Channel list.
typedef struct link_layer_address_s link_layer_address_s |
Network MAC address info.
typedef struct link_layer_setups_s link_layer_setups_s |
Network coordinator parameter list.
Structure is used to read network parameter for warm start.
typedef enum net_address_t net_address_t |
Ipv6 address type.
typedef enum net_mac_address_t net_mac_address_t |
MAC address type.
typedef enum net_security_t net_security_t |
Network security levels.
typedef struct net_tls_psk_info_s net_tls_psk_info_s |
TLS PSK info.
typedef struct network_layer_address_s network_layer_address_s |
Network layer parent address info.
Enumeration Type Documentation
Event library type.
- Enumerator:
Definition at line 49 of file net_interface.h.
Network Interface Status.
- Enumerator:
Definition at line 34 of file net_interface.h.
Different addressing modes for a network interface.
- Enumerator:
NET_6LOWPAN_GP64_ADDRESS Interface registers only GP64 address.
NET_6LOWPAN_GP16_ADDRESS Interface registers only GP16 address.
NET_6LOWPAN_MULTI_GP_ADDRESS Interface registers GP16 & GP64 addresses.
Definition at line 208 of file net_interface.h.
6LoWPAN network security & authentication modes.
- Enumerator:
Definition at line 144 of file net_interface.h.
enum net_6lowpan_mode_e |
Bootstrap modes.
- Enumerator:
Definition at line 152 of file net_interface.h.
6LoWPAN Extension modes.
- Enumerator:
NET_6LOWPAN_ND_WITHOUT_MLE **UNSUPPORTED**
NET_6LOWPAN_ND_WITH_MLE 6LoWPAN ND with MLE.
NET_6LOWPAN_THREAD 6LoWPAN Thread with MLE attached.
NET_6LOWPAN_ZIGBEE_IP **UNSUPPORTED**
Definition at line 162 of file net_interface.h.
enum net_address_t |
Ipv6 address type.
- Enumerator:
ADDR_IPV6_GP Node default global address.
ADDR_IPV6_GP_SEC Node secondary global address.
ADDR_IPV6_LL Node default link local address.
Definition at line 118 of file net_interface.h.
enum net_ipv6_accept_ra_e |
IPv6 accept RA behaviour.
- Enumerator:
Definition at line 177 of file net_interface.h.
enum net_ipv6_mode_e |
IPv6 bootstrap modes.
- Enumerator:
NET_IPV6_BOOTSTRAP_STATIC Application defines the IPv6 prefix.
NET_IPV6_BOOTSTRAP_AUTONOMOUS Interface gets IPv6 address automatically from network using ICMP and DHCP.
Definition at line 171 of file net_interface.h.
enum net_mac_address_t |
MAC address type.
- Enumerator:
ADDR_MAC_SHORT16 Nodes 16-bit short address.
ADDR_MAC_LONG64 IP layer EUID64 based on MAC layer 64-bit long address after U/I -bit conversion.
Definition at line 125 of file net_interface.h.
PANA session type.
- Enumerator:
NET_PANA_SINGLE_SESSION Client tracks only one PANA session data, default use case.
NET_PANA_MULTI_SESSION Client supports many Start network coordinator session data.
Definition at line 138 of file net_interface.h.
enum net_security_t |
Network security levels.
- Enumerator:
Definition at line 106 of file net_interface.h.
enum net_tls_cipher_e |
TLS cipher type.
- Enumerator:
NET_TLS_PSK_CIPHER Network authentication support, only PSK.
NET_TLS_ECC_CIPHER Network authentication support, only ECC.
NET_TLS_PSK_AND_ECC_CIPHER Network authentication support, PSK & ECC.
Definition at line 131 of file net_interface.h.
Function Documentation
void arm_ncache_flush | ( | void | ) |
Flush neighbor cache.
Flushes the neighbor cache
int8_t arm_net_address_add_to_interface | ( | int8_t | interface_id, |
const uint8_t | address[16], | ||
uint8_t | prefix_len, | ||
uint32_t | valid_lifetime, | ||
uint32_t | preferred_lifetime | ||
) |
A function to add an address to an interface.
- Parameters:
-
interface_id Network interface ID. address The address to be added to the interface. prefix_len The length of the address prefix. valid_lifetime The time in seconds until the address becomes invalid and is removed from the interface. Value 0xffffffff represents infinity. preferred_lifetime The time in seconds until the address becomes deprecated. Value 0xffffffff represents infinity. The preferred lifetime should not be longer than a valid lifetime.
- Returns:
- 0 on success, -1 on errors.
int8_t arm_net_address_delete_from_interface | ( | int8_t | interface_id, |
const uint8_t | address[16] | ||
) |
A function to remove an address from an interface.
- Parameters:
-
interface_id Network interface ID. address The address to be removed from the interface.
- Returns:
- 0 on success, -1 on errors.
int8_t arm_net_address_get | ( | int8_t | interface_id, |
net_address_t | addr_id, | ||
uint8_t * | address | ||
) |
A function to read the networking address information.
- Parameters:
-
interface_id Network interface ID. addr_id The address information type to be read. address A pointer to a structure where the address information is written.
- Returns:
- 0 On success, -1 on failure.
int8_t arm_net_address_list_get | ( | int8_t | interface_id, |
uint8_t | address_buf_size, | ||
uint8_t * | address_buffer, | ||
int * | writed_address_count | ||
) |
A function to read the network interface.
- Parameters:
-
interface_id Network interface ID. address_buf_size Buffer size in bytes, minimum 16 bytes. address_buffer A pointer to a structure where the addresses are saved one by one. writed_address_count A pointer to the structure where the number of addresses saved is written.
- Returns:
- 0 on success, -1 on errors.
int8_t arm_net_address_list_get_next | ( | int8_t | interface_id, |
int * | n, | ||
uint8_t | address_buffer[16] | ||
) |
A function to read networking addresses one by one.
- Parameters:
-
interface_id Network interface ID. n A pointer that is incremented every call. Start looping with n=0. address_buffer A pointer to buffer where address is copied.
- Returns:
- 0 On success.
- -1 No more addresses available.
int16_t arm_net_get_current_channel | ( | int8_t | interface_id ) |
Get current used channel.
- Parameters:
-
interface_id Network interface ID.
- Returns:
- Active channel.
- -1 = Radio is closed.
uint16_t arm_net_get_nwk_pan_id_filter | ( | int8_t | interface_id ) |
A function to read the PAN ID filter.
- Parameters:
-
interface_id Network interface ID.
- Returns:
- 16-bit value indicating a PAN ID filter.
int8_t arm_net_interface_address_list_size | ( | int8_t | interface_id, |
uint16_t * | address_count | ||
) |
A function to read network interface address count.
- Parameters:
-
interface_id Network interface ID. address_count A pointer to the structure where the address count is saved.
- Returns:
- 0 On success, -1 on errors.
int8_t arm_net_interface_get_metric | ( | int8_t | interface_id, |
uint16_t * | metric | ||
) |
A function to read the interface metric value on an interface.
- Parameters:
-
interface_id Network interface ID. metric A pointer to the variable where the interface metric value is saved.
- Returns:
- 0 On success, -1 on errors.
int8_t arm_net_interface_set_metric | ( | int8_t | interface_id, |
uint16_t | metric | ||
) |
A function to set interface metric.
- Parameters:
-
interface_id Network interface ID. metric Used to rank otherwise-equivalent routes. Lower is preferred and default is 0. The metric value is added to metric provided by the arm_net_route_add() function.
- Returns:
- 0 On success, -1 on errors.
int8_t arm_net_route_add | ( | const uint8_t * | prefix, |
uint8_t | prefix_len, | ||
const uint8_t * | next_hop, | ||
uint32_t | lifetime, | ||
uint8_t | metric, | ||
int8_t | interface_id | ||
) |
A function to add a route to the routing table.
- Parameters:
-
prefix Destination prefix for the route to be added. prefix_len The length of the prefix. next_hop Link-local address of the next hop (e.g. router); if NULL the route is marked as on-link. lifetime The time in seconds until the route is removed from the routing table. Value 0xffffffff means infinite. metric Used to rank otherwise-equivalent routes. Lower is preferred. Normally 128. interface_id Network interface ID.
- Returns:
- 0 on success, -1 on add failure, -2 on invalid function parameters.
int8_t arm_net_route_delete | ( | const uint8_t * | prefix, |
uint8_t | prefix_len, | ||
const uint8_t * | next_hop, | ||
int8_t | interface_id | ||
) |
A function to remove a route from the routing table.
- Parameters:
-
prefix The prefix to be removed. prefix_len The length of the prefix. next_hop Link-local address of the next hop. interface_id Network interface ID.
- Returns:
- 0 on success, -1 on delete failure, -2 on invalid function parameters.
int8_t arm_network_certificate_chain_set | ( | const arm_certificate_chain_entry_s * | chain_info ) |
Set certificate chain for PANA.
- Parameters:
-
chain_info Certificate chain.
- Returns:
- 0 on success, negative on failure.
int8_t arm_network_key_get | ( | int8_t | interface_id, |
ns_keys_t * | key | ||
) |
Read PANA server security key material.
previous_active_network_key Only valid when current_active_key_index is bigger than 1.
- Parameters:
-
interface_id Interface key Pointer for key material information store.
- Returns:
- 0 Key read OK.
- -1 PANA server key material not available.
int8_t arm_nwk_6lowpan_beacon_compare_rx_callback_set | ( | int8_t | interface_id, |
beacon_compare_rx_cb * | beacon_compare_rx_cb_ptr | ||
) |
Set callback for comparing received beacon.
Sets callback that defines how preferred the node that has sent beacon is for connecting to the network. If callback is not set default functionality is used. On default functionality connecting priority is defined based on join priority received in beacon and link quality.
- Parameters:
-
interface_id Network interface ID. beacon_compare_rx_cb_ptr Function pointer.
- Returns:
- 0 on success.
- -1 Unknown network ID.
- -2 Other error.
int8_t arm_nwk_6lowpan_beacon_join_priority_tx_callback_set | ( | int8_t | interface_id, |
beacon_join_priority_tx_cb * | beacon_join_priority_tx_cb_ptr | ||
) |
Set callback for beacon join priority transmit.
Sets callback that defines join priority that is transmitted in beacon. If callback is not set default functionality is used. On default functionality join priority is combined from RPL DAGRank and RPL DODAG preference.
- Parameters:
-
interface_id The network interface ID. beacon_join_priority_tx_cb_ptr Function pointer.
- Returns:
- 0 on success.
- -1 Unknown network ID.
- -2 Other error.
int8_t arm_nwk_6lowpan_border_route_nd_default_prefix_timeout_set | ( | int8_t | interface_id, |
uint32_t | time | ||
) |
Set timeout for default prefix on cache.
Requires arm_nwk_6lowpan_border_router_configure_push() be called to settings be taken into use.
- Parameters:
-
interface_id mesh interface. time seconds
- Returns:
- 0 on success, negative value on failure.
int8_t arm_nwk_6lowpan_border_router_configure_push | ( | int8_t | interface_id ) |
Update ND ABRO version number.
- Parameters:
-
interface_id Network interface ID
- Returns:
- 0 ABRO version update OK.
- -1 ABRO update fails (Interface is not up yet or the border router base is not allocated).
int8_t arm_nwk_6lowpan_border_router_context_parameter_update | ( | int8_t | interface_id, |
uint8_t | c_id, | ||
uint8_t | compress_mode, | ||
uint16_t | ttl | ||
) |
Update runtime configured context.
This function can change the value of context compress state or time to live. It triggers a new ABRO version number, indicating that ND parameters are updated.
- Parameters:
-
interface_id Network interface ID. c_id Context ID stack checks first 4 bits, supported values 0-15. compress_mode 0 = Compress disabled, otherwise compress enabled. ttl Context time to live value in minutes.
- Returns:
- 0 Update OK.
- -1 Update fail by router state.
int8_t arm_nwk_6lowpan_border_router_context_remove_by_id | ( | int8_t | interface_id, |
uint8_t | c_id | ||
) |
Delete allocated context by ID.
- Parameters:
-
interface_id Network interface ID. c_id 4-bit Context ID to be deleted.
- Returns:
- 0 Context delete OK.
- -1 Delete process fails.
int8_t arm_nwk_6lowpan_border_router_context_update | ( | int8_t | interface_id, |
uint8_t | c_id_flags, | ||
uint8_t | context_len, | ||
uint16_t | ttl, | ||
const uint8_t * | context_ptr | ||
) |
Add context at 6LoWPAN interface configure state.
- Parameters:
-
interface_id Network interface ID. c_id_flags Bit 4 indicates compress support and bit 0-3 context ID. context_len Context length in bits need to be 64-128. ttl Context time to live, value in minutes. context_ptr Pointer to full 128-bit memory area.
- Returns:
- 0 Context update OK.
- -1 No memory for new context.
- -2 Border router base not allocated.
- -3 Given parameter fails (c_id_flags > 0x1f or contex_len < 64). \
int8_t arm_nwk_6lowpan_border_router_init | ( | int8_t | interface_id, |
const border_router_setup_s * | border_router_setup_ptr | ||
) |
Define border router MAC and 6LoWPAN ND setup for selected interface.
- Parameters:
-
interface_id Network interface ID. border_router_setup_ptr Pointer to MAC and 6LoWPAN ND setup.
- Returns:
- 0 on success, negative value on error case.
int8_t arm_nwk_6lowpan_border_router_nd_context_load | ( | int8_t | interface_id, |
uint8_t * | contex_data | ||
) |
Load context from NVM at ZigBeeIP interface configure state.
- Parameters:
-
interface_id Network Interface ID contex_data A pointer to properly built 20 bytes update array.
- Returns:
- 0 Context reload OK.
- <0 Load fail.
int8_t arm_nwk_6lowpan_gp_address_mode | ( | int8_t | interface_id, |
net_6lowpan_gp_address_mode_e | mode, | ||
uint16_t | short_address_base, | ||
uint8_t | define_new_short_address_at_DAD | ||
) |
Set configured network interface global address mode (border router bootstrap mode cannot set this).
- Parameters:
-
interface_id Network interface ID. mode Define 6LoWPAN Global Address register mode: * NET_6LOWPAN_GP64_ADDRESS, Interface registers only GP64 * NET_6LOWPAN_GP16_ADDRESS, Interface registers only GP16 * NET_6LOWPAN_MULTI_GP_ADDRESS, Interface registers GP16 and GP64 addresses. GP16 is primary address and GP64 is secondary. short_address_base Short address base. If the application defines value 0-0xfffd, 6LoWPAN tries to register GP16 address using that address. 0xfffe and 0xffff generate random 16-bit short address. define_new_short_address_at_DAD This parameter is only checked when mode is not NET_6LOWPAN_GP64_ADDRESS and short_address_base is 0-0xfffd. Recommended value is 1. It enables automatic new address definition at Duplicate Address Detection (DAD). Value 0 generates a DAD error for the interface bootstrap. Border router device will not check that part.
- Returns:
- >=0 Bootstrap mode set OK.
- -1 Unknown network ID.
- -2 Illegal for border router.
- -3 No memory for 6LoWPAN stack.
int8_t arm_nwk_6lowpan_link_nwk_id_filter_for_nwk_scan | ( | int8_t | interface_id, |
const uint8_t * | nwk_id_filter | ||
) |
Enable/Disable network ID filter.
- Parameters:
-
interface_id Network interface ID. nwk_id_filter A pointer to a new network ID filter, NULL disable filter.
- Returns:
- 0 On success.
- -1 Unknown network ID.
- -2 Interface active.
int8_t arm_nwk_6lowpan_link_panid_filter_for_nwk_scan | ( | int8_t | interface_id, |
uint16_t | pan_id_filter | ||
) |
A function to set the PAN ID filter.
- Parameters:
-
interface_id Network interface ID. pan_id_filter Enable filter for specific PAN ID. 0xffff disables the filter.
- Returns:
- 0 Filter set OK.
- -1 Unknown Network interface ID.
- -2 Interface is active.
int8_t arm_nwk_6lowpan_link_protocol_id_filter_for_nwk_scan | ( | int8_t | interface_id, |
uint8_t | protocol_ID | ||
) |
Enable/Disable network protocol ID filter.
- Parameters:
-
interface_id Network interface ID. protocol_ID A value that filters only supported network protocols (0= Zigbee1.x, 2= ZigBeeIP).
- Returns:
- 0 On success.
- -1 Unknown network ID.
- -2 Interface active.
int8_t arm_nwk_6lowpan_link_scan_parameter_set | ( | int8_t | interface_id, |
uint8_t | scan_time | ||
) |
Set the link scan time used on network interface.
- Parameters:
-
interface_id Network interface ID. scan_time Value 0-14, scan duration/channel.
- Returns:
- >=0 Scan configuration OK.
- -1 Unknown network interface ID.
- -4 If network interface is already active and cannot be re-configured.
- -5 Invalid scan time.
int8_t arm_nwk_interface_accept_ipv6_ra | ( | int8_t | interface_id, |
net_ipv6_accept_ra_e | accept_ra | ||
) |
Accept Router Advertisements setting.
Accept Router Advertisements setting. Setting can be changed after an interface is created. If setting is changed it must be done before the bootstrap is started.
- Parameters:
-
interface_id The network interface ID. accept_ra Router Advertisements handling mode.
- Returns:
- 0 Setting done.
- <0 Failed (for example an invalid interface ID).
int8_t arm_nwk_interface_configure_6lowpan_bootstrap_set | ( | int8_t | interface_id, |
net_6lowpan_mode_e | bootstrap_mode, | ||
net_6lowpan_mode_extension_e | net_6lowpan_mode_extension | ||
) |
Set network interface bootstrap setup.
- Parameters:
-
interface_id Network interface ID. bootstrap_mode Selected bootstrap mode: * NET_6LOWPAN_BORDER_ROUTER, Initialize border router basic setup. * NET_6LOWPAN_ROUTER, Enable normal 6LoWPAN ND and RPL to bootstrap. * NET_6LOWPAN_HOST, Enable normal 6LoWPAN ND only to bootstrap. * NET_6LOWPAN_SLEEPY_HOST, Enable normal 6LoWPAN ND only to bootstrap. * NET_6LOWPAN_NETWORK_DRIVER, 6LoWPAN radio host device no bootstrap. * NET_6LOWPAN_SNIFFER, 6LoWPAN sniffer device no bootstrap. net_6lowpan_mode_extension Define 6LoWPAN MLE and mode as ZigBeeIP or Thread.
- Returns:
- >=0 Bootstrap mode set OK.
- -1 Unknown network ID.
- -2 Unsupported bootstrap type in this library.
- -3 No memory for 6LoWPAN stack.
- -4 Null pointer parameter.
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 | ||
) |
Set IPv6 interface setup.
- Parameters:
-
interface_id Network interface ID. bootstrap_mode Selected bootstrap mode: * NET_IPV6_BOOTSTRAP_STATIC, Application defines the IPv6 prefix. ipv6_prefix_pointer Pointer to 64 bit IPv6 prefix. The data is copied, so it can be invalidated after function call.
- Returns:
- >=0 Bootstrap mode set OK.
- -1 Unknown network ID.
int8_t arm_nwk_interface_down | ( | int8_t | interface_id ) |
Stop and set interface to idle.
- Parameters:
-
interface_id Network interface ID
- Returns:
- >=0 Process OK.
- -1 Unknown network ID.
- -3 Not Active.
int8_t arm_nwk_interface_ethernet_init | ( | struct eth_mac_api_s * | api, |
const char * | interface_name_ptr | ||
) |
Create network interface base to IDLE state.
- Parameters:
-
api Generates interface with ethernet MAC. interface_name_ptr String pointer to interface name. Need to end to '\0' character. Max length 32 characters including NULL at end. Note: the given name is not copied, so it must remain valid as long as the interface is.
- Returns:
- >=0 Interface ID (0-127). Application needs to save this information.
- -1 api was NULL.
- -2 Ethernet is not supported at this build.
- -3 No memory for the interface.
int8_t arm_nwk_interface_lowpan_init | ( | struct mac_api_s * | api, |
char * | interface_name_ptr | ||
) |
Create network interface base to IDLE state.
- Parameters:
-
api Generates interface with 802.15.4 MAC. interface_name_ptr String pointer to interface name. Need to end to '\0' character. Max length 32 characters including NULL at end. Note: the given name is not copied, so it must remain valid as long as the interface is.
- Returns:
- >=0 Interface ID (0-127). Application needs to save this information.
- -1 api was NULL.
- -3 No memory for the interface.
int8_t arm_nwk_interface_network_driver_set | ( | int8_t | interface_id, |
const channel_list_s * | nwk_channel_list, | ||
network_driver_setup_s * | link_setup | ||
) |
Set network interface link layer parameters.
- Parameters:
-
interface_id Network interface ID nwk_channel_list Defines network channel page and channel. link_setup Link layer parameters for NET_6LOWPAN_NETWORK_DRIVER defines NetworkID, PAN-ID Short Address.
- Returns:
- >=0 Configuration set OK.
- -1 Unknown network ID.
- -2 Interface is active, bootsrap mode not selected or is not NET_6LOWPAN_NETWORK_DRIVER or NET_6LOWPAN_SNIFFER.
- -3 No memory for 6LoWPAN stack.
- -4 Null pointer parameter.
int8_t arm_nwk_interface_up | ( | int8_t | interface_id ) |
Start network interface bootstrap.
- Parameters:
-
interface_id Network interface ID.
- Returns:
- >=0 Bootstrap start OK.
- -1 Unknown network ID.
- -2 Not configured.
- -3 Active.
int8_t arm_nwk_link_layer_security_mode | ( | int8_t | interface_id, |
net_6lowpan_link_layer_sec_mode_e | mode, | ||
uint8_t | sec_level, | ||
const net_link_layer_psk_security_info_s * | psk_key_info | ||
) |
Initialize and configure the interface security mode.
- Parameters:
-
interface_id Network interface ID. mode Defines link layer security mode. NET_SEC_MODE_NO_LINK_SECURITY, No security. NET_SEC_MODE_PSK_LINK_SECURITY, Predefined PSK link layer key and ID. NET_SEC_MODE_PANA_LINK_SECURITY, PANA bootstrap network authentication. sec_level Defined security level is checked only when the mode is not NET_SEC_MODE_NO_LINK_SECURITY. psk_key_info Pointer for PSK link layer keys. Checked only when the mode is NET_SEC_MODE_PSK_LINK_SECURITY.
- Returns:
- 0 on success.
int8_t arm_nwk_mac_address_read | ( | int8_t | interface_id, |
link_layer_address_s * | mac_params | ||
) |
A function to read MAC PAN-ID, Short address and EUID64.
- Parameters:
-
interface_id Network interface ID. mac_params A pointer to the structure where the MAC addresses are written.
- Returns:
- 0 On success.
- Negative value if interface is not known.
int8_t arm_nwk_nd_address_read | ( | int8_t | interface_id, |
network_layer_address_s * | nd_addr_info | ||
) |
A function to read 6LoWPAN ND border router address and NWK prefix.
- Parameters:
-
interface_id Network interface ID. nd_addr_info Pointer to the structure where the address is written.
- Returns:
- 0 On success.
- Negative value if network interface is not known or if the interface is not in active or ready state.
int8_t arm_nwk_param_read | ( | int8_t | interface_id, |
link_layer_setups_s * | network_params | ||
) |
A function to read network layer configurations.
- Parameters:
-
interface_id Network interface ID. network_params A pointer to the structure where the network layer configs are written.
- Returns:
- 0 On success.
- Negative value if interface is not known.
int8_t arm_nwk_set_channel_list | ( | int8_t | interface_id, |
const channel_list_s * | nwk_channel_list | ||
) |
Set the channel list configuration to be used on the network interface.
- Parameters:
-
interface_id Network interface ID. nwk_channel_list Channel list to be used.
- Returns:
- >=0 Channel configuration OK.
- -1 Unknown network interface ID.
- -2 Empty channel list, no channels enabled.
- -4 If network interface is already active and cannot be re-configured.
int8_t arm_pana_activate_new_key | ( | int8_t | interface_id ) |
Activate new key material before standard timeout.
This function is only for testing.
- Parameters:
-
interface_id Network interface ID.
- Returns:
- 0 Key activate process OK.
- -1 No Pending key update.
- -2 PANA server is not initialized or PANA server API is disabled with this library.
int8_t arm_pana_client_key_pull | ( | int8_t | interface_id ) |
Manually initiate a PANA client key pull.
For test purposes only.
- Parameters:
-
interface_id Network interface ID.
- Returns:
- 0 On success.
- -1 Unknown network ID.
int8_t arm_pana_client_library_init | ( | int8_t | interface_id, |
net_tls_cipher_e | cipher_mode, | ||
uint32_t | psk_key_id | ||
) |
Initialize and configure interface PANA network client.
- Parameters:
-
interface_id Network interface ID. cipher_mode Defines TLS 1.2 Cipher mode PSK, ECC or both. psk_key_id PSK KEY id for PSK Setup
- Returns:
- 0 on success.
- -1 Unknown network ID or PANA is not supported at this library.
- -2 Interface active.
int8_t arm_pana_server_key_update | ( | int8_t | interface_id, |
const uint8_t * | network_key_material | ||
) |
Trigger network key update process.
This function delivers a new network key to all ZigBee routers that have registered a GP address to server. The function call always trig new key-id. Key delivery is started in 300ms interval between nodes. This function does not cause any traffic if the server does not have any router device sessions.
- Parameters:
-
interface_id Network interface ID. network_key_material Pointer to new 128-bit key material, NULL generates a random key.
- Returns:
- 0 Key Update process OK.
- -1 PANA server is not initialized yet.
- -2 Old key update still active.
- -3 Memory allocation fails.
int8_t arm_pana_server_library_init | ( | int8_t | interface_id, |
net_tls_cipher_e | cipher_mode, | ||
const uint8_t * | key_material, | ||
uint32_t | time_period_before_activate_key | ||
) |
Initialize and Configure interface PANA network server.
- Parameters:
-
interface_id Network interface ID. cipher_mode Defines TLS 1.2 Cipher mode PSK, ECC or both. key_material A pointer to 128-bit key material or NULL when the PANA server generates the random key. time_period_before_activate_key Guard period after a succesful key delivery phase before the key will be activated by server.
- Returns:
- 0 On success.
- -1 Unknown network ID.
- -2 Interface active.
void arm_print_neigh_cache | ( | void | ) |
Print neighbor cache.
Prints neighbor cache to the command line
void arm_print_neigh_cache2 | ( | void(*)(const char *fmt,...) | print_fn ) |
Print neighbor cache.
Outputs the neighbor cache using the given printf style function
- Parameters:
-
print_fn pointer to a printf style output function
void arm_print_protocols | ( | void | ) |
Print PCB list.
Prints Protocol Control Block list to the command line
void arm_print_protocols2 | ( | void(*)(const char *fmt,...) | print_fn, |
char | sep | ||
) |
Print PCB list.
Prints Protocol Control Block list using the given printf style function
- Parameters:
-
print_fn pointer to a printf style output function sep column separator character
void arm_print_routing_table | ( | void | ) |
Print routing table.
Prints the routing table to the command line
void arm_print_routing_table2 | ( | void(*)(const char *fmt,...) | print_fn ) |
Print routing table.
Outputs the routing table using the given printf style function
- Parameters:
-
print_fn pointer to a printf style output function
int8_t arm_tls_add_psk_key | ( | const uint8_t * | key_ptr, |
uint16_t | key_id | ||
) |
Add PSK key to TLS library.
- Parameters:
-
key_ptr A pointer to 16 bytes long key array. key_id PSK key ID.
- Returns:
- 0 = success
- -1 = failure
int8_t arm_tls_check_key | ( | uint16_t | key_id ) |
Check if PSK key ID exists.
- Parameters:
-
key_id PSK key ID
- Returns:
- 0 = success
- -1 = failure
int8_t arm_tls_remove_psk_key | ( | uint16_t | key_id ) |
Remove PSK key from TLS library.
- Parameters:
-
key_id PSK key ID.
- Returns:
- 0 = success
- -1 = failure
void net_get_version_information | ( | uint8_t * | ptr ) |
Get the library version information.
- Parameters:
-
*ptr Pointer to data location. Required size is 20 bytes.
The array containing the version information has the following structure.
| Platform type | Version | Build ID | | :-----------: | :----------------: | | 1 byte | 1 byte | 4 bytes |
int8_t net_init_core | ( | void | ) |
Init 6LoWPAN library.
- Returns:
- 0, Init OK.
Generated on Sun Jul 17 2022 08:25:35 by 1.7.2