Kenji Arai / mbed-os_TYBLE16

Dependents:   TYBLE16_simple_data_logger TYBLE16_MP3_Air

Embed: (wiki syntax)

« Back to documentation index

net_interface.h File Reference

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  arm_certificate_entry_s
 Certificate structure. More...
struct  arm_cert_revocation_list_entry_s
 Certificate Revocation List 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_WS,
  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_ppp_init (struct eth_mac_api_s *api, const 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.
int8_t arm_network_trusted_certificate_add (const arm_certificate_entry_s *cert)
 Add trusted certificate.
int8_t arm_network_trusted_certificate_remove (const arm_certificate_entry_s *cert)
 Remove trusted certificate.
int8_t arm_network_trusted_certificates_remove (void)
 Remove trusted certificates.
int8_t arm_network_own_certificate_add (const arm_certificate_entry_s *cert)
 Add own certificate.
int8_t arm_network_own_certificates_remove (void)
 Remove own certificates.
int8_t arm_network_certificate_revocation_list_add (const arm_cert_revocation_list_entry_s *crl)
 Add Certificate Revocation List.
int8_t arm_network_certificate_revocation_list_remove (const arm_cert_revocation_list_entry_s *crl)
 Remove Certificate Revocation List.
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.
int arm_nwk_sleepy_device_parent_buffer_size_set (int8_t interface_id, uint16_t big_packet_threshold, uint16_t small_packets_per_child_count, uint16_t big_packets_total_count)
 Set buffer size for sleepy device parent.
int8_t arm_nwk_set_cca_threshold (int8_t interface_id, uint8_t cca_threshold)
 Set CCA threshold.
int8_t arm_nwk_set_tx_output_power (int8_t interface_id, uint8_t tx_power)
 Set TX output power.

Detailed Description

Network API.

Definition in file net_interface.h.


Typedef Documentation

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_idThe network interface ID.
join_priorityJoin priority that has been received in beacon. 0 to 255.
link_qualityLink quality. 0 to 255. 255 is best quality.
Returns:
Connect to preference. 0 to 255. 255 is highest connect to preference.

Definition at line 530 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_idThe network interface ID.
Returns:
Join priority to be transmitted in beacon. 0 to 255.

Definition at line 516 of file net_interface.h.

Channel list.

Network MAC address info.

Network coordinator parameter list.

Structure is used to read network parameter for warm start.

Ipv6 address type.

MAC address type.

Network security levels.

TLS PSK info.

Network layer parent address info.

typedef struct ns_keys_t ns_keys_t

Structure for the network keys used by net_network_key_get.


Enumeration Type Documentation

Event library type.

Enumerator:
ARM_LIB_TASKLET_INIT_EVENT 

Tasklet init occurs always when generating a tasklet.

ARM_LIB_NWK_INTERFACE_EVENT 

Interface bootstrap or state update event.

APPLICATION_EVENT 

Application-specific event.

*< System timer event.

Definition at line 52 of file net_interface.h.

Network Interface Status.

Enumerator:
ARM_NWK_BOOTSTRAP_READY 

Interface configured Bootstrap is ready.

ARM_NWK_RPL_INSTANCE_FLOODING_READY 

RPL instance has been flooded.

ARM_NWK_SET_DOWN_COMPLETE 

Interface DOWN command completed successfully.

ARM_NWK_NWK_SCAN_FAIL 

Interface has not detected any valid network.

ARM_NWK_IP_ADDRESS_ALLOCATION_FAIL 

IP address allocation failure (ND, DHCPv4 or DHCPv6).

ARM_NWK_DUPLICATE_ADDRESS_DETECTED 

User-specific GP16 was not valid.

ARM_NWK_AUHTENTICATION_START_FAIL 

No valid authentication server detected behind the access point.

ARM_NWK_AUHTENTICATION_FAIL 

Network authentication failed by handshake.

ARM_NWK_NWK_CONNECTION_DOWN 

No connection between access point and default router.

ARM_NWK_NWK_PARENT_POLL_FAIL 

Sleepy host poll failed 3 times.

Interface is shut down.

ARM_NWK_PHY_CONNECTION_DOWN 

Interface PHY cable off or serial port interface not responding anymore.

Definition at line 37 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 212 of file net_interface.h.

6LoWPAN network security & authentication modes.

Enumerator:
NET_SEC_MODE_NO_LINK_SECURITY 

Security disabled at link layer, DEFAULT.

NET_SEC_MODE_PSK_LINK_SECURITY 

Link security by PSK key.

NET_SEC_MODE_PANA_LINK_SECURITY 

PANA network authentication defined link KEY.

Definition at line 147 of file net_interface.h.

Bootstrap modes.

Enumerator:
NET_6LOWPAN_BORDER_ROUTER 

Root device for 6LoWPAN ND.

NET_6LOWPAN_ROUTER 

Router device.

NET_6LOWPAN_HOST 

Host device DEFAULT setting.

NET_6LOWPAN_SLEEPY_HOST 

Sleepy host device.

NET_6LOWPAN_NETWORK_DRIVER 

6LoWPAN radio host device, no bootstrap.

NET_6LOWPAN_SNIFFER 

Sniffer device, no bootstrap.

Definition at line 155 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_WS 

WS.

NET_6LOWPAN_ZIGBEE_IP 

**UNSUPPORTED**

Definition at line 165 of file net_interface.h.

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 121 of file net_interface.h.

IPv6 accept RA behaviour.

Enumerator:
NET_IPV6_RA_ACCEPT_IF_AUTONOMOUS 

Accept Router Advertisements when using autonomous IPv6 address allocation.

Ignore when using a static address. This is the default value for the setting.

NET_IPV6_RA_ACCEPT_ALWAYS 

Accept Router Advertisements always, even when using static IPv6 address allocation.

Definition at line 181 of file net_interface.h.

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 175 of file net_interface.h.

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 128 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 141 of file net_interface.h.

Network security levels.

Enumerator:
NW_NO_SECURITY 

No Security.

NW_SECURITY_LEVEL_MIC32 

32-bit MIC verify, no encoding.

NW_SECURITY_LEVEL_MIC64 

64-bit MIC verify, no encoding.

NW_SECURITY_LEVEL_MIC128 

128-bit MIC verify, no encoding.

NW_SECURITY_LEVEL_ENC 

AES encoding without MIC.

NW_SECURITY_LEVEL_ENC_MIC32 

32-bit MIC verify with encoding.

NW_SECURITY_LEVEL_ENC_MIC64 

64-bit MIC verify with encoding.

NW_SECURITY_LEVEL_ENC_MIC128 

128-bit MIC verify with encoding.

Definition at line 109 of file net_interface.h.

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 134 of file net_interface.h.


Function Documentation

void arm_ncache_flush ( void   )

Flush neighbor cache.

Flushes the neighbor cache

Definition at line 1517 of file ns_net.c.

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_idNetwork interface ID.
addressThe address to be added to the interface.
prefix_lenThe length of the address prefix.
valid_lifetimeThe time in seconds until the address becomes invalid and is removed from the interface. Value 0xffffffff represents infinity.
preferred_lifetimeThe 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.

Definition at line 622 of file ns_net.c.

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_idNetwork interface ID.
addressThe address to be removed from the interface.
Returns:
0 on success, -1 on errors.

Definition at line 642 of file ns_net.c.

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_idNetwork interface ID.
addr_idThe address information type to be read.
addressA pointer to a structure where the address information is written.
Returns:
0 On success, -1 on failure.

A function to read the networking address information.

Parameters:
addr_ididentifies the address information type to be read.
addressis a pointer to a buffer to where the address information is written to.
Returns:
zero on success, -1 on errors.

Definition at line 413 of file ns_net.c.

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_idNetwork interface ID.
address_buf_sizeBuffer size in bytes, minimum 16 bytes.
address_bufferA pointer to a structure where the addresses are saved one by one.
writed_address_countA pointer to the structure where the number of addresses saved is written.
Returns:
0 on success, -1 on errors.

A function to read the network interface.

Parameters:
interface_idId to interface.
address_buf_sizeIndicate buffer size in bytes minimal is 16 bytes.
address_bufferpointer where stack save address one by one.
writed_address_countpointer where stack save how many address is writed behind address_buffer.
Returns:
zero on success, -1 on errors.

Definition at line 527 of file ns_net.c.

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_idNetwork interface ID.
nA pointer that is incremented every call. Start looping with n=0.
address_bufferA pointer to buffer where address is copied.
Returns:
0 On success.
-1 No more addresses available.

Definition at line 579 of file ns_net.c.

int16_t arm_net_get_current_channel ( int8_t  interface_id )

Get current used channel.

Parameters:
interface_idNetwork interface ID.
Returns:
Active channel.
-1 = Radio is closed.
Active channel
-1 if invalid network interface ID is given

Definition at line 314 of file ns_net.c.

uint16_t arm_net_get_nwk_pan_id_filter ( int8_t  interface_id )

A function to read the PAN ID filter.

Parameters:
interface_idNetwork interface ID.
Returns:
16-bit value indicating a PAN ID filter.

A function to read the PAN ID filter.

Returns:
16-bit value indicating a pan ID filter.

Definition at line 213 of file ns_net.c.

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_idNetwork interface ID.
address_countA pointer to the structure where the address count is saved.
Returns:
0 On success, -1 on errors.

A function to read network interface address count.

Parameters:
interface_idId to interface.
address_countPointer where address count will be saved.
Returns:
zero on success, -1 on errors.

Definition at line 460 of file ns_net.c.

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_idNetwork interface ID.
metricA pointer to the variable where the interface metric value is saved.
Returns:
0 On success, -1 on errors.

Definition at line 504 of file ns_net.c.

int8_t arm_net_interface_set_metric ( int8_t  interface_id,
uint16_t  metric 
)

A function to set interface metric.

Parameters:
interface_idNetwork interface ID.
metricUsed 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.

Definition at line 484 of file ns_net.c.

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:
prefixDestination prefix for the route to be added.
prefix_lenThe length of the prefix.
next_hopLink-local address of the next hop (e.g. router); if NULL the route is marked as on-link.
lifetimeThe time in seconds until the route is removed from the routing table. Value 0xffffffff means infinite.
metricUsed to rank otherwise-equivalent routes. Lower is preferred. Normally 128.
interface_idNetwork interface ID.
Returns:
0 on success, -1 on add failure, -2 on invalid function parameters.

Definition at line 654 of file ns_net.c.

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:
prefixThe prefix to be removed.
prefix_lenThe length of the prefix.
next_hopLink-local address of the next hop.
interface_idNetwork interface ID.
Returns:
0 on success, -1 on delete failure, -2 on invalid function parameters.

Definition at line 671 of file ns_net.c.

int8_t arm_network_certificate_chain_set ( const arm_certificate_chain_entry_s chain_info )

Set certificate chain.

Parameters:
chain_infoCertificate chain.
Returns:
0 on success, negative on failure.

Definition at line 956 of file ns_net.c.

int8_t arm_network_certificate_revocation_list_add ( const arm_cert_revocation_list_entry_s crl )

Add Certificate Revocation List.

This is used to add Certificate Revocation List (CRL). Function can be called several times to add more than one Certificate Revocation List.

Parameters:
crlCertificate revocation list
Returns:
0 on success, negative on failure.

Definition at line 1017 of file ns_net.c.

int8_t arm_network_certificate_revocation_list_remove ( const arm_cert_revocation_list_entry_s crl )

Remove Certificate Revocation List.

This is used to remove Certificate Revocation List.

Parameters:
crlCertificate revocation list
Returns:
0 on success, negative on failure.

Definition at line 1027 of file ns_net.c.

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_idInterface
keyPointer for key material information store.
Returns:
0 Key read OK.
-1 PANA server key material not available.

Read PANA server security key material.

previous_active_network_key is information is only valid when current_active_key_index is bigger than 1.

Parameters:
keypointer for store keymaterial information.
Returns:
0 Key Read OK
-1 Pana server key material not available

Definition at line 1047 of file ns_net.c.

int8_t arm_network_own_certificate_add ( const arm_certificate_entry_s cert )

Add own certificate.

This is used to add own certificate and private key. In case intermediate certificates are used, function can be called several times. Each call to the function adds a certificate to own certificate chain. Certificates are in bottom up order i.e. the top certificate is given last.

Parameters:
certCertificate.
Returns:
0 on success, negative on failure.

Definition at line 998 of file ns_net.c.

int8_t arm_network_own_certificates_remove ( void   )

Remove own certificates.

This is used to remove own certificates (chain).

Returns:
0 on success, negative on failure.

Definition at line 1008 of file ns_net.c.

int8_t arm_network_trusted_certificate_add ( const arm_certificate_entry_s cert )

Add trusted certificate.

This is used to add trusted root or intermediate certificate in addition to those added using certificate chain set call. Function can be called several times to add more than one certificate.

Parameters:
certCertificate.
Returns:
0 on success, negative on failure.

Definition at line 969 of file ns_net.c.

int8_t arm_network_trusted_certificate_remove ( const arm_certificate_entry_s cert )

Remove trusted certificate.

This is used to remove trusted root or intermediate certificate.

Parameters:
certCertificate.
Returns:
0 on success, negative on failure.

Definition at line 979 of file ns_net.c.

int8_t arm_network_trusted_certificates_remove ( void   )

Remove trusted certificates.

This is used to remove all trusted root or intermediate certificates.

Returns:
0 on success, negative on failure.

Definition at line 989 of file ns_net.c.

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_idNetwork interface ID.
beacon_compare_rx_cb_ptrFunction pointer.
Returns:
0 on success.
-1 Unknown network ID.
-2 Other error.

Definition at line 1339 of file ns_net.c.

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_idThe network interface ID.
beacon_join_priority_tx_cb_ptrFunction pointer.
Returns:
0 on success.
-1 Unknown network ID.
-2 Other error.

Definition at line 1333 of file ns_net.c.

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_idmesh interface.
timeseconds
Returns:
0 on success, negative value on failure.

Definition at line 829 of file border_router.c.

int8_t arm_nwk_6lowpan_border_router_configure_push ( int8_t  interface_id )

Update ND ABRO version number.

Parameters:
interface_idNetwork 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).

Definition at line 806 of file border_router.c.

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_idNetwork interface ID.
c_idContext ID stack checks first 4 bits, supported values 0-15.
compress_mode0 = Compress disabled, otherwise compress enabled.
ttlContext time to live value in minutes.
Returns:
0 Update OK.
-1 Update fail by router state.

Definition at line 789 of file border_router.c.

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_idNetwork interface ID.
c_id4-bit Context ID to be deleted.
Returns:
0 Context delete OK.
-1 Delete process fails.

Definition at line 799 of file border_router.c.

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_idNetwork interface ID.
c_id_flagsBit 4 indicates compress support and bit 0-3 context ID.
context_lenContext length in bits need to be 64-128.
ttlContext time to live, value in minutes.
context_ptrPointer 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). \

Definition at line 819 of file border_router.c.

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_idNetwork interface ID.
border_router_setup_ptrPointer to MAC and 6LoWPAN ND setup.
Returns:
0 on success, negative value on error case.

Definition at line 782 of file border_router.c.

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_idNetwork Interface ID
contex_dataA pointer to properly built 20 bytes update array.
Returns:
0 Context reload OK.
<0 Load fail.

Definition at line 812 of file border_router.c.

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_idNetwork interface ID.
modeDefine 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_baseShort 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_DADThis 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.

Set configured network interface global address mode (border router bootstrap mode cannot set this).

Parameters:
interface_idNetwork interface ID
modeefine 6LoWPAN Global Address register mode:: * NET_6LOWPAN_GP64_ADDRESS, Interface register only GP64 * NET_6LOWPAN_GP16_ADDRESS, Interface register only GP16 * NET_6LOWPAN_MULTI_GP_ADDRESS, Interface register GP16 and GP64 addresses. GP16 is primary address and GP64 is secondary.
short_address_baseShort address base. If application defines value 0-0xfffd 6LoWPAN try to register GP16 address using that address. 0xfffe and 0xffff will generate random 16-bit short address.
define_new_short_address_at_DADThis parameter is only checked when mode is not NET_6LOWPAN_GP64_ADDRESS and short_address_base is 0-0xfffd. Recommend value is 1 that will enable automatic new address definition at Duplicate Address Detection(DAD). Value 0 will generate Duplicate Adreress Detection error for 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 Bootsrap not defined yet.

Definition at line 374 of file ns_net.c.

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_idNetwork interface ID.
nwk_id_filterA pointer to a new network ID filter, NULL disable filter.
Returns:
0 On success.
-1 Unknown network ID.
-2 Interface active.

Definition at line 1275 of file ns_net.c.

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_idNetwork interface ID.
pan_id_filterEnable filter for specific PAN ID. 0xffff disables the filter.
Returns:
0 Filter set OK.
-1 Unknown Network interface ID.
-2 Interface is active.

Definition at line 1258 of file ns_net.c.

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_idNetwork interface ID.
protocol_IDA value that filters only supported network protocols (0= Zigbee1.x, 2= ZigBeeIP).
Returns:
0 On success.
-1 Unknown network ID.
-2 Interface active.

Definition at line 1292 of file ns_net.c.

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_idNetwork interface ID.
scan_timeValue 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.

Definition at line 1233 of file ns_net.c.

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_idThe network interface ID.
accept_raRouter Advertisements handling mode.
Returns:
0 Setting done.
<0 Failed (for example an invalid interface ID).

Definition at line 1127 of file ns_net.c.

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_idNetwork interface ID.
bootstrap_modeSelected 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_extensionDefine 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.
Parameters:
interface_idNetwork interface ID
bootstrap_modeSelected Bootstrap mode: * NET_6LOWPAN_BORDER_ROUTER, Initialise 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_mode_extensionDefine MLE protocol use and 6LoWPAN mode
Returns:
>=0 Bootstrap mode set OK.
-1 Unknown network ID.
-2 Unsupported bootstrap type or extension in this library.
-3 No Memory for 6LoWPAN stack.
-4 Null pointer parameter

Definition at line 1173 of file ns_net.c.

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_idNetwork interface ID.
bootstrap_modeSelected bootstrap mode: * NET_IPV6_BOOTSTRAP_STATIC, Application defines the IPv6 prefix.
ipv6_prefix_pointerPointer 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.

Definition at line 1117 of file ns_net.c.

int8_t arm_nwk_interface_down ( int8_t  interface_id )

Stop and set interface to idle.

Parameters:
interface_idNetwork interface ID
Returns:
>=0 Process OK.
-1 Unknown network ID.
-3 Not Active.

Definition at line 870 of file ns_net.c.

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:
apiGenerates interface with ethernet MAC.
interface_name_ptrString 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.

Definition at line 681 of file ns_net.c.

int8_t arm_nwk_interface_lowpan_init ( struct mac_api_s api,
char *  interface_name_ptr 
)

Create network interface base to IDLE state.

Parameters:
apiGenerates interface with 802.15.4 MAC.
interface_name_ptrString 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.

Definition at line 727 of file ns_net.c.

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_idNetwork interface ID
nwk_channel_listDefines network channel page and channel.
link_setupLink 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.
Parameters:
interface_idNetwork interface ID
tun_driver_idDriver id FOR PHY data IN & OUT
channeldefine network link channel
link_setupLink layer parameters for NET_6LOWPAN_NETWORK_DRIVER defines NetworkID, PAN-ID Short Address
Returns:
>=0 Config set OK.
-1 Unknown network ID or tun driver.
-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
-5 Channel list empty

Definition at line 778 of file ns_net.c.

int8_t arm_nwk_interface_ppp_init ( struct eth_mac_api_s api,
const char *  interface_name_ptr 
)

Create network interface base to IDLE state.

Parameters:
apiGenerates interface with PPP.
interface_name_ptrString 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 PPP is not supported at this build.
-3 No memory for the interface.

Definition at line 704 of file ns_net.c.

int8_t arm_nwk_interface_up ( int8_t  interface_id )

Start network interface bootstrap.

Parameters:
interface_idNetwork interface ID.
Returns:
>=0 Bootstrap start OK.
-1 Unknown network ID.
-2 Not configured.
-3 Active.

Definition at line 846 of file ns_net.c.

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_idNetwork interface ID.
modeDefines 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_levelDefined security level is checked only when the mode is not NET_SEC_MODE_NO_LINK_SECURITY.
psk_key_infoPointer for PSK link layer keys. Checked only when the mode is NET_SEC_MODE_PSK_LINK_SECURITY.
Returns:
0 on success.

Definition at line 898 of file ns_net.c.

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_idNetwork interface ID.
mac_paramsA pointer to the structure where the MAC addresses are written.
Returns:
0 On success.
Negative value if interface is not known.

A function to read MAC PAN-ID, Short address and EUID64.

Parameters:
mac_paramsis a pointer to the structure to where the mac address are written to.
Returns:
0 on success.
Negative value if interface id is not known.

Definition at line 257 of file ns_net.c.

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_idNetwork interface ID.
nd_addr_infoPointer 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.
Parameters:
mac_paramsis a pointer to the structure to where the mac address are written to.
Returns:
0 on success.
-1 .

Definition at line 283 of file ns_net.c.

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_idNetwork interface ID.
network_paramsA pointer to the structure where the network layer configs are written.
Returns:
0 On success.
Negative value if interface is not known.
Parameters:
network_paramsis a pointer to the structure to where the network layer configs are written to.
Returns:
0 on success.
Negative value if interface id or PAN coordinator is not known.

Definition at line 232 of file ns_net.c.

int8_t arm_nwk_set_cca_threshold ( int8_t  interface_id,
uint8_t  cca_threshold 
)

Set CCA threshold.

This function can be used to set CCA threshold to PHY layer. Threshold is given as percentage of maximum threshold. 0 is the lowest(strictest) possible threshold and 100 is the highest possible threshold.

Note! Software MAC must be created and registered before using this function.

Parameters:
interface_idNetwork interface ID.
cca_thresholdCCA threshold (%).
Returns:
0 on success, <0 on errors.

Definition at line 1534 of file ns_net.c.

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_idNetwork interface ID.
nwk_channel_listChannel 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.

Definition at line 1193 of file ns_net.c.

int8_t arm_nwk_set_tx_output_power ( int8_t  interface_id,
uint8_t  tx_power 
)

Set TX output power.

This function can be used to set TX output power to PHY layer. TX power is given as percentage of maximum output power. 0 is the lowest possible TX power and 100 is the highest possible TX power.

Note! Software MAC must be created and registered before using this function.

Parameters:
interface_idNetwork interface ID.
tx_powerTX output power (%).
Returns:
0 on success, <0 on errors.

Definition at line 1550 of file ns_net.c.

int arm_nwk_sleepy_device_parent_buffer_size_set ( int8_t  interface_id,
uint16_t  big_packet_threshold,
uint16_t  small_packets_per_child_count,
uint16_t  big_packets_total_count 
)

Set buffer size for sleepy device parent.

This function can be used to set sleepy device parent buffer size and packet threshold.

Note! In Thread mode parent buffer size is automatically set during Thread initialization.

Parameters:
interface_idNetwork interface ID.
big_packet_thresholdIndicate how long packets are considered big. For Thread, must be 106 bytes.
small_packets_per_child_countNumber of small packets stored for each sleepy children. For Thread, must be at least 1.
big_packets_total_countTotal number of big packets parent can store for all sleepy children. For Thread, must be at least 1.
Returns:
0 on success, <0 on errors.

Definition at line 1522 of file ns_net.c.

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_idNetwork 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.

Definition at line 1067 of file ns_net.c.

int8_t arm_pana_client_key_pull ( int8_t  interface_id )

Manually initiate a PANA client key pull.

For test purposes only.

Parameters:
interface_idNetwork interface ID.
Returns:
0 On success.
-1 Unknown network ID.

Definition at line 890 of file ns_net.c.

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_idNetwork interface ID.
cipher_modeDefines TLS 1.2 Cipher mode PSK, ECC or both.
psk_key_idPSK KEY id for PSK Setup
Returns:
0 on success.
-1 Unknown network ID or PANA is not supported at this library.
-2 Interface active.

Definition at line 1107 of file ns_net.c.

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_idNetwork interface ID.
network_key_materialPointer 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.

Definition at line 1075 of file ns_net.c.

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_idNetwork interface ID.
cipher_modeDefines TLS 1.2 Cipher mode PSK, ECC or both.
key_materialA pointer to 128-bit key material or NULL when the PANA server generates the random key.
time_period_before_activate_keyGuard 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.

Definition at line 1056 of file ns_net.c.

void arm_print_neigh_cache ( void   )

Print neighbor cache.

Prints neighbor cache to the command line

Definition at line 1497 of file ns_net.c.

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_fnpointer to a printf style output function

Definition at line 1502 of file ns_net.c.

void arm_print_protocols ( void   )

Print PCB list.

Prints Protocol Control Block list to the command line

Definition at line 1507 of file ns_net.c.

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_fnpointer to a printf style output function
sepcolumn separator character

Definition at line 1512 of file ns_net.c.

void arm_print_routing_table ( void   )

Print routing table.

Prints the routing table to the command line

Definition at line 1483 of file ns_net.c.

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_fnpointer to a printf style output function

Definition at line 1488 of file ns_net.c.

int8_t arm_tls_add_psk_key ( const uint8_t *  key_ptr,
uint16_t  key_id 
)

Add PSK key to TLS library.

Parameters:
key_ptrA pointer to 16 bytes long key array.
key_idPSK key ID.
Returns:
0 = success
-1 = failure

Definition at line 2435 of file tls_lib.c.

int8_t arm_tls_check_key ( uint16_t  key_id )

Check if PSK key ID exists.

Parameters:
key_idPSK key ID
Returns:
0 = success
-1 = failure

Definition at line 129 of file tls_lib.c.

int8_t arm_tls_remove_psk_key ( uint16_t  key_id )

Remove PSK key from TLS library.

Parameters:
key_idPSK key ID.
Returns:
0 = success
-1 = failure

Definition at line 137 of file tls_lib.c.

void net_get_version_information ( uint8_t *  ptr )

Get the library version information.

Parameters:
*ptrPointer 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 |

Get the library version information.

Parameters:
ptris a pointer to an array to where the version information is read to.

Definition at line 350 of file ns_net.c.

int8_t net_init_core ( void   )

Init 6LoWPAN library.

Returns:
0, Init OK.

Init 6LoWPAN library.

Parameters:
core_idleis a function pointer to a function that is called whenever NanoStack is idle.
Returns:
0 on success.
-1 if a null pointer is given.

Definition at line 1352 of file ns_net.c.