Commit graph

861 commits

Author SHA1 Message Date
Anas Nashif ca0ad13a61 net: enable SLIP only on QEMU targets
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>
2017-07-26 10:57:48 -04:00
Andrew Boie 010498da62 samples: net: fix stack definitions
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-07-26 05:53:14 -04:00
Michael Scott c58be92208 samples: net: irc_bot: fix stack declarations
kernel APIs have changed to using K_THREAD_STACK_DEFINE to declare stack
memory as well as K_THREAD_STACK_SIZEOF to calculate it's size.

Adjust irc_bot sample to reflect those changes.

This fixes stack related page faults when running irc_bot with
CONFIG_X86_STACK_PROTECTION enabled (which it is by default for qemu).

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-07-25 18:01:32 -04:00
Paul Sokolovsky 0e5c365f9a samples: net: sockets: Move socket sample(s) under a subdir
It's expected that there will be few socket-based samples, so move
tehm under samples/sockets/ to not clutter the main dir.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-07-18 21:46:56 +03:00
Paul Sokolovsky 00e8309f03 samples: sockets: Add async echo server example
Implements asynchronous TCP echo server using non-blocking sockets
and poll, with concurrent connections support.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-07-18 21:46:06 +03:00
Jukka Rissanen 8f9249cf5c samples: net: coaps_server: Increase mcast addresses
The coaps server sample application did not start because
number of IPv6 multicast addresses was too low. Increased
the address count from 2 to 5.

Jira: ZEP-2359

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-18 09:33:46 +03:00
Robert Chou 33c54ee6fd net: zoap: advance block context by checking M bit from block option
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>
2017-07-14 11:06:54 +03:00
Erwin Rol 507add28c9 samples: net: http_server: Add olimex_stm32_e407 project config file
Signed-off-by: Erwin Rol <erwin@erwinrol.com>
2017-07-12 12:53:51 +03:00
David B. Kinder eeed8ce179 doc: fix wiki board references in non .rst files
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>
2017-07-11 12:45:35 -05:00
Paul Sokolovsky 52f8cde07b samples: net: socket_echo: Add sample.yaml, update for net_app refactor
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-07-11 10:32:29 +03:00
Andrew Boie 65a9d2a94a kernel: make K_.*_INITIALIZER private to kernel
Upcoming memory protection features will be placing some additional
constraints on kernel objects:

- They need to reside in memory owned by the kernel and not the
application
- Certain kernel object validation schemes will require some run-time
initialization of all kernel objects before they can be used.

Per Ben these initializer macros were never intended to be public. It is
not forbidden to use them, but doing so requires care: the memory being
initialized must reside in kernel space, and extra runtime
initialization steps may need to be peformed before they are fully
usable as kernel objects. In particular, kernel subsystems or drivers
whose objects are already in kernel memory may still need to use these
macros if they define kernel objects as members of a larger data
structure.

It is intended that application developers instead use the
K_<object>_DEFINE macros, which will automatically put the object in the
right memory and add them to a section which can be iterated over at
boot to complete initiailization.

There was no K_WORK_DEFINE() macro for creating struct k_work objects,
this is now added.

k_poll_event and k_poll_signal are intended to be instatiated from
application memory and have not been changed.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-07-10 11:44:56 -07:00
Geoff Gustafson 1405627c37 net: context: Use K_NO_WAIT instead of 0 for timeout
Signed-off-by: Geoff Gustafson <geoff@linux.intel.com>
2017-07-10 10:59:28 +03:00
Kumar Gala 5920acef8a samples: mark samples that require usb_device support
Add depends_on usb_device for those samples that need it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-07-07 09:01:01 -05:00
Jukka Rissanen 6ce9d8e882 samples: net: zperf: Add net tag
This sample app should be tested whenever net tag is specified.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-07 15:24:00 +03:00
Jukka Rissanen 3604c391e6 net: udp: Remove NET_UDP_HDR() macro and direct access to net_buf
Remove NET_UDP_HDR() macro as we cannot safely access UDP header
via it if the network packet header spans over multiple net_buf
fragments.

Fixed also the UDP unit tests so that they pass correctly.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-07 15:24:00 +03:00
Bogdan Davidoaia e90064f317 samples: net: ieee802154: add KW40Z prj conf file
The config file for KW40Z has the shell disabled, as available
SRAM memory is limitted to 16kB.

Signed-off-by: Bogdan Davidoaia <bogdan.davidoaia@linaro.org>
2017-07-06 14:20:32 -05:00
Bogdan Davidoaia 8909be81f9 samples: net: ieee802154: kw41z: reduce log level
Reduce log level to show only error messages.

Signed-off-by: Bogdan Davidoaia <bogdan.davidoaia@linaro.org>
2017-07-06 14:20:32 -05:00
Anas Nashif d7154d50df samples: wpanusb: add testcases
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-06 10:34:41 -05:00
Jukka Rissanen 7a31d4b8cb net: app: Fix dual IPv4 and IPv6 support
It was not possible to send IPv4 packets if IPv6 was also
enabled.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-06 14:32:37 +03:00
Anas Nashif 68d7a207ae ethernet: fix Kconfig option for ETHERNET
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-05 12:43:13 -04:00
Anas Nashif c01c074b5b net: fix wrong Kconfig
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>
2017-07-05 12:43:13 -04:00
Anas Nashif 8aac831e3c samples: mqtt_publisher: fixed typo
Also fix console syntax adding prompt: $

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-04 16:52:40 -04:00
Jukka Rissanen 439ceb99c1 samples: net: https: Increase the RAM for client and server
Next two commits will increase the mbedtls ram usage a bit and
https client and server sample test will fail.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-30 06:13:09 -04:00
Jukka Rissanen 5f9d79f290 samples: net: http: Remove net_app_init() calls
As the net app API is automatically initialized, there is no
need to call net_app_init() by the http client and server sample
applications.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-30 06:13:09 -04:00
Jukka Rissanen d14d167188 samples: net: wpan: No need to define IP addresses
Removing CONFIG_NET_APP_SETTINGS from prj.conf file as the
sample does not use or need any IP addresses.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-30 06:13:09 -04:00
Jukka Rissanen 76e6e32cad net: samples: Convert echo-client to use network app API
This commit will convert echo-client to use the net app API
when creating the connection to peer. Most of the network
setup code will be removed from echo-client by this commit.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-30 06:13:09 -04:00
Jukka Rissanen 2e7c3519a4 net: samples: Convert echo-server to use network app API
This commit will convert echo-server to use the net app API
when creating the listening service. Most of the network
setup code will be removed from echo-server by this commit.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-30 06:13:09 -04:00
Jukka Rissanen a1be6a8ba9 net: app: Create support for network application API
The network application API is a higher level API for creating
client and server type applications. Instead of applications
dealing with low level details, the network application API
provides services that most of the applications can use directly.

This commit removes the internal net_sample_*() API and converts
the existing users of it to use the new net_app API.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-30 06:13:09 -04:00
John Andersen 913e2cdb24 samples: net Documented QEMU_INSTANCE usage
Signed-off-by: John Andersen <john.s.andersen@intel.com>
2017-06-29 07:20:46 -04:00
John Andersen 06b92c6611 samples: net: Multiple instances of QEMU
Makefiles which start QEMU (make run) have been changed to operate
off of the QEMU_INSTANCE variable. QEMU_INSTANCE is simply appended
to the pid and sock file names. This makes us able to run multiple
QEMU Zephyr instances of the same sample.

Signed-off-by: John Andersen <john.s.andersen@intel.com>
2017-06-29 07:20:46 -04:00
Johann Fischer 08df5961b3 arch: intel_quark: use DW device driver when USB is selected
This patch allows more generic USB configuration in the samples
and removes platform dependent driver configuration.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-06-28 15:14:15 -04:00
Paul Sokolovsky d950ec2981 samples: net: Add socket-based echo server example
The example source code is POSIX-compatible (modulo include files),
i.e. can be built and behaves the same way for Zephyr and a POSIX
system (e.g. Linux). Makefile.posix is available for the latter.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-06-28 16:07:55 +03:00
Johann Fischer 3dd51d52a2 drivers: usb: use generic option name for log level
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-06-28 09:02:27 -04:00
Jukka Rissanen cd19a57811 samples: net: mbedtls: Fix server compilation
The code has missing proper conversion from net_buf to net_pkt
that was implemented in commit db11fcd "net/net_pkt: Fully
separate struct net_pkt from struct net_buf"

The sample.yaml had incorrect whitelist string so this is also
fixed here.

Fixes #596

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-27 19:20:53 -04:00
Anas Nashif 6ff291a174 tests: do not exclude quark_d2000_crb
quark_d2000_crb does not build net/bluetooth tests by default now.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-27 17:44:23 -04:00
Anas Nashif 3c50f7aa12 tests: samples: remove duplicate filtering
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>
2017-06-27 17:44:23 -04:00
Jukka Rissanen 92fa7ac6ce net: http: Remove mbedtls heap setting from http library
The global mbedtls heap is set automatically now so no need to
set it individually in the http library.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-27 16:42:59 +03:00
Kumar Gala 514a07a9e2 samples: coaps_server: Fix platforms to build coap_server test on
We incorrectly had an arch_whitelist constraint set to 'qemu_x86' that
should have been a platform_whitelist, so fix that and add arduino_101
frdm_k64f to the platform_whitelist as targets that we can test this on.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-06-23 16:03:21 -04:00
Johann Fischer aea4c31722 samples: wpanusb: remove unnecessary condition for ccflags
The condition in src/Makefile is not necessary since the
net_private.h is always included from wpanusb.c and is not
dependent on the transceiver.

Change-Id: I07a0bf599f328bacb8c5677f20eb221a05f30866
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-06-22 07:09:07 -04:00
Anas Nashif 470c5f3189 tests: remove testcase.ini files
We now use yaml files.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-21 20:56:53 -04:00
Anas Nashif cc24f4b03c tests: samples: convert testcase files to yaml
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>
2017-06-21 20:56:53 -04:00
Anas Nashif 397d29db42 linker: move all linker headers to include/linker
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-18 09:24:04 -05:00
Aska.Wu 2970e8beae samples: coaps_server: add prj_frdm_k64f.conf
Be able to test coaps server on frdm k64f board.

Jira: ZEP-1878
Signed-off-by: Aska Wu <aska.wu@linaro.org>
2017-06-14 09:51:34 +03:00
David B. Kinder d1bdb3e092 doc: fix board/sample broken links
Some files have moved from their original location, or are no longer
available.  For the mbedtls samples, tweak the link to point to a page
where links for current and previous downloads can be found.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-06-13 20:49:13 -04:00
Leandro Pereira cf05b11924 samples: net: Do not assume TCP connection was successful
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-06-13 10:33:41 +03:00
David B. Kinder 342bdda760 doc: spelling fixes in samples/ and boards/
regular spelling check on .rst files

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-06-12 18:28:08 -04:00
Jukka Rissanen 57df515028 samples: net: echo-client: Fix compile error
This commit fixes compile error caused by commit 39962dc9
"samples: use k_thread_create()"

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-12 18:01:50 -04:00
Andrew Boie e87eacacfa samples: use K_THREAD_STACK_DEFINE macros
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-06-09 18:53:28 -04:00
Jukka Rissanen e90f4e1486 sample: net: Add https-client sample application
This https-client sample starts to send HTTP GET/HEAD/POST
requests same way as http-client, to https server that can
be found in net-tools repository.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-09 09:56:21 +03:00
Jukka Rissanen 393ab90785 samples: net: Fix README.rst file documentation
Various network samples contained QEMU slip setup instructions
or those instructions were missing. A reference doc in
doc/subsystems/networking/qemu_setup.rst file already has the
setup instructions for QEMU. So add a reference to that file
in samples/net/*/README.rst files and remove unnecessary slip
setup instructions in relevant files.

Fix various typos in readme files at the same time.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-09 09:55:37 +03:00
Leandro Pereira cb0f81f25f samples: dns_resolve: Clarify documentation about DNS configuration
Add clarification that the DNS server configuration must be edited in
the respective prj.conf file.

JIRA: ZEP-2040
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-06-03 15:02:14 -04:00
Jukka Rissanen 3616ec145b samples: net: http_client: Increase the number of buffers
The number of RX and TX buffers is increased to 64 as the
earlier limit can cause memory exhaust in some cases.

Jira: ZEP-2223

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-02 12:43:52 +03:00
Jukka Rissanen bad6e28827 samples: net: dtls_client: Fix Coverity warning
This fix is basically a no-op as the rx_buf pointer cannot be null
in practice, but in order to avoid Coverity complaining about
it add some null pointer checks to the UDP handling code.

Coverity-CID: 170124
Jira: ZEP-2235

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-02 12:34:50 +03:00
Jukka Rissanen 7d13261bd9 samples: net: zperf: Fix llvm compiler warnings
Jira: ZEP-1884

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-01 10:30:21 -04:00
Leandro Pereira 7a972c0229 samples: mqtt_publisher: Try connecting a few times before giving up
Waiting for an NET_EVENT_IF_UP before trying to connect isn't sufficient
in some cases; for instance, on devices using the MCUX HAL, such as the
FRDM-K64F, the interface will have the NET_IF_UP flag set even though
the link negotiation didn't yet complete.

Executing this sample on such board will produce the following output.
Notice the "Enabled 100M..." message right after trying to connect.

    [dev/eth_mcux] [DBG] eth_0_init: MAC 00:04:9f:6f:91:da
    net_context_connect error Is the server (broker) up and running?
    [publisher:247] network_setup: -60 <ERROR>

    Bye!  [dev/eth_mcux] [INF] eth_mcux_phy_event: Enabled 100M
    full-duplex mode.

Even though the returned error is ETIMEDOUT, increasing
net_context_connect()'s timeout parameter to several seconds isn't
sufficient; other steps performed by network_setup() after the link has
been fully established are necessary.  As a stopgap measure, try
connecting a few times before giving up (more than one connection
attempt should be made by application in most cases, anyway.)

It might be the case that we need events to monitor ethernet link
(re)negotation in addition to the NET_IF_UP bit.

Jira: ZEP-2036
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-05-31 17:16:28 -04:00
Jukka Rissanen 35ef580389 samples: net: coaps_client: Fix testcase.ini
The platform list was incorrectly set.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-29 17:35:20 -04:00
Jukka Rissanen 5a0b4976d9 samples: net: coaps_client: Fix compile issues
The coaps_client was bit rotted and did not compile
correctly.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-29 17:35:20 -04:00
Jukka Rissanen e7c52a492f samples: net: mbedtls_dtlsclient: Fix testcase.ini
The platform list was incorrectly set.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-29 23:51:35 +03:00
Jukka Rissanen 27990f77e1 samples: net: mbedtls_dtlsclient: Fix compile issues
Some net_pkt API changes were not done for this sample.

Jira: ZEP-2072

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-29 23:51:35 +03:00
Jukka Rissanen eeaa29666b net: http: Handle HTTPS connection closing gracefully
If the HTTPS connection is closed, then properly handle call to
HTTP parser init in case of error and also remove any pending
data that belong to old connection.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-29 23:50:33 +03:00
John Andersen 7985e917c9 samples: net: mqtt_publisher: fixed formatting
README.rst had formatting which was making things disappear in the
online documentation.

Signed-off-by: John Andersen <john.s.andersen@intel.com>
2017-05-25 18:48:49 +03:00
Jukka Rissanen 11aee50eef sample: net: http: Add Basic auth support to server sample
Basic auth support was missing from HTTP server sample.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-23 18:01:04 +03:00
Jukka Rissanen 63ca45b222 samples: net: http: Remove Arduino-101 config from server
There is not enough memory to run the HTTP server sample
application in Arduino-101 so remove the config file.

Jira: ZEP-2157

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-19 16:05:38 +03:00
Anas Nashif 6aa77e9f3e Revert "net: zoap_server: Unify Makefile and add prj file"
This reverts commit 350d5d4d60.

This change break with many boards and leaves prj.conf unused.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-05-18 15:09:15 +03:00
Jukka Rissanen c9d21ef831 samples: net: http: Remove obsolete files from server sample
There was some left overs from earlier version of http_server
sample application.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-18 15:07:02 +03:00
Wu Jiequan 350d5d4d60 net: zoap_server: Unify Makefile and add prj file
Modify the Makefile to unify with other sample apps and
add the arduino 101 configuration file.

Signed-off-by: Wu Jiequan <jiequanx.wu@intel.com>
2017-05-17 09:37:40 +03:00
Jukka Rissanen a174d2eba7 net: http: Add HTTP server library support
This commit creates a HTTP server library. So instead of creating
a complex HTTP server application for serving HTTP requests, the
developer can use the HTTP server API to create HTTP server
insteances. This commit also adds support for creating HTTPS servers.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-13 14:30:58 -04:00
Jukka Rissanen 19868313fc net: samples: Fix the BT compilation in sample API
The CFLAGS and object path were set incorrectly for Bluetooth.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-13 14:30:58 -04:00
Jukka Rissanen d4c5cc10e4 net: samples: Add support to wait both IPv4 and IPv6
The net_sample_app_init() is now able to wait that both IPv4
and IPv6 addresses are setup before continuing.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-13 14:30:58 -04:00
Andrew Boie 39962dc92c samples: use k_thread_create()
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-05-11 20:24:22 -04:00
David B. Kinder 2f41cb8329 doc: misspelling and UTF-8 fixes
More general spelling fixes, and cleaning up stray UTF-8 characters
such as curly-quotes, em- and en-dashes.  Use replacement strings
for |reg| and |trade|.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-05-09 20:15:49 -04:00
Jukka Rissanen dc0fc57917 net: samples: Common application init API
This creates a common API for network sample applications for
setting up IP addresses etc. The HTTP client application is modified
to use this API.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-04 15:58:45 -04:00
Jukka Rissanen 70f334d9f2 http: client: Create a HTTP library
Instead of separate sample application that does everything
related to HTTP client connectivity, create a HTTP client library
that hides nasty details that are related to sending HTTP methods.
After this the sample HTTP client application is very simple and
only shows how to use the client HTTP API.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-04 15:58:45 -04:00
David B. Kinder 1d36cfba90 doc: change gerrit references to github
We're moving the project code to GitHub folks, so change references
in the documentation from gerrit over to GitHub:
https://github.com/zephyrproject-rtos/zephyr

Change-Id: Ic491a62ed43fc799eb5698e92435cb6eb4d89394
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-04-28 21:21:06 +00:00
Paul Sokolovsky ddf23f3167 samples: net: dns_resolve: Clarify that DNS queries aren't immediate
The sample in its default configuration waits for DNS server
configuration via IPv4 or IPv6 specific means. Until this
information is receives, DNS querying won't even start. Make
diagnostic messages explicit of this fact, because if user
doesn't have required services available in the network, the
sample will appear to just hang.

Jira: ZEP-2061

Change-Id: I56a5b7354a2d1239a35d8334ed95a15ebd19254f
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-04-28 15:01:12 +03:00
Ravi kumar Veeramally e4d8900cc6 net: samples: Use correct API to get net pkt length
net_pkt_get_len() is the correct API to get network packet
length.

Jira: ZEP-2076

Change-Id: Ifff6f3d5df28b3684cc8bb3758f9e8bccd5d4534
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-04-28 15:01:11 +03:00
Bogdan Davidoaia efc3ba6b98 samples: net: ieee802154: add KW41Z config file
Add config file to be used for testing KW41Z's IEEE 802.15.4 driver.

Jira: ZEP-2026
Change-Id: I7042c57ad33ff72b35d24fbf28085b99b2301726
Signed-off-by: Bogdan Davidoaia <bogdan.davidoaia@linaro.org>
2017-04-28 15:01:10 +03:00
Jukka Rissanen f7d291ea90 samples/dns: Add config file for Arduino-101 and FRDM-K64F
The dns_resolve sample application did not had project file for
two boards that the README file is talking about, so adding them here.

Jira: ZEP-2040

Change-Id: I68e825854a171b09d56df91ab80ce5d9349733f6
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-04-28 15:01:09 +03:00
Paul Sokolovsky 25307d5331 net: net_pkt_append: Refactor to return length of data actually added
For stream-based protocols (TCP), adding less data than requested
("short write") is generally not a problem - the rest of data can
be sent in the next packet. So, make net_pkt_append() return length
of written data instead of just bool flag, which makes it closer
to the behavior of POSIX send()/write() calls.

There're many users of older net_pkt_append() in the codebase
however, so net_pkt_append_all() convenience function is added which
keeps returning a boolean flag. All current users were converted to
this function, except for two:

samples/net/http_server/src/ssl_utils.c
samples/net/mbedtls_sslclient/src/tcp.c

Both are related to TLS and implement mbedTLS "tx callback", which
follows POSIX short-write semantics. Both cases also had a code to
workaround previous boolean-only behavior of net_pkt_append() - after
calling it, they measured length of the actual data added (but only
in case of successful return of net_pkt_append(), so that didn't
really help). So, these 2 cases are already improved.

Jira: ZEP-1984

Change-Id: Ibaf7c029b15e91b516d73dab3612eed190ee982b
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-04-28 15:01:09 +03:00
Piotr Mienkowski f9a85815c2 samples: net: remove redundant Kconfig options for sam_e70_xplained
- Manual MAC address settings
- Default ETH driver initialization priority

Change-Id: I6294e2f66623087dfdc131344a94d0e9f2edc6b4
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2017-04-28 15:01:09 +03:00
Kumar Gala a509441210 net: convert to using newly introduced integer sized types
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>
2017-04-21 09:30:38 -05:00
Tomasz Bursztyka e5896906f6 net: Rename all *_BUF() macros to *_HDR()
Most of these macros are not exactly exposing a buffer, but a specific
header pointer (ipv6, ivp4, ethernet and so on), so it relevant to
rename them accordingly.

Change-Id: I66e32f7c3f2bc75994befb28d823e24299a53f5c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-04-21 14:19:51 +03:00
Tomasz Bursztyka db11fcd174 net/net_pkt: Fully separate struct net_pkt from struct net_buf
- 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>
2017-04-21 14:19:50 +03:00
Tomasz Bursztyka bf964cdd4c net: Renaming net nbuf API to net pkt API
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>
2017-04-21 14:19:50 +03:00
Kumar Gala 789081673f Introduce new sized integer typedefs
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>
2017-04-20 16:07:08 +00:00
Tomasz Bursztyka 3a3636ff7f net/ieee802154/samples: Add a Kconfig option to tweak the TX power
This can be useful to override the default value, for testing.

Change-Id: I23b559152c71955ff5aa6fd3643f1f40f5594194
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-04-13 15:21:46 +03:00
Jukka Rissanen 611ccaaf88 net: dns: Remove dns_client API and sample application
DNS resolving is better done with DNS resolve API so remove
the DNS client API which is quite hard to use.

Change-Id: Ide4973a5be674414ea6e04a35c938195cce40b6a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-04-13 15:21:45 +03:00
Jukka Rissanen abb24bb46b samples: net: irc-bot: Use DNS resolve API
Modify the code to use DNS resolve API instead of DNS client API
as the latter is being phased out.

Change-Id: I6a7618d770621fee1f502d2bc277a162c589108a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-04-13 15:21:45 +03:00
Wu Jiequan 432c750d36 net: coaps_server: add prj_arduino_101.conf file
In order to test the coaps_server sample app on
Arduino 101 board.

Change-Id: I7b393dac03a8020b7bd515c3b5b2fd961940bc21
Signed-off-by: Wu Jiequan <jiequanx.wu@intel.com>
2017-04-13 15:21:44 +03:00
Wu Jiequan c84eff0be4 samples: net: http_server: Add bt test and arduino 101 support
Added bt test code in the http_server sample app and in order
to test on Arduino 101 board, added prj_arduino_101.conf file.

Change-Id: Ie68a81ee809e8618f70b5fab6fdbd66692401014
Signed-off-by: Wu Jiequan <jiequanx.wu@intel.com>
2017-04-13 15:21:43 +03:00
Luiz Augusto von Dentz 4d1115ab35 net: Enable context buffer pool in case TCP and 6LO are enabled
The context buffer pool was introduced to deal with TCP holding buffers
when 6LO may modify them, therefore it makes sense to have it enabled
by default when TCP and 6LO are enabled given that the code can deal
with NULL pool in case the application don't implement one.

Change-Id: I600ca31ab40c96ee27937c2e885e332b0cee4995
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-04-07 18:32:18 +03:00
Piotr Mienkowski afdb0e0a70 drivers: eth_sam_gmac: Fix initialization order
Atmel SAM family GMAC Ethernet driver is implementing zero-copy
networking. As a result it has to reserve a defined amount of RX
data net buffers before bringing up the interface. Since net buffer
pool is initialized by the network stack and this driver was bringing
the interface up in its initialization function the driver initialization
was performed, as a workaround, after network stack initialization. It
is not a clean solution. This patch fixes this by bringing the
interface up in interface initialization function. The driver itself
can now be initialized before the network stack is.

Tested on Atmel SMART SAM E70 Xplained board

Change-Id: I65886fd6db6f27a10628e393cfabd8e5f78c08ff
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2017-04-07 12:35:51 +03:00
Leandro Pereira bb4a2eef7f samples: net/nats: Fix parsing of MSG messages
This addresses the issues found by QA in ZEP-1012 and clarify the
documentated behavior as described in ZEP-1859.

Change-Id: I602e5749db7f6f44cf5be449b8e6f0d2ba66b69b
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-04-05 18:24:45 +00:00
David B. Kinder 7bc4890202 doc: add labels to net sample docs for linking
Docs need a label at the top so we can use :ref:`labelname`
to create a link to that doc from other docs.

Change-Id: I46cd75d714449de806a85dde08756c8e190488dc
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-04-04 19:52:06 +00:00
Tomasz Bursztyka e027645c88 net/samples/ieee802154: Making hw sample simpler
- Let's use samples settings
- Enable both net and 15.4 shell modules
- Change prj_*.conf accordingly

Change-Id: If7e32a42c8dc7026d0580b1e94e819e1eda82e5b
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-03-31 11:24:28 +02:00
Tomasz Bursztyka d2f8a5a27f net/samples: Add 802.15.4 link-layer security settings for the samples
And use them accordingly in the common code part.

Change-Id: Id91b76e5baea607c0d68eebcde6f84e4e35ca44c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-03-31 11:24:27 +02:00
Tomasz Bursztyka 7b8af87fdf samples/net: Remove the need for IEEE 802.15.4 stack in wpan serial
It can uses CONFIG_NET_APP_IEEE802154_* options instead.

Change-Id: I2501ca2015cfc1e68c6c384cb32c21084d2cb30d
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-03-31 11:24:27 +02:00
Tomasz Bursztyka 26a4df620f samples/net: Uses CONFIG_NET_APP_IEEE802154_* options relevantly
In order to simplify when 802.15.4 is selected on these samples, let's
setup the device through a common code.

For this to work, RFD is now the default.

Change-Id: I46590864442f77d83f681cc0e854c94344648856
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-03-31 11:24:27 +02:00
Tomasz Bursztyka 0f18ce44f9 net: Rename Kconfig.samples and its main option for future changes
s/SAMPLES/APP for name shortening. Applying the change where relevant.

Not only IP addresse will be available as samples settings there but
also IEEE 802.15.4 channel, pan_id, and more for instance.

Change-Id: I05dd24989bd0c804d9588092d67044a3e063bc88
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-03-31 11:24:26 +02:00
Jukka Rissanen c6cad93d8c samples: net: DNS resolving sample application
Change-Id: I4a0283efde4d0dd8ccd0933071acb277431d4a32
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-24 17:31:42 +02:00
Tomasz Bursztyka 3b0769889b net/samples: Add static ipv4 addresses for arduino 101 echo apps config
Jira: ZEP-1444

Change-Id: I689ae6b4b5316e36cdacdf20acbf6e335a10c9e5
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-03-24 17:31:42 +02:00
Tomasz Bursztyka d7145b3556 drivers/ieee802154: Remove very old CC2520 left-over from µIP stack
Change-Id: Ief7ef008905e81cedcfc1b7ea2f21702cb68a4ce
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-03-24 17:31:41 +02:00
Jukka Rissanen 4fcf04dde8 samples: net: Remove multicast address setting in echo-client
The echo-server no longer uses multicast addresses itself,
so the multicast address setting can be removed from echo-client.

Change-Id: Ieab069849ced8a850ada6e6618d625695819be8e
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-24 17:31:41 +02:00
Jukka Rissanen 35352130b5 samples: net: Remove multicast address setting in echo-server
The multicast address setting in echo-server was not really
used for anything so removing it from the app.

Change-Id: I8069c670388702fc46ae2f31506c982caa28212d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-24 17:31:41 +02:00
Andrei Emeltchenko 2801389a14 wpanusb: Fix using incorrect nbuf in fragment_get()
Fixes using buf instead of pkt.

Change-Id: I21fd84b68a3967bfc701887f01a7b403d04a4504
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-03-24 17:31:40 +02:00
Andrei Emeltchenko 0d168bff77 drivers: cc2520: Correct configuration options
At the moment CC2520 configuration options are selected inside "TI
CC2520 Driver RAW channe" submenu like:

           [*] TI CC2520 Driver support  ----

           [ ] TI CC2520 Driver RAW channel  --->

Make RAW channel depends on TI CC2520.

Change-Id: I92879b7f4391f1842c012b6c03c78956e90b9441
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-03-24 17:31:40 +02:00
Andrei Emeltchenko 33c2480c09 wpan_serial: Correct system logging domain
Correct logging domain to wpan_serial.

Change-Id: Ic5e99d2fc31ba68c7b211acbf372ee26ab93a62f
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-03-24 17:31:40 +02:00
Inaky Perez-Gonzalez 933366631c samples/net/echo_client: add SAM e70 and FRDM k64f ethernet configurations
These are copied verbatim from the echo_server sample.

Change-Id: I56d1386144967177f889e12d4a173bfb6628f18b
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2017-03-24 17:31:40 +02:00
Jukka Rissanen 3a1a4d3105 samples: net: coaps_client: Fix the parameters when setting callbacks
The RX callback and timeout parameters were reversed in call to
mbedtls_ssl_set_bio().

Change-Id: I285694e57a024ac3ce735e496daad690f94737ac
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-17 10:34:45 +02:00
Michael Scott 081246737c net/http: let HTTP_SERVER, HTTP_CLIENT and HTTP_PARSER select HTTP
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>
2017-03-17 10:34:45 +02:00
Piotr Mienkowski c54b3c7e8f drivers: Update Atmel SAM family GMAC Ethernet driver
Networking stack has split one global DATA pool to RX and TX DATA pools
and also added net_buf pool support to each context. Update the driver
to support this new design. Since the GMAC TX descriptor list has a fixed
size but the number of TX DATA buffers is no longer limited updating the
TX descriptor list has to be guarded by a semaphore.

Tested on Atmel SMART SAM E70 Xplained board

Change-Id: I181e1cdd183e173b85d5d1711b6e78cd5165666d
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2017-03-17 10:34:44 +02:00
Ravi kumar Veeramally bd1f30a3b9 net: samples: leds_demo: Fix memory leak
Unref the buffer if net_contect_send_to() fails to send.

Change-Id: I182125e64aabd171cd86f42fd9e1de036dd68544
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-03-17 10:34:42 +02:00
Jukka Rissanen fdccd1caf9 samples: net: zperf: Fix compiler warnings
LLVM/icx compiler gives some warnings for signed vs unsigned
pointers.

Jira: ZEP-1884

Change-Id: Ide57be898ebd1bff49c8a27aac392fa58dcae726
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-17 10:34:41 +02:00
Flavio Santes 876e341570 samples/net/http: Add the HTTP Basic Authentication routine
This patch adds the HTTP Basic Authentication routine "http_auth".
Authentication parameters are defined in the config.h file.

The README file is also updated by this patch.

Jira: ZEP-1543

Change-Id: I2d531966290e87a68c54fc1ac834491ac937df22
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-17 10:34:40 +02:00
Flavio Santes e1b46bfe29 samples/http: Match header field ctr with Kconfig variable
Set a local define with the value previously defined at the Kconfig
file.

Change-Id: I3ee424c4a1102ca00c0059cb9d0a86498806486f
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-17 10:34:39 +02:00
Sergio Rodriguez ff5178fd22 samples: mbedTLS coap: Cleaning prj.conf for QEMU
Removing unneeded configuration

Change-Id: I72e3714358366de715cb6f47d690a1b0e8f032f5
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-03-17 10:34:39 +02:00
Sergio Rodriguez 1b48f9fbc3 samples: mbedtls coap: Fixing entropy source
Using a more efficent entropy call and proper output data

Jira: ZEP-1878

Change-Id: Ife738b84c1e56d58784b4fbc61ec0843579c4453
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-03-17 10:34:39 +02:00
Juan Manuel Cruz Alcaraz 172c031ec9 sample: net: mbedtls ssl: SSL client sample is adapted to TCP API
Jira: ZEP-1798

Change-Id: I790cd49cb7cc5ed207141ca6634999d77d6a19bb
Signed-off-by: Juan Manuel Cruz Alcaraz <juan.m.cruz.alcaraz@intel.com>
2017-03-09 20:33:50 +02:00
Jukka Rissanen 695cfff535 samples: net: dtls_client: Fix memory leak in RX path
If we have not yet handled the previous RX buf, then we need
to drop the latest received one, otherwise the earlier net_buf
is leaked.

Change-Id: I1b69e07e8b3a3b87c76d923c847dc8316c128e76
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:50 +02:00
Jukka Rissanen 3a2bd9a162 samples: net: dtls_client: Fix mem leak in error path
We need to unref the net_buf in error path in RX and TX.

Change-Id: Icb6d43cb6b7411a5135ea09c6ae96742566fafc4
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:50 +02:00
Jukka Rissanen dc8a019823 samples: net: dtls_client: RX buf count too low
The mbedtls_dtlsclient needs more RX buffers.

Jira: ZEP-1855

Change-Id: I80732c511dfade8fa9139e3bd26e21de73a68acd
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:50 +02:00
Jukka Rissanen b1aadd0b3a samples: net: http_server: Disable mbedtls
Sanitycheck cannot link the result qemu binary because it is too
large. As a workaround, disable mbedtls to get the linking pass.

.../real-ld: zephyr.elf section `noinit' will not fit in region `RAM'
.../real-ld: region `RAM' overflowed by 192 bytes
collect2: error: ld returned 1 exit status

Change-Id: I543571505ab9412db7eac101848c6032d1550d79
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:50 +02:00
Juan Manuel Cruz Alcaraz 6828412f27 samples: dtls client: DTLS client sample configuration file
The configuration file for Arduino 101 for the DTLS client
sample needs to define IPv4 and IPv6 addresses.

Jira: ZEP-1169

Change-Id: Iabfd5f067d39faaf8796aac84642b630b11ef7f6
Signed-off-by: Juan Manuel Cruz Alcaraz <juan.m.cruz.alcaraz@intel.com>
2017-03-09 20:33:50 +02:00
Flavio Santes 87bc931826 samples/net: Add the HTTP API to the HTTP client sample application
This patch replaces some routines found at the HTTP client sample
application by the ones defined at the HTTP API.

Jira: ZEP-1824

Change-Id: Id19e3e346c09716ac95b0c488ff6e6949a5fbabe
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-09 20:33:50 +02:00
Flavio Santes 848966be43 samples/net: Add the HTTP API to the HTTP server sample application
This patch removes some routines from the HTTP server sample
application and replaces them by the ones defined at the HTTP API.

Jira: ZEP-1824

Change-Id: Ia5db424d62997e01896294e12224aa65a58db432
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-09 20:33:50 +02:00
Flavio Santes 8308b9bd2d net/http: Add the HTTP/1.1 API
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>
2017-03-09 20:33:49 +02:00
Flavio Santes e29202593d samples/net: Add the QEMU x86 prj file to the HTTP client sample app
Add the QEMU x86 project configuration file to the HTTP client sample app.

Change-Id: Ice6ae3f3559680e1d182506671984fd5f946f1d8
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-09 20:33:49 +02:00
Flavio Santes f6d40023b4 samples/net: Fix format warning in the HTTP client sample app
Fix a printk format warning found at the HTTP client sample app.

Change-Id: I9665e3e59595b383d6e809af51fe4cf3cd8f8bd8
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-09 20:33:49 +02:00
Flavio Santes a561f5e1c7 samples/net/http_client: Cast size_t to int to avoid compiler warnings
Cast size_t to int in the http_client_cb code.

Change-Id: I36133da953669ec133421b5e7fb21bec9807fd06
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-09 20:33:49 +02:00
Marcus Shawcroft 7e6656eb9e samples: net: echo-server: Fix conditional around net_if_ipv4_addr_add()
The invocation of net_if_ipv4_addr_add() should be included within the
conditional code that sets up the address added.

Change-Id: I9b4e76a6b4922b3455bc6b383431b4124d40a49e
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-03-09 20:33:47 +02:00
Vinicius Costa Gomes 43ae27fd9b samples/coaps_server: Don't error if the packet doesn't have payload
GET and DEL requests may not have payloads, so it's not correct to
return with an error in those cases.

This was only noticed now that zoap_packet_get_payload() returns the
correct value for all situations.

Jira: ZEP-1754

Change-Id: Ie533041aa7a66855582ff4c5c937d943304bad84
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-03-09 20:33:47 +02:00
Luiz Augusto von Dentz 4db2c941be net: samples: Enable CONFIG_NET_CONTEXT_NBUF_POOL in prj_bt.conf
Bluetooth consumes buffer when transmitting them therefore any protocol
that need to retain them, like TCP, needs to have its own pool to copy
the buffers as they may need to be resent in case they are not acked.

Change-Id: I483c5a3eb4d54fae6b5b2902c69b67e8c2e0be5e
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-03-09 20:33:46 +02:00
Leandro Pereira 141c0a5f1a samples: net: NATS protocol sample
NATS is a publisher/subscriber protocol implemented on top of TCP. It
is specified in [1], and this is a sample implementation for Zephyr
using the new IP stack.  The API is loosely based off of [2].

With this sample, it's possible to subscribe/unsubscribe to a given
subject, and be notified of changes asynchronously.  In order to
conserve resources, the implementation does not keep its own track of
subscribed subjects; that must be performed by the application itself,
so it ignore unknown/undesired subjects.

TLS is not supported yet, although basic auth is.  The client will
indicate if it supports username/password if a certain callback is set
in the struct nats.  This callback will then be called, and the user
must copy the username/password to the supplied user/pass buffers.

Content might be also published for a given subject.

The sample application lets one observe the subject "led0", and turn it
"on", "off", or "toggle" its value.  Changing the value will, if
supported, act on a status LED on the development board.  The new
status will be published.

Also worth noting is that most of the networking and GPIO boilerplate
has been shamelessly copied from the IRC bot example.  (Curiously, both
protocols are similar.)

[1] http://nats.io/documentation/internals/nats-protocol/
[2] https://github.com/nats-io/go-nats

Jira: ZEP-1012

Change-Id: I204adc61c4c533661eacfb8c28c1c08870debd91
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-03-09 20:33:45 +02:00
Flavio Santes 760c1f1214 samples/net: Fix error handling issues in IRC bot
Fix the following error:

Calling "transmit(irc->conn, pong, ret)" without checking return value.
It wraps a library function that may fail and return an error code.

Coverity-CID: 163115

Change-Id: I525e1059e6a2ae3896f68760f1a8a6c68ecfc074
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-09 20:33:45 +02:00
Flavio Santes c406be6360 samples/net: Fix uninitialized variable error
Fix "Uninitialized variables (UNINIT)" error found at the
HTTP client sample app.

Coverity-CID: 163117

Change-Id: I3d350fdc0e49a7bb7bea9d7af04494f6e918d603
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-09 20:33:45 +02:00
Jukka Rissanen aeb08874af net: samples: echo-client: Allow UDP and TCP run at the same time
Run both TCP and UDP to run at the same time. This requires two
extra threads in echo-client sample application.

Change-Id: I450a26d7ab1472150ea8f1309a43897a30bd4d90
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:44 +02:00
Jukka Rissanen f8c60de061 net: nbuf: Create net_nbuf_frag_del() for tracking allocations
Create net_nbuf_frag_del() so that we can track net_buf frees.
If CONFIG_NET_DEBUG_NET_BUF is not defined, then this new function
will call net_buf_frag_del() directly, and if not, then it will
track memory usage.

Change-Id: I5f382436cebc71fdaf12baf7bf964fb63bee7aca
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:44 +02:00
Jukka Rissanen 5197266768 net: nbuf: Use net_nbuf_get_frag() to allocate a fragment
The code used net_nbuf_get_reserve_{rx|tx}_data() function to
allocate a fragment. Instead of that low level function, use
net_nbuf_get_frag() instead. There are few places this is not
possible or is too big change like in few test programs.

Change-Id: Ied7e2b7db352de998b200ffa6ff82471bfa5ebe3
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:43 +02:00
Jukka Rissanen d32503f57e net: nbuf: Split one global DATA pool to RX and TX DATA pools
If we receive lot of packets, it might happen that we exhaust
all the DATA buffers in the system. This would prevent from
us sending anything to the network.
Change this by splitting the DATA buffer pool into RX and TX
parts. This way RX flooding cannot consume all DATA buffers
that needs to be sent.

Change-Id: I8e8934c6d5fdd47b579ffa6268721b5eb3d64b6d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:43 +02:00
Jukka Rissanen ee0cff9ac7 samples: net: Use context specific net_buf pools in echo_*
Use context specific net_buf pool in echo-server and echo-client.
This will prevent application from allocating all available network
buffers in the system and thus preventing the core IP stack
functionality.

Change-Id: I3dbc64dd81c8a1165241426287a3530d00cbc7bf
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:42 +02:00
Sergio Rodriguez ee8bfe586b samples: mbedtls: Fixing entropy source
Using a more efficent entropy call and proper output data

Change-Id: I2ce71f63b6f22e5ceda79babd2eac802fa4bdf53
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-03-09 20:33:40 +02:00
Flavio Santes c318967c56 samples/net/mqtt: Don't break lines after the "static" keyword
Fix some style issues found at the src/main.c file.

Change-Id: I2023deb5ac4f31b2cf5d14d8313bbcfc03647898
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-27 10:28:55 +02:00
Flavio Santes 9b381058f5 samples/net/mqtt: Move conf parameters to config.h
Move the client id define to config.h. Update the README file.

Change-Id: I1900c5e4f8c449e14279660d425501e86e07d409
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-27 10:28:55 +02:00
Flavio Santes 4979accb9f samples/net/mqtt: Improve inline doc
Remove the brief keyword for the mqtt_client_ctx structure's
inline documentation.

Change-Id: Ia3999bbb7e3246495fd1cab0ca828d95f5896835
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-27 10:28:55 +02:00
Flavio Santes 31f014a56d samples/net/mqtt: Simplify MQTT publisher
Remove the global bluemix flag and use a #define to set the
MQTT publisher topic and its parameters at compile time.

This change will save a few bytes and speed up computations.

Change-Id: I27bfc6b38c73d32c6105f1d506e147e9a5583097
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-27 10:28:55 +02:00
Vinicius Costa Gomes 270673e112 samples/zoap_client: Fix using the wrong timeout for retransmissions
It was assumed that the unit was microseconds, it is in miliseconds,
the same unit that is stored in the timeout field of the pending
transmission.

Change-Id: Ia99f363c7de4ec76a7ed229cb94a9964bcf609aa
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-02-27 10:28:55 +02:00
Vinicius Costa Gomes 2f574c7db5 samples/zoap_server: Add retransmissions for CON messages
This adds retransmission support for confirmable responses sent by the
server.

Jira: ZEP-1732

Change-Id: I77c0c6375fa666e4cfdda4016ad1e0e90caf4ac9
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-02-27 10:28:54 +02:00
Vinicius Costa Gomes 8e304ef2e6 iot/zoap: Fix requiring that the buffer is unchanged for retransmit
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>
2017-02-27 10:28:54 +02:00
Vinicius Costa Gomes 346edff2ca samples/zoap_server: Adds example for the link-format feature
This implements the /.well-known/core resouce and two children
resources (/core1 and /core2) so the link-format feature is better
explained.

Change-Id: I9dd8c69040c952c5d12a9987c1966a71b0257ef2
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-02-27 10:28:54 +02:00
Vinicius Costa Gomes ddb9cf90a7 samples/zoap_server: Add a test case for the observer feature
This adds the resource necessary for the TD_COAP_OBS group of tests.

Change-Id: I33bd09910f74db90ad0d713e4479ab2e3ec343a5
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-02-27 10:28:54 +02:00
Vinicius Costa Gomes 8ce3d4ec82 samples/zoap_server: Add more validation tests for block-wise
Add the resource for the TD_COAP_BLOCK_04 ETSI testcase.

Change-Id: Ied901db34ce79d3e1f7f8c7fd55bc398b1f88640
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-02-27 10:28:54 +02:00
Vinicius Costa Gomes da4580dc32 samples/zoap_server: Remove useless return statements
The functions that retrieve net_buf will wait forever until a buffer
is available.

Change-Id: I03ddd1239f50fe4467e86e31c8fbfc9b05c8b190
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-02-27 10:28:54 +02:00
Tomasz Bursztyka 2b5a343a0f samples/ieee802154: Update qemu based samples
- Let's build it with the various shell modules
- Make use of Kconfig.samples options

Thus: adding prj_server.conf and prj_client.conf to differentiate 2
instances of the app by their IPv6.

Then let's use samples/net/common/Makefile.ipstack

In the end, it is possible to build 2 times the samples this way:
make PCAP=154.pcap CONF_FILE=prj_server.conf server
and
make pristine
make CONF_FILE=prj_client.conf client

On client, or server, or both, shell commands can be used to ping each
other, check the statistics etc...

Once done, the given pcap file (154.pcap for instance) will have
recorded the traffic which can be parsed through:

wireshard 154.pcap

(Note: the "Malformed packet" warnings are not relevant, as the 15.4
frame FCS is a dummy one, it seems to make wireshark a bit lost)

Jira: ZEP-1774

Change-Id: I5590971660ecbfaac75af709124d59e1f98206fe
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-02-27 10:28:53 +02:00
Jukka Rissanen 1ca310fc93 samples: net: Fix the 802.15.4 monitor pcap saving
By default the net-tools package is expected to be located in
${ZEPHYR_BASE}/../net-tools directory. User can also specify
the directory using NET_TOOLS variable when running the make.

The net-tools package is located in this repository
https://gerrit.zephyrproject.org/r/net-tools

Change-Id: Ibccd7cabd567a630020fb9efbe1ec9e27b653b46
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-27 10:28:53 +02:00
Wojciech Bober f8c2b2e099 samples/net/ieee802154: Update example with nrf5 802.15.4
This commit updates the 802.15.4 example to work with the
nrf5 802.15.4 radio driver.

Change-Id: I8a4c80a21ebe29ce2616836b764c454979ebb2e9
Signed-off-by: Wojciech Bober <wojciech.bober@nordicsemi.no>
2017-02-22 17:28:24 +02:00
Wojciech Bober 4be677fa45 samples/net: ieee802154: Add configuration for nrf5
This commit addes new configuration for examples which use
nrf5 802.15.4 radio.

Change-Id: I0c57334d071fb58bc2282feb3f4e6b949ce5d472
Signed-off-by: Wojciech Bober <wojciech.bober@nordicsemi.no>
2017-02-22 17:28:24 +02:00
Anas Nashif fe118c4e95 license: replace APL2.0 license with SPDX
Some files made it through review process with full license header.

Change-Id: I2722b127c40b4b19500042c12e4fde85a165bae9
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-20 16:59:46 +00:00
Jukka Rissanen 14034ac515 samples: net: Add README.rst to echo apps
Add a README.rst file to both echo-server and echo-client
sample applications.

Jira: ZEP-1539

Change-Id: I1ee1d02a3de0295697117f448d8e13f5b161e11b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-15 12:20:08 +02:00
Jorge Ramirez-Ortiz c1c5e25bbc net/mqtt: Add support for IBM BlueMix Watson topic format
Change-Id: I044180d9f76a307c1cf4423a9b1d3ee6c540cbc7
Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
2017-02-15 12:20:08 +02:00
Flavio Santes 057f31e7e9 net/mqtt: Remove length computations for some msg fields
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>
2017-02-15 12:20:08 +02:00
Flavio Santes 540505757f net/mqtt: Add support for QEMU x86
Add the QEMU x86 prj file to the MQTT publisher application.

Change-Id: I1ba8c3a3bf818d8f6dee7ea94021a83ba5277e5f
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-15 12:20:08 +02:00
Jukka Rissanen 7608fcdb75 samples: net: Remove the README file
This README file is no longer needed as we have separate
README files in various sub-directories.

Change-Id: I38d1c4208e373aa7aa23373149ef1b89fbcda094
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-15 12:20:08 +02:00
Jukka Rissanen 9bfa9ca058 samples: net: Remove obsolete prj_slip.conf from echo-*
This config file is not needed.

Change-Id: Ib601605805d6c5c0173424b2e282a50a6a1076d6
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-15 12:20:08 +02:00
Sergio Rodriguez de60e4c8cd samples/net/http: Add HTTP over TLS sample application
Add the HTTPS (HTTP over TLS) server sample application on top
of the current HTTP Parser Library and mbedTLS. This code uses
TLS to stablish a secure connection and HTTP parser to identify
the request and the proper response.

Jira: ZEP-799

Change-Id: Ifbbcd0347bec47d12158440e50a82dc2966334d3
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-14 08:30:35 +02:00
Jorge Ramirez-Ortiz f994efa8c1 net/mqtt: Add BT support to MQTT publisher sample
Change-Id: I56d54c3550a530bf250210e939840e7c7e89c5d9
Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
2017-02-14 08:30:35 +02:00
Richard Peters d502c24a5d samples: net: Add .conf file for qemu_cortex_m3 in echo_*
Added conf files for qemu_cortex_m3, until a better solution
than CONF_FILE=prj_$(BOARD).conf exists in the makefile.

Change-Id: I1edc4f37bb3c49ecb65abf7c93b3c9f4608d601e
Signed-off-by: Richard Peters <mail@richardpeters.de>
2017-02-14 08:30:34 +02:00
Flavio Santes f40bdd67ac net/http: Improve network configuration routines
Modify the network setup routine to accept the following parameters:
- network context
- accept callback
- server IP address
- server port

This change will allow us to reuse this routine for TLS.

Change-Id: I1fdbaa908783c69f87863cbc597b42f39358762c
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-14 08:30:34 +02:00
Flavio Santes 79a064fae8 net/http: Add QEMU support to the HTTP server sample app
This patch adds the QEMU prj file for the HTTP server sample
app.

Change-Id: I0b910b5ec9970a7ffe9621e19d9544d899c22132
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-14 08:30:34 +02:00
Flavio Santes 449cbbd874 net/dns: Update QEMU prj file
Update the IPv4 addresses to 192.0.2.x.

Change-Id: I0eafccfaf691cfd2ffb896e18d3fdcf091837edc
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-14 08:30:34 +02:00
Vinicius Costa Gomes 62a6c9c6d0 samples/zoap-server: Update docs with information about libcoap
Add information about how to run libcoap's[1] implementation of the
ETSI testcases against zoap-server.

Jira: ZEP-1538

[1] https://github.com/obgm/libcoap (branch develop)

Change-Id: I6aa5989575cc15630371aa0761bee98fb6fe1b80
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-02-14 08:30:33 +02:00
Anas Nashif d4c9a7d80c net: remove obsolete CONFIG_NET_YAIP
Change-Id: Ie8ef79e7d7a6f229af3771b7786af3db89c5e458
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-14 08:30:33 +02:00
Anas Nashif 3557d04eb5 tests: net: whitelist boards for telnet server
Change-Id: I141cb9e680584b9b26926eae288ae7a2a85633f8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-11 07:00:39 +00:00
Marcus Shawcroft 7421928ae5 samples/dhcpv4_client: Switch from private net_sprint_ipv4_addr to public net_addr_ntop
Change-Id: I894c22548aeea4dcb42e457266e7e140acdace0f
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-02-09 14:27:09 +00:00
Marcus Shawcroft 7a903ede9f samples/dhcpv4_client: Increase number of DATA buffers.
Change-Id: I0116613cb63070d08c4cb6ad7a5864d09a014c68
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-02-09 14:27:09 +00:00
Marcus Shawcroft 571bdbb7c3 samples/dhcpv4_client: Reduce default debug to dhcpv4
Turn down the default logging verbosity on the dhcpv4 frdm_k64f config
to focus on the dhcpv4 implementation.

Change-Id: Ifb450181add653951517a7b128b11657ec2bab62
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-02-09 14:27:08 +00:00
Marcus Shawcroft 15a151a0a0 samples/mbedtls_dtls_client: Fix wild write in entropy_source
The example entropy_source implementation should write entropy to the
output buffer rather than to the context pointer which in this example
happens to be NULL.

Take the opportunity to reorganize the entropy_source to use all of
the entropy provided by a call to sys_rand32_get() rather than just
1/4 of it.

The entropy_source() callback from mbedtls is given a maximum amount
of entropy to return, rather than a minimum amount.  Hence it makes
more sense to deliver exactly one chunk (32 bits) of entropy from the
call to sys_rand32_get() per call and let the mbedtls entropy handler
worry about how much entropy we actually need to collect (ie the threshold).

Change-Id: I57ed438de5cb1223619fde0fb8039d6eca284646
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-02-09 14:26:58 +00:00
Marcus Shawcroft 8a612c3a44 samples/mbedtls_dtls_server: Use k_uptime_get_32()
The kernel provides an API call to get the least signficant 32 bits of
system time, use it rather than	reaching under the hood.

Change-Id: I98fabdcadfd0a4fe5ae10226dabf4e6d31e88df6
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-02-09 14:26:57 +00:00
Marcus Shawcroft e2e43774d2 samples/mbedtls_dtls_client: Use k_uptime_get_32()
The kernel provides an API call to get the least signficant 32 bits of
system time, use it rather than reaching under the hood.

Change-Id: I9c303ef949f7670f2a2d9691c342e496873e96e6
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-02-09 14:26:57 +00:00
Ravi kumar Veeramally f6916acbee net: samples: Unref the buf if app data length is zero
Core stack is not removing the network buffer if app data length
is zero. So memory leak happening here.

Change-Id: I3d354b5e7008396ca7cb977631036871998165b4
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-02-09 12:29:29 +02:00
Ravi kumar Veeramally 083e112197 net: samples: Unref net_buf using net_nbuf_unref
Using net_buf_unref() technically works but debugging the network buffer
allocations is more difficult if done like that.

Change-Id: Ib8e3f8b412c2f8388315c2f63cae4392f814ea2f
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-02-09 12:29:29 +02:00
Juan Manuel Cruz 5225daad94 mbedtls: add arduino 101 configuration to ssl client sample
Jira: ZEP-748

Change-Id: Ied8c521f80b8f1d4b22497a059ee5c948449613f
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2017-02-08 10:12:36 +02:00
Michael Scott 76551f469e samples: net: irc_bot: add testcase.ini
Change-Id: I61b6373572254cbb63a8170eb2dfd8381a0973a2
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-08 10:12:36 +02:00
Michael Scott 92042b25c2 samples: net: irc_bot: fix size_t related build warnings
size_t has different types depending on the arch selected for
building.  Correct format identifier is %zu in this case.

Change-Id: I4388fcd8c5eb8bcd5997bb921bd80b4c2175b24c
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-08 10:12:36 +02:00
Michael Scott 6a3b3f0e46 samples: net: irc_bot: fix build break
Fix build break introduced in commit 6b013c4721c5
("net: nbuf: Add timeout to net_buf getters")

Change-Id: Iaa521c6a49ae740eaee5276936442ab8aa4c47ba
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-08 10:12:36 +02:00
Jukka Rissanen bd3908b2a9 net: nbuf: Add timeout to net_buf getters
This commit changes the net_buf getter functions in nbuf.h
by adding a timeout parameter. These function prototypes
are changed to accept a timeout parameter.
	net_nbuf_get_rx()
	net_nbuf_get_tx()
	net_nbuf_get_data()
	net_nbuf_get_reserve_rx()
	net_nbuf_get_reserve_tx()
	net_nbuf_get_reserve_data()
	net_nbuf_copy()
	net_nbuf_copy_all()
	net_nbuf_push()
	net_nbuf_append()
	net_nbuf_write()
	net_nbuf_insert()

Following convinience functions have not been changed
	net_nbuf_append_u8
	net_nbuf_append_be16
	net_nbuf_append_be32
	net_nbuf_insert_u8
	net_nbuf_insert_be16
	net_nbuf_insert_be32
	net_nbuf_write_u8
	net_nbuf_write_be16
	net_nbuf_write_be32
so they call the base function using K_FOREVER. Use the
base function if you want to have a timeout when net_buf
is allocated.

Change-Id: I20bb602ffb73069e5a02668fce60575141586c0f
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-08 10:12:35 +02:00
Wojciech Bober 573774a9bf drivers/net/ieee802154: Change configuration prefix
This commit changes Kconfig prefix for ieee802154 drivers to
IEEE802154_*. This is done for consistency with config prefixes
used in other subsystems.

Change-Id: Ibbb4d96d2b748f4f13135bde85304ec34c5a90a6
Signed-off-by: Wojciech Bober <wojciech.bober@nordicsemi.no>
2017-02-08 10:12:35 +02:00
Jukka Rissanen b9ac440d02 samples: net: Fix invalid memory access for TCP
Set protocol family value only after the buf is verified
to be non-null.

Change-Id: I0ce7bab3539087d0f522b4bb3024f46a7eb3c15f
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-08 10:12:34 +02:00
Flavio Santes c2c32d24e3 samples/net/http: Add the HTTP client sample application
This patch adds a basic HTTP client sample application.
The following HTTP 1.1 methods are supported: GET, HEAD,
OPTIONS and POST.

This sample application does not define an API for HTTP,
for more information see ZEP-346.

Jira: ZEP-827

Change-Id: Iee63a53f2ef424964f040eba20326d648249fc24
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-08 10:12:34 +02:00
Jukka Rissanen 2612b04d80 samples: net: zperf: Set the proper UDP payload
Use a static buffer for sending UDP payload instead of reading
values from memory.

Change-Id: I037db5cd9b8784966d481c36e8cbe92d19760475
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-03 15:59:20 +02:00
Jukka Rissanen 517fb19586 samples: net: zperf: Fix compiler warnings
Compiler was giving "Unused variables" warnings if IPv6 was
enabled and IPv4 was not, and vice versa.

Change-Id: I3b17534bb8bdef207512ea5b618e138edb420871
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-03 15:59:20 +02:00
Jukka Rissanen 47685ef71f samples: net: zperf: Fix udp.upload command
The IP address and port number were incorrectly parsed if
user used udp.upload command.

Change-Id: Ib37d481012af5e186a1e342c92d10ddef9fe35b1
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-03 15:59:20 +02:00
Jukka Rissanen 1ec6038c48 samples: net: zperf: Initialize address family properly
The IP address family was not set correctly when setting up
the connection. This lead to connectivity error in udp.upload
command.

Change-Id: I598ff2675f97e10e2033763a497f7583c94f3840
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-03 15:59:20 +02:00
Flavio Santes 53e9245b33 samples/net/http: Add the HTTP server sample application
Add the HTTP server sample application on top of the
HTTP Parser Library.

This sample application is based on TCP and HTTP chunk
transfer code found at:

https://gerrit.zephyrproject.org/r/#/c/9977/

A README file with sample output and a detailed
description of this application is also provided.

Jira: ZEP-820
Jira: ZEP-1542
Jira: ZEP-1556

Change-Id: I649104a256190577000bbac118136d5bc21f83bf
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-03 15:59:20 +02:00
Luiz Augusto von Dentz e89aebc4d5 net: samples: Add CONFIG_NET_L2_BLUETOOTH_ZEP1656
This enables these samples to interoperate with Linux 6LoWPAN over
Bluetooth implementation while that is being fixed, in the long term
we might remove it from the samples once Linux is fixed.

Jira: ZEP-1656

Change-Id: I8ca9fe5a27f43cebc75b6fe5a436a5e8fcee26d5
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-02-03 15:59:20 +02:00
Flavio Santes 20bf36601b samples/net/dns: Update README file
The DNS client sample application was updated to use IP addresses
from the prj_*.conf files. This patch updates the README file to
reflect those changes.

Change-Id: Ic72510be8da208aef19fb188560221e1c2386457
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-03 15:59:19 +02:00
Anas Nashif 9051e1ab1d doc: net: use Qemu setup section in current documentation
Fix references to Qemu section and references to boards.

Change-Id: Ib2174ff698d57d3272073eecc71209e047961aaa
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-03 15:59:19 +02:00
Anas Nashif f75462984f doc: update networking with Qemu section
Copy the documentation from the Wiki over here, the cross linking
between online documentation and Wiki and duplication of information was
inconsistent and confusing. Put everything in one place.

Change-Id: Ia3aaec1b431477e2ec54dbec2ccaa655870b0ee3
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-03 15:59:19 +02:00
Vinicius Costa Gomes 88405fcd17 samples/zoap_server: Fix errors for GET requests without payloads
It doesn't really make sense for GET requests to have payloads, we
shouldn't even be checking if they have any payloads.

Change-Id: I4bb8cccd6c733a5825c2ca5067a990937c7045a6
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-02-03 15:59:19 +02:00
Flavio Santes 76785f0bcd samples/net/dns: Improve network configuration
- Reorganize some CONF variables and add the CONFIG_NET_SAMPLES_xxx
  variables to the DNS sample application.
- Remove all the numeric IP addresses
- Use the CONFIG_NET_SAMPLES_xxx variables to define the IP addresses

Change-Id: Ib294d338f163f03ea1b47143b489d916578c532d
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-03 15:59:18 +02:00
Flavio Santes 3a05189284 samples/net/dns: Move conf variables to config.h and delete unused defines
- Move the MAX_ADDRESSES macro to config.h.
  Document the meaning and usage of this macro

- Delete unused defines

Change-Id: I035feb605611e564db15cba77d6a3dce8409ca18
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-03 15:59:18 +02:00
Flavio Santes 660b0324e0 samples/net/dns: Add the FRDM_K64F board to the testcase.ini file
Add the FRDM_K64F board to the DNS sample app testcase.ini

Change-Id: Iea8f7d09ed0d793711a5807f4bb67ed35ebf52c1
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-03 15:59:18 +02:00
Flavio Santes 59b1384885 net/mqtt: Add the MQTT Publisher sample application
This commit adds the MQTT Publisher sample application for Zephyr.

The following MQTT API routines are exercised in this sample:

- mqtt_init
- mqtt_tx_connect
- mqtt_tx_pingreq
- mqtt_tx_publish
- mqtt_tx_disconnect

The following MQTT API data structures are used in this application:

- struct mqtt_ctx
- struct mqtt_connect_msg
- struct mqtt_publish_msg

This sample application exemplifies how to send MQTT PUBLISH messages
with different QoS values.

A README file is also included in this patch.

Change-Id: I2b41b276d5178a2cd1b07b031c38bff481885fff
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-03 15:59:18 +02:00
Jukka Rissanen cc9ec3488f samples: zperf: Enable TCP for zperf configuration
Change-Id: I0154c6d890a3bff5be2cad5ea621660bf46a158d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-03 15:59:17 +02:00
Jukka Rissanen 48b9b96d3f samples: zperf: Use native IP stack for TCP support
Enable zperf code to support TCP using the native IP stack
when testing the network throughput.

Change-Id: I3e58754cfff65525ad15e63adf57f1ea22e4559d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-03 15:59:17 +02:00
Michael Scott 1a21a36b7e samples: net: irc_bot: add DHCPv4 support
When CONFIG_NET_DHCPV4 is selected, ignore the CONFIG_NET_SAMPLES_MY_IPV4_ADDR
setting and instead used DHCPv4.

NOTE: This commit also adds a placeholder for DHCPv6 behavior which is not
yet functional.

Change-Id: Id31fcb99be46e966babf18f94b5dec151920dedc
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:17 +02:00
Michael Scott fab087e9ba samples: net: irc_bot: add DNS support
When CONFIG_DNS_RESOLVER is active, the PEER config will be ignored and
instead a DNS query for DEFAULT_SERVER will be used.

Change-Id: If2c699944027f3c6a8ae9654f9cda0d7dca387c8
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:17 +02:00
Michael Scott 2f10b31431 samples: net: irc_bot: add IPv4 support
NOTE: You must set CONFIG_NET_IPV6=n in the project .conf file for
the CONFIG_NET_IPV4 setting to take effect.

Only 1 IP connection is active at a time.  And when both are active
CONFIG_NET_IPV6 takes precedence.

Change-Id: I34a75f8d44db986810648d82a65d2ed29fc9a940
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:17 +02:00
Michael Scott 8a7e30609a samples: net: irc_bot: add FRDM K64F project .conf
Change-Id: Id16d379629bba2f4663355021c7510170cd42cba
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:16 +02:00
Michael Scott 2618fcfb3c samples: net: irc_bot: add Linaro copyright
Change-Id: Ic16902e6ce28765ffd8d9cb2f1699a33af19d1ae
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:16 +02:00
Michael Scott 103c1aff9b samples: net: irc_bot: handle messages across multiple fragments
Often IRC messages are split across multiple netbuf fragments.
Let's fix the message processing to account for this.

Change-Id: I3835af6adf337d27c28a0beeb72848dcc838772c
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:16 +02:00
Michael Scott 50a93d906d samples: net: irc_bot: create semi-unique IRC user names
IRC won't allow 2 users to use the same user name, so let's add
a random number to the end of "zephyrbot" to make it semi-unique.

Change-Id: I56349de21823d8fd2c52646656615b42fc12de5e
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:16 +02:00
Michael Scott fc9443209f samples: net: irc_bot: modify disco check in on_context_recv()
Currently, status can be 0 when a NULL buffer is sent to
on_context_recv() so let's not include status in our check.

And in the future, status parameter may be a non-zero value indicating
an error condition.  So modify check to include positive values as well.

NOTE: Also make sure to use NET_ERR in these cases and not NET_INFO.

Change-Id: I8eac9a86d22b3b5624cd7a4e9d99e57afcac035f
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:16 +02:00
Michael Scott 7f90bc7244 samples: net: irc_bot: dont hardcode NET_SYS_LOG_LEVEL
Instead let this be set via the project .conf file

Change-Id: Id8d7b46cc0888b83593b6f82dae619fb42c6ae3f
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:16 +02:00
Michael Scott 65abcd4580 samples: net: irc_bot: use irc parameter's connection
chan->irc won't be set after the "JOIN" transmit succeeds.

Change-Id: I935b0a44c94ec3d2c91b73db92bfd2005c27bb7f
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:16 +02:00
Michael Scott f6255a78ae samples: net: irc_bot: fix null pointer deref
samples/net/irc_bot/src/irc-bot.c:368:36:
warning: 'c' may be used uninitialized in this function
[-Wmaybe-uninitialized]
  for (cc = &chan->irc->chans, c = c->irc->chans;
                                   ^
As suggested by Leandro Pereira <leandro.pereira@intel.com>
adjusted to:
  for (cc = &chan->irc->chans, c = chan->irc->chans;

Change-Id: Icd490059e0b97f95408dd7bad3f1783a215c5edb
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:16 +02:00
Michael Scott 359ef02bdf samples: net: irc_bot: expand some char buffers
Making a bit more room in these buffers.  Some were not big enough
in certain cases, while others needed more room in general.

Change-Id: I47a4bb8c6635305f55dee323f7293b2e4cbed55a
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:16 +02:00
Michael Scott 267cbd9469 samples: net: irc_bot: simplify connect path
K_FOREVER timeout in net_context_connect() will wait until
SYNACK has been received and we're ready to proceed with socket
communication.

To make the code as clear as possible, let's remove 2 callback
functions and relocate that code inside zirc_connect().

Change-Id: I6c64852ad5f48b24e1e6a58a741981e7d07bfd40
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:16 +02:00
Michael Scott 36b551edeb samples: net: irc_bot: make some functions more accessible
Due to code restructuring we should move the following
functions higher in the code (above zirc_connect):
zirc_nick_set()
zirc_user_set()
zirc_chan_join()

Also relocate the function declaration for on_msg_rcvd()
to the top of the code.

Change-Id: I3936fb645b709dcbcfcc4212c127db819974c046
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:16 +02:00
Michael Scott f75c1fdabf samples: net: irc_bot: use #defines for server and port
Users can locate and edit these easier when they are at the
top as a #define.

Change-Id: Iecb53999cef1e70a80a28c7be5664ccde0fe7acf
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:16 +02:00
Michael Scott 81640ab197 samples: net: irc_bot: make panic() more accessible
By moving panic() function up to the top, other functions can be moved
later and still be able to call it.

Change-Id: I4290d1509cc64fc3f5fc5ec109cc19058090e6dd
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:15 +02:00
Michael Scott a1d630398f samples: net: irc_bot: remove sockaddr globals
Instead use helper function where necessary.

Change-Id: Idcb47d02966731d7ef18588d1dccc8031a38d9d0
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:15 +02:00
Michael Scott dbe4635368 samples: net: irc_bot: add helper function in_addr_set()
The aim of this helper function is to remove duplicate code for setting
the parameters of in_addr structures.

Change-Id: Id882a5947c47a9b6f92924ce8fb04023540fbb8d
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:15 +02:00
Michael Scott 01e3c3380f samples: net: irc_bot: remove unneeded typecasts and extra var
From function: zirc_connect

Change-Id: Ie0abc919c62b12995af7605bd080eafa48b48841
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:15 +02:00
Michael Scott 79dc068bea samples: net: irc_bot: release net_context reference upon error
Change-Id: I69451b3035d09c0de8ae0f448c80b780a09e72bd
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:15 +02:00
Michael Scott 14a6306069 samples: net: irc_bot: establish privmsg callback typedef
Change-Id: I005fc4d33da7b2c81e2add5e73f11f6c5bd2c42c
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:15 +02:00
Michael Scott ed7ea99244 samples: net: irc_bot: run sample process as a thread
This allows for a set app stack and threaded functions to be used later.

Change-Id: I647a3defdf6eb4cca2a4a21192b20641f5bf8d4a
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:15 +02:00
Leandro Pereira 2bcd700462 samples: net: Add IRC bot example
This is a sample IRC bot program, written using the new IP stack API.
All it does is join an IRC channel, wait for some commands, and react
to them:
	!hello will greet whoever sent the command
	!random will generate a pseudo-random number and send it back
	!led_toggle will toggle an LED in the board [1]
	!led_on will turn the LED on regardless of its current state
	!led_off will turn the LED off
	!rejoin will part the current channel and join again
	!disconnect will quit from the IRC server

As far as the IRC protocol goes, it doesn't do much more than this, but
it should be straightforward to add support for other things (such as
notices, CTCP, DCC, etc) if someone is inclined to do so.  However,
that's way beyond the scope of this sample, which is to show how to use
the network API to write a TCP client.

Some things are still missing as an example of how to use the APIs,
namely DNS resolution, automatically setting up the network with DHCP,
maybe saving settings on EEPROM.  These are good candidates to be added
in the future.

[1] The LED code has been shamelessly stolen from the CoAP sample code.

Change-Id: I7152e97c0726f3559db545579ae8ae8d07bf04cd
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:15 +02:00
Tomasz Bursztyka bc406fab08 samples/net: Add a simple telnet sample
It will setup IPv4/IPv6 addresses. Telnet is ran in the background,
along with net and kernel shell modules.

See the README.rst for more information how to start and use this
sample.

Change-Id: I3e935014c79b534aab43a6fa8256792b23abb38e
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-02-03 15:59:14 +02:00
Vinicius Costa Gomes d689c5ee97 samples/zoap_server: Add a 802.15.4 case to the test suite
Allow build-testing zoap-server with support for the CC2520 radio.

Change-Id: I986afd7b15208d477bd79f42a52dd45b217214cb
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-02-03 15:59:14 +02:00
Vinicius Costa Gomes 0ef657904d samples/zoap_server: Allow overriding the BOARD variable
In case the user wants to use BOARD make variable to conveniently use
another board with this sample.

Change-Id: I6dd0656da223218d116dd498c1336c890563b212
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-02-03 15:59:14 +02:00
Ravi kumar Veeramally b13f44bcdd net: utils: Add net_addr_ntop() helper function
net_addr_ntop() will convert IPv4|6 address to string form.
Renamed existing net_sprint_ip_addr_buf() to net_addr_ntop()
and adjusted parameters as per API.

Jira: ZEP-1638

Change-Id: Ia497be6bf876ca63b120529acbadcfd9162a96e3
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-02-03 15:59:14 +02:00
Tomasz Bursztyka 227bf97f60 samples/net: Fix a tiny mistake in dhcpv4_client README.rst
Change-Id: I7ce6e9a762f13d3db5d2769301719f17b798a4fe
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-02-03 15:59:14 +02:00
Paul Sokolovsky 63e6b60969 net: echo_server: Enable TCP for frdm_k64f
To match qemu_x86.

Change-Id: I04806d8a8850a76c984f3cda1efaa065bcf4596e
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-02-03 15:59:14 +02:00
Vinicius Costa Gomes f0f8a99257 samples/zoap_server: Enable support for 802.15.4
This configuration file allows using the device 802.15.4 radio for
IPv6 networks.

Change-Id: I9b3ee9a64acb71e97e4e8f7aae3e619196ad0462
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-02-03 15:59:13 +02:00
Michael Scott ca6a686495 net: correct in*_addr parameter of net_addr_pton()
Currently, the function accepts a struct sockaddr * but the code
immediately type casts this to either in_addr or in6_addr.  This is
incorrect behavior as the first field in a sockaddr is sa_family_t
and not address data.

So without special knowledge, a developer will use a sockaddr structure
as the parameter and then wonder why the address information isn't being
set correctly.

Let's change this parameter to void * which makes this function similar
to inet_pton().

Jira: ZEP-1616

Change-Id: I1fc9368da999d90feb07c03fac55dcc749d4eba6
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:13 +02:00
Piotr Mienkowski f5b3e2a09b samples: net: echo_server .conf for Atmel SMART SAM E70 Xplained board
Tested on Atmel SMART SAM E70 Xplained board

Origin: Original

Jira: ZEP-1492
Change-Id: If6acbaabf0857425684e0ab2d4db513e5bbc7b77
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2017-02-01 21:01:20 +00:00
David B. Kinder f3bc4c018d doc: fix .rst headings in new sample docs
Change-Id: I14230acb0fff64936c890478d5bf9bb81dcf9985
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-01-30 14:54:22 -08:00
Kumar Gala c9a4335ad3 samples: zperf: cleanup types for constant arrays
There are a few arrays we use with print_number and parse_number.  These
functions expect a const uint32_t so lets have the arrays for TIME_US,
KBPS, and K match.

Change-Id: I6347b06af2374d702144084bb6b538a478fb8fac
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-30 12:01:48 +00:00
Jukka Rissanen 7ad52b94cf net: echo-client: Add TCP support
This commit enables echo-client application to start to
send data over TCP connection.

Change-Id: I9acdaae7f1e8411952c30caeedc9c1fb07cdd448
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-01-27 15:06:06 +02:00
Andrei Emeltchenko 6043dddd4a net: Remove unused CONFIG_NET_IPV6_NO_DAD option
Option CONFIG_NET_IPV6_NO_DAD is not used anymore, clean project
configuration files.

Change-Id: I368e076d2f79f1d4bc86edee11ff5befe37362c8
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-01-27 12:35:54 +02:00
Tomasz Bursztyka 83ed3a29be net/ieee802154: Modify radio TX function signature
The cause for this change is TCP. Until now, the radio strategy driver
(ALOHA or CSMA) was providing the actual nbuf, and not the buffer
fragment, counting on the fact that the loop was using
net_buf_frag_del() which made so, iteration after iteration, buffer
framgent to be always buf->frags. The problem with this logic is loosing
the fragments that might be still referenced by TCP, in case the whole
buffer did not make it so TCP can retry later and so on.

Instead, TX now takes the nbuf and the actual frag to send. It could
have been working with just a pointer on the data, and the whole length
of the frame. But it has been avoided due to possible future devices,
that will be smarter and run CSMA directly in the hw, thus it will
require to access the whole buffer list through the nbuf.

Change-Id: I8d77b1e13b648c0ec3645cb2d55d1910d00381ea
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-27 12:35:53 +02:00
Andrei Emeltchenko 5794d80c10 net: Remove CONFIG_NET_IPV6_NO_ND config option
The option is no longer used so it can be removed.
Use CONFIG_NET_IPV6_ND option instead.

Change-Id: Ibaa3d3deb52b8b176e85f8b9e1d8c80c1026aea1
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-01-27 12:35:53 +02:00
Sergio Rodriguez 98d7ff0013 samples/coaps_client CoAP over DTLS client example app using mbedTLS
Jira: ZEP-941

Change-Id: Ia49087b75b33bcedb1b77b6a062368281c41e479
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-01-27 12:35:53 +02:00
Sergio Rodriguez 3818af4a7b samples/coaps_server CoAP over DTLS server example app using mbedTLS
Jira: ZEP-942

Change-Id: I810fccfed912d9de62073a9a4e943b7924aa6392
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-01-27 12:35:53 +02:00
Tomasz Bursztyka 507fa88734 samples/net: Add telnet console support on echo_server with qemu
This is meant to test telnet console easily, as echo_server already
enables net shell module etc.

Change-Id: I045340ae5d6e179ea5ce1416cd7d67c6956bd973
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-27 12:35:53 +02:00
Johann Fischer ed6712fa23 samples: net: add configs for MCR20A
Add configs for MCR20A device to echo_server and echo_client.

Change-Id: Ic0e310c0eb2eefe6ce5752a20b0c079b7ea8757c
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-01-27 12:35:51 +02:00
Johann F 12306df1ad samples: ieee802154: add MCR20A
Add MCR20A to 802154 driver test application.

Change-Id: I18d4178668542c1da197d5a2b3b0b502c9b128c1
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-01-27 12:35:51 +02:00
Ravi kumar Veeramally 5e5b187371 net: samples: Fix config option
Only CONFIG_NET_SLIP_TAP will select SLIP, UART_PIPE,
UART_INTERRUPT_DRIVEN and SLIP_TAP. Otherwise apps will crash on
qemu.

Jira: ZEP-1617

Change-Id: Ibefbe708deb05e28b43ed4225211a5af655cec8d
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-01-27 12:35:51 +02:00
Ravi kumar Veeramally 5cf134f45a net: samples: Use lighter printk() instead of printf()
Use printk(), snprintk() instead of printf() and snprintf().
CONFIG_STDOUT_CONSOLE is anyway disabled by default so printf()
will not output anything without it.

Change-Id: Ide24e4d669e9821289189ed28e30a596120d9611
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-01-27 12:35:51 +02:00
Ravi kumar Veeramally 395ad208b1 samples: net: Add DHCPv4 sample application README file
Instructions to verify DHCPv4 client functionality in QEMU and
FRDM_K64F.

Change-Id: I623128186387c0c3237c8e759b949a3d0fde0993
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-01-27 12:35:50 +02:00