Linux Audio

Check our new training course

Embedded Linux Audio

Check our new training course
with Creative Commons CC-BY-SA
lecture materials

Bootlin logo

Elixir Cross Referencer

Loading...
# Kconfig - Native posix ethernet driver configuration options

# Copyright (c) 2018 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0

menuconfig ETH_NATIVE_POSIX
	bool "Native Posix Ethernet driver"
	depends on ARCH_POSIX
	help
	  Enable native posix ethernet driver. Note, this driver is run inside
	  a process in your host system.

if ETH_NATIVE_POSIX
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

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.

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.

endif # ETH_NATIVE_POSIX_STARTUP_AUTOMATIC

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.

config ETH_NATIVE_POSIX_PTP_CLOCK
	bool "PTP clock driver support"
	default y if NET_GPTP
	select PTP_CLOCK
	depends on NET_GPTP
	help
	  Enable PTP clock support.

config ETH_NATIVE_POSIX_RANDOM_MAC
	bool "Random MAC address"
	depends on ENTROPY_GENERATOR
	default y
	help
	  Generate a random MAC address dynamically.

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

endif # ETH_NATIVE_POSIX