zephyr/samples/net/virtual
Gerard Marull-Paretas 79e6b0e0f6 includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h>
As of today <zephyr/zephyr.h> is 100% equivalent to <zephyr/kernel.h>.
This patch proposes to then include <zephyr/kernel.h> instead of
<zephyr/zephyr.h> since it is more clear that you are including the
Kernel APIs and (probably) nothing else. <zephyr/zephyr.h> sounds like a
catch-all header that may be confusing. Most applications need to
include a bunch of other things to compile, e.g. driver headers or
subsystem headers like BT, logging, etc.

The idea of a catch-all header in Zephyr is probably not feasible
anyway. Reason is that Zephyr is not a library, like it could be for
example `libpython`. Zephyr provides many utilities nowadays: a kernel,
drivers, subsystems, etc and things will likely grow. A catch-all header
would be massive, difficult to keep up-to-date. It is also likely that
an application will only build a small subset. Note that subsystem-level
headers may use a catch-all approach to make things easier, though.

NOTE: This patch is **NOT** removing the header, just removing its usage
in-tree. I'd advocate for its deprecation (add a #warning on it), but I
understand many people will have concerns.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-09-05 16:31:47 +02:00
..
src includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
CMakeLists.txt cmake: increase minimal required version to 3.20.0 2021-08-20 09:47:34 +02:00
Kconfig
README.rst everywhere: fix typos 2022-03-18 13:24:08 -04:00
prj.conf
sample.yaml

README.rst

.. _virtual_network_interface-sample:

Virtual Network Interface Application
#####################################

Overview
********

This sample application creates a sample virtual network interface for
demonstrative purposes, it does not do anything useful here.
There are total 4 network interfaces.
Ethernet network interface is providing the real network interface and
all the virtual interfaces are running on top of it.
On top of Ethernet interface there are two virtual network interfaces,
one provides only IPv6 tunnel, and the other only IPv4. These two tunnels
are provided by IPIP tunnel.
The sample provides tunnel interface which runs on top of the IPv6 tunnel.

The source code for this sample application can be found at:
:zephyr_file:`samples/net/virtual`.

Requirements
************

- :ref:`networking_with_host`

Building and Running
********************

The `net-tools`_ project provides a configuration that can be used
to create a sample tunnels in host side.

.. code-block:: console

	net-setup.sh -c zeth-tunnel.conf

Note that the sample application expects that the board provides
an Ethernet network interface. Build the sample application like this:

.. zephyr-app-commands::
   :zephyr-app: samples/net/virtual
   :board: <board to use>
   :goals: build
   :compact:

.. _`net-tools`: https://github.com/zephyrproject-rtos/net-tools