1# Capture network packets
2
3# Copyright (c) 2021 Intel Corporation
4# SPDX-License-Identifier: Apache-2.0
5
6config NET_CAPTURE
7	bool "Network packet capture support"
8	select NET_L2_VIRTUAL
9	select NET_L2_VIRTUAL_MGMT
10	select NET_L2_IPIP
11	select NET_MGMT
12	select NET_MGMT_EVENT
13	select NET_CONTEXT_NET_PKT_POOL
14	help
15	  This option allows user to capture network packets.
16	  The captured packets are sent to another host for processing.
17	  User can use network packet analyzer like Wireshark to
18	  process the packets.
19	  The captured network packets are sent using IPIP tunnel
20	  as a payload in UDP datagrams.
21
22if NET_CAPTURE
23
24config NET_CAPTURE_PKT_COUNT
25	int "How many network packets to allocate for capture"
26	default 4
27	help
28	  This tells how many net_pkt to allocate for capturing
29	  network traffic. Each network frame sent or received
30	  will allocate one net_pkt for network metadata.
31	  Each net_pkt will contain a list of net_buf's that contain
32	  the actual network data.
33
34config NET_CAPTURE_BUF_COUNT
35	int "How many network buffers to allocate for capture"
36	default 16
37	help
38	  This tells how many net_buf to allocate for capturing
39	  network traffic.
40
41config NET_CAPTURE_DEVICE_COUNT
42	int "Number of network capture devices"
43	default 1
44	help
45	  Number of network capture devices. Usually one is enough but
46	  if one needs to send captured data to multiple different devices,
47	  then you need to increase the value.
48
49config NET_CAPTURE_COOKED_MODE
50	bool "Capture non-IP packets a.k.a cooked (SLL) mode [EXPERIMENTAL]"
51	select NET_PSEUDO_IFACE
52	select NET_L2_DUMMY
53	select NET_L2_VIRTUAL
54	select EXPERIMENTAL
55	help
56	  This enables application to capture packets in so called
57	  Linux cooked mode (sll). Here a synthetic link layer header
58	  is used instead of real network link header.
59
60choice NET_CAPTURE_COOKED_MODE_SLL_VERSION
61	prompt "SLL version to use"
62	depends on NET_CAPTURE_COOKED_MODE
63	default NET_CAPTURE_COOKED_MODE_SLLV1
64	help
65	  What SLL header version to use.
66
67config NET_CAPTURE_COOKED_MODE_SLLV1
68	bool "SLL version 1"
69	depends on NET_CAPTURE_COOKED_MODE
70	help
71	  Use SLL version 1 (header is 16 bytes)
72
73config NET_CAPTURE_COOKED_MODE_SLLV2
74	bool "SLL version 2"
75	depends on NET_CAPTURE_COOKED_MODE
76	help
77	  Use SLL version 2 (header is 20 bytes)
78
79endchoice
80
81config NET_CAPTURE_COOKED_MODE_INTERFACE_NAME
82	string "Name of the cooked mode network interface"
83	default "cooked"
84	depends on NET_CAPTURE_COOKED_MODE
85	help
86	  This sets the name of the cooked mode capture network interface.
87
88config NET_CAPTURE_COOKED_MODE_MAX_LINK_TYPES
89	int "How many link types (ETH_P_*) to capture at the same time"
90	default 2
91	range 1 64
92	depends on NET_CAPTURE_COOKED_MODE
93	help
94	  This defines how many ETH_P_* link type values can be captured
95	  at the same time in cooked mode.
96
97module = NET_CAPTURE
98module-dep = NET_LOG
99module-str = Log level for network capture API
100module-help = Enables network capture API debug messages.
101source "subsys/net/Kconfig.template.log_config.net"
102
103config NET_CAPTURE_TX_DEBUG
104	bool "Debug sent packets"
105	depends on NET_CAPTURE_LOG_LEVEL_DBG
106	help
107	  Enables printing of sent network packet.
108	  This can produce lot of output so it is disabled by default.
109
110endif # NET_CAPTURE
111