Commit graph

41120 commits

Author SHA1 Message Date
Ricardo Salveti
51036ca5f4 nrf_rtc_timer: clear events and counter when disabling sys_clock
Clear pending IRQ when starting and restore back the RTC1 state when
disabling sys_clock, to avoid issues when soft rebooting the device or
chainloading another Zephyr image (e.g. mcuboot).

Change-Id: I693d9168196ad2cfb8475ecfa2051eac043b1fbd
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
2017-03-27 09:05:57 -05:00
Ricardo Salveti
67f488b8f1 boards: add 96b_nitrogen board documentation
This patch adds documentation for 96b_nitrogen board.

Change-Id: I3e50d61cb9dd3e3a1afd242e53c74aae969ffdf0
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
2017-03-27 09:05:57 -05:00
Ricardo Salveti
2df2790448 boards: add 96b_carbon board documentation
This patch adds documentation for 96b_carbon board.

Change-Id: I2ffa8dc0dab579306474887023275d85d9a168da
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
2017-03-27 09:05:57 -05:00
Kumar Gala
83d8ffb2a0 spi: mcux: Rename spi driver to DSPI to match naming convention
In prep for supporting the older KL2x SoCs that use a different SPI
block, rename the current SPI driver to DSPI to match what the MCUX HAL
defines it as.

Change-Id: I9097580df5fca649ab6fd9a38212fced0b1ea6ed
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-03-27 09:05:57 -05:00
Yannis Damigos
fedf497b03 olimexino_stm32: Enable DT usage for OLIMEXINO STM32
This patch adds the necessary changes to enable use of DTS for
generating required build information.

Change-Id: I0d7aa15488339a425ffe57b6354992851212f7f3
Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2017-03-27 09:05:57 -05:00
Yannis Damigos
a7b6d769d4 dts: arm: Add base DTS support for Olimexino STM32 board
This patch adds the base DTS files required to support DTS for the
STM32F103xB based Olimexino STM32 board.

Origin: Original

Change-Id: I2a20d3f3ce8b1d3c20fe92b2ffa584c69fbd96a5
Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2017-03-27 09:05:57 -05:00
Gustavo Denardin
5295191b28 arm: IRQ number correction in the soc configuration
The previous file contained erroneous values of the number of IRQs
in these socs.

Change-Id: Ie7d2c19d86e247599f4924b95d9330175140d894
Signed-off-by: Gustavo Denardin <gustavo.denardin@gmail.com>
2017-03-27 09:05:57 -05:00
Anas Nashif
f475d2cde9 samples: grove: remove duplicate config
Duplicate Kconfig variable in prj.conf causes warning

Jira: ZEP-1880
Change-Id: I941b36a17c550d7e64759ea3266da6957ec3e82c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-26 02:10:24 +00:00
Flavio Santes
c3f79e1d46 test/crypto: Update ECC DSA test case
The ECC DSA test case was updated in TinyCrypt 0.2.6.

Fix the length of the random vector.

Change-Id: I7545a51c6855959afdefe00a1e0b53e5c3001a7c
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-25 15:42:13 +00:00
Flavio Santes
3692aed6a8 test/crypto: Update ECC DH test case
The ECC DH test case was updated in TinyCrypt 0.2.6.

This patch adds two helper arrays for the Monte Carlo routine.

Change-Id: If28292512b351feffc3fe470942cd97b18851a57
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-25 15:42:13 +00:00
Leandro Pereira
a50c1d0620 test: Add test for JSON library
This adds a test suite for the JSON library, testing both encoding and
decoding of all supported data types, including arrays, nested objects,
and basic types such as booleans, numbers, and strings.

Jira: ZEP-1607
Change-Id: I4f6ad7e2859a142e06d405e0760e91751e01a31f
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-03-25 13:11:55 +00:00
Leandro Pereira
262365c727 lib: json: Fix parsing of boolean values
Boolean values were being decoded using the descriptor type rather than
the value type.

Jira: ZEP-1607
Change-Id: I0c9324ee705af973ccf738e92785820c3a5fb692
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-03-25 13:11:55 +00:00
Leandro Pereira
4c7803b59f lib: json: Ignore spaces while scanning for tokens
The function to ignore spaces was not being called, so some tokens had
whitespace in the beginning.  They were correctly lexed, but parsing
could eventually fail.

Jira: ZEP-1607
Change-Id: I796596143895fa0fa652641f56af9a03e7a65b7a
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-03-25 13:11:54 +00:00
Leandro Pereira
844ef6744e lib: json: Fix number parsing
Comparing *endptr with '\0' will always be true before replacing
*token->end with prev_end.

Jira: ZEP-1607
Change-Id: I224129586e15380d3919bfba3db4fcf38c28cb07
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-03-25 13:11:53 +00:00
Leandro Pereira
122cdb3956 lib: json: Do not use translation tables to encode characters
It has been suggested in a review to use a simple function with a
switch statement instead of the table trick.

Jira: ZEP-1607
Change-Id: I5290de175021bfa8642334548ece8266d4c137f0
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-03-25 13:11:52 +00:00
Leandro Pereira
95ec49cb70 lib: json: Simplify lexing of "true", "false", and "null" tokens
Roll the loop in an accept_run() function and use it to match "rue" and
"alse" depending on the first character of the token.  Use that to lex
"ull" after finding "n" as well.  This reduces the code slightly.

Jira: ZEP-1607
Change-Id: Iec8ff6ae2fb79e7fe65d476d1574c5943d23e14f
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-03-25 13:11:52 +00:00
Leandro Pereira
b9b1c18cd7 lib: json: Add encoding support
Serializing an object in JSON is quite tricky to do by hand, and with
an array of descriptor structs, there's enough information to do that
programatically.

The encoder takes a callback function, so that one can be written to
write bytes to, for instance, a struct net_buf.  This way, there's no
guesswork to determine the buffer size, reducing the possibility of
overflowing the stack.

Jira: ZEP-1607
Change-Id: I5ccf1012e46c1db32fcfdf2ecee4a1ef44c927d5
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-03-25 13:11:51 +00:00
Leandro Pereira
67ac6f6701 lib: json: Parse nested objects and arrays
Parse arrays and nested objects.

Array parsing is limited to items of the same type, and requires an array
with fixed number of elements.  Elements can be of any type supported by
the parser, including arrays and objects.

The return value of json_obj_parse() won't be that helpful: the nth bit
will only be set if the object has been fully decoded.

Jira: ZEP-1607
Change-Id: I472e402ae3f36a1bd1505decc0313f74cbfa2e07
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-03-25 13:11:50 +00:00
Anas Nashif
0505c9c881 benchmarks: convert latency_measure to unified kernel
Change-Id: If92833d699b95f5a7e813d0577f5467b06d3a1b6
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-25 12:38:50 +00:00
David B. Kinder
c096453f34 doc: fix installation on windows instructions
Add more installation details for building zephyr on Windows
including what to do with the ISSM tar.gz file that's
downloaded, proxy settings if behind a firewall, adding tar
to the dependencies (needed to extract the ISSM tar.gz file),
linking to the downloads page for the ARM toolchain, and
fixing command lines to correctly use `make BOARD=`. Verified
instructions work on a Windows 10 system.

Change-Id: I04e5f8e46df7630868568b90388dc65bb9baa4c9
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-03-25 12:36:14 +00:00
Anas Nashif
25aa9e8e36 tests: enable syslog for sensors
Change-Id: If866083d5707a83b1df0a3411f3a848fdf40dbcb
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-25 12:00:30 +00:00
Anas Nashif
a53bc0eef0 sensors: sx9500: varables undeclared when in debug mode
Change-Id: I1625fffbe4c1d24b7976fe5b82dafc29e8ec8350
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-25 12:00:29 +00:00
Anas Nashif
2c04055970 Merge "Merge bluetooth branch into master" 2017-03-25 11:25:43 +00:00
Anas Nashif
8ec959a041 Merge "Merge net branch into master" 2017-03-25 11:25:33 +00:00
Johan Hedberg
93fbca0d16 Merge bluetooth branch into master
- Controller cleanups
 - Refactor controller for a cleaner Link Layer abstraction
 - SDP enhancements
 - Use sys_slist_t API wherever possible
 - Fix race condition in controller
 - Update controller to report Bluetooth 5.0 version

----------------------------------------------------------------
Carles Cufi (6):
      Bluetooth: controller: Remove unused H:4 tag macros
      Bluetooth: controller: Rename downstream API calls
      Bluetooth: controller: Introduce BLUETOOTH_LL_SW
      Bluetooth: controller: Move ll.h to an include folder
      Bluetooth: controller: Remove public address config option
      Bluetooth: controller: Move LL code from driver to ll_sw

Johan Hedberg (11):
      Bluetooth: Make bt_hci_driver instances link-time constants
      Bluetooth: shell: Fix missing initialization of param.own_addr
      Bluetooth: shell: Add command to start continuous passive scanning
      Bluetooth: Move crypto APIs to dedicated header file
      Bluetooth: Controller: Factor out ECB core code from ecb_encrypt()
      Bluetooth: Controller: Introduce big-endian variant for ECB
      Bluetooth: Introduce public big-endian AES API
      Bluetooth: Controller: Increase default TX buffer count
      Bluetooth: Use specific pointer type for conn->channels
      Bluetooth: ATT: Reorder handler struct for compactness
      Bluetooth: ATT: Refactor PDU handling

Kaustav Dey Biswas (5):
      Bluetooth: SDP: Server: Send service search response
      Bluetooth: SDP: Server: Handle ServiceAttributeRequest
      Bluetooth: SDP: Server: Find the attributes in the record
      Bluetooth: SDP: Server: Send ServiceAttributeResponse
      Bluetooth: SDP: Server: Support ServiceSearchAttributeRequest

Luiz Augusto von Dentz (4):
      Bluetooth: ipsp: Fix checking for NULL pointer
      Bluetooth: L2CAP: Use sys_slist_t for connection channels
      Bluetooth: L2CAP: Use sys_slist_t for server channels
      Bluetooth: L2CAP: Use sys_slist_t for fixed channels

Mariusz Skamra (2):
      Bluetooth: L2CAP: Fix TX queueing for LE CoC
      Bluetooth: tester: Fix UART issue on qemu

Matthias Ringwald (1):
      Bluetooth: Controller: Kconfig company id and subversion number

Sathish Narasimman (5):
      Bluetooth: HFP HF: SCO: Handle synchronous_conn_complete
      Bluetooth: SCO: Rename 'conn' to 'acl'
      Bluetooth: HFP HF: SCO: Handle SCO Disconnect
      Bluetooth: HFP HF: SCO Initiate Audio connection
      Bluetooth: AT: Fix reset the state during error

Vinayak Chettimada (16):
      Bluetooth: Controller: Fix RSSI feature conditional compilation
      Bluetooth: Controller: Add advertisement event indication feature
      Bluetooth: Controller: Add Kconfig range check for public address
      Bluetooth: Controller: Version 5.0 and PDU type rename
      Bluetooth: controller: Use explicit paths to internal headers
      Bluetooth: controller: Move bt_rand into separate file
      Bluetooth: Make LE Encrypt helpers public
      Bluetooth: controller: Replace 0 for pointers with NULL keyword
      Bluetooth: Fix checks for changes in connection parameters
      Bluetooth: Support connection parameter update as central
      Bluetooth: shell: Reorder commands in logical order of use
      Bluetooth: shell: Add connection update command
      Bluetooth: controller: Move PDU macros from radio.h to pdu.h
      Bluetooth: controller: Cleanup makefiles
      Bluetooth: controller: Fix mayfly caller id for thread call path
      Bluetooth: controller: Fix race waiting for ticker job to complt

 drivers/bluetooth/hci/h4.c                         |   2 +-
 drivers/bluetooth/hci/h5.c                         |   2 +-
 drivers/bluetooth/hci/spi.c                        |   2 +-
 include/bluetooth/bluetooth.h                      |  15 +-
 include/bluetooth/conn.h                           |  11 +
 include/bluetooth/crypto.h                         |  77 ++
 include/bluetooth/hci.h                            |  24 +
 include/bluetooth/l2cap.h                          |   4 +-
 include/drivers/bluetooth/hci_driver.h             |   2 +-
 samples/bluetooth/ipsp/src/main.c                  |   6 +-
 subsys/bluetooth/Kconfig                           |   2 +-
 subsys/bluetooth/controller/Kconfig                |  39 +-
 subsys/bluetooth/controller/Makefile               |  23 +-
 subsys/bluetooth/controller/hal/Makefile           |   1 +
 subsys/bluetooth/controller/hal/ecb.h              |   3 +
 subsys/bluetooth/controller/hal/nrf5/Makefile      |   3 +
 subsys/bluetooth/controller/hal/nrf5/cntr.c        |   4 +-
 subsys/bluetooth/controller/hal/nrf5/ecb.c         |  64 +-
 subsys/bluetooth/controller/hal/nrf5/radio.c       |  17 +-
 subsys/bluetooth/controller/hal/nrf5/rand.c        |   4 +-
 subsys/bluetooth/controller/hal/radio.h            |   5 -
 subsys/bluetooth/controller/hci/Makefile           |   4 +
 subsys/bluetooth/controller/hci/hci.c              |  76 +-
 subsys/bluetooth/controller/hci/hci_driver.c       | 217 +-----
 subsys/bluetooth/controller/include/ll.h           |  58 ++
 subsys/bluetooth/controller/ll/ll.h                |  29 -
 subsys/bluetooth/controller/ll_sw/Makefile         |   4 +
 subsys/bluetooth/controller/ll_sw/crypto.c         |  54 ++
 subsys/bluetooth/controller/{ll => ll_sw}/ctrl.c   | 660 +++++++++--------
 subsys/bluetooth/controller/{ll => ll_sw}/ctrl.h   |  54 +-
 .../controller/{ll => ll_sw}/ctrl_internal.h       |   6 +-
 subsys/bluetooth/controller/{ll => ll_sw}/ll.c     | 237 ++++++-
 subsys/bluetooth/controller/{ll => ll_sw}/pdu.h    |  64 +-
 subsys/bluetooth/controller/ticker/Makefile        |   3 +
 subsys/bluetooth/controller/ticker/ticker.c        |  12 +-
 subsys/bluetooth/controller/util/Makefile          |   1 +
 subsys/bluetooth/controller/util/memq.c            |   5 +-
 subsys/bluetooth/host/Kconfig                      |  16 +-
 subsys/bluetooth/host/Makefile                     |   2 +
 subsys/bluetooth/host/at.c                         |   7 +-
 subsys/bluetooth/host/att.c                        | 204 ++++--
 subsys/bluetooth/host/conn.c                       | 148 +++-
 subsys/bluetooth/host/conn_internal.h              |  12 +-
 subsys/bluetooth/host/crypto.c                     | 155 ++++
 subsys/bluetooth/host/crypto.h                     |   8 +
 subsys/bluetooth/host/hci_core.c                   | 150 ++--
 subsys/bluetooth/host/hci_core.h                   |   2 +-
 subsys/bluetooth/host/hci_ecc.c                    |   9 +-
 subsys/bluetooth/host/hci_ecc.h                    |   5 +-
 subsys/bluetooth/host/hci_raw.c                    |   8 +-
 subsys/bluetooth/host/hci_raw_internal.h           |   2 +-
 subsys/bluetooth/host/l2cap.c                      | 202 ++----
 subsys/bluetooth/host/l2cap_br.c                   |  97 +--
 subsys/bluetooth/host/l2cap_internal.h             |   5 +-
 subsys/bluetooth/host/sdp.c                        | 781 +++++++++++++++++++++
 subsys/bluetooth/host/sdp_internal.h               |  14 +
 subsys/bluetooth/host/smp.c                        |  36 +-
 tests/bluetooth/init/prj_controller_4_0.conf       |   1 +
 tests/bluetooth/init/prj_controller_dbg.conf       |   1 +
 tests/bluetooth/shell/src/main.c                   | 137 +++-
 tests/bluetooth/test_bluetooth/src/bluetooth.c     |   2 +-
 tests/bluetooth/tester/qemu.conf                   |   1 +
 62 files changed, 2583 insertions(+), 1216 deletions(-)
 create mode 100644 include/bluetooth/crypto.h
 create mode 100644 subsys/bluetooth/controller/hal/Makefile
 create mode 100644 subsys/bluetooth/controller/hal/nrf5/Makefile
 create mode 100644 subsys/bluetooth/controller/hci/Makefile
 create mode 100644 subsys/bluetooth/controller/include/ll.h
 delete mode 100644 subsys/bluetooth/controller/ll/ll.h
 create mode 100644 subsys/bluetooth/controller/ll_sw/Makefile
 create mode 100644 subsys/bluetooth/controller/ll_sw/crypto.c
 rename subsys/bluetooth/controller/{ll => ll_sw}/ctrl.c (93%)
 rename subsys/bluetooth/controller/{ll => ll_sw}/ctrl.h (84%)
 rename subsys/bluetooth/controller/{ll => ll_sw}/ctrl_internal.h (98%)
 rename subsys/bluetooth/controller/{ll => ll_sw}/ll.c (58%)
 rename subsys/bluetooth/controller/{ll => ll_sw}/pdu.h (77%)
 create mode 100644 subsys/bluetooth/controller/ticker/Makefile
 create mode 100644 subsys/bluetooth/controller/util/Makefile
 create mode 100644 subsys/bluetooth/host/crypto.c
 create mode 100644 subsys/bluetooth/host/crypto.h

Change-Id: Ic8bee0eb4f15c00ce5ca7b3b80133b1bbd0bdbf5
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-03-24 23:21:09 -07:00
Anas Nashif
898c8b639b tests: object_footprint: add missing file
Change-Id: I2d26f0770ac81482d70a8101c22745b2baef64ae
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-24 18:17:32 -04:00
Anas Nashif
e994b0ab19 benchmarks: remove legacy tests already ported to unified
Change-Id: I002a462e06333b8540e96d4e4e166830b231d536
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-24 18:17:04 -04:00
Anas Nashif
7942eaee39 benchmarks: port object_footprint to unified kernel
Change-Id: Iaa39f60b9ef498059f0320631823a9d7d47a99de
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-24 21:51:17 +00:00
Anas Nashif
477a928134 benchmarks: move footprint benchmark out of legacy
Those can be used with unified kernel.

Change-Id: I4bd024f7e645b99ac1b8df6dfbbdd94f2fda99c4
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-24 21:51:17 +00:00
Inaky Perez-Gonzalez
6db4a991b2 tests: tag with 'ignore_faults' testcases that provoke faults
This way we can monitor testcases for faults that should not be there;
however, in the case of these, a fault message is expected and shall
be ignored.

Change-Id: I63736723026c381c9fee7f24a751ceafc12f2a40
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2017-03-24 21:51:16 +00:00
Anas Nashif
aa70533244 tests: remove legacy tests already ported to unified
Legacy APIs are to be deprecated, so getting rid of tests that have been
moved to unified kernel already.

Change-Id: I752e42bc498dfdd0ea29b0b5b7b9da1dac7b1136
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-24 21:51:15 +00:00
Vinayak Chettimada
611460b913 Bluetooth: controller: Fix race waiting for ticker job to complt
Same volatile status variable as return and being updated
in ISR would modify the variable in two context which
caused the variable to be set to a stale value.

This commit uses two different variables, one for return
value and the other to be updated by ISR.

Jira: ZEP-1941

Change-id: I19e3bdc85e15bda7891395f3f1f64c2ddbeee0c6
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2017-03-24 17:06:59 +00:00
Vinayak Chettimada
2d644f2f42 Bluetooth: controller: Fix mayfly caller id for thread call path
role_disable initiated through HCI commands are initiated
in thread context and controller code was using the job
mayfly caller id instead of using the correct app caller
id.

Also the XTAL retain calls being called from two different
call context used the same worker caller id and same mayfly
instead of using the correct caller ids and independent
mayfly for each caller.

This potentially could cause mayfly enqueued list to be
corrupted and enqueued mayfly could be lost.

Change-id: Ia356419462d1fb4e38f4a20c720974143f12fdb6
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2017-03-24 17:06:43 +00:00
Jukka Rissanen
9b135773e0 Merge net branch into master
Main changes:

- IP offloading fixes
- cc2520 fixes
- wpan usb and serial fixes
- IPv6 fixes
- TCP fixes
- RPL fixes
- IPv6 mesh routing fixes
- net-shell fixes
- New commands added to net-shell
- New DNS API added

----------------------------------------------------------------
Andrei Emeltchenko (3):
      wpan_serial: Correct system logging domain
      drivers: cc2520: Correct configuration options
      wpanusb: Fix using incorrect nbuf in fragment_get()

Gil Pitney (3):
      net: offload: Rename Kconfig NET_L2_OFFLOAD_IP to NET_OFFLOAD
      net: offload: Move offload_ip field from net_l2 to net_if
      net: offload: More decoupling of net_offload from l2 naming

Inaky Perez-Gonzalez (1):
      samples/net/echo_client: add SAM e70 and FRDM k64f ethernet configurations

Jukka Rissanen (16):
      net: route: Try to route IPv6 packet if we are not the recipient
      net: Select IPv6 neighbor cache when RPL is enabled
      net: rpl: Fix printf modifiers for size_t variables
      net: context: Set the bind port
      samples: net: Remove multicast address setting in echo-server
      net: ipv6: Adding router mgmt add/del events
      samples: net: Remove multicast address setting in echo-client
      net: tcp: Refactor net_tcp_trace()
      net: shell: Add command for testing TCP connection
      net: tcp: Invalid transition from FIN_WAIT_1 to CLOSE_WAIT
      net: dns: Add resolve API
      net: dns: Initialize DNS resolver if DNS servers are set
      net: dns: Add functions to resolve using default context
      samples: net: DNS resolving sample application
      net: shell: Add DNS query support
      tests: dns: Resolve API test cases

Ravi kumar Veeramally (8):
      net: zoap: Fix memory leak
      net: rpl: Handle verdict properly for forwarding_dao
      net: rpl: Add missing Kconfig option
      net: rpl: Fix invalid reading of RPL Transmit information
      net: rpl: Fix setting metadata of forwarding buffer
      net: rpl: Cache src and dst addresses for DAO ACK reply
      net: rpl: Fix verdict for handle_dao_ack
      net: route: Fix when route not found with dst address

Tomasz Bursztyka (10):
      drivers/ieee802154: Remove very old CC2520 left-over from µIP stack
      net/ipv6: Regroup debugging routines relevantly
      net/ipv6: Renaming IPv6 neighbor state related macros and function
      net/shell: Simplify ping logic
      net/icpmv4: Add dynamically registered ICMPv4 handlers
      net/shell: Add ping reply handlers and a timeout
      net/icmpv4: Normalize input function signature with ipv6 counter-part
      net/samples: Add static ipv4 addresses for arduino 101 echo apps config
      net/ipv6: Fix a NULL dereferencing issue when debug is enabled
      net/net_if: When IPv6 DAD is disabled, added address gets final state

 .../x86/quark_se_c1000_devboard/Kconfig.defconfig  |   4 +-
 boards/x86/quark_se_c1000_devboard/board.c         |   8 +-
 boards/x86/quark_se_c1000_devboard/board.h         |   8 +-
 drivers/ieee802154/Kconfig.cc2520                  |  27 +-
 drivers/ieee802154/Makefile                        |   1 -
 include/net/dns_resolve.h                          | 307 +++++++
 include/net/nbuf.h                                 |  21 +
 include/net/net_event.h                            |   8 +
 include/net/net_if.h                               |  20 +-
 include/net/net_l2.h                               |  12 +-
 include/net/{offload_ip.h => net_offload.h}        |  93 +--
 samples/net/dns_resolve/Makefile                   |  13 +
 samples/net/dns_resolve/prj_qemu_x86.conf          |  59 ++
 samples/net/dns_resolve/src/Makefile               |   7 +
 samples/net/dns_resolve/src/main.c                 | 284 +++++++
 samples/net/dns_resolve/testcase.ini               |   4 +
 samples/net/echo_client/prj_arduino_101.conf       |   4 +
 samples/net/echo_client/prj_frdm_k64f.conf         |  32 +
 samples/net/echo_client/prj_sam_e70_xplained.conf  |  36 +
 samples/net/echo_client/src/echo-client.c          |  40 +-
 samples/net/echo_server/prj_arduino_101.conf       |   4 +
 samples/net/echo_server/src/echo-server.c          |  37 +-
 samples/net/wpan_serial/prj.conf                   |   1 +
 samples/net/wpan_serial/src/main.c                 |   2 +-
 samples/net/wpanusb/prj.conf                       |   2 +-
 samples/net/wpanusb/src/Makefile                   |   4 -
 samples/net/wpanusb/src/wpanusb.c                  |   2 +-
 subsys/net/ip/Kconfig                              |   6 +-
 subsys/net/ip/Kconfig.rpl                          |  11 +-
 subsys/net/ip/icmpv4.c                             |  59 +-
 subsys/net/ip/icmpv4.h                             |  21 +-
 subsys/net/ip/ipv6.c                               | 102 ++-
 subsys/net/ip/ipv6.h                               |  20 +-
 subsys/net/ip/l2/Kconfig                           |  12 +-
 subsys/net/ip/l2/bluetooth.c                       |   3 +-
 subsys/net/ip/net_context.c                        |  93 ++-
 subsys/net/ip/net_core.c                           |  37 +-
 subsys/net/ip/net_if.c                             |  11 +-
 subsys/net/ip/net_shell.c                          | 673 +++++++++++++--
 subsys/net/ip/route.c                              |  71 ++
 subsys/net/ip/route.h                              |  25 +
 subsys/net/ip/rpl.c                                |  90 +-
 subsys/net/ip/tcp.c                                |   9 +-
 subsys/net/lib/dns/Kconfig                         |  80 +-
 subsys/net/lib/dns/Makefile                        |   4 +-
 subsys/net/lib/dns/resolve.c                       | 907 +++++++++++++++++++++
 subsys/net/lib/zoap/zoap_link_format.c             |  10 +-
 tests/net/lib/dns_resolve/Makefile                 |   4 +
 tests/net/lib/dns_resolve/prj.conf                 |  31 +
 tests/net/lib/dns_resolve/src/Makefile             |   7 +
 tests/net/lib/dns_resolve/src/main.c               | 656 +++++++++++++++
 tests/net/lib/dns_resolve/testcase.ini             |   6 +
 tests/net/rpl/src/main.c                           |   4 +-
 53 files changed, 3587 insertions(+), 405 deletions(-)
 create mode 100644 include/net/dns_resolve.h
 rename include/net/{offload_ip.h => net_offload.h} (84%)
 create mode 100644 samples/net/dns_resolve/Makefile
 create mode 100644 samples/net/dns_resolve/prj_qemu_x86.conf
 create mode 100644 samples/net/dns_resolve/src/Makefile
 create mode 100644 samples/net/dns_resolve/src/main.c
 create mode 100644 samples/net/dns_resolve/testcase.ini
 create mode 100644 samples/net/echo_client/prj_frdm_k64f.conf
 create mode 100644 samples/net/echo_client/prj_sam_e70_xplained.conf
 create mode 100644 subsys/net/lib/dns/resolve.c
 create mode 100644 tests/net/lib/dns_resolve/Makefile
 create mode 100644 tests/net/lib/dns_resolve/prj.conf
 create mode 100644 tests/net/lib/dns_resolve/src/Makefile
 create mode 100644 tests/net/lib/dns_resolve/src/main.c
 create mode 100644 tests/net/lib/dns_resolve/testcase.ini

Change-Id: I1bdd9f5d9893701a514160900357408a355fb2ce
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-24 17:38:13 +02:00
Tomasz Bursztyka
178589fc31 net/net_if: When IPv6 DAD is disabled, added address gets final state
There is no transition from tentative state etc... It should directly go
to preferred.

This is fixing ND processing when DAD is disabled: source address was
never set, as tentative state is not a valid in
is_proper_ipv6_address().

Change-Id: I6f0a0fdd99dd13d28849f9749f89ec21fdd370d8
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-03-24 17:31:42 +02:00
Tomasz Bursztyka
53b9c45f11 net/ipv6: Fix a NULL dereferencing issue when debug is enabled
Change-Id: If62aa12acfc07d32ae29068537127d245f8af87e
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-03-24 17:31:42 +02:00
Jukka Rissanen
c3b1070d10 tests: dns: Resolve API test cases
Change-Id: I090515c0e720c5779e3b5a9f2eb19e398ea0e987
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-24 17:31:42 +02:00
Jukka Rissanen
aa11cef227 net: shell: Add DNS query support
Add "net dns <hostname> [A | AAAA]" command support that can be
used to query IPv4 or IPv6 address for a given host name.

Change-Id: I86b2258efa994a67163f9b3b340f44d65767f11b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-24 17:31:42 +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
Jukka Rissanen
cbfce3a299 net: dns: Add functions to resolve using default context
Applications should normally use these functions as then the system
wide DNS server settings are used.

Change-Id: I2c1fc7c7c881081506d21c3d37628d5c3dcc6aaa
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-24 17:31:42 +02:00
Jukka Rissanen
8dc01261ea net: dns: Initialize DNS resolver if DNS servers are set
If the config file contains DNS server addresses, then
configure the DNS resolver to use them.

Change-Id: Ie7f2bdcf7ac4bb7ee0ecf7fb5b7bd2df3379cdc3
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-24 17:31:42 +02:00
Jukka Rissanen
79cd66f40c net: dns: Add resolve API
This commit introduces a generic DNS resolving API that can
be used by applications. Later commits will introduce a system
level DNS support which simplifies the DNS resolving so that
DNS server names can be given from config file.

Change-Id: I60fbc81e2a44928d2ca53d51e703b9cde222b382
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
850efc270c net/icmpv4: Normalize input function signature with ipv6 counter-part
Length parameter was always useless, only used in debugging, so that can
be removed.

Change-Id: If597f424840f37955202fa5fe827dd992e4cf776
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-03-24 17:31:42 +02:00
Tomasz Bursztyka
e98f2e0b6a net/shell: Add ping reply handlers and a timeout
Thus the ping command is more user-friendly: at least user knows the
ping got a reply or not.

Change-Id: I740a2f77d288f6287ac04c908f3d517a49df57d2
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-03-24 17:31:42 +02:00
Tomasz Bursztyka
19af4eee4f net/icpmv4: Add dynamically registered ICMPv4 handlers
As it is done for ICMPv6. This will prove to be useful for implementing
an echo reply handler in a ping for instance.

Change-Id: I969a1da60f2a4ea59eee5c9983eb6e340923e2ef
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-03-24 17:31:41 +02:00
Tomasz Bursztyka
1d361b0507 net/shell: Simplify ping logic
net_addr_pton always returns -EINVAL in case of error, so let's play with
it to factorize the code.

net_icmpv<4/6>_send_echo_request always returns -EIO in case of error.

Change-Id: I89e5ccd4b936701f7dad194089dda845fab5d738
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-03-24 17:31:41 +02:00
Tomasz Bursztyka
1e3dc0cbb4 net/ipv6: Renaming IPv6 neighbor state related macros and function
Refining the names around IPv6's neighbor states to differentiate them
easily from any net_nbr related names (which are not tighten to IPv6).

Change-Id: Ibc24df2a9485477a53fe5fe1c8f993f0fcd91635
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-03-24 17:31:41 +02:00
Tomasz Bursztyka
4991499cab net/ipv6: Regroup debugging routines relevantly
Probably some refactoring left-over.

Change-Id: I9715441a54b2e675135ce4072651dcead3216d3b
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-03-24 17:31:41 +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