The old legacy APIs use net-app library and as that is being
removed, then the dependencies need to be removed also.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Move to latest cmake version with many bug fixes and enhancements.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Remove network specific default and max log level setting
and start to use the zephyr logging values for those.
Remove LOG_MODULE_REGISTER() from net_core.h and place the
calls into .c files. This is done in order to avoid weird
compiler errors in some cases and to make the code look similar
as other subsystems.
Fixes#11343Fixes#11659
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Many tests use either Ethernet or Dummy L2 and as such require
modifications towards the driver API on their fake devices.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Two separate folders and Kconfig options causing confusion on
CoAP and CoAP_SOCK implementations. This patch simplifies it.
Current CoAP Kconfig option moved to COAP_NET_PKT.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Rename existing headers and sybols to mqtt_legacy, to allow new
implementation to keep old config and header names.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
When using an IDE (e.g. Eclipse, Qt Creator), the project name gets
displayed. This greatly simplifies the navigation between projects when
having many of them open at the same time. Naming every project "NONE"
defeats this functionality.
This patch tries to use sensible project names while not duplicating
too much of what is already represented in the path. This is done by
using the name of the directory the relevant CMakeLists.txt file is
stored in. To ensure unique project names in the samples (and again, in
the tests folder) folder, small manual adjustments have been done.
Signed-off-by: Reto Schneider <code@reto-schneider.ch>
The return of memset is never checked. This patch explicitly ignore
the return to avoid MISRA-C violations.
The only directory excluded directory was ext/* since it contains
only imported code.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Run networking tests for native_posix, qemu_x86 and qemu_cortex_m3
platforms only as the tests are generic enough so no need to run
them in real physical device.
Fixes#9623#9614#9622#9621#9618
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Prepend the text 'cmake_minimum_required(VERSION 3.8.2)' into the
application and test build scripts.
Modern versions of CMake will spam users with a deprecation warning
when the toplevel CMakeLists.txt does not specify a CMake
version. This is documented in bug #8355.
To resolve this we include a cmake_minimum_required() line into the
toplevel build scripts. Additionally, cmake_minimum_required is
invoked from within boilerplate.cmake. The highest version will be
enforced.
This patch allows us to afterwards change CMake policy CMP000 from OLD
to NEW which in turn finally rids us of the verbose warning.
The extra boilerplate is considered more acceptable than the verbosity
of the CMP0000 policy.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
This finishes refactor of splitting off net_config library name from
net_app library, started in c60df1311, c89a06dbc. This commit makes
sure that Kconfig options are prefixed with CONFIG_NET_CONFIG_
instead of CONFIG_NET_APP_, and propagates these changes thru the
app configs in the tree.
Also, minor dependency, etc. tweaks are made.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
In coap module previous test cases are modified as well as
new test functions are added to increase the code coverage
Signed-off-by: Tarun Kumar Agarwal <tarun.kumar.agarwal@intel.com>
Introduce TC_RESULT_TO_STR to convert from an integer test result to a
string like "PASS", "FAIL", "SKIP". Do this to remove the defines of
PASS/FAIL/SKIP since those names might get used by other code and to
have a single consistent way of doing the conversion.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
The ARRAY_SIZE() utility macro will actually test the parameter types,
and ensure that it is only called with arrays, and not arrays decayed
to pointers.
Changes were performed with a simple Coccinelle script.
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
The icmpv6, http_header_fields, mqtt_packet, dns_packet and
net utils tests were failing in frdm-k64f because of too small
stack.
Fixes#8171
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
These were using the older name CONFIG_NET_NBUF_DATA_SIZE (note the
extra 'N'). The symbol was renamed in commit bf964cdd4c ("net:
Renaming net nbuf API to net pkt API").
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
The options array was not initialized to 0 and the size of the
array was not set properly. This caused following error in valgrind
Conditional jump or move depends on uninitialised value(s)
at 0x8056777: coap_find_options (coap.c:1096)
by 0x804AEFF: test_parse_simple_pdu (main.c:455)
by 0x80500E6: zephyr_app_main (main.c:1585)
by 0x807E231: bg_thread_main (init.c:254)
by 0x80842D7: _thread_entry (thread.c:201)
by 0x8059618: posix_thread_starter (posix_core.c:301)
by 0x40752C8: start_thread (in /usr/lib/libpthread-2.25.so)
by 0x4182055: clone (in /usr/lib/libc-2.25.so)
Fixes#7447
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
For many tests, avoid splitting into files and put eveything in main.c.
For many of the tests, use main.c as the test source file to keep things
consistent.
Signed-off-by: Anas Nashif <anas.nashif@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>
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>
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>
mbedTLS include directories will now default to be in the 'app'
include path when mbedTLS has been enabled.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Introducing CMake is an important step in a larger effort to make
Zephyr easy to use for application developers working on different
platforms with different development environment needs.
Simplified, this change retains Kconfig as-is, and replaces all
Makefiles with CMakeLists.txt. The DSL-like Make language that KBuild
offers is replaced by a set of CMake extentions. These extentions have
either provided simple one-to-one translations of KBuild features or
introduced new concepts that replace KBuild concepts.
This is a breaking change for existing test infrastructure and build
scripts that are maintained out-of-tree. But for FW itself, no porting
should be necessary.
For users that just want to continue their work with minimal
disruption the following should suffice:
Install CMake 3.8.2+
Port any out-of-tree Makefiles to CMake.
Learn the absolute minimum about the new command line interface:
$ cd samples/hello_world
$ mkdir build && cd build
$ cmake -DBOARD=nrf52_pca10040 ..
$ cd build
$ make
PR: zephyrproject-rtos#4692
docs: http://docs.zephyrproject.org/getting_started/getting_started.html
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
Create http library that uses net-app instead of net_context
directly. The old HTTP API is deprecated.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This should clear up some of the confusion with random number
generators and drivers that obtain entropy from the hardware. Also,
many hardware number generators have limited bandwidth, so it's natural
for their output to be only used for seeding a random number generator.
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
From RFC 7252, section 3
"The absence of the Payload Marker denotes a zero-length payload.
The presence of a marker followed by a zero-length payload MUST
be processed as a message format error."
Check empty payload when COAP_MARKER is found and add a test case to
cover it
Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
The payload variable was one byte long but we read 32 bytes
from it.
Coverity-CID: 178064
Fixes#4397
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
ZoAP tests are modified to use new CoAP API. Also modified tests
name from 'zoap' to 'coap'.
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
If IPv6 is disabled, then it is useless to try to resolve
IPv6 address because "struct sockaddr" does not have enough
space to store IPv6 address.
Fixes#1487
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If the query name is already in numeric format, there is no
need to send the query string to DNS server as we can just
convert it ourselves.
Jira: ZEP-2562
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
POSIX requires struct sockaddr's field to be named "sa_family"
(not just "family"):
http://pubs.opengroup.org/onlinepubs/009696699/basedefs/sys/socket.h.html
This change allows to port POSIX apps easier (including writing
portable apps using BSD Sockets compatible API).
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
- replaced test points with ztest APIs wherever possible
- added CONFIG_ZTEST_STACKSIZE=320
JIRA: ZEP-2249
Signed-off-by: Niranjhana N <niranjhana.n@intel.com>
The API name space for Bluetooth is bt_* and BT_* so it makes sense to
align the Kconfig name space with this. The additional benefit is that
this also makes the names shorter. It is also in line with what Linux
uses for Bluetooth Kconfig entries.
Some Bluetooth-related Networking Kconfig defines are renamed as well
in order to be consistent, such as NET_L2_BLUETOOTH.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Use net app API since we want to enable MQTT with TLS.
mqtt_connect() and mqtt_close() are added to build and close the
connection to the broker. The caller doesn't need to deal with
the net context anymore and the most of network setup code in
mqtt_publisher is removed.
Signed-off-by: Aska Wu <aska.wu@linaro.org>
In many networking tests we had to configure SLIP in the prj.conf
leaving those configurations Qemu specific. This change enables SLIP for
QEMU targets automatically and allows reuse of prj.conf for multiple
boards.
Additionally, the TUN options is removed. This option was not used
anywhere.
To enable self-contained networking tests that do not depend on SLIP, we
introduce the new option NET_TEST which disables TAP and allows testing
in QEMU without the need for a host interface.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The majority of these fixes adjust the memory limit needed to build the
various tests on systems with and without BLE support. We also fixup
one test case that was able to run on platforms with 16k of memory.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
A number of the network tests have minimal memory requirements that not
all boards are able to meet. Add in those memory requirements so we
don't attempt to build these tests for those platforms. Utilized the
frdm_kl25z (with 16K of memory) and cc2650_sensortag (with 20K) to test
the limits.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Instead of only running net tests in qemu_x86, enable those
tests in all suitable platforms. The tests are disabled for
bbc_microbit as that platform does not have enough memory.
The tests/net/arp and tests/net/ieee802154/l2 are disabled
for qemu_xtensa as the qemu crashed when running the tests.
For tests/net/all there was a weird build error for qemu_xtensa
so that test is also disabled for that platform.
Increased the trickle timeout to 3 secs in tests/net/trickle as
occacionally there was timeout error in qemu_cortex_m3 when the
test was run.
Jira: ZEP-2398
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
According to RFC7959 page 30, "The end of a block-wise transfer is
governed by the M bits in the Block options, _not_ by exhausting the
size estimates exchanges."
Therefore, we should check the M bit instead of total size (which
is not always available, too)
Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
Some README files referenced wiki articles that have been
moved to the doc area on the website.
Fixes#668
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
CONFIG_NET_IF_UNICAST_IPV6_ADDR_COUNT should be used instead of
CONFIG_NET_IFACE_UNICAST_IPV6_ADDR_COUNT.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
We have many testcases doing filtering both on the architecture level
and the platform level, which is redundant. Also many testcases are
running the same test twice on the same SoC for no good reason, cleanup
the tests and cleanup the filtering.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This will prepare test cases and samples with metadata and information
that will be consumed by the sanitycheck script which will be changed to
parse YAML files instead of ini.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Convert code to use u{8,16,32,64}_t and s{8,16,32,64}_t instead of C99
integer types.
Jira: ZEP-2051
Change-Id: I4ec03eb2183d59ef86ea2c20d956e5d272656837
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
- net_pkt becomes a stand-alone structure with network packet meta
information.
- network packet data is still managed through net_buf, mostly named
'frag'.
- net_pkt memory management is done through k_mem_slab
- function got introduced or relevantly renamed to target eithe net_pkt
or net_buf fragments.
- net_buf's sent_list ends up in net_pkt now, and thus helps to save
memory when TCP is enabled.
Change-Id: Ibd5c17df4f75891dec79db723a4c9fc704eb843d
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
There have been long lasting confusion between net_buf and net_nbuf.
While the first is actually a buffer, the second one is not. It's a
network buffer descriptor. More precisely it provides meta data about a
network packet, and holds the chain of buffer fragments made of net_buf.
Thus renaming net_nbuf to net_pkt and all names around it as well
(function, Kconfig option, ..).
Though net_pkt if the new name, it still inherit its logic from net_buf.
'
This patch is the first of a serie that will separate completely net_pkt
from net_buf.
Change-Id: Iecb32d2a0d8f4647692e5328e54b5c35454194cd
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This is a start to move away from the C99 {u}int{8,16,32,64}_t types to
Zephyr defined u{8,16,32,64}_t and s{8,16,32,64}_t. This allows Zephyr
to define the sized types in a consistent manor across all the
architectures we support and not conflict with what various compilers
and libc might do with regards to the C99 types.
We introduce <zephyr/types.h> as part of this and have it include
<stdint.h> for now until we transition all the code away from the C99
types.
We go with u{8,16,32,64}_t and s{8,16,32,64}_t as there are some
existing variables defined u8 & u16 as well as to be consistent with
Zephyr naming conventions.
Jira: ZEP-2051
Change-Id: I451fed0623b029d65866622e478225dfab2c0ca8
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
ztest has a number of assert style macros and used a baseline assert()
that varies from the system definition of assert() so lets rename
everything as zassert to be clear.
Change-Id: I7f176b3bae94d1045054d665be8b5bda947e5bb0
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Due to commit 8308b9bd2d ("net/http: Add the HTTP/1.1 API")
every user of CONFIG_HTTP_PARSER would need to add CONFIG_HTTP to
their .conf files. Which is fine for intree samples/tests as they
have been adjusted, but the rest of world working on Zephyr apps
will need to make this changes as well.
Instead, we should have each of the following select HTTP instead of
depend on it, which will make future use of these configs and their
dependencies more intuitive:
HTTP_SERVER
HTTP_CLIENT
HTTP_PARSER
NOTE: As cleanup, this commit also removes the CONFIG_HTTP added to
samples and test .conf files.
Change-Id: I81cfaa19e37333b1bf98778f8147814780e7f77c
Signed-off-by: Michael Scott <michael.scott@linaro.org>
This patch adds some routines to evaluate DNS responses as specified
by RFC 1035.
Jira: ZEP-1876
Change-Id: Ia78a1175229962128a0bcee985e507d72ed26aea
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
This patch adds the HTTP/1.1 API for Zephyr. This API consists of client
and server context structures enabled via Kconfig variables.
HTTP parser support is enabled via the CONFIG_HTTP_PARSER configuration
variable.
Currently, this API only includes support for writing HTTP requests
(client mode) and HTTP responses (server mode). TLS support is not
considered in this iteration.
Supported HTTP methods:
GET, HEAD, OPTIONS and POST.
Supported HTTP responses:
400, 403 404. The http_response routine may be used to write
any HTTP status code, for example 200 OK.
Jira: ZEP-1701
Change-Id: Ic9ccd4d4578d6d0f3a439976ea332b031644ca7d
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
This patch adds the test case for the DNS API low-level routines.
The following routines are evaluated by this test case:
- dns_msg_pack_qname
- dns_msg_pack_query
- dns_unpack_header_id
- dns_header_qr
- dns_header_opcode
- dns_header_aa
- dns_header_tc
- dns_header_rd
- dns_header_ra
- dns_header_z
- dns_header_rcode
- dns_header_qdcount
- dns_header_ancount
- dns_header_nscount
- dns_header_arcount
- dns_unpack_query_qclass
- dns_unpack_query_qtype
Next iterations will consider IPv6 and DNS RR coverage.
Jira: ZEP-1499
Change-Id: I4ef46203e6fec57c6fe5a5db8132ed140b412fc2
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
It is possible that the buffer waiting for retransmission is modified
after it is sent, for example, it can be compacted by 6lo, and our
assumption of where is the message ID is located in the buffer is no
longer valid.
As the message ID is the only information that is necessary for
keeping track of retransmissions, we keep a copy of it in the pending
struct, as well as the destination address of the retransmission.
Change-Id: Id33d54353404628673541225a1a05e27ee08765f
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
This unit test verifies that zoap_packet_get_payload() returns the
expected size for received packets.
Jira: ZEP-1662
Change-Id: Ibe011959f4d6593f4f20f0f5901c9033c76c9518
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Currently, for the following MQTT msg fields:
- client_id
- will_topic
- user_name
- topic
their length is computed inside the routine that receives the MQTT msg.
Although this simplifies development, also imposes one restriction:
data must be null-terminated. Sometimes, data is received from other
sources and not generated by the application, so the null-terminated
constraint may be considered problematic for the user.
This patch removes the assumption that string fields are null-terminated.
Current data structures are already prepared to handle this case, so no
API change is required.
Change-Id: I5a147a5b21e0da49541cbe62baac363c8737cd3e
Signed-off-by: Flavio Santes <flavio.santes@intel.com>