Commit graph

41120 commits

Author SHA1 Message Date
Jukka Rissanen
f55e545376 net: utils: Byte to hex converter had wrong prototype
The net_byte_to_hex() prototype first parameter was uint8_t *,
but it should have been char *.

Jira: ZEP-1885

Change-Id: I6132a67bb9e8199de88451fb4e446081f401e8f6
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-17 10:34:41 +02:00
Jukka Rissanen
d9528ac7fa net: ipv6: Properly enter DELAY state in NUD
We did not handle NUD (Neighbor Unreachability Detection)
properly and did not go to DELAY state when neighbor
reachability was checked.

Change-Id: I127d25124aa806c44ff37c1355cc3db7fb25b2d2
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-17 10:34:40 +02:00
Jukka Rissanen
cd85a5e924 net: ipv6: Add more debugging to reachability timer
Print timer information when creating and expiring the
reachability timer.

Change-Id: I5c8fee91de85fe7c9ea7c467f45dbb105250d5b1
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-17 10:34:40 +02:00
Jukka Rissanen
7848d6e0ff net: ipv6: Wrong timer was used when reachability timer expired
The send_ns timer was used instead of reachable timer when
the reachability timer was expired. This meant that the
reachability timer was never restarted after it expired once.

Change-Id: Iccbd6d019d1106adca60f7319bc4c547cdb1d924
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-17 10:34:40 +02:00
Jukka Rissanen
49c0444f5c net: shell: Print more detailed neighbor information
Print the neighbor pointer address and remaining time when
viewing the neighbor cache in "net nbr" command.

Change-Id: I13840ccc16c31c99a803ec1b7afe69879bd639f2
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-17 10:34:40 +02:00
Jukka Rissanen
ac74637e54 net: ipv6: Return the prefix lifetime in seconds
Use the proper API to get the remaining time in prefix timer
and return the value in seconds as expected.

Change-Id: I055ce0ba6092c23ad60d6775ce75a0a67ad91d26
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-17 10:34:40 +02:00
Jukka Rissanen
465ce5bac5 net: ipv6: Send NS when neighbor is added
In order to verify that the neighbor is reachable, send
neighbor solicitation message to neighbor which should then
send neighbor advertisement to us so that we can then mark
it reachable.

Change-Id: I2c45ee4a6982c698ef6c8fa1acccb995aadf8ee6
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-17 10:34:40 +02:00
Jukka Rissanen
2f5ee81c28 net: ipv6: Print IPv6 neighbor state changes
In order to be able to debug IPv6 neighbor state changes,
pretty print the state names when setting the new state.

Change-Id: I64e0b4173eaa63c9715c17420a008602759aa4fa
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-17 10:34:40 +02:00
Jukka Rissanen
91e99ea7da net: ipv6: Add debug function to convert nbr state to string
To be used by net-shell and other files for debugging neighbor
state.

Change-Id: Ie9b09a54a05dcb066906a3697dfe38aeffc886e6
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-17 10:34:40 +02:00
Tomasz Bursztyka
f6987169d8 net/ieee802154: Fix net mgmt request to get core settings
Obviously s/SET/GET

Change-Id: Iab4fa82ee6c53cb53806bf131655605a21125c3b
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-03-17 10:34:40 +02:00
Tomasz Bursztyka
00a3b880f6 net/ieee802154: Add missing line breaks in the shell module
Change-Id: Ib05922bd2799732107bea1bef218e558dd94f264
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-03-17 10:34:40 +02:00
Flavio Santes
876e341570 samples/net/http: Add the HTTP Basic Authentication routine
This patch adds the HTTP Basic Authentication routine "http_auth".
Authentication parameters are defined in the config.h file.

The README file is also updated by this patch.

Jira: ZEP-1543

Change-Id: I2d531966290e87a68c54fc1ac834491ac937df22
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-17 10:34:40 +02:00
Flavio Santes
b8f8968f70 net/http: Move some statements to the right place
The "null terminator" for the chunked transfer encoding must be
added only if the payload is present.

Change-Id: Id325a660f060b3a3468bcca16a079def11b8c3ef
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-17 10:34:39 +02:00
Flavio Santes
e1b46bfe29 samples/http: Match header field ctr with Kconfig variable
Set a local define with the value previously defined at the Kconfig
file.

Change-Id: I3ee424c4a1102ca00c0059cb9d0a86498806486f
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-17 10:34:39 +02:00
Sergio Rodriguez
ff5178fd22 samples: mbedTLS coap: Cleaning prj.conf for QEMU
Removing unneeded configuration

Change-Id: I72e3714358366de715cb6f47d690a1b0e8f032f5
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-03-17 10:34:39 +02:00
Sergio Rodriguez
1b48f9fbc3 samples: mbedtls coap: Fixing entropy source
Using a more efficent entropy call and proper output data

Jira: ZEP-1878

Change-Id: Ife738b84c1e56d58784b4fbc61ec0843579c4453
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-03-17 10:34:39 +02:00
Kumar Gala
efc68b4faf dts/extract_dts_includes.py: Replace cell_prefix to cell_string
Only the IRQ prasing was using cell_prefix and cell_string does the same
thing so lets just use that everywhere.

Change-Id: I2ef9b1e2c1baef54b71d811c835b29a9ca8fe81b
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-03-16 22:16:24 +00:00
Andrew Boie
420606b925 arduino_101: add defconfig for mcuboot demonstration
This builds the zephyr OS image with the proper flash offsets for
slot 0.

After building, the image needs to be signed using the zep2newt.py
script included in the MCUBoot repo:

  ./scripts/zep2newt.py --vtoff 0x200 --word-size 4 --sig RSA \
	--key root-rsa-2048.pem --bin <path to zephyr.bin> \
	--out <path to zephyr.bin>

And then run 'make flash'.

Change-Id: I4739c0b7912c8066882208cb450a8224d433965b
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-03-15 12:45:44 -07:00
Patrice Buriez
a375932dee doc: arduino_101: fix typos/mistakes, and clarify some points
- Fix path to pinmux.c
- Fix note markup
- s/TTY-to-USB/TTL-to-USB/ ; s/adaptor/adapter/
- Recommend 3.3V TTL serial cable
- Consistent use of "Flyswatter2" official spelling
- s/UART0/UART1/
- Provide CONFIG_ARC_INIT relevant value
- s/for for/for/
- Consistent naming of JTAG 2x5 male pins as "micro JTAG header"
- s/orange/green/
- The Arduino 101 micro JTAG header connects to the Flyswatter2
  via the ARM Micro JTAG Connector
- Consistent case
- $USERNAME is not set on Ubuntu, $LOGNAME is POSIX-compliant
- su requires root password, 'sudo su' only requires user password
- Exit root session when done creating udev rule
- Note: code-block above should be rewritten using 'sudo tee'
- s/X86/x86/
- Fix paths to i586-zephyr-elfiamcu-gdb and arc-zephyr-elf-gdb
- samples/hello_world does not set CONFIG_ARC_INIT=y, so suggest
  using tests/booting/stub instead
- s/debugserver/debug server/
- s/BLUETOOTH_DEBUG_STDOUT/BLUETOOTH_DEBUG_LOG/
- s/bottle neck/bottleneck/

Change-Id: I4a76020f67d9672f59eae52f78c5caeb9e513aee
Signed-off-by: Patrice Buriez <patrice.buriez@intel.com>
2017-03-14 23:43:49 +00:00
Patrice Buriez
eea731816f doc: arduino_101: document 'make flash' over DFU
Explain how to create the udev rules granting access to the
Arduino 101 board in DFU mode.

Explain the available methods to flash the Arduino 101 board:
either manually with dfu-util command line,
or automated with ZEPHYR_FLASH_OVER_DFU=y and 'make flash'.

Provide instructions for x86, ARC and BLE cores, using distinct
code-blocks for the manual and make-assisted methods.

Change-Id: I0f9fe3849dec3c2dc2249b77d31d4f2414c98331
Signed-off-by: Patrice Buriez <patrice.buriez@intel.com>
2017-03-14 23:41:23 +00:00
Patrice Buriez
1f429cd4a2 boards: arduino_101: support 'make flash' over DFU
Let 'make flash' invoke the dfuutil.sh support script, and
export the relevant DFUUTIL_* environment variables, for all
3 cores of the Arduino 101 board: x86, ARC and BLE.

This is backward compatible with the current usage of OpenOCD
over JTAG, since this is only enabled when the environment
variable ZEPHYR_FLASH_OVER_DFU is set to y.

Change-Id: Ic5528cb87a180378d7120d150c27d1e24c9ebe75
Signed-off-by: Patrice Buriez <patrice.buriez@intel.com>
2017-03-14 23:39:38 +00:00
Patrice Buriez
82188ed651 scripts: add support script for 'make flash' over DFU
Flashing the Arduino 101 board over DFU can be tricky: the
dfu-util command line is cumbersome, and the reset button
must be pressed at the right time.

This script brings the convenience of 'make flash' for the
Arduino 101 board and for other boards that support the DFU
protocol. It checks whether the board is in DFU mode, and
prompts the user to reset it when needed.

The dfu-util command line is constructed from the following
environment variables, to be exported from the Makefile:
- DFUUTIL: path to the dfu-util executable, default: dfu-util
- DFUUTIL_PID: vendor_ID:product_ID of the board in DFU mode
- DFUUTIL_ALT: alternate setting name of the DFU interface
- DFUUTIL_IMG: path to the binary image sent to the board

Change-Id: Ia9577ec96102a92d4c60481f980f30f4f6e7cd9e
Signed-off-by: Patrice Buriez <patrice.buriez@intel.com>
2017-03-14 23:38:13 +00:00
Patrice Buriez
5ae8c95389 doc: add dfu-util to Linux dependencies
Since we recommend using dfu-util to flash the Arduino 101 board,
it should be mentioned in the list of packages to be installed.
Also fix indentation.

Change-Id: Iafc053c1b07e79bd7d02059b46a842c25ebaaf64
Signed-off-by: Patrice Buriez <patrice.buriez@intel.com>
2017-03-14 23:36:29 +00:00
Paul Sokolovsky
cb2ae52fae scripts: sanitycheck: Typo fixes in docstring.
Change-Id: I219d9f6af972b4090536fe83b6b93e6b7191572a
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-03-13 18:06:05 +03:00
Paul Sokolovsky
f1a919187e drivers: eth_enc28j60: Clarify comments in the header file.
Change-Id: Idfac3e6718a2be135e0b4c7f32aad0ddccf18e3c
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-03-13 18:02:34 +03:00
Paul Sokolovsky
70772add28 arch/arm/core: In comments, consistently refer to "Cortex-M".
This directory now handles all of Cortex-M0, Cortex-M3/M4. So, just
consistently use "Cortex-M" (as used by number of files already)
without refering to a particular subarch. Also, consistently (letter
casing) spell it as "Cortex-M". A typo is fixed too.

Change-Id: I42ee09abc9a503381bca4ae437c83a8f48816ebc
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-03-13 12:53:46 +00:00
Anas Nashif
9d57a938ac doc: add 1.7.0 to the list of releases
Change-Id: I3e851e4d34e905601672e60ded50ed732c4c2a3c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-11 17:31:13 +01:00
Anas Nashif
b862addcf5 Zephyr 1.7.0 release notes
Change-Id: I806f00a905f800bf8ab7f35a1c68b75e2c660729
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-11 17:31:13 +01:00
Flavio Santes
c2cc5f90e2 ext/lib/crypto: Update TinyCrypt to version 0.2.6
Update TinyCrypt to version 0.2.6.

Origin: https://github.com/01org/tinycrypt/releases/tag/v0.2.6

Jira: ZEP-749

Change-Id: I62be0c134236d4a5dcae14bee86692c0fd6dc381
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-10 20:08:21 -06:00
Sergio Rodriguez
381df63fe8 drivers: dma_qmsi: Wait few cycles to allow DMA controller changes
Add few nop instructions to allow the DMA controller settle,
It takes time after starting the transfer to access the DMA
controller registers, so a few cycles are added, the minimal number
of cycles needed has been calculated using tests results on c1000
development board.

Jira: ZEP-1803

Change-Id: I1f8e8478f0350e1b6e4dd596b783dc4babc2d02b
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-03-10 22:40:06 +00:00
Anas Nashif
9e4772372f Merge "Merge net branch into master" 2017-03-10 17:07:04 +00:00
David B. Kinder
137f207223 doc: Update getting started with Windows material
Update documentation on using a Windows host for doing Zephyr development
using ISSM toolchain and console commands in a mingw environment

Jira: ZEP-1177

Change-Id: I3e4edec26a430f424427734dfe407a185ace8434
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-03-10 15:19:17 +00:00
Jukka Rissanen
80b5344970 Merge net branch into master
Main changes:

- Compiler warning fixes
- DHCPv4 fixes and enhancements
- net_buf pool enhancements and fixes
- NATS protocol sample application
- JSON library implementation
- HTTP API library implementation
- HTTP client & server sample applications
- IPv6 Multicast Listener Discovery (MLDv2) implementation
- TCP fixes
- 6Lo fixes
- DNS fixes
- ICMPv6 fixes
- IPv6 extension header parsing fixes
- Bluetooth IPSP invalid pointer fixes
- Memory leak fixes in DTLS client sample
- RPL ICMPv6 option parsing fixes

---------------------------------------------------------------
Flavio Santes (12):
      samples/net: Fix uninitialized variable error
      samples/net: Fix error handling issues in IRC bot
      net/dns: Fix style issues in the DNS high-level API
      net/dns: Add the static keyword to the dns_find_null routine
      net/dns: Fix style issues
      tests/net/dns: Add the test case for the DNS low-level routines
      samples/net/http_client: Cast size_t to int to avoid compiler warnings
      samples/net: Fix format warning in the HTTP client sample app
      samples/net: Add the QEMU x86 prj file to the HTTP client sample app
      net/http: Add the HTTP/1.1 API
      samples/net: Add the HTTP API to the HTTP server sample application
      samples/net: Add the HTTP API to the HTTP client sample application

Jesus Sanchez-Palencia (2):
      net: context: Make packet_received() static
      net: todo: Remove TCP from TODO

Jithu Joseph (1):
      net: ip: Address type mismatch warnings

Juan Manuel Cruz (1):
      drivers: enc28j60: buffer reception waits timeout

Juan Manuel Cruz Alcaraz (2):
      samples: dtls client: DTLS client sample configuration file
      sample: net: mbedtls ssl: SSL client sample is adapted to TCP API

Jukka Rissanen (57):
      net: buf: Add more accounting info to net_buf pool
      net: nbuf: Remove unnecessary debugging code
      net: Add net_buf pool support to each context
      samples: net: Use context specific net_buf pools in echo_*
      net: buf: Store name of the buffer pool
      net: shell: Print network buffer pool information
      net: nbuf: Fix the net_nbuf_copy() buf parameter
      net: nbuf: Fix net_nbuf_copy() so that original nbuf is not modified
      net: nbuf: Add helper function to copy buf user_data
      net: 6lo: Use dedicated buf pool if enabled
      net: 6lo: Change how net_buf is allocated in RX side
      net: conn: Print UDP and TCP checksum after receiving pkt
      net: tcp: Fix the issues with 6lo
      net: context: TCP packets must be send via net_tcp_send_data()
      net: nbuf: Split one global DATA pool to RX and TX DATA pools
      net: shell: Fix the info prints for net_buf pools
      net: nbuf: Print pool name instead of address in debug prints
      net: nbuf: Use net_nbuf_get_frag() to allocate a fragment
      net: Remove link layer reserve param from IP packet creator
      net: nbuf: Pass ll_reserve when creating TX buffer
      net: nbuf: Remove obsolete reserve variable from net_nbuf
      net: if: Clarify the documentation in net_if_send_data()
      net: nbuf: Remove unnecessary buf init
      net: nbuf: Track memory allocations
      net: shell: Add cmd to see net_buf allocations
      net: nbuf: Create net_nbuf_frag_del() for tracking allocations
      net: shell: Show also ISR and main stack usage
      net: nbuf: Do not delete the fragments in net_nbuf_unref()
      net: nbuf: Print adjust value if we fail in read or write
      net: 6lo: ieee802154: Do no try to unref NULL net_buf
      net: 6lo: ieee802154: Memory leak when unfragmenting received data
      net: samples: echo-client: Allow UDP and TCP run at the same time
      net: nbuf: Print more info when trying double free net_buf
      net: core: Fix IPv6 extension parsing
      net: ipv6: Add support to join/leave multicast group
      net: if: Join/leave pre-defined IPv6 multicast groups
      net: ipv6: Notify others if we join/leave IPv6 mcast group
      net: if: Leave all joined IPv6 multicast groups at net_if_down
      net: ipv6: Allow joining to existing multicast address
      net: if: Create support to flush the TX queue
      net: ipv6: Add router alert option to MLD msg
      tests: net: Add unit tests for mld
      net: ipv6: Respond to MLD query
      net: ipv6: Collect MLD statistics
      net: icmpv6: Add function to unregister ICMPv6 handler
      tests: net: Add MLD query tests
      tests: net: Check allnodes and solicit node addresses.
      net: iface: Print error if we cannot join mcast groups
      net: todo: Mark multicast join/leave support done
      net: core: Mark RX and TX threads essential
      net: core: Use K_NO_WAIT when spawning RX and TX threads
      samples: net: http_server: Disable mbedtls
      samples: net: dtls_client: RX buf count too low
      samples: net: dtls_client: Fix mem leak in error path
      samples: net: dtls_client: Fix memory leak in RX path
      net: if: Fix compiler warning when printing TX stack size
      net: if: Skip error print for already joined mcast group

Leandro Pereira (3):
      net: tcp: ACK packet should not be forwarded to application
      lib: Add minimal JSON library
      samples: net: NATS protocol sample

Luiz Augusto von Dentz (4):
      net: samples: Enable CONFIG_NET_CONTEXT_NBUF_POOL in prj_bt.conf
      net: bt: Fix setting ll addresses to possible invalid pointers
      net: bt: Place ll address type together with other assignments
      net: bt: Fix memory corruption

Marcus Shawcroft (27):
      net/dhcpv4: Add missing const
      net/dhcpv4: Refactor packet construction
      net/dhcpv4: Refactor dhcpv4 message type representation.
      net/dhcpv4: Move timers inside the net_if dhcpv4 context
      net/dhcpv4: Unify dhcpv4 state name printers
      net/dhcpv4: Adjust state names to reflect rfc2131
      net/dhcpv4: Refactor handle_reply()
      net/dhcpv4: Implement NAK support.
      net/dhcpv4: Explicitly initialize net_if dhcpv4 state.
      net/dhcpv4: Refactor send_request state handling.
      net/dhcpv4: Refactor send_discover
      net/dhcpv4: Refactor SELECTING state entry.
      net/dhcpv4: Refactor REQUESTING state entry.
      net/dhcpv4: Rework initialization.
      net/dhcpv4: Introduce start/stop API and disabled state.
      net/dhcpv4: Call net_if_ipv4_addr_rm
      net/dhcpv4: Use server identifier appropriately.
      net/dhcpv4: Use BROADCAST and UNICAST appropriately.
      net/dhcpv4: Fix the behaviour of ciaddr.
      net/dhcpv4: Remove !iface checks from timeout handlers.
      net/dhcpv4: Refactor t1 handler.
      net/dhcpv4: Support REBINDING
      eth/eth_mcux: Make promiscous mode configurable.
      eth/mcux: Fix Kconfig help formatting.
      eth/mcux: Turn down the PHY debug verbosity.
      net: shell: Fix missing return when IPv6 disabled
      samples: net: echo-server: Fix conditional around net_if_ipv4_addr_add()

Michael Scott (3):
      net: tcp: fix NET_TCP_CLOSED state propagatation
      net: tcp: remove net_tcp_set_state() function
      net: ip: Fix 6lo buffer leak when sending ACK

Patrik Flykt (1):
      net/trickle: Include net_core.h in order to define NET_ASSERT

Paul Sokolovsky (1):
      net: context: Check if conn_handler exists when binding

Ravi kumar Veeramally (13):
      net: icmpv6: Remove unused variable 'len' from input calls
      net: icmpv6: Remove unnecessary cache pointers for src and dst
      net: icmpv6: Simplify debug calls
      net: icmpv6: Return valid verdict in case of success
      net: core: Fix missing verdict assignment
      net: core: Do not handle RPL options if RPL not enabled
      net: core: Remove duplicate calls
      net: core: Fix IPv6 extra header options handling
      net: 6lo: Fix incorrect order of HLIM and NH compression
      net: 6lo: Fix invalid hoplimit uncompression
      net: 6lo: Fix tiny style and comments issues
      net: 6lo: Fix invalid check on context id
      net: 6lo: Fix compress bit calculation

Sergio Rodriguez (1):
      samples: mbedtls: Fixing entropy source

Tomasz Bursztyka (4):
      net: Switch from per-iface tx thread to a unique k_poll triggered one
      drivers/net/ieee802154: Display the wrong channel setting in error msg
      net/ieee802154: Display which channel is being scanned
      net/ieee802154: Use pre-filled link address as ll target

Vinicius Costa Gomes (2):
      lib/zoap: Fix warning about signedness conversion
      samples/coaps_server: Don't error if the packet doesn't have payload

Wojciech Bober (2):
      drivers/ieee802154: Added RAW mode support to nRF5 radio driver
      drivers/ieee802154: Added RAW device to nRF5 radio driver

june li (1):
      net: tcp: Add tcp options length

 drivers/ethernet/Kconfig.enc28j60                  |   9 +
 drivers/ethernet/Kconfig.mcux                      |  38 +-
 drivers/ethernet/eth_enc28j60.c                    |   6 +-
 drivers/ethernet/eth_enc28j60_priv.h               |   1 +
 drivers/ethernet/eth_mcux.c                        |  12 +-
 drivers/ethernet/eth_sam_gmac.c                    |  12 +-
 drivers/ethernet/eth_sam_gmac_priv.h               |   2 +-
 drivers/ieee802154/Kconfig.nrf5                    |  24 +-
 drivers/ieee802154/Makefile                        |   1 +
 drivers/ieee802154/ieee802154_cc2520.c             |   5 +-
 drivers/ieee802154/ieee802154_mcr20a.c             |   7 +-
 drivers/ieee802154/ieee802154_nrf5.c               |  25 +-
 drivers/ieee802154/ieee802154_uart_pipe.c          |   2 +-
 drivers/slip/slip.c                                |   4 +-
 ext/hal/nordic/drivers/Kbuild                      |   4 +-
 include/linker/common-ram.ld                       |  10 +-
 include/net/buf.h                                  |  28 +
 include/net/dhcpv4.h                               |  30 +-
 include/net/http.h                                 | 123 ++++
 include/net/nbuf.h                                 | 208 +++++-
 include/net/net_context.h                          |  52 ++
 include/net/net_core.h                             |   6 +-
 include/net/net_event.h                            |   8 +
 include/net/net_if.h                               |  89 ++-
 include/net/net_stats.h                            |  15 +
 include/net/trickle.h                              |   1 +
 lib/Kbuild                                         |   2 +
 lib/Kconfig                                        |   2 +
 lib/json/Kconfig                                   |  19 +
 lib/json/Makefile                                  |   1 +
 lib/json/json.c                                    | 564 ++++++++++++++++
 lib/json/json.h                                    | 110 +++
 samples/bluetooth/ipsp/prj.conf                    |   3 +-
 samples/net/coaps_client/prj_qemu_x86.conf         |   3 +-
 samples/net/coaps_server/prj_qemu_x86.conf         |   3 +-
 samples/net/coaps_server/src/coaps_server.c        |  28 +-
 samples/net/dhcpv4_client/prj_arduino_101.conf     |   3 +-
 samples/net/dhcpv4_client/prj_frdm_k64f.conf       |   3 +-
 samples/net/dhcpv4_client/prj_qemu_x86.conf        |   3 +-
 samples/net/dns_client/prj_arduino_101.conf        |   3 +-
 samples/net/dns_client/prj_frdm_k64f.conf          |   3 +-
 samples/net/echo_client/prj_arduino_101.conf       |   3 +-
 .../net/echo_client/prj_arduino_101_cc2520.conf    |   3 +-
 samples/net/echo_client/prj_bt.conf                |   5 +-
 samples/net/echo_client/prj_cc2520.conf            |   3 +-
 samples/net/echo_client/prj_frdm_k64f_cc2520.conf  |   3 +-
 samples/net/echo_client/prj_frdm_k64f_mcr20a.conf  |   3 +-
 samples/net/echo_client/prj_nrf5.conf              |   3 +-
 samples/net/echo_client/prj_qemu_802154.conf       |   3 +-
 samples/net/echo_client/prj_qemu_cortex_m3.conf    |   3 +-
 samples/net/echo_client/prj_qemu_x86.conf          |   9 +-
 samples/net/echo_client/src/echo-client.c          | 122 +++-
 samples/net/echo_server/prj_arduino_101.conf       |   5 +-
 .../net/echo_server/prj_arduino_101_cc2520.conf    |   5 +-
 samples/net/echo_server/prj_bt.conf                |   5 +-
 samples/net/echo_server/prj_cc2520.conf            |   3 +-
 samples/net/echo_server/prj_frdm_k64f.conf         |   3 +-
 samples/net/echo_server/prj_frdm_k64f_cc2520.conf  |   3 +-
 samples/net/echo_server/prj_frdm_k64f_mcr20a.conf  |   3 +-
 samples/net/echo_server/prj_nrf5.conf              |   3 +-
 samples/net/echo_server/prj_qemu_802154.conf       |   3 +-
 samples/net/echo_server/prj_qemu_cortex_m3.conf    |   3 +-
 samples/net/echo_server/prj_qemu_x86.conf          |   9 +-
 samples/net/echo_server/prj_sam_e70_xplained.conf  |   3 +-
 samples/net/echo_server/src/echo-server.c          |  47 +-
 samples/net/http_client/Makefile                   |   1 +
 samples/net/http_client/prj_frdm_k64f.conf         |   7 +-
 samples/net/http_client/prj_qemu_x86.conf          |  33 +
 samples/net/http_client/src/http_client.c          | 113 ----
 samples/net/http_client/src/http_client.h          |  23 +-
 samples/net/http_client/src/http_client_cb.c       |   6 +-
 samples/net/http_client/src/http_client_types.h    |   9 +
 samples/net/http_client/src/main.c                 |  26 +-
 samples/net/http_client/testcase.ini               |   2 +-
 samples/net/http_server/prj_frdm_k64f.conf         |   5 +-
 samples/net/http_server/prj_qemu_x86.conf          |  11 +-
 samples/net/http_server/src/http_server.c          |  11 +-
 samples/net/http_server/src/http_types.h           |  55 +-
 samples/net/http_server/src/http_write_utils.c     | 128 +---
 samples/net/http_server/src/http_write_utils.h     |  49 +-
 samples/net/http_server/src/main.c                 |   7 +-
 samples/net/ieee802154/hw/prj.conf                 |   3 +-
 samples/net/ieee802154/hw/prj_mcr20a.conf          |   3 +-
 samples/net/ieee802154/hw/prj_nrf5.conf            |   3 +-
 samples/net/ieee802154/qemu/prj.conf               |   3 +-
 samples/net/ieee802154/qemu/prj_client.conf        |   3 +-
 samples/net/ieee802154/qemu/prj_server.conf        |   3 +-
 samples/net/irc_bot/prj_frdm_k64f.conf             |   3 +-
 samples/net/irc_bot/prj_qemu_x86.conf              |   3 +-
 samples/net/irc_bot/src/irc-bot.c                  |   6 +-
 .../net/mbedtls_dtlsclient/prj_arduino_101.conf    |  14 +-
 samples/net/mbedtls_dtlsclient/src/udp.c           |  17 +
 samples/net/mbedtls_dtlsserver/src/dtls_server.c   |  13 +-
 samples/net/mbedtls_sslclient/prj_arduino_101.conf |   3 +-
 samples/net/mbedtls_sslclient/src/mini_client.c    |  29 +-
 samples/net/mbedtls_sslclient/src/tcp.c            | 182 +++--
 samples/net/mbedtls_sslclient/src/tcp.h            |  11 +-
 samples/net/mbedtls_sslclient/src/tcp_cfg.h        |  39 +-
 samples/net/mqtt_publisher/prj_96b_nitrogen.conf   |   3 +-
 samples/net/mqtt_publisher/prj_frdm_k64f.conf      |   3 +-
 samples/net/mqtt_publisher/prj_qemu_x86.conf       |   3 +-
 samples/net/nats/Makefile                          |  14 +
 samples/net/nats/README.rst                        | 159 +++++
 samples/net/nats/prj_qemu_x86.conf                 |  30 +
 samples/net/nats/src/Makefile                      |   3 +
 samples/net/nats/src/main.c                        | 324 +++++++++
 samples/net/nats/src/nats.c                        | 570 ++++++++++++++++
 samples/net/nats/src/nats.h                        |  47 ++
 samples/net/telnet/prj_frdm_k64f.conf              |   3 +-
 samples/net/telnet/prj_qemu_x86.conf               |   3 +-
 samples/net/telnet/prj_qemu_x86_iamcu.conf         |   3 +-
 samples/net/wpan_serial/src/main.c                 |   4 +-
 samples/net/wpanusb/src/wpanusb.c                  |   2 +-
 samples/net/zperf/prj_bt.conf                      |   3 +-
 samples/net/zperf/prj_frdm_k64f.conf               |   3 +-
 samples/net/zperf/prj_frdm_k64f_prof.conf          |   3 +-
 samples/net/zperf/prj_qemu_x86.conf                |   3 +-
 samples/net/zperf/prj_quark_se_c1000_devboard.conf |   3 +-
 scripts/sanitycheck                                |   2 +-
 subsys/net/Kconfig                                 |  11 +
 subsys/net/TODO                                    |  25 -
 subsys/net/buf.c                                   |  10 +
 subsys/net/ip/6lo.c                                |  56 +-
 subsys/net/ip/6lo_private.h                        |   6 +
 subsys/net/ip/Kconfig                              |  22 +-
 subsys/net/ip/Kconfig.debug                        |  10 +
 subsys/net/ip/Kconfig.ipv6                         |   8 +
 subsys/net/ip/Kconfig.stats                        |   7 +
 subsys/net/ip/connection.c                         |  20 +-
 subsys/net/ip/dhcpv4.c                             | 743 +++++++++++++--------
 subsys/net/ip/dhcpv4.h                             |  19 +
 subsys/net/ip/icmpv4.c                             |  13 +-
 subsys/net/ip/icmpv6.c                             | 107 ++-
 subsys/net/ip/icmpv6.h                             |   5 +-
 subsys/net/ip/ipv4.c                               |   4 +-
 subsys/net/ip/ipv4.h                               |   2 -
 subsys/net/ip/ipv6.c                               | 392 +++++++++--
 subsys/net/ip/ipv6.h                               |  37 +-
 subsys/net/ip/l2/arp.c                             |  15 +-
 subsys/net/ip/l2/bluetooth.c                       |  21 +-
 subsys/net/ip/l2/ieee802154/ieee802154.c           |  13 +-
 subsys/net/ip/l2/ieee802154/ieee802154_fragment.c  |  17 +-
 subsys/net/ip/l2/ieee802154/ieee802154_frame.c     |  44 +-
 subsys/net/ip/l2/ieee802154/ieee802154_frame.h     |   2 +-
 subsys/net/ip/l2/ieee802154/ieee802154_mgmt.c      |   1 +
 subsys/net/ip/nbuf.c                               | 644 +++++++++++-------
 subsys/net/ip/net_context.c                        |  40 +-
 subsys/net/ip/net_core.c                           | 207 +++---
 subsys/net/ip/net_if.c                             | 262 ++++++--
 subsys/net/ip/net_shell.c                          | 255 +++++--
 subsys/net/ip/net_stats.h                          |  21 +
 subsys/net/ip/rpl.c                                |  40 +-
 subsys/net/ip/tcp.c                                |  94 ++-
 subsys/net/ip/tcp.h                                |  12 -
 subsys/net/lib/Kbuild                              |   2 +-
 subsys/net/lib/Makefile                            |   2 +-
 subsys/net/lib/dns/dns_client.c                    |  30 +-
 subsys/net/lib/dns/dns_pack.c                      |  10 +-
 subsys/net/lib/dns/dns_pack.h                      |   4 +-
 subsys/net/lib/http/Kconfig                        |  33 +
 subsys/net/lib/http/Makefile                       |   4 +-
 subsys/net/lib/http/http_client.c                  | 154 +++++
 subsys/net/lib/http/http_server.c                  | 127 ++++
 subsys/net/lib/zoap/zoap_link_format.c             |   5 +-
 tests/net/6lo/prj.conf                             |   4 +-
 tests/net/6lo/src/main.c                           |   4 +-
 tests/net/arp/prj.conf                             |   3 +-
 tests/net/arp/src/main.c                           |  30 +-
 tests/net/context/prj.conf                         |   4 +-
 tests/net/dhcpv4/prj.conf                          |   3 +-
 tests/net/dhcpv4/src/main.c                        |  23 +-
 tests/net/icmpv6/prj.conf                          |   3 +-
 tests/net/icmpv6/src/main.c                        |  10 +-
 tests/net/ieee802154/fragment/prj.conf             |   3 +-
 tests/net/ieee802154/fragment/src/main.c           |   6 +-
 tests/net/ieee802154/l2/prj.conf                   |   3 +-
 tests/net/ieee802154/l2/src/ieee802154_test.c      |   2 +-
 tests/net/iface/prj.conf                           |   4 +-
 tests/net/ip-addr/prj.conf                         |   4 +-
 tests/net/ipv6/prj.conf                            |   3 +-
 tests/net/ipv6/src/main.c                          |  65 +-
 tests/net/lib/dns_packet/Makefile                  |   4 +
 tests/net/lib/dns_packet/prj.conf                  |  11 +
 tests/net/lib/dns_packet/src/Makefile              |   6 +
 tests/net/lib/dns_packet/src/dns_packet.c          | 186 ++++++
 tests/net/lib/dns_packet/testcase.ini              |   7 +
 tests/net/lib/http_header_fields/prj.conf          |   1 +
 tests/net/mgmt/prj.conf                            |   3 +-
 tests/net/mld/Makefile                             |   4 +
 tests/net/mld/prj.conf                             |  27 +
 tests/net/mld/src/Makefile                         |   4 +
 tests/net/mld/src/main.c                           | 458 +++++++++++++
 tests/net/mld/testcase.ini                         |   5 +
 tests/net/nbuf/prj.conf                            |   3 +-
 tests/net/nbuf/src/main.c                          |  80 ++-
 tests/net/neighbor/prj.conf                        |   3 +-
 tests/net/route/prj.conf                           |   4 +-
 tests/net/route/src/main.c                         |   9 +-
 tests/net/rpl/prj.conf                             |   4 +-
 tests/net/rpl/src/main.c                           |   3 +-
 tests/net/tcp/prj.conf                             |   3 +-
 tests/net/tcp/src/main.c                           |  14 +-
 tests/net/trickle/prj.conf                         |   3 +-
 tests/net/udp/prj.conf                             |   3 +-
 tests/net/udp/src/main.c                           |   4 +-
 tests/net/utils/prj.conf                           |   3 +-
 tests/net/utils/src/main.c                         |  24 +-
 207 files changed, 6413 insertions(+), 1932 deletions(-)
 create mode 100644 include/net/http.h
 create mode 100644 lib/json/Kconfig
 create mode 100644 lib/json/Makefile
 create mode 100644 lib/json/json.c
 create mode 100644 lib/json/json.h
 create mode 100644 samples/net/http_client/prj_qemu_x86.conf
 create mode 100644 samples/net/nats/Makefile
 create mode 100644 samples/net/nats/README.rst
 create mode 100644 samples/net/nats/prj_qemu_x86.conf
 create mode 100644 samples/net/nats/src/Makefile
 create mode 100644 samples/net/nats/src/main.c
 create mode 100644 samples/net/nats/src/nats.c
 create mode 100644 samples/net/nats/src/nats.h
 create mode 100644 subsys/net/ip/dhcpv4.h
 create mode 100644 subsys/net/lib/http/http_client.c
 create mode 100644 subsys/net/lib/http/http_server.c
 create mode 100644 tests/net/lib/dns_packet/Makefile
 create mode 100644 tests/net/lib/dns_packet/prj.conf
 create mode 100644 tests/net/lib/dns_packet/src/Makefile
 create mode 100644 tests/net/lib/dns_packet/src/dns_packet.c
 create mode 100644 tests/net/lib/dns_packet/testcase.ini
 create mode 100644 tests/net/mld/Makefile
 create mode 100644 tests/net/mld/prj.conf
 create mode 100644 tests/net/mld/src/Makefile
 create mode 100644 tests/net/mld/src/main.c
 create mode 100644 tests/net/mld/testcase.ini

Change-Id: Id5135d0234830c6778e609e4fae592d1c28cd7cf
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:51:51 +02:00
Jukka Rissanen
a060553666 net: if: Skip error print for already joined mcast group
No need to print error if we have already joined a pre-defined
multicast group.

Change-Id: I1237d5fbf0b63267ccb00432522513358c48d31d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:51 +02:00
Jukka Rissanen
011392dafd net: if: Fix compiler warning when printing TX stack size
Wrong type modifier %zu in debug print, should be %d.

Change-Id: I82feca91d9e083a03263477569c552acc7c9767f
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:50 +02:00
Luiz Augusto von Dentz
50ec0864c6 net: bt: Fix memory corruption
Patch 235118245864491a592245f57e5244bf61711943 did not set the ll
addresses in the right buffer which causes 6lo to unref buffers
causing a double unref latter.

Jira: ZEP-1890

Change-Id: Id7591ef3c20c7ab62dcb04576406d70602baa129
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-03-09 20:33:50 +02:00
Tomasz Bursztyka
b1d73aaa98 net/ieee802154: Use pre-filled link address as ll target
IPv6 fills in lladdr_dst properly according to nexthop. Thus it's
useless to lookup again for nbr when creating data frame etc... Let's
use this directly. It both optimizes the code path as well as implements
proper nexthop frame sending.

Jira: ZEP-1863

Change-Id: Ic17a1b14a0db0692d31419ea2f45a5f288a09fb5
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-03-09 20:33:50 +02:00
Tomasz Bursztyka
fac10f9b9a net/ieee802154: Display which channel is being scanned
Change-Id: I1917db4ac0ce5e65aff98a290401fa3caa896520
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-03-09 20:33:50 +02:00
Tomasz Bursztyka
bd7cd8c056 drivers/net/ieee802154: Display the wrong channel setting in error msg
Change-Id: I42987715594f35aa0bc77a17970c430b5605f199
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-03-09 20:33:50 +02:00
Juan Manuel Cruz Alcaraz
172c031ec9 sample: net: mbedtls ssl: SSL client sample is adapted to TCP API
Jira: ZEP-1798

Change-Id: I790cd49cb7cc5ed207141ca6634999d77d6a19bb
Signed-off-by: Juan Manuel Cruz Alcaraz <juan.m.cruz.alcaraz@intel.com>
2017-03-09 20:33:50 +02:00
Jukka Rissanen
695cfff535 samples: net: dtls_client: Fix memory leak in RX path
If we have not yet handled the previous RX buf, then we need
to drop the latest received one, otherwise the earlier net_buf
is leaked.

Change-Id: I1b69e07e8b3a3b87c76d923c847dc8316c128e76
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:50 +02:00
Jukka Rissanen
3a2bd9a162 samples: net: dtls_client: Fix mem leak in error path
We need to unref the net_buf in error path in RX and TX.

Change-Id: Icb6d43cb6b7411a5135ea09c6ae96742566fafc4
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:50 +02:00
Jukka Rissanen
dc8a019823 samples: net: dtls_client: RX buf count too low
The mbedtls_dtlsclient needs more RX buffers.

Jira: ZEP-1855

Change-Id: I80732c511dfade8fa9139e3bd26e21de73a68acd
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:50 +02:00
Jukka Rissanen
b1aadd0b3a samples: net: http_server: Disable mbedtls
Sanitycheck cannot link the result qemu binary because it is too
large. As a workaround, disable mbedtls to get the linking pass.

.../real-ld: zephyr.elf section `noinit' will not fit in region `RAM'
.../real-ld: region `RAM' overflowed by 192 bytes
collect2: error: ld returned 1 exit status

Change-Id: I543571505ab9412db7eac101848c6032d1550d79
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:50 +02:00
Juan Manuel Cruz Alcaraz
6828412f27 samples: dtls client: DTLS client sample configuration file
The configuration file for Arduino 101 for the DTLS client
sample needs to define IPv4 and IPv6 addresses.

Jira: ZEP-1169

Change-Id: Iabfd5f067d39faaf8796aac84642b630b11ef7f6
Signed-off-by: Juan Manuel Cruz Alcaraz <juan.m.cruz.alcaraz@intel.com>
2017-03-09 20:33:50 +02:00
Flavio Santes
87bc931826 samples/net: Add the HTTP API to the HTTP client sample application
This patch replaces some routines found at the HTTP client sample
application by the ones defined at the HTTP API.

Jira: ZEP-1824

Change-Id: Id19e3e346c09716ac95b0c488ff6e6949a5fbabe
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-09 20:33:50 +02:00
Flavio Santes
848966be43 samples/net: Add the HTTP API to the HTTP server sample application
This patch removes some routines from the HTTP server sample
application and replaces them by the ones defined at the HTTP API.

Jira: ZEP-1824

Change-Id: Ia5db424d62997e01896294e12224aa65a58db432
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-09 20:33:50 +02:00
Flavio Santes
8308b9bd2d net/http: Add the HTTP/1.1 API
This patch adds the HTTP/1.1 API for Zephyr. This API consists of client
and server context structures enabled via Kconfig variables.
HTTP parser support is enabled via the CONFIG_HTTP_PARSER configuration
variable.

Currently, this API only includes support for writing HTTP requests
(client mode) and HTTP responses (server mode). TLS support is not
considered in this iteration.

Supported HTTP methods:
	GET, HEAD, OPTIONS and POST.

Supported HTTP responses:
	400, 403 404. The http_response routine may be used to write
	any HTTP status code, for example 200 OK.

Jira: ZEP-1701

Change-Id: Ic9ccd4d4578d6d0f3a439976ea332b031644ca7d
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-09 20:33:49 +02:00
Flavio Santes
e29202593d samples/net: Add the QEMU x86 prj file to the HTTP client sample app
Add the QEMU x86 project configuration file to the HTTP client sample app.

Change-Id: Ice6ae3f3559680e1d182506671984fd5f946f1d8
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-09 20:33:49 +02:00
Flavio Santes
f6d40023b4 samples/net: Fix format warning in the HTTP client sample app
Fix a printk format warning found at the HTTP client sample app.

Change-Id: I9665e3e59595b383d6e809af51fe4cf3cd8f8bd8
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-09 20:33:49 +02:00