Commit graph

99553 commits

Author SHA1 Message Date
Kumar Gala
c7bc909914 tests/ztest: rename assert macros to be zephyr specific
ztest has a number of assert style macros and used a baseline assert()
that varies from the system definition of assert() so lets rename
everything as zassert to be clear.

Change-Id: I7f176b3bae94d1045054d665be8b5bda947e5bb0
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-13 21:17:33 +00:00
Max Filippov
a0fa4f3265 xtensa: use -mlongcalls instead of --longcalls
gcc only understands -mlongcalls form of this option, xcc understands
both. Use -mlongcalls for building with both xcc and gcc.

Change-Id: I93f65ccbc97429ae564f1986120b37ce205ee38c
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2017-04-13 20:33:28 +00:00
Max Filippov
ac430f9595 xtensa: conditionally define endianness macros
__BYTE_ORDER__, __ORDER_BIG_ENDIAN__ and __ORDER_LITTLE_ENDIAN__ are not
defined when building with xcc, but are defined when building with gcc.
Define them conditionally.

Change-Id: Ib205ffee28360aa240d61731b7a3d6f45401b4c1
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2017-04-13 20:33:27 +00:00
Max Filippov
0ad868a58c xtensa_sim_console: fix simcall
simcall must be in the volatile asm so that gcc does not optimize it
out. It also needs "memory" clobber to make sure data passed through
memory buffer is actually written back before the simcall.

Change-Id: I410b7348bf605d0d08f81ec5395f6cb144f33a43
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2017-04-13 20:33:27 +00:00
Anas Nashif
ed3d7c1de5 build: make sure we are calling python3 in all scripts
Jira: ZEP-1759
Change-Id: I0fc7329f806ca0049c555d3402dd145e92e54028
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-13 20:22:54 +00:00
Andrew Boie
b53145c6bc ztest: apply extra stack size to ztest stack
The directive exists for platforms that require more stack space than
usual. However, it wasn't being applied to the ztest thread stack
which ztest-enabled cases are run on.

Fixes numerous failures on xtensa simulator targets.

Change-Id: Iafa84de002421f03729c0f0cdeefdea51842ae32
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-04-13 12:45:36 -07:00
Andrew Boie
a883722fb6 tests: test_pipe_api: increase stack size
A recent patch added some new tests here. Unfortunately,
the current stack size value of 512 was too small for Xtensa.
Increase it to 1024.

Change-Id: I16c52b74412cbd7665e774ce3baed260885ddb9b
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-04-13 18:58:51 +00:00
Andrew Boie
d75fa6bc13 tests: sprintf: increase stack size
A recent patch pinned the stack size for this test at 1024
instead of the platform default. This value wasn't sufficient
on Xtensa. Set to 2048, which was the default on most platforms.

Change-Id: I9a9d5fd448d2377aaf782c2c093a16147f31886a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-04-13 18:58:24 +00:00
Mazen NEIFER
a6e0404983 xtensa port: Fixed crash on startup on CP enabled cores
The issue was that cpStack was changed to a memory buffer by commit
https://gerrit.zephyrproject.org/r/#/c/12816
However the assembly code was expecting it to be a pointer and thus
issuing an indirection, that leads to wrong addresses.

The fix removed this unnecessary indirection and thus the inherent
invalid memory access exception.

Issue: ZEP-1997
Change-Id: I843f049212f2d116a01b05367a284209f463a5e7
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-04-13 11:54:49 -07:00
Andrew Boie
6e1ff792fc sanitycheck: remove hifi_mini from arch config
Change-Id: I24eca1d3f95a4941e5efe1bfbc4905c38d7cb253
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-04-13 11:54:49 -07:00
Andrew Boie
6311ede125 xtensa: remove hifi_mini sim target
The core build in the SDK does not have a timer, making it impossible
to use this core with most of the sanity checks. We are working on
getting a special package of cores for Zephyr which meet our build
requirments; until then, remove this core as it doesn't build.

Change-Id: I3fa201f3c6b5724501e8cb1e1b8ba631436ebc23
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-04-13 11:45:52 -07:00
Kumar Gala
46e4755d63 Revert "Revert "scripts: devicetree: Handle mixed case node names""
Yes, revert the revert, was a little too quick to apply this.  The fix
is to cleanup the dtsi file in question.

This reverts commit 6702686976.

Change-Id: I933fad9d96ec6375eda33f0b012349f1c39e261f
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-13 15:02:13 +00:00
Kumar Gala
1df7eba02c dts: arm: ti: Use hardcoded addresses in cc32xx_launchxl.dtsi
In general we should be using hardcoded addresses in the dtsi files
rather than getting ifdef from other places.  As the unit address of the
node is typically based on the address in hex w/o the '0x' we can't just
use #defines directly.

Change-Id: I0e17e001151728d16842806d9407e66e6e5129cf
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-13 15:01:57 +00:00
Jukka Rissanen
711da3a10f Merge net branch into master
Main changes:

- IPv6 fragmented packet support added.
- DNS client API removed.
- New network test case which enables all config options.
- More network management events for IPv6.
- IRC bot sample to support DNS resolver API.
- Network interface structure memory savings.
- crc16 implementation added.
- IEEE 802.15.4 TX power setting support added.
- Fixes for accessing unaligned network data.
- nbuf network buffer fixes.
- DNS resolver, IPv6, RPL and TCP fixes.
- Ethernet sam_gmac and mcux driver memory leak fixes.
- Network management API fixes.
- MQTT test cases added.

----------------------------------------------------------------
Andrei Emeltchenko (1):
      net: nbuf: Implement net_nbuf_append_le32 helper

Bogdan Davidoaia (2):
      net: use UNALIGNED_GET in net_addr_ntop
      net: use UNALIGNED_GET/PUT to access IP address

Jukka Rissanen (26):
      net: tcp: Store MSS in tcp header correctly
      net: dns: Invalid memory access
      tests: net: tcp: Fix NULL pointer dereference
      drivers/eth/mcux: Make sure not to leak net_buf in RX
      net: nbuf: Add function to split a data fragment
      net: ipv6: Support fragmented IPv6 packets
      net: ipv6: Add helper to get the last extension header
      net: shell: Add IPv6 fragmentation info printing
      net: rpl: Add checks for probing timer
      net: rpl: Fix the statistics collection
      net: ipv6: Allow user to tweak packet hop limit value
      net: dns: Set the address family and address length correctly
      net: dns: Add more debugging about configured servers
      net: dns: Fix the documentation errors in header file
      net: dns: Fix the compilation even if DNS is disabled
      net: route: Fix compilation error
      net: rpl: Fix compilation if CONFIG_NET_RPL_MOP3 is enabled
      net: rpl: Fix compilation if MRHOF is enabled
      net: shell: Fix printk format for multicast routes
      net: tests: Enables all net kconfig options in one test case
      net: ipv6: Fix the constness of function parameters
      net: mgmt: Add IPv6 DAD succeed/failed event
      samples: net: irc-bot: Use DNS resolve API
      net: dns: Remove dns_client API and sample application
      net: if: Repack net_if_addr struct to save space
      net: if: Reshuffle fields in net_if and related structs

Luiz Augusto von Dentz (3):
      net: buf: Print pool name if available
      net: ipv6: Fix not initializing delayed work
      net: ipv6: Rework net_ipv6_nbr_add

Patrik Flykt (2):
      crc16: Create function for computing CRC 16
      unit: Create ztest unit test for CRC16 functionality

Piotr Mienkowski (1):
      drivers: eth_sam_gmac: Make sure not to leak net_buf in RX

Tomasz Bursztyka (11):
      tests/net: MQTT tests should be under lib
      tests/net: arp_input() unref the buffer on success
      net: Make sure IP layer events have fully differentiated layer code
      net/ieee802154: aux sec header frame counter is in little endian
      net/nbuf: Add an attribute to store/get IEEE 802.15.4 RSSI on RX
      drivers/ieee802154/cc2520: Set the current rx frame RSSI into its nbuf
      net/ieee802154: Fixing a typo in net_mgmt settings accessor
      net/ieee802154: Expose TX power setting through net mgmt API
      net/ieee802154: Add a Kconfig option to set a default tx power
      net/ieee802154/samples: Add a Kconfig option to tweak the TX power
      net/ieee802154: Add ieee15_4 shell module functions to set/get tx power

Wu Jiequan (3):
      tests: net: Add mqtt testcases
      samples: net: http_server: Add bt test and arduino 101 support
      net: coaps_server: add prj_arduino_101.conf file

june li (1):
      net: tcp: Release buf after failing to send

 .known-issues/doc/networking.conf                  |   12 -
 doc/api/networking.rst                             |    6 +-
 doc/zephyr.doxyfile                                |    2 +-
 drivers/Makefile                                   |    1 +
 drivers/crc/Makefile                               |    1 +
 drivers/crc/crc16_sw.c                             |   35 +
 drivers/ethernet/eth_mcux.c                        |    4 +-
 drivers/ethernet/eth_sam_gmac.c                    |    4 +-
 drivers/ieee802154/ieee802154_cc2520.c             |    7 +-
 include/crc16.h                                    |   66 +
 include/net/dns_client.h                           |  107 --
 include/net/dns_resolve.h                          |   27 +-
 include/net/ieee802154.h                           |   15 +
 include/net/nbuf.h                                 |  159 ++
 include/net/net_event.h                            |   12 +-
 include/net/net_if.h                               |  148 +-
 include/net/net_ip.h                               |   70 +-
 samples/net/coaps_server/prj_arduino_101.conf      |   46 +
 samples/net/common/ieee802154_settings.c           |    5 +-
 samples/net/dns_client/sample_output_IPv4.txt      |   46 -
 samples/net/dns_client/sample_output_IPv6.txt      |   39 -
 samples/net/dns_client/src/Makefile                |    7 -
 samples/net/dns_client/src/config.h                |   38 -
 samples/net/dns_client/src/main.c                  |  198 ---
 samples/net/dns_client/testcase.ini                |    4 -
 samples/net/{dns_client => dns_resolve}/README.rst |  110 +-
 samples/net/http_server/prj_arduino_101.conf       |   45 +
 samples/net/http_server/prj_bt.conf                |   46 +
 samples/net/http_server/src/Makefile               |    5 +-
 samples/net/http_server/src/main.c                 |   27 +
 samples/net/http_server/testcase.ini               |    8 +-
 samples/net/irc_bot/prj_frdm_k64f.conf             |   22 +-
 samples/net/irc_bot/prj_qemu_x86.conf              |   20 +-
 samples/net/irc_bot/src/irc-bot.c                  |  365 +++--
 subsys/net/buf.c                                   |   15 +-
 subsys/net/ip/6lo.c                                |   31 +-
 subsys/net/ip/Kconfig.app                          |    7 +
 subsys/net/ip/Kconfig.ipv6                         |   32 +
 subsys/net/ip/Kconfig.rpl                          |    7 +
 subsys/net/ip/connection.c                         |   22 +-
 subsys/net/ip/ipv6.c                               | 1568 ++++++++++++++------
 subsys/net/ip/ipv6.h                               |   61 +
 subsys/net/ip/l2/ieee802154/Kconfig.radio          |    9 +-
 subsys/net/ip/l2/ieee802154/ieee802154.c           |    5 +
 subsys/net/ip/l2/ieee802154/ieee802154_frame.c     |    5 +-
 subsys/net/ip/l2/ieee802154/ieee802154_mgmt.c      |   19 +-
 subsys/net/ip/l2/ieee802154/ieee802154_shell.c     |   34 +
 subsys/net/ip/nbuf.c                               |   53 +
 subsys/net/ip/net_core.c                           |   13 +-
 subsys/net/ip/net_if.c                             |   48 +-
 subsys/net/ip/net_private.h                        |    5 +
 subsys/net/ip/net_shell.c                          |   42 +-
 subsys/net/ip/net_stats.c                          |    4 +-
 subsys/net/ip/route.c                              |    2 +-
 subsys/net/ip/rpl-mrhof.c                          |    4 +-
 subsys/net/ip/rpl.c                                |   41 +-
 subsys/net/ip/rpl.h                                |   24 +-
 subsys/net/ip/tcp.c                                |   14 +-
 subsys/net/ip/utils.c                              |   10 +-
 subsys/net/lib/dns/Makefile                        |    1 -
 subsys/net/lib/dns/README                          |   18 -
 subsys/net/lib/dns/dns_client.c                    |  362 -----
 subsys/net/lib/dns/resolve.c                       |   24 +-
 tests/net/all/Makefile                             |    4 +
 tests/net/all/prj.conf                             |  237 +++
 tests/net/all/src/Makefile                         |    2 +
 tests/net/all/src/main.c                           |   27 +
 tests/net/all/testcase.ini                         |    5 +
 tests/net/arp/src/main.c                           |    2 -
 tests/net/lib/mqtt_publisher/Makefile              |    8 +
 .../net/lib/mqtt_publisher}/prj_arduino_101.conf   |   48 +-
 .../net/lib/mqtt_publisher}/prj_frdm_k64f.conf     |   19 +-
 .../net/lib/mqtt_publisher}/prj_qemu_x86.conf      |   27 +-
 tests/net/lib/mqtt_publisher/src/Makefile          |    3 +
 tests/net/lib/mqtt_publisher/src/config.h          |   42 +
 tests/net/lib/mqtt_publisher/src/main.c            |   24 +
 .../net/lib/mqtt_publisher/src/test_mqtt_publish.c |  448 ++++++
 tests/net/lib/mqtt_publisher/testcase.ini          |    4 +
 .../net/lib/mqtt_subscriber}/Makefile              |    7 +-
 tests/net/lib/mqtt_subscriber/prj_arduino_101.conf |   52 +
 tests/net/lib/mqtt_subscriber/prj_frdm_k64f.conf   |   39 +
 tests/net/lib/mqtt_subscriber/prj_qemu_x86.conf    |   40 +
 tests/net/lib/mqtt_subscriber/src/Makefile         |    9 +
 tests/net/lib/mqtt_subscriber/src/config.h         |   42 +
 tests/net/lib/mqtt_subscriber/src/main.c           |   24 +
 .../lib/mqtt_subscriber/src/test_mqtt_subscribe.c  |  483 ++++++
 tests/net/lib/mqtt_subscriber/testcase.ini         |    4 +
 tests/net/nbuf/src/main.c                          |  100 ++
 tests/net/rpl/prj.conf                             |    2 +-
 tests/net/tcp/src/main.c                           |    2 +-
 tests/unit/drivers/crc/Makefile                    |    3 +
 tests/unit/drivers/crc/main.c                      |   26 +
 tests/unit/drivers/crc/testcase.ini                |    4 +
 93 files changed, 4197 insertions(+), 1727 deletions(-)
 create mode 100644 drivers/crc/Makefile
 create mode 100644 drivers/crc/crc16_sw.c
 create mode 100644 include/crc16.h
 delete mode 100644 include/net/dns_client.h
 create mode 100644 samples/net/coaps_server/prj_arduino_101.conf
 delete mode 100644 samples/net/dns_client/sample_output_IPv4.txt
 delete mode 100644 samples/net/dns_client/sample_output_IPv6.txt
 delete mode 100644 samples/net/dns_client/src/Makefile
 delete mode 100644 samples/net/dns_client/src/config.h
 delete mode 100644 samples/net/dns_client/src/main.c
 delete mode 100644 samples/net/dns_client/testcase.ini
 rename samples/net/{dns_client => dns_resolve}/README.rst (55%)
 create mode 100644 samples/net/http_server/prj_arduino_101.conf
 create mode 100644 samples/net/http_server/prj_bt.conf
 delete mode 100644 subsys/net/lib/dns/README
 delete mode 100644 subsys/net/lib/dns/dns_client.c
 create mode 100644 tests/net/all/Makefile
 create mode 100644 tests/net/all/prj.conf
 create mode 100644 tests/net/all/src/Makefile
 create mode 100644 tests/net/all/src/main.c
 create mode 100644 tests/net/all/testcase.ini
 create mode 100644 tests/net/lib/mqtt_publisher/Makefile
 rename {samples/net/dns_client => tests/net/lib/mqtt_publisher}/prj_arduino_101.conf (72%)
 rename {samples/net/dns_client => tests/net/lib/mqtt_publisher}/prj_frdm_k64f.conf (75%)
 rename {samples/net/dns_client => tests/net/lib/mqtt_publisher}/prj_qemu_x86.conf (68%)
 create mode 100644 tests/net/lib/mqtt_publisher/src/Makefile
 create mode 100644 tests/net/lib/mqtt_publisher/src/config.h
 create mode 100644 tests/net/lib/mqtt_publisher/src/main.c
 create mode 100644 tests/net/lib/mqtt_publisher/src/test_mqtt_publish.c
 create mode 100644 tests/net/lib/mqtt_publisher/testcase.ini
 rename {samples/net/dns_client => tests/net/lib/mqtt_subscriber}/Makefile (60%)
 create mode 100644 tests/net/lib/mqtt_subscriber/prj_arduino_101.conf
 create mode 100644 tests/net/lib/mqtt_subscriber/prj_frdm_k64f.conf
 create mode 100644 tests/net/lib/mqtt_subscriber/prj_qemu_x86.conf
 create mode 100644 tests/net/lib/mqtt_subscriber/src/Makefile
 create mode 100644 tests/net/lib/mqtt_subscriber/src/config.h
 create mode 100644 tests/net/lib/mqtt_subscriber/src/main.c
 create mode 100644 tests/net/lib/mqtt_subscriber/src/test_mqtt_subscribe.c
 create mode 100644 tests/net/lib/mqtt_subscriber/testcase.ini
 create mode 100644 tests/unit/drivers/crc/Makefile
 create mode 100644 tests/unit/drivers/crc/main.c
 create mode 100644 tests/unit/drivers/crc/testcase.ini

Change-Id: I90549f6ba36041741b257be0d63e8bad8ad802b8
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-04-13 15:49:22 +03:00
Andrew Boie
6922a22c28 xtensa: add simulator targets for more SOCs
Change-Id: Ibceaf01ed71783c597b030bcc5778da6a03e5699
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-04-13 12:42:07 +00:00
Andrew Boie
d73641c50b xt-sim: remove extraneous C file
Change-Id: I8f2ac2e743e57e6a591b2f995fbef97ecfebf46e
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-04-13 12:42:06 +00:00
Andrew Boie
11ee791b32 xtensa: build similar to other Zephyr arches
* CONFIG_SOC is now properly set and we do not need a separate
  XTENSA_CORE build variable

* Some unnecessary macro -D CFLAGS in the Xtensa Makefile removed

* There is no default SOC selection, it is now done explicitly in
  the board's defconfig

* CONFIG_<board name> now renamed to CONFIG_SOC_<board name in
  uppercase> to conform to established style.

Issue: ZEP-1711
Change-Id: I88997530db09970b7fdd1c3e3d355bfca9d0be1a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-04-13 12:42:06 +00:00
Bogdan Davidoaia
290e1d8451 net: use UNALIGNED_GET/PUT to access IP address
Use UNALIGNED_GET and UNALIGNED_PUT throughout the networking stack to
access fields from the IP address structure. These structures can be
mapped directly to buffers and the macros are required for correct
unaligned memory access.

Jira: ZEP-2012

Change-Id: I55f9da7b143a22fa869d5d215c661de988cd9b91
Signed-off-by: Bogdan Davidoaia <bogdan.davidoaia@linaro.org>
2017-04-13 15:21:46 +03:00
Andrei Emeltchenko
01a9e4001d net: nbuf: Implement net_nbuf_append_le32 helper
net_nbuf_append_le32 helper appends le32 data to the packet, this is
needed in some Thread headers using LE data.

Change-Id: I04233ca064c2e23ec5c53979ac234adfe0ccb9dd
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-04-13 15:21:46 +03:00
Tomasz Bursztyka
987df43ba5 net/ieee802154: Add ieee15_4 shell module functions to set/get tx power
Change-Id: I1245686118daa1c81691694b4b4c1512847beca0
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-04-13 15:21:46 +03: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
Tomasz Bursztyka
26b5f94a79 net/ieee802154: Add a Kconfig option to set a default tx power
Change-Id: Ife2af22c13954286d8e44c3e0b1f60962c617c52
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-04-13 15:21:46 +03:00
Tomasz Bursztyka
951294f15e net/ieee802154: Expose TX power setting through net mgmt API
This permits to tweak the TX power in dbm.

Change-Id: Idadff397941a39010ce3c374d9ca74b777934626
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-04-13 15:21:46 +03:00
Tomasz Bursztyka
63619b503f net/ieee802154: Fixing a typo in net_mgmt settings accessor
s/SET/GET obviously

Change-Id: Ibaad65f846fef8b1b7839616b2022fad6548612a
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-04-13 15:21:45 +03:00
Tomasz Bursztyka
feaa1e1371 drivers/ieee802154/cc2520: Set the current rx frame RSSI into its nbuf
Change-Id: I215a8ceaa066a8521a2f647746301dbec780b43f
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-04-13 15:21:45 +03:00
Tomasz Bursztyka
192435ae2b net/nbuf: Add an attribute to store/get IEEE 802.15.4 RSSI on RX
This way, the driver will be able to pass the RSSI of the frame it just
received.

Change-Id: I08e7565e35b4fb087cf348bce01722ab25d59f0f
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-04-13 15:21:45 +03:00
Jukka Rissanen
f8c9439908 net: if: Reshuffle fields in net_if and related structs
This does not save any space but sets the fields in the
structs in more natural order. Move IPv6 related
fields in net_if into internal ipv6 struct so that all
IPv6 fields are located inside one struct. Same thing
is done for IPv4 fields which are now located inside
IPv4 internal struct in net_if.

There is no functionality changes by this commit.

Change-Id: I7d72ec0a28e2b88c79a4c294655d5ef6da6ccb25
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-04-13 15:21:45 +03:00
Jukka Rissanen
8b8371f573 net: if: Repack net_if_addr struct to save space
Shuffle the fields to different order in net_if_addr struct.
This saves space in net_if struct. This saved 4.8% memory,
640 bytes in original versus 608 bytes after this commit, when
allocating net_if using minimal amount of address counts and
IPv4, DHCPv4 and IPv6 enabled.

Change-Id: I591543cded587178cf6f82189953bb2e99c2188a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-04-13 15:21:45 +03:00
Tomasz Bursztyka
62b710384d net/ieee802154: aux sec header frame counter is in little endian
So manipulating it requires to be ready to swap it if the CPU is BE.

Change-Id: I8d657c31cecfc9f3fcd010efbb6d090bf021f5f5
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-04-13 15:21:45 +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
Jukka Rissanen
57e128654b net: mgmt: Add IPv6 DAD succeed/failed event
We need a way to know when IPv6 address is successfully set
into network interface.

If IPv6 DAD (Duplicate Address Detection) succeeds or fails,
we send a management event for that. This can be used by
other components to detect when the network interface is in
usable state.

Change-Id: Ifb22415fe21f31f5dba4f55455d6e0f89b414d32
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-04-13 15:21:45 +03:00
Jukka Rissanen
528a393470 net: ipv6: Fix the constness of function parameters
Some of the IPv6 utility functions were missing const in
one of the parameters that are not modified by the corresponding
function.

Change-Id: Ic9fe53daac288570c14423fd9410dcf15d1c5cfa
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-04-13 15:21:44 +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
Tomasz Bursztyka
e896d18a63 net: Make sure IP layer events have fully differentiated layer code
Layer code should be made so that masking them don't overlap with
another one in net_event code logic. Earlier it was possible to get
an IP addr event for IPv6 even though code would be only listening
for IPv4 one.

Reported-by: Xiaorui Hu <xiaorui.hu@linaro.org>

Change-Id: I8341a91d55556033dd228f68f8ca64e196f52bec
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-04-13 15:21:44 +03:00
Luiz Augusto von Dentz
076ddacca5 net: ipv6: Rework net_ipv6_nbr_add
This makes net_ipv6_nbr_add able to update entries so it can be reused
when receiving RA or NS requests, so it now performs a lookup before
creating a new entry (using nbr_new to reuse more code) and in case it
finds a match attempts to update the lladdr.

Change-Id: I305a67a955e037cbbb862fef947a5fcfe131507c
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-04-13 15:21:44 +03:00
Luiz Augusto von Dentz
8b23e3e984 net: ipv6: Fix not initializing delayed work
net_ipv6_nbr_add shall init the delayed work as nbr_new does, so this
unifies both codes into nbr_init which does take care of initializing
the fields properly.

Change-Id: I91746276d346a3dc3c36be20d49bcf1968245fc5
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-04-13 15:21:44 +03:00
Jukka Rissanen
bed1117423 net: tests: Enables all net kconfig options in one test case
This creates a test case that enables all the currently known
network related Kconfig options. This is useful so that we can
compile test various Kconfig options. Note that the result binary
is not meant to be run anywhere and it will probably not run as
some of the enabled options do not make sense in real life.

Change-Id: Iede36131b43d95acb78b4094004626e1b86e0f95
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-04-13 15:21:44 +03:00
Jukka Rissanen
07438ead0d net: shell: Fix printk format for multicast routes
Route lifetime was printed using wrong modifier.

Change-Id: Ib503d50b5817491984d51bbdaadf7457fdde178b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-04-13 15:21:44 +03:00
Jukka Rissanen
d1ac3d6914 net: rpl: Fix compilation if MRHOF is enabled
Make sure the RPL is compiled ok if CONFIG_NET_RPL_MRHOF is
enabled in the configuration.

Change-Id: I51fc0e20f854164c7e0374fa6a1ebf1d4e4dbc5b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-04-13 15:21:44 +03:00
Jukka Rissanen
43847e751d net: rpl: Fix compilation if CONFIG_NET_RPL_MOP3 is enabled
If multicast routing is set meaning that MOP3 (Mode of Operation)
is enabled, then the code was not compiling properly.

Change-Id: Ice8a9f7b705c781536d3c2c5ca6cc2bb77a7acc1
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-04-13 15:21:44 +03:00
Jukka Rissanen
c7102c77a2 net: route: Fix compilation error
Change-Id: Ib4ed6fffe637ac9cd67ce4685d540730c26c8339
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-04-13 15:21:44 +03:00
Jukka Rissanen
186939c43d net: dns: Fix the compilation even if DNS is disabled
Make sure that CONFIG_DNS_RESOLVER_MAX_SERVERS and
CONFIG_DNS_NUM_CONCUR_QUERIES are defined even if
CONFIG_DNS_RESOLVER is not enabled. This fixes compilation
error in this special case.

Change-Id: Icf1f247c138c379246ece57e78b04e70ae43cc1e
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-04-13 15:21:43 +03:00
Jukka Rissanen
83822b932a net: dns: Fix the documentation errors in header file
Change-Id: I516d5634a0f4d66ec15324fb856f9b313bc6f9d8
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-04-13 15:21:43 +03:00
Jukka Rissanen
4bcdf049bb net: dns: Add more debugging about configured servers
Print information about configured DNS servers when starting
in order to ease the debugging.

Change-Id: I3ba71e514e463db790b82913e4c66a67160366dc
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-04-13 15:21:43 +03:00
Jukka Rissanen
d31fa5b87c net: dns: Set the address family and address length correctly
We need to set the resolved IP address family and length
before calling the user callback so that callback does not
need to figure out these values itself.

Change-Id: I724909fc1707608ab8728231a0311795b6a313f3
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-04-13 15:21:43 +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
Piotr Mienkowski
323db1e366 drivers: eth_sam_gmac: Make sure not to leak net_buf in RX
Check net_recv_data() return value, if it returns an error release
the net_buf. Based on a fix in eth_mcux driver.

Change-Id: I44ca5fd8dfb7175620b7e8850a68443100039db6
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2017-04-13 15:21:43 +03:00
Tomasz Bursztyka
000539ecd2 tests/net: arp_input() unref the buffer on success
Since commit-id 1ab40390c9 arp_input()
unrefs the buffer on success (NET_OK) so no need to do it afterward.

Change-Id: I84ab7e8eb07f50d52b329e4c025d88753a5de4db
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-04-13 15:21:43 +03:00
Tomasz Bursztyka
19a321090c tests/net: MQTT tests should be under lib
moving tests/net/mqtt_* tests under tests/net/lib/

Change-Id: I966a6b303ad4d0fb467f277a4a7379b29fe40e98
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-04-13 15:21:43 +03:00