genode/repos/os/src/server/nic_dump
Norman Feske 9d67f9fc8e Remove Allocator_guard
This patch removes old 'Allocator_guard' utility and replaces its use
with the modern 'Constrained_ram_allocator'.

The adjustment of core in this respect has the side effect of a more
accurate capability accounting in core's CPU, TRACE, and RM services.
In particular, the dataspace capabilities needed for core-internal
allocations via the 'Sliced_heap' are accounted to the client now.
The same goes for nitpicker and nic_dump as other former users of the
allocator guard. Hence, the patch also touches code at the client and
server sides related to these services.

The only remaining user of the 'Allocator_guard' is the Intel GPU
driver. As the adaptation of this component would be too invasive
without testing, this patch leaves this component unchanged by keeping a
copy of the 'allocator_guard.h' locally at the component.

Fixes #3750
2020-05-18 10:16:12 +02:00
..
README nic_dump: default attribute 2018-04-10 11:20:49 +02:00
component.cc Remove Allocator_guard 2020-05-18 10:16:12 +02:00
component.h Remove Allocator_guard 2020-05-18 10:16:12 +02:00
config.xsd base: define generic config XSD types globally 2018-08-28 16:48:47 +02:00
interface.cc timeout: use uint64_t for all plain time values 2019-05-06 16:15:26 +02:00
interface.h nic_dump: default attribute 2018-04-10 11:20:49 +02:00
main.cc timeout: use uint64_t for all plain time values 2019-05-06 16:15:26 +02:00
packet_log.cc net: use Size_guard for packet-data accessors 2018-05-30 13:36:11 +02:00
packet_log.h nic_dump: make protocols configurable 2018-04-10 11:20:49 +02:00
pointer.h os/server: nic_dump 2017-03-15 12:32:26 +01:00
target.mk nic_dump: add config XML schema file 2018-04-10 11:20:49 +02:00
uplink.cc nic_dump: make protocols configurable 2018-04-10 11:20:49 +02:00
uplink.h Add missing override annotations 2019-02-19 11:12:11 +01:00

README

The 'nic_dump' component is a bump-in-the-wire component for the NIC service
that does deep packet inspection for each passing packet and dumps the
gathered information to the log. This includes information about Ethernet,
ARP, IPv4, TCP, UDP, and DHCP.


Basics
~~~~~~

this is an example configuration of the component showing all attributes with
their default values (except config.uplink and config.downlink):

! <config uplink="uplink"
!         downlink="downlink"
!         time="no"
!         default="default"
!         eth="default"
!         arp="default"
!         ipv4="default"
!         dhcp="default"
!         udp="default"
!         icmp="default"
!         tcp="default" />

The values of the 'uplink' and 'downlink' attributes are used as log labels
for the two NIC peers. These labels are only relevant for the readability of
the log. The third attribute 'time' defines wether to print timing information
or not. Furthemore, as you can see, each supported protocol has an attribute
with the name of the protocol in the config tag. Each of these attributes
accepts one of four possible values:

* no      - do not print out this protocol
* name    - print only the protocol name
* default - print a short summary of the most important header values
* all     - print all available header values

The 'default' attribute is useful to change the default value for protocol
attributes that are not explicitely set.

An example output snippet of the component might be:

! (olivia <- karl) ETH ... ARP ... time 4626 (15)
! (karl <- olivia) ETH ... ARP ... time 4639 (7)
! (olivia <- karl) ETH ... IPV4 ... TCP ... time 4644 (5)
! (karl <- olivia) ETH ... IPV4 ... TCP ... time 4660 (6)

After the NIC peer labels and the traffic direction, the unfolding of the
protocols and their information follows. The printing order is from the lowest
to the highest networking layer. At the end of each line there is the word
'time' followed by two numbers if you have enabled timing information. The
first number is the packet-arrival time (the milliseconds since 'nic_dump' was
started). The second number is the time from the last packet that passed till
this one (milliseconds).

A comprehensive example of how to use the NIC dump can be found in the test
script 'libports/run/nic_dump.run'.