2018-02-21 22:18:35 +08:00
|
|
|
# Kconfig - Native posix ethernet driver configuration options
|
|
|
|
|
|
|
|
# Copyright (c) 2018 Intel Corporation
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
menuconfig ETH_NATIVE_POSIX
|
2018-03-25 23:17:57 +08:00
|
|
|
bool "Native Posix Ethernet driver"
|
2018-12-28 02:10:14 +08:00
|
|
|
depends on ARCH_POSIX
|
2018-02-21 22:18:35 +08:00
|
|
|
help
|
|
|
|
Enable native posix ethernet driver. Note, this driver is run inside
|
|
|
|
a process in your host system.
|
|
|
|
|
|
|
|
if ETH_NATIVE_POSIX
|
2018-10-17 18:48:51 +08:00
|
|
|
config ETH_NATIVE_POSIX_STARTUP_AUTOMATIC
|
|
|
|
bool "Start network interface automatically"
|
|
|
|
help
|
|
|
|
If set, the native_posix ethernet driver will set up the network
|
|
|
|
interface, requiring ``zephyr.exe`` to be run with root privileges
|
|
|
|
(needed to create and configure the TAP device).
|
|
|
|
If not set (the default and recommended way), the network interface
|
|
|
|
must be set up manually using ``net-setup.sh`` (from the net-tools
|
|
|
|
project repo). The ``zephyr.exe`` program can then be run as a
|
|
|
|
non-root user.
|
|
|
|
|
|
|
|
if ETH_NATIVE_POSIX_STARTUP_AUTOMATIC
|
|
|
|
|
2018-02-21 22:18:35 +08:00
|
|
|
config ETH_NATIVE_POSIX_SETUP_SCRIPT
|
|
|
|
string "Host setup script"
|
|
|
|
default "${ZEPHYR_BASE}/samples/net/eth_native_posix/net_setup_host"
|
|
|
|
help
|
|
|
|
This option sets the name of the script that is run when the host TAP
|
|
|
|
network interface is created. The script should setup IP addresses
|
|
|
|
etc. for the host TAP network interface.
|
|
|
|
The default script accepts following options:
|
|
|
|
-i|--interface <network interface name>, default is zeth
|
|
|
|
-f|--file <config file name>, default is net_setup_host.conf
|
|
|
|
If needed, you can add these options to this script name option.
|
|
|
|
Note that the driver will add -i option with the value of
|
|
|
|
CONFIG_ETH_NATIVE_POSIX_DRV_NAME option to the end of the options
|
|
|
|
list when calling the host setup script.
|
|
|
|
|
2018-08-01 16:09:33 +08:00
|
|
|
config ETH_NATIVE_POSIX_STARTUP_SCRIPT
|
|
|
|
string "Host startup script"
|
|
|
|
default ""
|
|
|
|
help
|
|
|
|
This option sets the name of the script that is run when the host TAP
|
|
|
|
network interface is created and setup script has been run.
|
|
|
|
The startup script could launch e.g., wireshark to capture
|
|
|
|
the network traffic for the freshly started network interface.
|
|
|
|
Note that the network interface name CONFIG_ETH_NATIVE_POSIX_DRV_NAME
|
|
|
|
is appended at the end of this startup script name.
|
|
|
|
Example script for starting wireshark is provided in
|
|
|
|
${ZEPHYR_BASE}/samples/net/eth_native_posix/net_start_wireshark.sh
|
|
|
|
file.
|
|
|
|
|
|
|
|
config ETH_NATIVE_POSIX_STARTUP_SCRIPT_USER
|
|
|
|
string "Username to run the host startup script"
|
|
|
|
default ""
|
|
|
|
help
|
|
|
|
By default the startup script is run as a root user. Set here the
|
|
|
|
username to run the script if running it as a root user is not
|
|
|
|
desired. Note that this setting is only for startup script and not
|
|
|
|
for the setup script. The setup script needs to be run always as
|
|
|
|
a root user.
|
|
|
|
|
2018-10-17 18:48:51 +08:00
|
|
|
endif # ETH_NATIVE_POSIX_STARTUP_AUTOMATIC
|
|
|
|
|
2018-02-21 22:18:35 +08:00
|
|
|
config ETH_NATIVE_POSIX_DRV_NAME
|
|
|
|
string "Ethernet driver name"
|
|
|
|
default "zeth"
|
|
|
|
help
|
|
|
|
This option sets the driver name and name of the network interface
|
|
|
|
in your host system.
|
|
|
|
|
|
|
|
config ETH_NATIVE_POSIX_DEV_NAME
|
|
|
|
string "Host ethernet TUN/TAP device name"
|
|
|
|
default "/dev/net/tun"
|
|
|
|
help
|
|
|
|
This option sets the TUN/TAP device name in your host system.
|
|
|
|
|
2018-03-13 03:54:19 +08:00
|
|
|
config ETH_NATIVE_POSIX_PTP_CLOCK
|
|
|
|
bool "PTP clock driver support"
|
2018-12-03 20:03:17 +08:00
|
|
|
default y if NET_GPTP
|
2018-03-13 03:54:19 +08:00
|
|
|
select PTP_CLOCK
|
|
|
|
depends on NET_GPTP
|
|
|
|
help
|
|
|
|
Enable PTP clock support.
|
|
|
|
|
2018-02-21 22:18:35 +08:00
|
|
|
config ETH_NATIVE_POSIX_RANDOM_MAC
|
|
|
|
bool "Random MAC address"
|
|
|
|
depends on ENTROPY_GENERATOR
|
|
|
|
default y
|
|
|
|
help
|
|
|
|
Generate a random MAC address dynamically.
|
|
|
|
|
2019-04-12 19:19:16 +08:00
|
|
|
config ETH_NATIVE_POSIX_VLAN_TAG_STRIP
|
|
|
|
bool "Strip VLAN tag from Rx frames"
|
|
|
|
depends on NET_VLAN
|
|
|
|
help
|
|
|
|
Native posix ethernet driver will strip of VLAN tag from
|
|
|
|
Rx Ethernet frames and sets tag information in net packet
|
|
|
|
metadata.
|
|
|
|
|
2018-02-21 22:18:35 +08:00
|
|
|
if ! ETH_NATIVE_POSIX_RANDOM_MAC
|
|
|
|
|
|
|
|
config ETH_NATIVE_POSIX_MAC_ADDR
|
|
|
|
string "MAC address for the interface"
|
|
|
|
default ""
|
|
|
|
help
|
|
|
|
Specify a MAC address for the ethernet interface in the form of
|
|
|
|
six hex 8-bit chars separated by colons (e.g.:
|
|
|
|
aa:33:cc:22:e2:c0). The default is an empty string, which
|
|
|
|
means the code will make 00:00:5E:00:53:XX, where XX will be
|
|
|
|
random.
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
2018-12-28 02:09:09 +08:00
|
|
|
endif # ETH_NATIVE_POSIX
|