Commit Graph

232 Commits

Author SHA1 Message Date
Jesus Sanchez-Palencia 22e68cbc84 net: Remove EXPERIMENTAL label from net and bluetooth
These features set are not experimental anymore.

Change-Id: Ia9e4803982f625157e78c8002c38fed1e95c4892
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
2016-02-05 20:24:17 -05:00
Jukka Rissanen 01d8a82332 net: tinydtls: Add missing header files
Tinydtls had its own .gitignore file that masked away two
include files that are needed in compilation. Removed
the files from ignore file and added those two files.

Change-Id: Ibcfcf4e18ca8f56eef97d41464c4233148e9db9e
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:16:16 -05:00
Jukka Rissanen 3cf2e63f81 net: Check neighbor discovery option correctly
Use correct config option to either enable or disable
neighbor discovery.

Change-Id: If67219cfa71893d2805b37e5ab3bbd11af789cb5
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:16:16 -05:00
Jukka Rissanen d56ed452cb net: tools: Use default pipe names for 802.15.4 monitor tool
No need to give the pipe names as the default values can be
used instead.

Change-Id: I610d07b860a32b55e6c68e7b2869218b29c8f304
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:41 -05:00
Jukka Rissanen 062c467fac net: contiki: Run DAD in periodic timer
The duplicate address detection check was not run properly
in periodic timer. After this patch the IPv6 address is
marked properly as preferred if DAD succeeds.

Change-Id: I2b4ad91b2c851dca51a52635ef2dea92fb5b58b5
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:40 -05:00
Jukka Rissanen 80252f5cd2 net: Enable network statistics support
This is only meant for testing the network. This must not be
enabled in live system as it takes memory and processing power
for each sent or received network packet.

Change-Id: I223a087175b19c8561743a1fcceb659be2356c4d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:40 -05:00
Jukka Rissanen a67415ebb8 net: contiki: slip: Fix compile error when getting the MAC address
Change-Id: I75823ac9b71cefcfd1258471a93aa7e3e4511fac
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:40 -05:00
Jukka Rissanen 7d3e5f847f net: contiki: Add utility function to get the MAC address
Add function that returns the link address that the system
is using at the moment.

Change-Id: Id09aed3f6cbc4cd3ee694e18441f7443f0b7c3bf
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:40 -05:00
Jukka Rissanen 53a18f6c33 net: contiki: Call etimers correctly when they expire
Make sure the etimers are triggered in main event processing
function in tcpip.c

Change-Id: Ib521b9291c768245a9f35f3502b3b173abe08ee9
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:40 -05:00
Jukka Rissanen 88fcbd52d0 net: Create a separate fiber that handles Contiki timers
The Contiki etimers need polling which is handled by this fiber.
This fiber sleeps until next etimer is to be triggered. If the wakeup
time is long, we wait max 60 sec so that new timers can be triggered
also. This 60 sec timeout might be too long and require tweaking when
we know how the system behaves.
If there are no etimer event in the system, then the timer fiber
will only sleep 2 seconds before checking the timers again. This
interval might need tweaking also.

Change-Id: If34b97073882d8b273941cfb0be36df6aac97cf8
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:40 -05:00
Jukka Rissanen 68dce30b3f net: tools: Add radvd instructions to README file
Add sample radvd.conf and instructions how to use it in README
file. This is needed if user wants to use IPv6 SLAAC (stateless
address auto configuration) when using qemu setup.

Change-Id: I3c9c34cfcc1bc88117a1c70a5d3ef6b5e56739f1
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:40 -05:00
Jukka Rissanen 95ee00e099 net: contiki: Use new TX net_buf when sending NS packet
Allocate a new TX net_buf when sending neighbor solicitation
message instead trying to use the existing RX net_buf. This
simplifies and unifies the RX and TX buffer management.

Change-Id: Ia1c42f7fef720ad85fe1c599c3c2ec9ea2c024b5
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:40 -05:00
Jukka Rissanen 25e5ccdccb net: contiki: Add checks to not send NULL or empty net_buf
When sending IPv6 packet, make sure that the net_buf is valid.

Change-Id: I0027f42f307c09b3add42f430abf759bd88d63c5
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:40 -05:00
Jukka Rissanen 5604782d6c net: contiki: Send RS, RA and NS ICMPv6 messages properly
Allocate a separate buffer when sending RS, RA and NS ICMPv6
messages to the network.

The ICMPv6 messages are:
RS = router solicitation
RA = router advertisement
NS = neighbor solicitation

Change-Id: Ibe5a1701f78f72dce6460f77e9f659b16c355640
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:40 -05:00
Jukka Rissanen 1b1cb8e8fa net: contiki: Debug print enhancements in IPv6 ND code
Debug prints were missing line feeds + spaces in neighbor
discovery code.

Change-Id: I1373af38cc7eae103d1a1da527430f2eb63e6b7a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:40 -05:00
Jukka Rissanen f9a7e27220 net: contiki: Add Kconfig option to disable ND
User is able to disable IPv6 neighbor discovery.
Normally ND should be enabled but for testing purposes
the ND can be turned off as it simplifies the network
setup.

The default value atm is not to run ND because
we do not have a proper network setup. If user is
running qemu image, then ND should be disabled because
ND does not work properly with tun device.

Change-Id: I0ab7d6ee2ea3bc70918d9adf6f44473f71b3bd29
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:40 -05:00
Jukka Rissanen df30c05771 net: contiki: Fix compile error when sending IPv6 NS
Neighbor solicitation message sending had a typo.

Change-Id: Ia2a8b5c0eef60acc093463eb24f33bbe8fb93421
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:40 -05:00
Jukka Rissanen e37ed46b17 net: contiki: Timer handling fixes
Now we can wakeup properly if there are multiple Contiki etimers
in the system.

Change-Id: I356818f4b79427c9bf26afca31b1a0766760ca3d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:40 -05:00
Jukka Rissanen b342e41bb4 net: contiki: Fix clock_delay function
The clock_delay() function sleeps now correctly either
in micro or nano kernel.

Change-Id: I1df71b64c5f0b46d963ee117252e41be3ddfb1df
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:40 -05:00
Jukka Rissanen cd83fcd536 net: Enable timeouts and timers kernel support
IP networking depends on CONFIG_NANO_TIMEOUTS and
CONFIG_NANO_TIMERS support so select them automatically
in Kconfig.

Change-Id: Ib3a86ca5a2006da545bed8c13b631d6a8c45ea99
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:40 -05:00
Jukka Rissanen df8426aad1 net: tools: Move tools directory to net/ip
The net/ip/contiki/tools directory was not in proper place
as it contains also non Contiki code. The net/ip/tools is
a more suitable location.

Change-Id: I1eb621680d4247d56d67ea977120f3c67c013599
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:39 -05:00
Jukka Rissanen 23a0543aee net: apps: Add coap observe client
Add sample CoAP application for observe client functionality.

Change-Id: Ie2ee5d191bcc68ec634367c9b36e46ea4261d6b5
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:39 -05:00
Jukka Rissanen 088bb9cf0f net: coap: Observe client needs to allocate net_buf
The observe client routines need to allocate a net_buf that
will hold the sent UDP data.

Change-Id: Ia04aacdde266aa93de1b9941eeed0c8292ca83b8
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:39 -05:00
Jukka Rissanen 73e861d351 net: coap: Retransmit needs to allocate net_buf
When a transaction is retransmitted, we need to allocate a
net_buf that will hold the actual UDP packet to be sent.

Change-Id: Ie0d51694b5531938cd1da5c330a308e3e9fd1764
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:39 -05:00
Jukka Rissanen 5165b908b4 net: coap: Add coap_context_connect() for client
Add coap_context_connect() function so that client can use
it both in DTLS and normal connections.

Change-Id: Ibd8cff904e79a97f97ed6ff20d92078eff110e35
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:39 -05:00
Jukka Rissanen 5042669536 net: coap: Avoid floating point arithmetics
Use only integer arithmetics when calculating the timeout
value.

Change-Id: Ifc61e1eee4a9a680e9c4f8c89f146417d6cc5ba4
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:39 -05:00
Jukka Rissanen bfa8358b24 net: coap: Tweaked the debug print when transaction alloc fails
If the transaction allocation fails, then print additional
information in order to find the place of the failure.

Change-Id: Idd59969b2c5eff53170b51a471583ec8c837416a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:39 -05:00
Jukka Rissanen b9cc0e27f3 net: coap: Add util function to initialize the message id
The mid needs to be init from server and client code so
create a new function for it.

Change-Id: I662b64c207ac69288648ffbdc950896edd5ade52
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:39 -05:00
Jukka Rissanen c796f3cfcc net: contiki: Use Zephyr provided timer API
Refactor etimer and timer Contiki APIs to use the native
Zephyr timers. The Contiki way did not work well anyway
as we do not really have the process concept in Zephyr.

Change-Id: I14743707f3cf43eddfe914717b069204cde4bd65
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:39 -05:00
Jukka Rissanen 320df470b7 net: contiki: Clock returned wrong number of seconds
The clock_seconds() API returned wrong number of seconds since
initialization.

Change-Id: I4f0f6197327f4ebe12e2c37588d9611ec40d7643
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:39 -05:00
Jukka Rissanen 48186c99f5 net: Get debug info about available net buffers
Print additional information about how many net buffers
are available when allocating (get) or de-allocating (put)
them. The prints are only available if Kconfig option
CONFIG_NETWORKING_WITH_LOGGING is set.

Change-Id: I85e6a5813356d8fe00f0ba633c3ebf5379e56bff
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:39 -05:00
Jukka Rissanen 4d745b70b0 net: Create separate net_buf pool for RX and TX use
Have a separate network buffer pool for received and transmitted
data. This way incoming packet flood cannot prevent from sending
IP packets out.

Change-Id: I2aae3bcb4ea63f36355f758de44532b167edfdb8
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:39 -05:00
Jukka Rissanen c00a7aa320 net: tools: Add CoAP client
Add simple CoAP client that can be used to test
the CoAP server running in Zephyr inside qemu.
The coap-client is run in the host.

Change-Id: I50e4b0e13aa657a0d805b0438050b8b9187d3839
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:39 -05:00
Jukka Rissanen 6ed897f907 net: coap: Initial client support
Adding CoAP client support to Kconfig and Makefile.

Change-Id: I857169feac8b6c4347af4369b0cdfb806c6aedb0
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:39 -05:00
Jukka Rissanen 20b9a6f845 net: coap: Activate Erbium CoAP support
Add CoAP switches to Kconfig and enable them in Makefile.

Change-Id: I3d5e18f34c0ab0853838c2e883748dd4ae62aed2
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:39 -05:00
Jukka Rissanen 8848f33030 net: coap: Use CoAP context also in non-DTLS case
The use of CoAP context is needed as we do not have
global buffers any longer. This commit adds support
for CoAP context when user does not have DTLS enabled.

Change-Id: Ief716e2a3290bd1f7e5a3286a20deba690b3c1c5
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:39 -05:00
Jukka Rissanen 77b15eba04 net: coap: Port DTLS code to Zephyr
Make the DTLS code in CoAP context to work in Zephyr.

Change-Id: I0c9cd30a02fa6b3f0221f78e1dadd1d476bad646
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:39 -05:00
Jukka Rissanen 39e5eeef9d net: coap: Initial port to Zephyr
Initial port of er-coap code into Zephyr.

Change-Id: Icb45903387eb08418a3610c1bd0933a9a9c6f8dd
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:39 -05:00
Jukka Rissanen 036eda7b9f net: coap: Use uIP debug macros
Use the debug macros from uip-debug.h so that they are
in one place.

Change-Id: I342d727d4c6af9a655729db6245668968bee4b07
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:39 -05:00
Jukka Rissanen d60155d02f net: rest-engine: Initial commit
This is originally from git@github.com:YanziNetworks/netcontiki.git
commit e7d7ee5b142fb7b0695677dac9cc1899620b0fe0

Change-Id: I606b26420b9df841f03bc955039f25970553e481
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:39 -05:00
Jukka Rissanen 7da5d379e1 net: coap: Initial commit importing er-coap
This is originally from git@github.com:YanziNetworks/netcontiki.git
commit 02bb8eed066c012b4b6033cbe17a31ff15879a24

Change-Id: I4b19302266a6ff562532c493bb34b7cd9a27ee5d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:39 -05:00
Jukka Rissanen b617cbbfd1 net: tools: Usage info was missing -i option in echo-client
The -i (interface) option was not described in usage.

Change-Id: I50d01f0e639d3258234c5573abd8836a7144584e
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:38 -05:00
Jukka Rissanen 607bc6deb2 net: tools: Clarify how to run echo-server in host
Add note about possible firewall issue in host.
Make sure you run echo-server as a root user.

Change-Id: I9ebe06db799eef8664d7d7ccb38827280e338f9d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:38 -05:00
Jukka Rissanen 882d53dce8 net: tools: echo-client did not return proper error code
So return 0 if all the tests run ok, and !=0 if some failed.

Change-Id: Ib66d84dbcc6cc29e5e46609b1e2b1b1748ce6fcc
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:38 -05:00
Jukka Rissanen 662fc64009 net: Remove obsolete comment in net_init.c
Change-Id: I088c734317f0fe6efe1691fce26e2cab8febecb9
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:38 -05:00
Jukka Rissanen 1abb0b5792 net: Enhance debugging of mac net buffer allocations
Print information who allocated or freed mac net buffer.

Change-Id: I106e1703b7f5c3e5363d53d63c599a12b65577cb
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:38 -05:00
Jukka Rissanen b6230cac0a net: 15.4: Use stack analyze functions from net_buf.h
Use more generic stack analyze functions that are now
found in net_buf.h

Change-Id: I473665bbad8aa1a6749a4c5dc1d6952bdb56da5d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:38 -05:00
Jukka Rissanen 792bbbb6d8 net: Refactor the stack analyzer functions
Generalize the stack analyze functions so that they
can be used by other fibers.

Change-Id: If1fae51db45010b75f6ac58cd8d874b31ca336e2
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:38 -05:00
Jukka Rissanen 649a525329 net: Check NULL net_buf when releasing it
Make sure we are not trying to release a NULL net_buf.

Change-Id: Ie4d2e7cdbd4f85c5543874471cc7c7ce3bc0b9df
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:38 -05:00
Jukka Rissanen 4b5a1d7172 net: tinydtls: Do not access NULL net_buf
If the net_buf allocation fails, then return and do not
try to access it.

Change-Id: Ib4c4a0b3a6669f6e6030357f3f2dd9af4dc638c8
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:15:38 -05:00