Commit graph

39 commits

Author SHA1 Message Date
Adam Wojasinski 58a611d814 net: ptp: Initial PTP library implementation
This is an initial commit that introduces PTP library in the Zephyr.
It adds basic Kconfig symbols for enabling library, CMakeLists.txt
for compiling it, public header file, and initial PTP thread definition
and library initialization. Implementation of the functional PTP stack
will be introduced in following commits.

Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
2024-06-13 05:40:41 -04:00
Jukka Rissanen 4b157b9099 net: lib: http_server: Initial HTTP server support
Original code developed as a GSoC 2023 project by Emna Rekik.

Code refactored in order to provide better bisectability
as the origical commits were not bisectable.

The server supports static and dynamic resources, managed by
HTTP_SERVICE/HTTP_RESOURCE macros.

Fixes #59685
Fixes #59686
Fixes #59688
Fixes #59690
Fixes #59670
Fixes #59700
Fixes #59684
Fixes #59693
Fixes #59693
Fixes #59694
Fixes #59699
Fixes #59696
Fixes #59688
Fixes #59690
Fixes #59670
Fixes #59700
Fixes #59685
Fixes #59686
Fixes #59688
Fixes #59691

Signed-off-by: Emna Rekik <emna.rekik007@gmail.com>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-04-30 13:25:22 +02:00
Robert Lubos cefc391db3 net: dhcpv6: Move DHCPv6 files to lib directory
For consistency with DHCPv4.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-01-29 13:47:05 +01:00
Robert Lubos 19722aa8e8 net: dhcpv4: Move DHCPv4 files to lib directory
As discussed during DHCPv4 server integration, group DHCPv4 client files
with DHCPv4 server in a single lib directory.

Renamed internal "dhcpv4.h" header to "dhcpv4_internal.h" so that it's
not confused with the public "dhcpv4.h" header.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-01-29 13:47:05 +01:00
Robert Lubos 1e08bbd543 net: dhcpv4: Implement DHCPv4 server
Add basic socket-based implementation of DHCPv4 sever.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-01-19 10:15:23 +00:00
Jukka Rissanen b6d9ed095d net: Move trickle files to lib
The trickle algorithm files are clearly a library so move
them under lib/ directory.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-12-11 10:50:35 +01:00
Jukka Rissanen 56c1bb813f net: shell: Move the shell code to subsys/net/lib/shell
This is preparation commit that moves the net shell code to
subsys/net/lib/shell directory. The following commits will
then refactor the code in net_shell.c to smaller and more
manageable pieces.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-10-23 10:40:28 +02:00
Georges Oates_Larsen 716c19f7ef net: conn_mgr: Reorganize files
Since conn_mgr is a subsystem rather than a library, relocate it
directly into subsys/net rather than subsys/net/lib/

Rename header files to better match their function.

Remove net_ prefix from conn_mgr types, API, and files, since it is
unnecessary.

Signed-off-by: Georges Oates_Larsen <georges.larsen@nordicsemi.no>
2023-05-11 12:15:44 +02:00
René Beckmann 26758117d6 net: mqtt-sn: Add MQTT-SN library
This commit adds an implementation of MQTT-SN v1.2.
The specification is available on oasis-open.org:
https://www.oasis-open.org/committees/download.php/66091/MQTT-SN_spec_v1.2.pdf

The following things are missing in this implementation:
- Pre-defined topic IDs
- QoS -1 - it's most useful with predefined topics
- Gateway discovery using ADVERTISE, SEARCHGW and GWINFO messages.
- Setting the will topic and message after the initial connect
- Forwarder Encapsulation

Signed-off-by: René Beckmann <rene.beckmann@grandcentrix.net>
2022-11-09 10:43:00 +01:00
Robert Lubos 2091b34820 net: zperf: Extract zperf into library
Make a library out of the zperf shell sample. This makes to enable the
module in any application, not only the dedicated sample.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-08-10 11:15:21 +02:00
Robert Lubos 815ebc316e net: openthread: Move glue code into module directory
Move OpenThread's glue code along with the Kconfig files that configure
OpenThread stack itself into module directory.

Update the maintainers file to reflect this change.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-07-11 11:00:12 +02:00
Jukka Rissanen e917d80473 net: capture: Add support for network packet capturing
Add infrastructure to allow user to configure the system so that
all the network packets, that are sent to or received from a specific
network interface, are sent to remote system for analysis.
The captured network packets are placed as a payload in UDP packet,
which is then sent inside a tunnel to a remote host. The host can
then receive the packets and for example show them in wireshark.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-04-02 07:24:06 -04:00
Eduardo Montoya 526fca251f net: openthread: Align Kconfig with cmake symbols
Reorder and add missing symbols.
Organize some options in submenus.

Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
2020-08-18 15:57:14 +03:00
Carles Cufi 244f826e3c cmake: remove _if_kconfig() functions
This set of functions seem to be there just because of historical
reasons, stemming from Kbuild. They are non-obvious and prone to errors,
so remove them in favor of the `_ifdef()` ones with an explicit
`CONFIG_` condition.

Script used:

git grep -l _if_kconfig | xargs sed -E -i
"s/_if_kconfig\(\s*(\w*)/_ifdef(CONFIG_\U\1\E \1/g"

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-08-01 12:35:20 +02:00
Bilal Wasim 220b664617 net: tftp: Adding support for TFTP Client.
Adding RFC1350 compliant support for TFTP Client in Zephyr. The
current implementation is minimal and only supports the ability
to get a file from the server.

Things for the future include support for putting files to
server and adding support for RFC2347.

Signed-off-by: Bilal Wasim <bilalwasim676@gmail.com>
2020-04-30 14:19:46 +03:00
Jukka Rissanen 6af987646f net: websocket: client: Simple API for Websocket client
Implement simple API to do Websocket client requests.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-10-04 16:38:34 +03:00
Jukka Rissanen eb40499627 net: http: client: Initial version
Simple HTTP client API.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-10-04 16:38:34 +03:00
Tomasz Bursztyka b2e71a2fa2 net: Add a connection manager preliminary logic
It currently only listens to relevant events about network interface to
decide whether raising connected or disconnected event.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-07-12 12:33:19 +03:00
Loic Poulain 4f4adae271 net: lib: Fix missing dns subdir include
The dns directory was not included when building with
MDNS_RESONDER or LLMR_RESPONDER configs.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2019-06-12 13:59:27 +03:00
Paul Sokolovsky 426f3fa1ac net: socketutils: Add utils to manipulate network address strings
Two utils to manipulate addresses in format "addr[:port]". I.e.,
network address (domain name or numeric), optionally followed by
port number:

* net_addr_str_find_port(), to return pointer to port number
substring (or NULL if not present).
* net_getaddrinfo_addr_str(), which is effectively getaddrinfo()
wrapper taking a "addr[:port]" string as a parameter.

The header file is named socketutils.h to emphasize that these
utility functions are implemented on top of BSD Sockets API
(and other POSIX/ANSI C functions), and thus portable to other
POSIX systems (e.g., Linux), so can be used in apps testing
POSIX compatibility. More utility functions (beyond address
manipulation) can be added later.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-05-10 13:44:32 +03:00
Anas Nashif 3ae52624ff license: cleanup: add SPDX Apache-2.0 license identifier
Update the files which contain no license information with the
'Apache-2.0' SPDX license identifier.  Many source files in the tree are
missing licensing information, which makes it harder for compliance
tools to determine the correct license.

By default all files without license information are under the default
license of Zephyr, which is Apache version 2.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-04-07 08:45:22 -04:00
Kumar Gala abeed4ab74 net: lib: Remove CONFIG_HTTP reference
CONFIG_HTTP isn't a Kconfig symbol so remove reference to it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-11 22:29:58 -05:00
Tomasz Gorochowik ead249f2f9 net: Add initial SOCKS5 support
This adds some very basic SOCKS5 proxy client support.

Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
2019-02-08 14:20:44 +02:00
Robert Lubos 418b9236fa net: lib: mqtt: Get rid of _sock suffix
As the legacy library has been removed, we no longer need to
differentiate betwen MQTT implementations. Therefore align the library
folder name with other libraries and remove the `_sock` suffix.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2019-02-05 11:05:26 -05:00
Jukka Rissanen d1162600e9 net: app: Remove net-app API files
The net-app API is removed. Users should use the BSD socket API
for application development.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-02-01 12:29:21 +02:00
Jukka Rissanen 581261334c net: mqtt: Remove legacy MQTT library
The old and deprecated net-app based MQTT library is removed.
See the BSD socket based MQTT library for a replacement.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-01-29 07:11:23 -05:00
Jukka Rissanen 1cba0161ed net: websocket: Remove the websocket as HTTP APIs are removed
Remove the experimental websocket code as it uses HTTP APIs
which are being removed.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-01-25 11:21:20 -05:00
Anas Nashif 3d906dc4c1 net: coap: Move both CoAP implementations into one Kconfig
Two separate folders and Kconfig options causing confusion on
CoAP and CoAP_SOCK implementations. This patch simplifies it.
Current CoAP Kconfig option moved to COAP_NET_PKT.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-22 09:08:46 -05:00
Robert Lubos 37563a92d5 net: mqtt: Add BSD socket implementation
Add new, socket based MQTT implementation, based on MQTT from Nordic
nRF5 SDK, introducing the following features:

* transport independent MQTT logic, with support for multiple transports
* support for multiple MQTT versions (3.1.0 and 3.1.1 supported)
* single event handler - no need to keep callback array in RAM
* automatic send of Ping Requests, for connection keep-alive
* message/event parameters wrapped into strucutres - easier extension
  for future MQTT versions
* no separate thread needed to run MQTT - application only needs to call
  mqtt_input and mqtt_live periodically

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-11-19 09:31:01 -05:00
Robert Lubos f50aa6d3fb net: mqtt: Mark existing implementation as legacy
Rename existing headers and sybols to mqtt_legacy, to allow new
implementation to keep old config and header names.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-11-19 09:31:01 -05:00
Ravi kumar Veeramally c8954d3544 net: coap: CoAP library support over sockets
CoAP library is migrated to support over socket based
applications or other higher layer protocols. Most of the
API's and functionality is kept as it is except few changes.

net_pkt/net_buf is removed from CoAP library. Now it expects
a pre-allocated flat buffer and length. If there is not enough
space to append any data, library simply returns an error.
It's user's responsibility to allocate and free memory.

One change in functionality is, earlier coap_pending_clear()
used to clear the memory, but now it's user's responsibility
to free the memory.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-10-31 19:44:25 -04:00
Paul Sokolovsky 028aae1ec9 net: config: Rename Kconfig options to correspond to library name
This finishes refactor of splitting off net_config library name from
net_app library, started in c60df1311, c89a06dbc. This commit makes
sure that Kconfig options are prefixed with CONFIG_NET_CONFIG_
instead of CONFIG_NET_APP_, and propagates these changes thru the
app configs in the tree.

Also, minor dependency, etc. tweaks are made.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-08-13 18:42:31 -07:00
Robert Lubos d09cbcaf6f net: tls: Add credential management subsystem
Add TLS credential management subsystem that enables to register TLS
credentials in the system. Once specific credentials are registered in
the system, they will be available for TLS secure sockets to use.

To use a TLS credential with a socket, the following steps have to be
taken:
1. TLS credential has to be registered in a system-wide pool, using the
API provided in "net/tls_credentials.h" header file.
2. TLS credential (and other TLS parameters) should be set on a socket
using setsockopt().

Note, that there is no need to repeat step 1 for different sockets using
the same credentials. Once TLS credential is registered in the system,
it can be used with mulitple sockets, as long as it's not deleted.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-07-26 12:13:15 -04:00
Paul Sokolovsky c60df13110 net: app: Split code for configuring network to a separate lib, "config"
net_app library consisted of 2 disjoint parts: a) library to
setup/configure networking on the application startup; b) library
to setup client and server connections.

As the configuration library is universally useful and is a generic
Zephyr networking component, split it out to a seperate top-level
networking library under net/lib/config/.

Fixes: #7658

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-06-20 17:10:39 +03:00
Jukka Rissanen d70c7383de net: websocket: Initial support for server websocket
This commit creates a websocket library that can be used by
applications. The websocket library implements currently only
server role and it uses services provided by net-app API.
The library supports TLS if enabled in configuration file.

This also adds websocket calls to HTTP app server if websocket
connection is established.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-03-15 15:17:36 +02:00
Kamil Sroka 83b2218ab5 subsys: net: lib: Add OpenThread platform
OpenThread requires platform definition with standarized API
so we have to add wrappers to make it compatible with Zephyr.
OpenThread is based on autoconf, this requires
more specific CMakeLists.txt which allows to clone specific
commit or point to local copy of openthread.

Signed-off-by: Kamil Sroka <kamil.sroka@nordicsemi.no>
2018-01-29 22:42:03 -05:00
Anas Nashif 13b08296e1 net: remove zoap library
We now have coap, all dependencies have been removed, so cleanup for the
next release.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-02 09:41:24 -05:00
Sebastian Bøe dad876f837 cmake: Fixed subsys/net/lib/http
This fixes the CI failure of the sample lwm2m_client.

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Sebastian Bøe 12f8f76165 Introduce cmake-based rewrite of KBuild
Introducing CMake is an important step in a larger effort to make
Zephyr easy to use for application developers working on different
platforms with different development environment needs.

Simplified, this change retains Kconfig as-is, and replaces all
Makefiles with CMakeLists.txt. The DSL-like Make language that KBuild
offers is replaced by a set of CMake extentions. These extentions have
either provided simple one-to-one translations of KBuild features or
introduced new concepts that replace KBuild concepts.

This is a breaking change for existing test infrastructure and build
scripts that are maintained out-of-tree. But for FW itself, no porting
should be necessary.

For users that just want to continue their work with minimal
disruption the following should suffice:

Install CMake 3.8.2+

Port any out-of-tree Makefiles to CMake.

Learn the absolute minimum about the new command line interface:

$ cd samples/hello_world
$ mkdir build && cd build
$ cmake -DBOARD=nrf52_pca10040 ..

$ cd build
$ make

PR: zephyrproject-rtos#4692
docs: http://docs.zephyrproject.org/getting_started/getting_started.html

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00