Commit graph

18591 commits

Author SHA1 Message Date
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
Jukka Rissanen
42bd36ec77 net: ipv6: Allow user to tweak packet hop limit value
The default hop limit is defined in struct net_if. It is possible
that user might want to tweak it for each network packet. For this
purpose, a net_nbuf_set_ipv6_hop_limit(buf) function is created.

Change-Id: I7568330358f80f0f5007d6d3c411c120b043c04f
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-04-13 15:21:43 +03:00
Jukka Rissanen
31d3406efa net: rpl: Fix the statistics collection
The Kconfig.rpl file was missing option to actually collect
RPL statistics. Unified the config option name to be
CONFIG_NET_STATISTICS_RPL as there was two conflicting settings
in the code and both of them were missing from Kconfig file.

Change-Id: I4ce4fcbaa317b36cac315ea3b3f710fa7a344b25
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-04-13 15:21:42 +03:00
Jukka Rissanen
dc9f8629b2 net: rpl: Add checks for probing timer
The probing_timer is only available if CONFIG_NET_RPL_PROBING
is defined.

Change-Id: I2835d17e6c3d616f815f8beefd87d2571a5ad94c
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-04-13 15:21:42 +03:00
june li
961d7fc8f4 net: tcp: Release buf after failing to send
After failing to send the buf we need to release it.
This is not done for Bluetooth or IEEE 802.15.4 links which
create a copy of the sent buf and the failure case is already
checked by net_tcp_send_buf().

Change-Id: Ia556376b58ad74f68accb64eb2221a78d59dc2ec
Signed-off-by: june li <junelizh@foxmail.com>
2017-04-13 15:21:42 +03:00
Luiz Augusto von Dentz
9c0ea2b90b net: buf: Print pool name if available
In case CONFIG_NET_BUF_POOL_USAGE is defined use print pool->name
instead of the pointer.

Change-Id: I0be5fd8283a887145e61bdad02f721265453ce20
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-04-13 15:21:42 +03:00
Bogdan Davidoaia
8f97651d23 net: use UNALIGNED_GET in net_addr_ntop
Use UNALIGNED_GET in net_addr_ntop as the uint16_t pointer used in this
function can point to an unalined address.

Jira: ZEP-2012

Change-Id: Idfbfa8da4c8d4e10299c4ae4d6431b10466cc988
Signed-off-by: Bogdan Davidoaia <bogdan.davidoaia@linaro.org>
2017-04-13 15:21:42 +03:00
Wu Jiequan
0e3d582623 tests: net: Add mqtt testcases
Add two testcases for mqtt_publisher and mqtt_subscriber.
The combination of the two, covering most of the MQTT APIs.

Change-Id: Ib663ee1f550362ca493501046ddf8508a25ac956
Signed-off-by: Wu Jiequan <jiequanx.wu@intel.com>
2017-04-13 15:21:42 +03:00
Patrik Flykt
3f8f1ed3b0 unit: Create ztest unit test for CRC16 functionality
Ensure that the CRC16 functions compute a few test values properly.

Change-Id: Ie98049aefac8a330b9b81d3bf333deb09bc35c39
Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2017-04-13 15:21:42 +03:00
Patrik Flykt
bd75219ba0 crc16: Create function for computing CRC 16
Add the simplest possible CRC 16 function that computes the CRC value
without the help of lookup tables.

Change-Id: I9163389adaa4a70c4e8ce8ce6d5f0661f40c7871
Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2017-04-13 15:21:42 +03:00
Jukka Rissanen
70cdaba202 net: shell: Add IPv6 fragmentation info printing
If the IPv6 fragmentation support is enabled, then print current
status of the IPv6 packet reassembly in "net conn" command.

Change-Id: I384e35928b67dd39ac720c77683b1767e2a1ce88
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-04-13 15:21:42 +03:00
Jukka Rissanen
d8feb0a0e4 net: ipv6: Add helper to get the last extension header
Figure out what is the last extension header in IPv6 packet
and return offset to it. This is needed by IPv6 fragmentation
when fragmentation header is added to the packet.

Change-Id: I925ab806a5de076a425ff354711730d4f4b3c52f
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-04-13 15:21:41 +03:00
Jukka Rissanen
ea17e9d321 net: ipv6: Support fragmented IPv6 packets
This commit adds support for IPv6 packet fragmentation when
receiving (IPv6 reassembly) and when sending larger than 1280 bytes
long IPv6 packet. See RFC 2460 chapter 4.5 for more details.

Jira: ZEP-1718

Change-Id: Ia31c147cce4d456ee48f39276cca99aa09ce81d6
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-04-13 15:21:41 +03:00