Commit graph

42249 commits

Author SHA1 Message Date
Jukka Rissanen
3d363db33c net: Remember IPv6 extension header len when packet is received
This is needed in other part of the stack in order to able to
parse packets properly.

Change-Id: I8082860333bdcb2c6114d517ff0b782b9ba526a0
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:08 +02:00
Jukka Rissanen
7e9eaaacb9 samples: net: Fix echo-server UDP packet sending
This commit fixes the case when we receive large amount of
data and then copy it into new fragments. If the MTU is larger
than the fragment size, then it is possible that we might
overwrite net_buf memory and crash. This is typical in ethernet
network.

Change-Id: Ib1c65819c3bc718ec04f558e3df235246b5655dd
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:08 +02:00
Sergio Rodriguez
8a7ca107b5 samples/mbedtls_dtlsclient: Using unified kernel thread spawn API
Change-Id: I760183861e458f3daf8d419a5234332141a732dc
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-12-02 12:41:07 +02:00
Sergio Rodriguez
67ce715d0d samples/mbedtls_dtlsclient: Removing unnecessary files
The DTLS client will not longer use the legacy IP stack.

Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
Change-Id: I7402a188fc7501873d98d3b6cb2f03ee51f3506b
2016-12-02 12:41:07 +02:00
Andrei Emeltchenko
afc122eeec drivers: cc2520: Remove double space in debug and errors
commit-id 67c465d2cc introduced this
weird format by not removing unnecessary spaces.

Change-Id: I964185c8a894cfcf10e253e6d378c63ec02ad8d7
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-02 12:41:07 +02:00
Tomasz Bursztyka
4438278133 net: ieee802154: Fix a double ll address swap
Commit 7bdd30d99d447b89b89c7fb0c76d52586744176f was properly swapping
incoming ll address, but in case of sending, frame creation logic is
already doing the job properly.

Change-Id: I864abba9b09f9176b3f1efec6055c193f3fbabc9
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:07 +02:00
Jukka Rissanen
f836032d39 samples: net: Bind any IPv6 address by default in echo-server
This commit allows echo-server to listen all defined addresses
specified to its network interfaces.

Change-Id: I52874210f6987c75d7921e514399a9eda55911bb
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:07 +02:00
Tomasz Bursztyka
ed6ccead1e drivers: ieee802154: Let the initialization priority be done via Kconfig
Since the whole init level changes: all drivers and most of subsystems
are initialized at level POST_KERNEL. Unfortunately that broke legacy
tweaks on what to start first and after.

Let's raise cc2520 priority, still below net_init.

Jira: ZEP-1261

Change-Id: I0d91aa87a893584b3f5b39a193c823127961402f
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:07 +02:00
Tomasz Bursztyka
54ddabc7e6 net: context: Instead of 0 as timeout, K_NO_WAIT is better.
Updating the API documentation to use K_NO_WAIT instead of 0.

Change-Id: I10ba31fe116210443f383b343993c3cca830a7c2
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:07 +02:00
Tomasz Bursztyka
3964a6cef3 samples: net: echo apps: Using unified kernel API
Dropping legacy API.

Change-Id: Ib1f2fbffddde02ea97ad2cb665d7fda77248d936
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:07 +02:00
Tomasz Bursztyka
85a8f8e6fa net: trickle: Using unified kernel API
Dropping legacy API. This commit also contains updated
unit tests in order to pass the test.

Change-Id: Ibc7426837e2f4f23bb5f3ed3719635c5c3d0ed0f
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:07 +02:00
Tomasz Bursztyka
06362ff5c6 tests: net: Using unified kernel API
Dropping legacy API.

Change-Id: Ife835e38fb03e909e89c3060771f42d1cfa12164
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:07 +02:00
Tomasz Bursztyka
8e075eb469 net: route/rpl: Using unified kernel API
Dropping legacy API.

Change-Id: If9f52f88c77e4e5ef19b9c0cc66c0d4e31efbe98
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:07 +02:00
Tomasz Bursztyka
500cc706b1 net: dhcpv4: Using unified kernel API
Dropping legacy API.

Change-Id: I0f1a04d0f9a19696ddb50d976beba00a19a830cd
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:07 +02:00
Tomasz Bursztyka
799c57b261 net: nbuf: Using unified kernel API
Dropping legacy API.

Change-Id: I8766a27f90c99aca0aa222833018a4dd8d65b885
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:07 +02:00
Tomasz Bursztyka
92700ee8ef net: tcp: Using unified kernel API
Dropping legacy API.

Change-Id: Ia1eecd5d6dad07f3e9272d7b62c0b7a4b939317b
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:06 +02:00
Tomasz Bursztyka
1aaf5aaa93 net: l2: Using unified kernel API
Dropping legacy API.

Change-Id: Icf24ecef714a9d6ddbe16aff6422b4fcc6c428e2
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:06 +02:00
Tomasz Bursztyka
710e6c327e net: ipv6: Using unified kernel API
Dropping legacy API.

Change-Id: I6e7887d8212ec59214b1c28dd9a3320b1a8fff1f
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:06 +02:00
Tomasz Bursztyka
aa9a552012 net: if: Using unified kernel API
Dropping legacy API.

Change-Id: I46eb30f691f5e0a9e9156f8b4dab3c00e64ffb9b
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:06 +02:00
Tomasz Bursztyka
bd293e4dd9 net: mgmt: Using unified kernel API
Dropping legacy API.

Change-Id: Ifcada6513cf57bf2b73809bd9ed886f2c623baab
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:06 +02:00
Tomasz Bursztyka
ea13cf8575 net: context: Using unified kernel API
Dropping legacy API.

Change-Id: I2f98ec39906bd8c0a8979171904d244b6a82a5e7
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:06 +02:00
Tomasz Bursztyka
f3cb3ff40e net: core: Using unified kernel API
Dropping legacy API.

Change-Id: I756e47855cc979aa130ad0de4fd527c4a79e8d71
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:06 +02:00
Tomasz Bursztyka
764cd1118b drivers: ieee802154: Using unified kernel API
Dropping legacy API.

Change-Id: Ifa3b61082036b0f7b593f1f28a30a1d0ad18e179
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:06 +02:00
Jukka Rissanen
aa438d10fe net: Add more debugging when receiving invalid packet
Also fix typo in debug print when discarding a packet.

Change-Id: I3ac41e86d7b2dc05b9d92cde93a646f2dc49d8c0
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:06 +02:00
Jukka Rissanen
40508b1747 net: nbuf: Add more debugging if ref count is wrong
Change-Id: I0fc77456c20b6ecd4066e8a70c1df4ecab9a689d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:06 +02:00
Andrei Emeltchenko
3d67b5badb wpan_serial: Correct SLIP buffer size
SLIP buffer size depends on maximum IEEE 802.15.4 frame size and start
byte.

Change-Id: I1cb0a848dce6b0c85bf11408733d777f7a3b03c9
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-02 12:41:06 +02:00
Flavio Santes
c55ca20ad4 iot/mqtt: Add support for frdm_k64f
This commit adds the frdm_k64f board to the testcase.ini while list.
It also updates the README file with the build instructions and
firmware version used in this test.

Change-Id: Ia0e989d483aede51aa53e7453bbd1c260223372d
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-02 12:41:06 +02:00
Leandro Pereira
0596472772 net: Fix connection-in-use test while unregistering connection
The bitwise and operator was being applied to a boolean operand because
of lack of parenthesis in the expression.

Change-Id: Ibfbdd8acce9db95f9274f48fd145f4d8467508e2
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2016-12-02 12:41:06 +02:00
Leandro Pereira
90f324869f net: Print more debug messages when processing corrupted buffers
Change-Id: I62fa8cd05b1b4598dfefc7a82b28467072b06ae3
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2016-12-02 12:41:05 +02:00
Piotr Mienkowski
93e46cc8d8 net: Definitions for IEEE 802.3, Section 2 MII compatible PHY transceivers
Origin: Original

Based on "IEEE Std 802.3-2008, Section 2" Chapter 22.2.4

Change-Id: I08516dd1c2f74c1324d00d665f221e01af25d7f1
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2016-12-02 12:41:05 +02:00
Jukka Rissanen
89a00ada23 net: Replace deprecated kernel init level
Replace NANOKERNEL by POST_KERNEL in the net stack.

Change-Id: Iaad7cdbe849741bc1cf18b0ccf7264417a9495d6
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:05 +02:00
Andrei Emeltchenko
f0e819faea wpanusb: Update wpan protocol document
Remove unneeded SET_HW_ADDR_FILT since it is handled by other
commands and add missing opcodes.

Change-Id: I4b6488e6cee742b79c16789e817795138506dc77
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-02 12:41:05 +02:00
Luiz Augusto von Dentz
59dfdf7c72 net: l2: Make NET_DEBUG_L2_BLUETOOTH depend on NET_L2_BLUETOOTH
Change-Id: I6244cb48304562d7430535c7df9fe2206c2c84b3
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-12-02 12:41:05 +02:00
Luiz Augusto von Dentz
cfef21d13c net: l2: Enable security for bluetooth driver
IPSP spec states other security level can be used depending on the use
case:

  7.1 Node Security Considerations
  This section describes the security requirements for the Node.
  The Node may use the SM Slave Security Request procedure to request
  an LE Security Mode other than LE Security Mode 1 Level 1 if required
  by the use case.

Change-Id: I24c6676bdb05099a7e222085ee41539994eea77f
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-12-02 12:41:05 +02:00
Luiz Augusto von Dentz
f2f96bc6f5 net: l2: Fix warning when building Bluetooth driver
Bluetooth driver requires BLUETOOTH_SMP in order to build properly since
BLUETOOTH_L2CAP_DYNAMIC_CHANNEL depend on it.

Change-Id: I7878c0c26ebf688b2a7321eb37025a9ebde6c6b8
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-12-02 12:41:05 +02:00
Tomasz Bursztyka
acc7e6a011 samples: net: Do not set nbuf data size on 802.15.4 samples
It's 127 by default as soon as 802.15.4 l2 is selected.

Change-Id: I6c29d88bb3277a15fe54693027caf320bc3d9fc4
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:05 +02:00
Tomasz Bursztyka
9c1d4c934d drivers: ieee802154: cc2520: Priority range is now 1-15
Thus setting a high priority of 2 on the rx fiber, as 0 is invalid.

Change-Id: I44a95f3648ca3fbf2eb699f1fa36963d6f3e5021
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:05 +02:00
Vinicius Costa Gomes
30dec49fd8 iot/zoap: Remove unnecessary cflags
These cflags were only needed when using the old network stack.

Change-Id: I660e397b2648137450c45d4f2edc8ec6ec7ae774
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-12-02 12:41:05 +02:00
Vinicius Costa Gomes
432c6b9997 samples/net: Add a simple demo for the link-format feature
This demo showcases how to expose resources that are exposed using the
link-format feature.

Change-Id: Iad9421082fae3212cae58e6d6e9b88fa170678b8
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-12-02 12:41:05 +02:00
Vinicius Costa Gomes
ac152ea884 iot/zoap: Add support for RFC6690 link format
RFC6690[1] defines a lightweight format for listing and querying
resources and their relationships.

The RFC defines an '.well-known/core' resource that will list the
resources and their associated metadata. It also allows resources to
filtered by their attributes.

The implementation uses the fact that resources are organized in an
array: only the resources present in the array after the
"ZOAP_WELL_KNOWN_CORE_RESOURCE" will be considered, this allows a
primitive form of visibility control for the attributes.

[1] https://tools.ietf.org/html/rfc6690

Change-Id: I2bc21ddf45f20e1f749d8ac36d247474fdaa9d64
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-12-02 12:41:05 +02:00
Vinicius Costa Gomes
ec184107be zoap: Add support for retrieving the underlying net_buf
Add an alternative to zoap_packet_get_payload(), that instead of
returning a byte array, returns the net_buf (with the COAP_MARKER
added, if needed) associated with the packet, positioned so the
application can add more data.

Change-Id: I7c955ef42f5ef8406d77da994d1673e6a69b0b6b
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-12-02 12:41:05 +02:00
Jukka Rissanen
1d86b236af net: nbuf: Fix UDP and TCP start of the packet calculation
The functions that return the start of the UDP and TCP buffers,
did not take the IP extension header length into account.

Change-Id: Ie3e2fbc49365de9176a788b54ab628e6ef37f5ee
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:04 +02:00
Jukka Rissanen
c5f8dc4748 net: ipv4: Move broadcast address getter to ipv4.c
More logical place for net_ipv4_broadcast_address() is in ipv4.c
instead of net_if.c.

Change-Id: I069f5030963bcb809df34e874054e2b7826ff868
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:04 +02:00
Jukka Rissanen
1b58d970ca net: ipv6: Move unspecified address getter to ipv6.c
More logical place for net_ipv6_unspecified_address() is in ipv6.c
instead of net_if.c. Removing the net_if_ipv6_unspecified_addr()
variant as it is no longer needed.

Change-Id: Ib5b4f6748030a8bf50fb848a87eef2968e2bcbc8
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:04 +02:00
Jukka Rissanen
59f4810d0a net: Allow binding to any IP address
The net_context_bind() was checking that the IP address is
specified before allowing the binding. If the user wants
to bind to any address, then this check needs to be relaxed
a bit.

Change-Id: Ic92b1ba616bf096551ee996fb9cdbf2c9d156f60
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:04 +02:00
Jukka Rissanen
b30bb36216 net: Add util to return IPv4 ANY address
Add function that returns IPv4 any address (all bits are zero).

Change-Id: I8816f7f264ad3a98fced7089f0b94220603c2291
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:04 +02:00
Tomasz Bursztyka
68bddda6de net: ieee802154: Create data frame after 6lo processing
6lo compresses and fragments the result. Result is that we might end up
with less fragments than earlier. So it's more logical to create the
15.4 frame _after_ 6lo compression/fragmentation. However, since 6lo
compresses the IPv6 header, it is not possible to use buffer's IPv6
distant address directly. Instead, we copy it locally before 6lo, and
use this copy to generate the 15.4 frames afterwards.

Change-Id: I1c7b1a1702daffd6be4cacd15011c84f0beb4b2f
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:04 +02:00
Tomasz Bursztyka
7edb182d63 net: Set nbuf user data size according to 802.15.4 MTU
When 802.15.4 L2 is built-in, let's set the nbuf user data size to 127
to avoid current limitation of nbuf not taking care of MTU by itself (so
it would fragment per-nbuf user data size, and not per-MTU).

Change-Id: I14e7b0df5ae24d5c0474d1f111fac59d795ab292
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:04 +02:00
Tomasz Bursztyka
23f6eb9953 drivers: ieee802154: Implement get_lqi() relevantly
Change-Id: Idc433b77ea3cb38af648d70ad285429c29e53c08
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:04 +02:00
Tomasz Bursztyka
bf33494e49 net: ieee802154: Let's ask LQI through driver API
Instead of appending the LQI into the buffer, which is an awkward usage.

Change-Id: I2f604cd61ef3b309cdfe304dac0ab1e7a2ca3f6a
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:04 +02:00