Network Commands#

ifconfig#

Description#

Prints out interfaces information

Requirements#

Network Module

Synopsis#

ifconfig

Arguments#

None.

Notes / Warnings#

None.

net_ping#

Description#

Issue a ICMP Echo Request from the target. (IPv4 or IPv6)

Requirements#

Network Module

Synopsis#

net_ping ip_addr

Arguments#

ip_addr Address of the remote host.

Notes / Warnings#

None.

net_if_start#

Description#

Start an interface.

Requirements#

Network Module

Synopsis#

net_if_start -i if_nbr

Arguments#

-i if_nbr Specifies the interface to start.

Notes / Warnings#

None.

net_if_stop#

Description#

Stop an interface.

Requirements#

Network Module

Synopsis#

net_if_stop -i if_nbr

Arguments#

-i if_nbr Specifies the which interface to stop.

Notes / Warnings#

None.

net_if_restart#

Description#

Restart a network interface.

Requirements#

Network Module

Synopsis#

net_if_restart -i if_nbr [-t wait_time ]

Arguments#

Argument

Detail

-i if_nbr

Interface number to restart.

-t wait_time

Time to wait after interface stop, before issuing the interface start command, in seconds. Default = 10s.

Notes / Warnings#

None.

net_if_reset#

Description#

Reset interface(s); remove all configured addresses, IPv4 or IPv6 or both, on specified interface.

Requirements#

Network Module

Synopsis#

net_if_reset [-i if_nbr] [-4|-6]

Arguments#

Argument

Detail

-i if_nbr

Specifies on which interface the reset will occur. If no interface is specified, all existing interfaces will be reset.

-4

Specifies to clear only the IPv4 addresses of the interface.

-6

Specifies to clear only the IPv6 addresses of the interface.

Notes / Warnings#

None.

net_if_set_mtu#

Description#

Configure MTU of given Interface

Requirements#

Network Module

Synopsis#

net_if_set_mtu -i if_nbr -M mtu

Arguments#

Argument

Detail

-i if_nbr

Specifies on which interface to set the MTU.

-M mtu

Specifies the new MTU value to configure.

Notes / Warnings#

None.

net_if_buf_rx#

Description#

Get Rx large Buffer statistics

Requirements#

Network Module

Synopsis#

net_if_buf_rx [-i if_nbr]

Arguments#

-i if_nbr Specifies the interface for which to return the number of large Rx buffers

Notes / Warnings#

None.

net_if_buf_tx_l#

Description#

Get Tx large Buffer statistics

Requirements#

Network Module

Synopsis#

net_if_buf_tx_l [-i interface_nbr]

Arguments#

-i [interface_nbr] Specifies the interface for which to return the number of large Tx buffers

Notes / Warnings#

None.

net_if_buf_tx_s#

Description#

Get Tx small Buffer statistics

Requirements#

Network Module

Synopsis#

net_if_buf_tx_s [-i interface_nbr]

Arguments#

-i [interface_nbr], Specifies the interface for which to return the number of small Tx buffers

Notes / Warnings#

None.

net_ip_setup#

Description#

Configure an IPv4 address.

Requirements#

Network Module

Synopsis#

net_ip_setup -i if_nbr -a ip_addr -m mask

Arguments#

Argument

Detail

-i if_nbr

Interface number to setup

- a ip_addr

IP address to assign to the interface

- m mask

Subnet mask to assign to the interface

Notes / Warnings#

None.

net_route_add#

Description#

Add IP address route

Requirements#

Network Module

Synopsis#

net_route_add -i if_nbr [-4 ip_addr mask gateway] [-6 ip_addr prefix_len]

Arguments#

Argument

Detail

-i if_nbr

Specifies on which interface to add the route

-4 ip_add mask gateway

IPv4 addresses.

-6 ip_addr prefix_len

IPv6 addresses.

Notes / Warnings#

None.

net_route_remove#

Description#

Remove a route (previously added using net route add ).

Requirements#

Network Module

Synopsis#

net_route_remove {-i [if_nbr]} {-4 [IP Address] [Mask] [Gateway]} {-6 [IP Address] [Prefix Length]}

Arguments#

Argument

Detail

-i [Interface number],

Specified on which interface the reset will occur. If no interface is specified, all existing interfaces will be reset.

-4 [IP_address Mask Gateway],

IPv4 addresses.

-6 [IP_address Prefix_len],

IPv6 addresses.

Notes/Warnings#

None.

net_sock_accept#

Description#

Accept connection on a socket

Requirements#

Network Module

Synopsis#

net_sock_accept -s sock_id

Arguments#

-s sock_id Specifies the Socket descriptor/handle identifier of listen socket

Notes / Warnings#

None.

net_sock_listen#

Description#

Set socket to listen for connection requests.

Requirements#

Network Module

Synopsis#

net_sock_listen -s sock_id -q queue_size

Arguments#

Argument

Detail

-s sock_id

Socket descriptor/handle identifier of socket to listen.

-q queue_size

Maximum number of connection requests to accept & queue on listen socket.

Notes / Warnings#

None.

net_sock_bind#

Description#

Bind a network socket to a local address.

Requirements#

Network Module

Synopsis#

net_sock_bind -s sock_id -p port_nbr -f family

Arguments#

Argument

Detail

-s sock_id

Specifies the Socket descriptor/handle identifier of listen socket

-p port_nbr

Port to bind on.

-f family

IP address family to use (4 or 6)

Notes / Warnings#

None.

net_sock_open#

Description#

Open a network socket.

Requirements#

Network Module

Synopsis#

net_sock_open -f family -t protocol_type

Arguments#

Argument

Detail

-f family

IP address family to use: IPv4 (4) or IPv6 (6)

-t protocol_type

Protocol type: stream (s) or datagram (d)

Notes / Warnings#

None.

net_sock_close#

Description#

Close a network socket.

Requirements#

Network Module

Synopsis#

net_sock_close -s sock_id

Arguments#

-s sock_id Specifies the Socket descriptor/handle identifier of the socket to close

Notes / Warnings#

None.

net_sock_connect#

Description#

Connect a network socket to a remote host.

Requirements#

Network Module

Synopsis#

net_sock_conn -s sock_id -p port_nbr ip_addr

Arguments#

Argument

Detail

-s sock_id

Specifies the Socket descriptor/handle identifier of listen socket

-p port_nbr

Port number to which to connect

ip_addr

IP Address to which to connect

Notes / Warnings#

None.

net_sock_rx#

Description#

Receive data on a socket

Requirements#

Network Module

Synopsis#

net_sock_rx -s sock_id -l data_len -F outfmt [ -a address ] [-p port ] [-r retry ]

Arguments#

Argument

Detail

-s sock_id

Socket ID.

-l data_len

Data length to receive

-F outfmt

Output format Hexadecimal (h) or Char/string (s)

-a address

IP address to receive from (optional)

-p port

Port number (optional; required if -a is specified)

-r retry

Number of retry attempts after timeout

Notes / Warnings#

None.

net_sock_tx#

Description#

Receive data on a socket

Requirements#

Network Module

Synopsis#

net_sock_tx -s sock_id -l data_len -d data

Arguments#

Argument

Detail

-s sock_id

Socket ID

-l data_len

Data length to send

-d data

Data to transmit

Notes / Warnings#

None.

net_sock_opt_set_child#

Description#

Configure socket's child connection queue size

Requirements#

Network Module

Synopsis#

net_sock_opt_set_child -s sock_id -v queue_size

Arguments#

Argument

Detail

-s sock_id

Socket ID.

-v queue_size

Desired child connection queue size

Notes / Warnings#

None.

net_sock_mcast_join#

Description#

Join a multicast group

Requirements#

Network Module

Synopsis#

net_sock_mcast_join -i if_nbr -a ip_address

Arguments#

Argument

Detail

-i if_nbr

Interface number onto which to join the multicast group.

-a ip_address

IP address of the multicast group

Notes / Warnings#

None.

net_sock_mcast_leave#

Description#

Leave a multicast group

Requirements#

Network Module

Synopsis#

net_sock_mcast_leave -i if_nbr -a ip_address

Arguments#

Argument

Detail

-i if_nbr

Interface number from which to leave the multicast group.

-a ip_address

IP address of the multicast group

Notes / Warnings#

None.

net_wifi_create#

Description#

Create a WiFi Network.

Requirements#

Network Module

Synopsis#

net_wifi_create ssid -p pwd -c channel -i if_nbr -t net_type -s sec_type

Arguments#

Argument

Detail

ssid

SSID of the Wi-Fi network to join

-p pwd

Password to use to access the WiFi network

-c channel

Wi-Fi channel

-i if_nbr

Interface number on which to create the Wi-Fi network

-t net_type

Network Type (infra or adhoc)

-s sec_type

Network security type (open, wep, wpa or wpa2)

Notes / Warnings#

  1. This command will failed if the interface has already joined or created an network. In this case, use net_wifi_leave command before.

  2. The argument [-p password] is not applicable if the security_type specified is 'open'.

net_wifi_scan#

Description#

Scan for available WiFi SSID.

Requirements#

Network Module

Synopsis#

net_wifi_scan [ssid] -i if_nbr [-c channel]

Arguments#

Argument

Detail

ssid

SSID to find (opt.)

-i if_nbr

Interface number to use

-c channel

WiFi Channel to scan (opt.)

Notes / Warnings#

None.

net_wifi_join#

Description#

Join a Wi-Fi Network.

Requirements#

Network Module

Synopsis#

net_wifi_join ssid -p pwd -i if_nbr -t net_type -s sec_type

Arguments#

Argument

Detail

ssid

Wi-Fi network to join

-p pwd

Password to use to access the Wi-Fi network

-i if_nbr

Interface number on which to join the Wi-Fi network

-t net_type

Network Type (infra or adhoc)

-s sec_type

Network security type (open, wep, wpa or wpa2).

Notes / Warnings#

  1. This command will failed if the interface has already joined or created an network. In this case, use 1 command before.

  2. The argument [-p password] is not applicable if the security_type specified is open.

net_wifi_leave#

Description#

Leave a WiFi Network.

Requirements#

Network Module

Synopsis#

net_wifi_leave -i if_nbr

Arguments#

-i if_nbr Interface number of the Wi-Fi network to leave.

Notes / Warnings#

None.

net_wifi_peer#

Description#

Output the peer information when acting as an Wi-Fi Access point.

Requirements#

Network Module

Synopsis#

net_wifi_peer -i if_nbr

Arguments#

-i if_nbr Specified on which interface to use.

Notes / Warnings#

This command is applicable only if a Wi-Fi network is created by the interface.

sntp_help#

Description#

Displays information on how to use the SNTP client related commands.

Requirements#

SNTP Client

Synopsis#

sntp_help

Arguments#

None.

Notes / Warnings#

None.

sntp_get#

Description#

Retrieves and displays current time from a remote NTP server.

Requirements#

SNTP Client

Synopsis#

sntp_get [OPTION]

Arguments#

Argument

Detail

Example

-6

Test SNTP client using IPv6.

-4

Test SNTP client using IPv4.

-d [hostname]

Retrieves time from hostname 0.pool.ntp.org or the one provided.

sntp_get -d, sntp_get -d 1.pool.ntp.org.

Notes / Warnings#

None.