mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-07 11:50:24 +00:00
nic_router: add verbose_packets attribute
This separates the decision wether to log the received and sent packets from the 'verbose' attribute. This information is now only logged if 'verbose_packets' is switched on. If 'verbose' is switched on, only routing decisions and optional hints are printed. Ref #2670
This commit is contained in:
parent
b69134f1fe
commit
bd16f89617
@ -213,6 +213,7 @@ append config {
|
|||||||
<resource name="RAM" quantum="10M"/>
|
<resource name="RAM" quantum="10M"/>
|
||||||
<provides><service name="Nic"/></provides>
|
<provides><service name="Nic"/></provides>
|
||||||
<config verbose="no"
|
<config verbose="no"
|
||||||
|
verbose_packets="no"
|
||||||
verbose_domain_state="yes"
|
verbose_domain_state="yes"
|
||||||
dhcp_discover_timeout_sec="3"
|
dhcp_discover_timeout_sec="3"
|
||||||
dhcp_request_timeout_sec="3"
|
dhcp_request_timeout_sec="3"
|
||||||
|
@ -357,6 +357,27 @@ The attributes of the 'report' tag:
|
|||||||
'interval_sec' : 1..3600 : Interval of sending reports in seconds
|
'interval_sec' : 1..3600 : Interval of sending reports in seconds
|
||||||
|
|
||||||
|
|
||||||
|
Verbosity
|
||||||
|
#########
|
||||||
|
|
||||||
|
This is how you can configure the routers verbosity on its environment LOG
|
||||||
|
session:
|
||||||
|
|
||||||
|
! <config verbose="yes">
|
||||||
|
|
||||||
|
Log router decisions and optional hints.
|
||||||
|
|
||||||
|
! <config verbose_packets="yes">
|
||||||
|
|
||||||
|
Log most important protocol header fields of each packet that is received or
|
||||||
|
sent by the router (ETH, IPv4, ARP, UDP, TCP, DHCP).
|
||||||
|
|
||||||
|
! <config verbose_domain_state="yes">
|
||||||
|
|
||||||
|
Log most important changes in the state of a domain (number of nic sessions
|
||||||
|
connected, current IPv4 config).
|
||||||
|
|
||||||
|
|
||||||
Examples
|
Examples
|
||||||
########
|
########
|
||||||
|
|
||||||
|
@ -148,6 +148,7 @@
|
|||||||
|
|
||||||
</xs:choice>
|
</xs:choice>
|
||||||
<xs:attribute name="verbose" type="Boolean" />
|
<xs:attribute name="verbose" type="Boolean" />
|
||||||
|
<xs:attribute name="verbose_packets" type="Boolean" />
|
||||||
<xs:attribute name="verbose_domain_state" type="Boolean" />
|
<xs:attribute name="verbose_domain_state" type="Boolean" />
|
||||||
<xs:attribute name="dhcp_discover_timeout_sec" type="Seconds" />
|
<xs:attribute name="dhcp_discover_timeout_sec" type="Seconds" />
|
||||||
<xs:attribute name="dhcp_request_timeout_sec" type="Seconds" />
|
<xs:attribute name="dhcp_request_timeout_sec" type="Seconds" />
|
||||||
|
@ -32,8 +32,10 @@ Configuration::Configuration(Env &env,
|
|||||||
Allocator &alloc,
|
Allocator &alloc,
|
||||||
Timer::Connection &timer)
|
Timer::Connection &timer)
|
||||||
:
|
:
|
||||||
_alloc(alloc), _verbose(node.attribute_value("verbose", false)),
|
_alloc(alloc),
|
||||||
_verbose_domain_state(node.attribute_value("verbose_domain_state", false)),
|
_verbose (node.attribute_value("verbose", false)),
|
||||||
|
_verbose_packets (node.attribute_value("verbose_packets", false)),
|
||||||
|
_verbose_domain_state (node.attribute_value("verbose_domain_state", false)),
|
||||||
_dhcp_discover_timeout(read_sec_attr(node, "dhcp_discover_timeout_sec", DEFAULT_DHCP_DISCOVER_TIMEOUT_SEC)),
|
_dhcp_discover_timeout(read_sec_attr(node, "dhcp_discover_timeout_sec", DEFAULT_DHCP_DISCOVER_TIMEOUT_SEC)),
|
||||||
_dhcp_request_timeout (read_sec_attr(node, "dhcp_request_timeout_sec", DEFAULT_DHCP_REQUEST_TIMEOUT_SEC )),
|
_dhcp_request_timeout (read_sec_attr(node, "dhcp_request_timeout_sec", DEFAULT_DHCP_REQUEST_TIMEOUT_SEC )),
|
||||||
_dhcp_offer_timeout (read_sec_attr(node, "dhcp_offer_timeout_sec", DEFAULT_DHCP_OFFER_TIMEOUT_SEC )),
|
_dhcp_offer_timeout (read_sec_attr(node, "dhcp_offer_timeout_sec", DEFAULT_DHCP_OFFER_TIMEOUT_SEC )),
|
||||||
|
@ -32,6 +32,7 @@ class Net::Configuration
|
|||||||
|
|
||||||
Genode::Allocator &_alloc;
|
Genode::Allocator &_alloc;
|
||||||
bool const _verbose;
|
bool const _verbose;
|
||||||
|
bool const _verbose_packets;
|
||||||
bool const _verbose_domain_state;
|
bool const _verbose_domain_state;
|
||||||
Genode::Microseconds const _dhcp_discover_timeout;
|
Genode::Microseconds const _dhcp_discover_timeout;
|
||||||
Genode::Microseconds const _dhcp_request_timeout;
|
Genode::Microseconds const _dhcp_request_timeout;
|
||||||
@ -64,6 +65,7 @@ class Net::Configuration
|
|||||||
***************/
|
***************/
|
||||||
|
|
||||||
bool verbose() const { return _verbose; }
|
bool verbose() const { return _verbose; }
|
||||||
|
bool verbose_packets() const { return _verbose_packets; }
|
||||||
bool verbose_domain_state() const { return _verbose_domain_state; }
|
bool verbose_domain_state() const { return _verbose_domain_state; }
|
||||||
Genode::Microseconds dhcp_discover_timeout() const { return _dhcp_discover_timeout; }
|
Genode::Microseconds dhcp_discover_timeout() const { return _dhcp_discover_timeout; }
|
||||||
Genode::Microseconds dhcp_request_timeout() const { return _dhcp_request_timeout; }
|
Genode::Microseconds dhcp_request_timeout() const { return _dhcp_request_timeout; }
|
||||||
|
@ -879,7 +879,7 @@ void Interface::_handle_eth(void *const eth_base,
|
|||||||
/* inspect and handle ethernet frame */
|
/* inspect and handle ethernet frame */
|
||||||
try {
|
try {
|
||||||
Ethernet_frame *const eth = reinterpret_cast<Ethernet_frame *>(eth_base);
|
Ethernet_frame *const eth = reinterpret_cast<Ethernet_frame *>(eth_base);
|
||||||
if (_config().verbose()) {
|
if (_config().verbose_packets()) {
|
||||||
log("(router <- ", _domain, ") ", *eth); }
|
log("(router <- ", _domain, ") ", *eth); }
|
||||||
|
|
||||||
if (_domain.ip_config().valid) {
|
if (_domain.ip_config().valid) {
|
||||||
@ -953,7 +953,7 @@ void Interface::_send_submit_pkt(Packet_descriptor &pkt,
|
|||||||
{
|
{
|
||||||
_source().submit_packet(pkt);
|
_source().submit_packet(pkt);
|
||||||
_domain.raise_tx_bytes(pkt_size);
|
_domain.raise_tx_bytes(pkt_size);
|
||||||
if (_config().verbose()) {
|
if (_config().verbose_packets()) {
|
||||||
log("(", _domain, " <- router) ",
|
log("(", _domain, " <- router) ",
|
||||||
*reinterpret_cast<Ethernet_frame *>(pkt_base));
|
*reinterpret_cast<Ethernet_frame *>(pkt_base));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user