Commit graph

18396 commits

Author SHA1 Message Date
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
Flavio Santes
a561f5e1c7 samples/net/http_client: Cast size_t to int to avoid compiler warnings
Cast size_t to int in the http_client_cb code.

Change-Id: I36133da953669ec133421b5e7fb21bec9807fd06
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-09 20:33:49 +02:00
Tomasz Bursztyka
e38a9e8b9c net: Switch from per-iface tx thread to a unique k_poll triggered one
Now that k_poll landed in the kernel, it's worth using it to save
memory and reduce the number of threads at runtime.

Such switch has been first done in bluetooth (see hci_core.c and conn.c
in subsys/bluetooth/host). Since network interfaces kind of follows the
same design for sending data, it was then easy to copy the same change as
in bluetooth.

Change-Id: I7f9734b88ac818284bbabaedc946b4765b905ebb
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-03-09 20:33:49 +02:00
Michael Scott
0453629078 net: ip: Fix 6lo buffer leak when sending ACK
Due to recent TCP fixes for 6lo, we are making a copy of buffers
sent to net_tcp_send_buf() so that TCP retransmit can send the original
(unmodified) buffer.  This original buffer is freed via the TCP
sent_list when the related ACK packet is received.

However, there are users of the net_tcp_send_buf() function which
will never get a corresponding ACK (and do not add the buffer to the
TCP sent_list).  An example is send_ack() in net_context.c.  In this
case, we leak the original buffer.

To fix this leak in the 6lo specific block of net_tcp_send_buf(),
let's check to see if the original buffer was added to the TCP sent_list
and if not, then avoid the buffer copy process entirely.

Change-Id: If99e0e5bf266d33dd3466dc5d74443eaa39d10a8
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-03-09 20:33:49 +02:00
Flavio Santes
bed2f43120 tests/net/dns: Add the test case for the DNS low-level routines
This patch adds the test case for the DNS API low-level routines.

The following routines are evaluated by this test case:

- dns_msg_pack_qname
- dns_msg_pack_query
- dns_unpack_header_id
- dns_header_qr
- dns_header_opcode
- dns_header_aa
- dns_header_tc
- dns_header_rd
- dns_header_ra
- dns_header_z
- dns_header_rcode
- dns_header_qdcount
- dns_header_ancount
- dns_header_nscount
- dns_header_arcount
- dns_unpack_query_qclass
- dns_unpack_query_qtype

Next iterations will consider IPv6 and DNS RR coverage.

Jira: ZEP-1499

Change-Id: I4ef46203e6fec57c6fe5a5db8132ed140b412fc2
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-09 20:33:49 +02:00
Flavio Santes
1532013f53 net/dns: Fix style issues
Don't break lines after the static keyword.

Change-Id: I46e3a427d819f864c57b142f38b8956d93b6d428
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-09 20:33:49 +02:00
Flavio Santes
f4890e2d87 net/dns: Add the static keyword to the dns_find_null routine
The static keyword is missing in the dns_find_null function definition.

Change-Id: I19c89ca61b6ff550bf7ccb2ca9065a957532ede1
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-09 20:33:49 +02:00
Flavio Santes
e376a68bd1 net/dns: Fix style issues in the DNS high-level API
Don't break the line after the static keyword.

Change-Id: I51343124ae3b3a2f9b4916c5279ba09b8c08fd9a
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-09 20:33:49 +02:00
Jukka Rissanen
6ff97e40c4 net: core: Use K_NO_WAIT when spawning RX and TX threads
Instead of magic constant (0) use the K_NO_WAIT when spawning
a thread.

Change-Id: Ib3a181fdfa246843d9c708592ccc754e54bc6005
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:49 +02:00
Jukka Rissanen
2e552b2b59 net: core: Mark RX and TX threads essential
As the networking cannot work without RX or TX threads, mark
them as essential.

Change-Id: Icb52c77fcdcef35d77c36e5ec855fed438a38407
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:49 +02:00
Jukka Rissanen
df19a423b0 net: todo: Mark multicast join/leave support done
Jira: ZEP-828

Change-Id: I806a80cdc532ac02122f54fbb7df60fa0f3883a4
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:48 +02:00
Jukka Rissanen
aa95a93f38 net: iface: Print error if we cannot join mcast groups
If we cannot join pre-defined allnodes or solicit node multicast
groups, then print error. Typically this will happen if the number
of multicast IPv6 address records is too small in net_if struct.

Change-Id: I12211cff90ef4edc856f1432cab0c37aae9a1bd5
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:48 +02:00
Jukka Rissanen
e82f7a6a31 tests: net: Check allnodes and solicit node addresses.
Make sure that the network interface has proper allnodes and
solicit node multicast addresses set.

Change-Id: I2318d63df0b5d09dfaa8347b69c843b84ed63f4b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:48 +02:00
Jukka Rissanen
253e9a377f tests: net: Add MLD query tests
Add tests for verifying that we can receive Multicast Listener
Discovery query and act on it.

Change-Id: I926cf5e9f77cd250d2d7094f2379e320ef163540
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:48 +02:00
Jukka Rissanen
29a6cc0add net: icmpv6: Add function to unregister ICMPv6 handler
This is only needed when doing unit tests.

Change-Id: Ifd4e5e8ea98e3ab2344ed0c19d92f2be7d8008f8
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:48 +02:00
Jukka Rissanen
75b550e81d net: ipv6: Collect MLD statistics
Collect number of received, sent or dropped multicast listener
reports and queries.

Change-Id: Ia5c08203155475763f96df23f44eceffa7569873
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:48 +02:00
Jukka Rissanen
8d8e3772e6 net: ipv6: Respond to MLD query
If we receive MLDv2 (Multicast Listener Discover) query,
we send out information about the multicast groups that
we have joined.

Change-Id: If4ea9fa685319b2ad900e1949a5cbe12e7696b43
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:48 +02:00
Jukka Rissanen
d0fc787c21 tests: net: Add unit tests for mld
MLD (Multicast Listerer Discovery) unit tests when joining
or leaving an IPv6 multicast group.

Change-Id: I7cd0f4c5f31c693d816fb5d27d3d23bb27679c35
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:48 +02:00
Jukka Rissanen
ef2ee88af1 net: ipv6: Add router alert option to MLD msg
As dictated by RFC 3810 ch 5, we need to add Hop-by-Hop option
with Router Alert sub-option to the sent multicast listener
message.

Change-Id: I8e3ed58fff4736e9708276a3185f94e7f2b453a3
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:48 +02:00
Jukka Rissanen
c89270c670 net: if: Create support to flush the TX queue
If we are taking network interface down, then flush the TX for any
pending bufs that would be needed to be sent.

Change-Id: I229ecce8e07ec5847d4c6c6a1994de04bd9171e2
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:48 +02:00
Jukka Rissanen
82267e7bd4 net: ipv6: Allow joining to existing multicast address
If the multicast address already exists, then do not give
error but try to join it.

Change-Id: I32ffa6b3bf0798011d684a1a21e87e389f1f0380
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:48 +02:00
Jukka Rissanen
f8467437e6 net: if: Leave all joined IPv6 multicast groups at net_if_down
When network interface is taken down, leave only those
IPv6 multicast groups that were joined.

Change-Id: I414556c093ba67be7c13e6c86e0451465c2203f3
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:48 +02:00
Jukka Rissanen
c3c76f35cc net: ipv6: Notify others if we join/leave IPv6 mcast group
Send management event if we joined or leaved IPv6 multicast
group.

Change-Id: Ieeb407ef88fb3bf4cd92d4fb4b69f03b260474e7
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:48 +02:00
Jukka Rissanen
ba5bb5a9df net: if: Join/leave pre-defined IPv6 multicast groups
When we setup the network interface, add predefined IPv6 multicast
groups into the network interface. When interface is taken down,
then leave all the multicast groups that joined.
See RFC 4291 ch 2.8 for details.

Change-Id: If17d3e8c75157a02aa93c92e2fb499619c1484cf
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:47 +02:00
Jukka Rissanen
74e747a27f net: ipv6: Add support to join/leave multicast group
This and subsequent commits adds API to join or leave
an IPv6 multicast group.

Jira: ZEP-1673

Change-Id: I26dcfe16a4527dbf7886a30827a5d4ebfdeaac01
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:47 +02:00