In Zephyr this has no effect because getaddrinfo() returns a pointer
to a static array, but Coverity scan checks for this pattern.
Coverity-CID: 185273
Coverity-CID: 185279
Fixes#7085Fixes#7091
Signed-off-by: Stig Bjørlykke <stig.bjorlykke@nordicsemi.no>
Previously, some fields like sin6_scope_id weren't explicitly
initialized. Such aren't really used, but to keep Coverity
happy, let's zero out the entire address structure.
Coverity-Id: 182763
Fixes: #6108
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Min RAM requirement for tests/net/utils was 16K,
hence run on nucleo_l073rz.
Though, build size is a little more than 20K which
overflows board RAM.
Increase min RAM requirement for this test to 24K
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
This will prevent building these tests for boards not supposed to run
a TCP/IP stack, particularly 96b_carbon_nrf51 where test-with-dns
would not fit into 32 kB of RAM.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Drivers will be directly contacted via net_if's offload attribute. No
need for a an extra layer as an L2.
Signed-off-by: Dario Pennisi <dario@iptronix.com>
Signed-off-by: Massimiliano Agneni <massimiliano.agneni@iptronix.com>
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
The test actually has three network interfaces in native_posix board
and not two so check that correctly.
Fixes#6988
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Curently only link speed is exposed.
Opportunity taken to remove any post-fix enumerating the iface init
and/or the api: these must be generic and used by all the instances.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Because we now return first non VLAN interface if found, the
VLAN disable test case needs adjustment.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Add tests to verify the bit manipulation functions in net/vlan.h
file. Also check that we can check if given network interface has
VLAN enabled or not. Verify also that received network packet
contains correct VLAN tag.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This allows creation of virtual lan (VLAN) networks. VLAN support is
only available for ethernet network technology.
Fixes#3234
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Some of the sanitycheck tests were having too small limit for
network buffers when compiling for sam_e70_xplained board.
Increase the buffer limits when testing this for this board.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
When dns_get_addr_info() returns an error it does not call the
resolve callback, and thus the semaphore will not be given.
This fix will avoid a deadlock situation for various errors.
Added some small tests for getaddrinfo().
Signed-off-by: Stig Bjørlykke <stig.bjorlykke@nordicsemi.no>
Enable the loopback driver and set up network testing so that it
will not require a SLIP driver. Move values from the extra test
config so that they are always enabled.
Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
This demostrates how to classify the network traffic when sending
data. The application will create similar functionality as
echo-client so user can use echo-server running in remote host to
test this sample application.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Test that we can set the priority of the network packet and
that high priority packets are sent before low priority ones.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Instead of always allocating both IPv6 and IPv4 address information
to every network interface, allow more fine grained address
configuration. So it is possible to have IPv6 or IPv4 only network
interfaces.
This commit introduces two new config options:
CONFIG_NET_IF_MAX_IPV4_COUNT and CONFIG_NET_IF_MAX_IPV6_COUNT
which tell how many IP address information structs are allocated
statically. At runtime when network interface is setup, it is then
possible to attach this IP address info struct to a specific
network interface. This can save considerable amount of memory
as the IP address information struct can be quite large (depends
on how many IP addresses user configures in the system).
Note that the value of CONFIG_NET_IF_MAX_IPV4_COUNT and
CONFIG_NET_IF_MAX_IPV6_COUNT should reflect the estimated number of
network interfaces in the system. So if if CONFIG_NET_IF_MAX_IPV6_COUNT
is set to 1 and there are two network interfaces that need IPv6
addresses, then the system will not be able to setup IPv6 addresses to
the second network interface in this case. This scenario might be
just fine if the second network interface is IPv4 only. The net_if.c
will print a warning during startup if mismatch about the counts and
the actual number of network interface is detected.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Move IP address settings from net_if to separate structs.
This is needed for VLAN support.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Test that if the checksum offloading is enabled, then we do not
calculate the checksum. Also the normal case, where offloading is
disabled and we need to calculate the checksum, is tested.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Create infrastructure that allows ethernet device driver to tell
if it supports network packet checksum offloading. This applies only
to IPv4, UDP or TCP checksums. The driver can enable/disable checksum
offloading separately for Tx and Rx network packets.
If the device (ethernet in this case) can calculate the network
packet checksum for IPv4, UDP or TCP, then do not calculate the
corresponding checksum by the stack itself.
Fixes#2987
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Network packet cannot be NULL so no need to check its value.
Coverity-CID: 183063
Fixes#6669
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Add support for MSG_PEEK flag in recv and recvfrom.
This flag is needed when using non-zephyr embedded applications with
Zephyr's socket API.
Signed-off-by: Stig Bjørlykke <stig.bjorlykke@nordicsemi.no>
We don't currently build on qemu_xtensa because completion is missing.
Seems like we have some dependency issue.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This tests websocket by creating a websocket support http server
and sending data to it and verifying the returned data is the same.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Rename variable zpkt to cpkt to complete the move from ZoAP to CoAP.
Remove unused tests/net/lib/zoap/CMakeLists.txt file.
Signed-off-by: Stig Bjørlykke <stig.bjorlykke@nordicsemi.no>
Test case should first check for next block in the coap packet and
unref the packet (assuming packet has been sent).
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Provided separate event information structs based on events. This way
user will know what kind of information will be received to that
particular event.
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Increasing the IPv6 multicast address count from 2 to 5 so that
tests will always run ok.
Fixes#4401
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>