genode/repos/os/src/server/nic_dump
Martin Stein f4a2d932e3 net: check packet data size in accessor
Instead of having a method validate_size in each packet class, check
sizes in the data accessor of the surrounding packet class. This packet
accessor is the one that casts the data pointer to the desired data type
so it is sensible that it also checks whether the desired type would
exceed the available RAM before doing the cast. This also fits nicely
the fact that for the top-level packet-class of a packet, the size must
not be checked (which was previously done).

Issue #465
2018-01-17 12:14:41 +01:00
..
component.cc nic_dump: use Duration instead of unsigned 2017-10-19 13:29:42 +02:00
component.h Follow practices suggested by "Effective C++" 2018-01-17 12:14:35 +01:00
interface.cc net: check packet data size in accessor 2018-01-17 12:14:41 +01:00
interface.h Follow practices suggested by "Effective C++" 2018-01-17 12:14:35 +01:00
main.cc nic_dump: use Duration instead of unsigned 2017-10-19 13:29:42 +02:00
packet_log.cc net: check packet data size in accessor 2018-01-17 12:14:41 +01:00
packet_log.h nic_dump: configurable packet print 2017-10-19 13:29:45 +02:00
pointer.h os/server: nic_dump 2017-03-15 12:32:26 +01:00
README os/server: nic_dump 2017-03-15 12:32:26 +01:00
target.mk nic_dump: configurable packet print 2017-10-19 13:29:45 +02:00
uplink.cc Follow practices suggested by "Effective C++" 2018-01-17 12:14:35 +01:00
uplink.h nic_dump: use Duration instead of unsigned 2017-10-19 13:29:42 +02:00

                      ==================================
                      Component for tracking NIC traffic
                      ==================================


Brief
#####

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
######

The component knows three configuration attributes:

! <config uplink="karl" downlink="olivia" time="yes"/>

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.

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'.