2016-08-25 17:48:53 +02:00
|
|
|
/*
|
|
|
|
* \brief A net interface in form of a signal-driven NIC-packet handler
|
|
|
|
* \author Martin Stein
|
|
|
|
* \date 2016-08-24
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2017-02-20 13:23:52 +01:00
|
|
|
* Copyright (C) 2016-2017 Genode Labs GmbH
|
2016-08-25 17:48:53 +02:00
|
|
|
*
|
|
|
|
* This file is part of the Genode OS framework, which is distributed
|
2017-02-20 13:23:52 +01:00
|
|
|
* under the terms of the GNU Affero General Public License version 3.
|
2016-08-25 17:48:53 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _INTERFACE_H_
|
|
|
|
#define _INTERFACE_H_
|
|
|
|
|
2016-09-12 12:55:12 +02:00
|
|
|
/* local includes */
|
|
|
|
#include <link.h>
|
|
|
|
#include <arp_cache.h>
|
|
|
|
#include <arp_waiter.h>
|
2017-09-14 15:10:32 +02:00
|
|
|
#include <l3_protocol.h>
|
nic_router: DHCP client functionality
If the attribute 'interface' is not set in a 'domain' tag, the router tries to
dynamically receive and maintain an IP configuration for that domain by using
DHCP in the client role at all interfaces that connect to the domain. In the
DHCP discover phase, the router simply chooses the first DHCP offer that
arrives. So, no comparison of different DHCP offers is done. In the DHCP
request phase, the server is expected to provide an IP address, a gateway, a
subnet mask, and an IP lease time to the router. If anything substantial goes
wrong during a DHCP exchange, the router discards the outcome of the exchange
and goes back to the DHCP discover phase. At any time where there is no valid
IP configuration present at a domain, the domain does only act as DHCP client
and all other router functionality is disabled for the domain. A domain cannot
act as DHCP client and DHCP server at once. So, a 'domain' tag must either
have an 'interface' attribute or must not contain a 'dhcp-server' tag.
Ref #2534
2017-10-16 11:31:43 +02:00
|
|
|
#include <dhcp_client.h>
|
2017-10-16 13:37:06 +02:00
|
|
|
#include <dhcp_server.h>
|
2016-09-12 12:55:12 +02:00
|
|
|
|
2016-08-25 17:48:53 +02:00
|
|
|
/* Genode includes */
|
|
|
|
#include <nic_session/nic_session.h>
|
2017-10-06 13:00:05 +02:00
|
|
|
#include <net/dhcp.h>
|
2016-08-25 17:48:53 +02:00
|
|
|
|
|
|
|
namespace Net {
|
|
|
|
|
2016-09-12 12:55:12 +02:00
|
|
|
using Packet_descriptor = ::Nic::Packet_descriptor;
|
|
|
|
using Packet_stream_sink = ::Nic::Packet_stream_sink< ::Nic::Session::Policy>;
|
|
|
|
using Packet_stream_source = ::Nic::Packet_stream_source< ::Nic::Session::Policy>;
|
2017-10-13 16:22:05 +02:00
|
|
|
class Ipv4_config;
|
2016-09-12 12:55:12 +02:00
|
|
|
class Forward_rule_tree;
|
|
|
|
class Transport_rule_list;
|
2016-08-25 17:48:53 +02:00
|
|
|
class Ethernet_frame;
|
|
|
|
class Arp_packet;
|
|
|
|
class Interface;
|
2017-10-06 13:00:05 +02:00
|
|
|
class Dhcp_server;
|
2016-09-12 12:55:12 +02:00
|
|
|
class Configuration;
|
|
|
|
class Domain;
|
2016-08-25 17:48:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-09-12 12:55:12 +02:00
|
|
|
class Net::Interface
|
2016-08-25 17:48:53 +02:00
|
|
|
{
|
|
|
|
protected:
|
|
|
|
|
2016-09-12 12:55:12 +02:00
|
|
|
using Signal_handler = Genode::Signal_handler<Interface>;
|
|
|
|
|
|
|
|
Signal_handler _sink_ack;
|
|
|
|
Signal_handler _sink_submit;
|
|
|
|
Signal_handler _source_ack;
|
|
|
|
Signal_handler _source_submit;
|
|
|
|
Mac_address const _router_mac;
|
|
|
|
Mac_address const _mac;
|
2016-08-25 17:48:53 +02:00
|
|
|
|
nic_router: DHCP client functionality
If the attribute 'interface' is not set in a 'domain' tag, the router tries to
dynamically receive and maintain an IP configuration for that domain by using
DHCP in the client role at all interfaces that connect to the domain. In the
DHCP discover phase, the router simply chooses the first DHCP offer that
arrives. So, no comparison of different DHCP offers is done. In the DHCP
request phase, the server is expected to provide an IP address, a gateway, a
subnet mask, and an IP lease time to the router. If anything substantial goes
wrong during a DHCP exchange, the router discards the outcome of the exchange
and goes back to the DHCP discover phase. At any time where there is no valid
IP configuration present at a domain, the domain does only act as DHCP client
and all other router functionality is disabled for the domain. A domain cannot
act as DHCP client and DHCP server at once. So, a 'domain' tag must either
have an 'interface' attribute or must not contain a 'dhcp-server' tag.
Ref #2534
2017-10-16 11:31:43 +02:00
|
|
|
void _init();
|
|
|
|
|
2016-08-25 17:48:53 +02:00
|
|
|
private:
|
|
|
|
|
2017-10-16 13:37:06 +02:00
|
|
|
Timer::Connection &_timer;
|
|
|
|
Genode::Allocator &_alloc;
|
|
|
|
Domain &_domain;
|
|
|
|
Arp_cache _arp_cache;
|
|
|
|
Arp_waiter_list _own_arp_waiters;
|
|
|
|
Arp_waiter_list _foreign_arp_waiters;
|
|
|
|
Link_side_tree _tcp_links;
|
|
|
|
Link_side_tree _udp_links;
|
|
|
|
Link_list _closed_tcp_links;
|
|
|
|
Link_list _closed_udp_links;
|
|
|
|
Dhcp_allocation_tree _dhcp_allocations;
|
|
|
|
Dhcp_allocation_list _released_dhcp_allocations;
|
|
|
|
Dhcp_client _dhcp_client { _alloc, _timer, *this };
|
2016-09-12 12:55:12 +02:00
|
|
|
|
2017-09-14 15:10:32 +02:00
|
|
|
void _new_link(L3_protocol const protocol,
|
2016-09-12 12:55:12 +02:00
|
|
|
Link_side_id const &local_id,
|
|
|
|
Pointer<Port_allocator_guard> const remote_port_alloc,
|
|
|
|
Interface &remote_interface,
|
|
|
|
Link_side_id const &remote_id);
|
|
|
|
|
2017-10-16 13:37:06 +02:00
|
|
|
void _destroy_released_dhcp_allocations();
|
2017-10-06 13:00:05 +02:00
|
|
|
|
2017-10-16 13:37:06 +02:00
|
|
|
void _destroy_dhcp_allocation(Dhcp_allocation &allocation);
|
2017-10-06 13:00:05 +02:00
|
|
|
|
2017-10-16 13:37:06 +02:00
|
|
|
void _release_dhcp_allocation(Dhcp_allocation &allocation);
|
2017-10-06 13:00:05 +02:00
|
|
|
|
2017-12-05 15:45:54 +01:00
|
|
|
void _new_dhcp_allocation(Ethernet_frame ð,
|
|
|
|
Dhcp_packet &dhcp,
|
|
|
|
Dhcp_server &dhcp_srv);
|
|
|
|
|
2017-10-06 13:00:05 +02:00
|
|
|
void _send_dhcp_reply(Dhcp_server const &dhcp_srv,
|
|
|
|
Mac_address const &client_mac,
|
|
|
|
Ipv4_address const &client_ip,
|
|
|
|
Dhcp_packet::Message_type msg_type,
|
|
|
|
Genode::uint32_t xid);
|
|
|
|
|
2017-09-14 15:10:32 +02:00
|
|
|
Forward_rule_tree &_forward_rules(L3_protocol const prot) const;
|
2016-08-25 17:48:53 +02:00
|
|
|
|
2017-09-14 15:10:32 +02:00
|
|
|
Transport_rule_list &_transport_rules(L3_protocol const prot) const;
|
2016-08-25 17:48:53 +02:00
|
|
|
|
2016-09-12 12:55:12 +02:00
|
|
|
void _handle_arp(Ethernet_frame ð, Genode::size_t const eth_size);
|
2016-08-25 17:48:53 +02:00
|
|
|
|
2016-09-12 12:55:12 +02:00
|
|
|
void _handle_arp_reply(Arp_packet &arp);
|
2016-08-25 17:48:53 +02:00
|
|
|
|
2016-09-12 12:55:12 +02:00
|
|
|
void _handle_arp_request(Ethernet_frame ð,
|
|
|
|
Genode::size_t const eth_size,
|
|
|
|
Arp_packet &arp);
|
2016-08-25 17:48:53 +02:00
|
|
|
|
2017-10-06 13:00:05 +02:00
|
|
|
void _handle_dhcp_request(Ethernet_frame ð,
|
|
|
|
Genode::size_t eth_size,
|
|
|
|
Dhcp_packet &dhcp);
|
|
|
|
|
2016-09-12 12:55:12 +02:00
|
|
|
void _handle_ip(Ethernet_frame ð,
|
|
|
|
Genode::size_t const eth_size,
|
|
|
|
Packet_descriptor const &pkt);
|
2016-08-25 17:48:53 +02:00
|
|
|
|
2016-09-12 12:55:12 +02:00
|
|
|
void _adapt_eth(Ethernet_frame ð,
|
|
|
|
Genode::size_t const eth_size,
|
|
|
|
Ipv4_address const &ip,
|
|
|
|
Packet_descriptor const &pkt,
|
|
|
|
Interface &interface);
|
2016-08-25 17:48:53 +02:00
|
|
|
|
2016-09-12 12:55:12 +02:00
|
|
|
void _nat_link_and_pass(Ethernet_frame ð,
|
|
|
|
Genode::size_t const eth_size,
|
|
|
|
Ipv4_packet &ip,
|
2017-09-14 15:10:32 +02:00
|
|
|
L3_protocol const prot,
|
2016-09-12 12:55:12 +02:00
|
|
|
void *const prot_base,
|
|
|
|
Genode::size_t const prot_size,
|
|
|
|
Link_side_id const &local_id,
|
|
|
|
Interface &interface);
|
2016-08-25 17:48:53 +02:00
|
|
|
|
2016-09-12 12:55:12 +02:00
|
|
|
void _broadcast_arp_request(Ipv4_address const &ip);
|
2016-08-25 17:48:53 +02:00
|
|
|
|
2017-09-21 20:00:37 +02:00
|
|
|
void _pass_prot(Ethernet_frame ð,
|
|
|
|
Genode::size_t const eth_size,
|
|
|
|
Ipv4_packet &ip,
|
2017-09-14 15:10:32 +02:00
|
|
|
L3_protocol const prot,
|
2017-09-21 20:00:37 +02:00
|
|
|
void *const prot_base,
|
|
|
|
Genode::size_t const prot_size);
|
|
|
|
|
|
|
|
void _pass_ip(Ethernet_frame ð,
|
|
|
|
Genode::size_t const eth_size,
|
|
|
|
Ipv4_packet &ip);
|
2016-08-25 17:48:53 +02:00
|
|
|
|
2016-09-12 12:55:12 +02:00
|
|
|
void _continue_handle_eth(Packet_descriptor const &pkt);
|
2016-08-25 17:48:53 +02:00
|
|
|
|
2017-09-14 15:10:32 +02:00
|
|
|
Link_list &_closed_links(L3_protocol const protocol);
|
2016-08-25 17:48:53 +02:00
|
|
|
|
2017-09-14 15:10:32 +02:00
|
|
|
Link_side_tree &_links(L3_protocol const protocol);
|
2016-08-25 17:48:53 +02:00
|
|
|
|
2016-09-12 12:55:12 +02:00
|
|
|
Configuration &_config() const;
|
2016-08-25 17:48:53 +02:00
|
|
|
|
2017-10-13 16:22:05 +02:00
|
|
|
Ipv4_config const &_ip_config() const;
|
|
|
|
|
2016-09-12 12:55:12 +02:00
|
|
|
Ipv4_address const &_router_ip() const;
|
2016-08-25 17:48:53 +02:00
|
|
|
|
2016-09-12 12:55:12 +02:00
|
|
|
void _handle_eth(void *const eth_base,
|
|
|
|
Genode::size_t const eth_size,
|
|
|
|
Packet_descriptor const &pkt);
|
2016-08-25 17:48:53 +02:00
|
|
|
|
2016-09-12 12:55:12 +02:00
|
|
|
void _ack_packet(Packet_descriptor const &pkt);
|
2016-08-25 17:48:53 +02:00
|
|
|
|
2016-09-12 12:55:12 +02:00
|
|
|
void _cancel_arp_waiting(Arp_waiter &waiter);
|
2016-08-25 17:48:53 +02:00
|
|
|
|
2016-09-12 12:55:12 +02:00
|
|
|
virtual Packet_stream_sink &_sink() = 0;
|
|
|
|
|
|
|
|
virtual Packet_stream_source &_source() = 0;
|
2016-08-25 17:48:53 +02:00
|
|
|
|
|
|
|
|
|
|
|
/***********************************
|
|
|
|
** Packet-stream signal handlers **
|
|
|
|
***********************************/
|
|
|
|
|
2016-09-12 12:55:12 +02:00
|
|
|
void _ready_to_submit();
|
|
|
|
void _ack_avail() { }
|
|
|
|
void _ready_to_ack();
|
|
|
|
void _packet_avail() { }
|
2016-08-25 17:48:53 +02:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
nic_router: DHCP client functionality
If the attribute 'interface' is not set in a 'domain' tag, the router tries to
dynamically receive and maintain an IP configuration for that domain by using
DHCP in the client role at all interfaces that connect to the domain. In the
DHCP discover phase, the router simply chooses the first DHCP offer that
arrives. So, no comparison of different DHCP offers is done. In the DHCP
request phase, the server is expected to provide an IP address, a gateway, a
subnet mask, and an IP lease time to the router. If anything substantial goes
wrong during a DHCP exchange, the router discards the outcome of the exchange
and goes back to the DHCP discover phase. At any time where there is no valid
IP configuration present at a domain, the domain does only act as DHCP client
and all other router functionality is disabled for the domain. A domain cannot
act as DHCP client and DHCP server at once. So, a 'domain' tag must either
have an 'interface' attribute or must not contain a 'dhcp-server' tag.
Ref #2534
2017-10-16 11:31:43 +02:00
|
|
|
struct Bad_send_dhcp_args : Genode::Exception { };
|
|
|
|
struct Bad_transport_protocol : Genode::Exception { };
|
|
|
|
struct Bad_network_protocol : Genode::Exception { };
|
|
|
|
struct Packet_postponed : Genode::Exception { };
|
|
|
|
struct Alloc_dhcp_msg_buffer_failed : Genode::Exception { };
|
|
|
|
struct Dhcp_msg_buffer_too_small : Genode::Exception { };
|
|
|
|
|
2017-12-05 14:43:02 +01:00
|
|
|
struct Drop_packet_inform : Genode::Exception
|
nic_router: DHCP client functionality
If the attribute 'interface' is not set in a 'domain' tag, the router tries to
dynamically receive and maintain an IP configuration for that domain by using
DHCP in the client role at all interfaces that connect to the domain. In the
DHCP discover phase, the router simply chooses the first DHCP offer that
arrives. So, no comparison of different DHCP offers is done. In the DHCP
request phase, the server is expected to provide an IP address, a gateway, a
subnet mask, and an IP lease time to the router. If anything substantial goes
wrong during a DHCP exchange, the router discards the outcome of the exchange
and goes back to the DHCP discover phase. At any time where there is no valid
IP configuration present at a domain, the domain does only act as DHCP client
and all other router functionality is disabled for the domain. A domain cannot
act as DHCP client and DHCP server at once. So, a 'domain' tag must either
have an 'interface' attribute or must not contain a 'dhcp-server' tag.
Ref #2534
2017-10-16 11:31:43 +02:00
|
|
|
{
|
2017-12-05 14:43:02 +01:00
|
|
|
Genode::String<128> msg;
|
nic_router: DHCP client functionality
If the attribute 'interface' is not set in a 'domain' tag, the router tries to
dynamically receive and maintain an IP configuration for that domain by using
DHCP in the client role at all interfaces that connect to the domain. In the
DHCP discover phase, the router simply chooses the first DHCP offer that
arrives. So, no comparison of different DHCP offers is done. In the DHCP
request phase, the server is expected to provide an IP address, a gateway, a
subnet mask, and an IP lease time to the router. If anything substantial goes
wrong during a DHCP exchange, the router discards the outcome of the exchange
and goes back to the DHCP discover phase. At any time where there is no valid
IP configuration present at a domain, the domain does only act as DHCP client
and all other router functionality is disabled for the domain. A domain cannot
act as DHCP client and DHCP server at once. So, a 'domain' tag must either
have an 'interface' attribute or must not contain a 'dhcp-server' tag.
Ref #2534
2017-10-16 11:31:43 +02:00
|
|
|
|
2017-12-05 14:43:02 +01:00
|
|
|
template <typename... ARGS>
|
|
|
|
Drop_packet_inform(ARGS... args) : msg({args...}) { }
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Drop_packet_warn : Genode::Exception
|
|
|
|
{
|
|
|
|
Genode::String<128> msg;
|
|
|
|
|
|
|
|
template <typename... ARGS>
|
|
|
|
Drop_packet_warn(ARGS... args) : msg({args...}) { }
|
nic_router: DHCP client functionality
If the attribute 'interface' is not set in a 'domain' tag, the router tries to
dynamically receive and maintain an IP configuration for that domain by using
DHCP in the client role at all interfaces that connect to the domain. In the
DHCP discover phase, the router simply chooses the first DHCP offer that
arrives. So, no comparison of different DHCP offers is done. In the DHCP
request phase, the server is expected to provide an IP address, a gateway, a
subnet mask, and an IP lease time to the router. If anything substantial goes
wrong during a DHCP exchange, the router discards the outcome of the exchange
and goes back to the DHCP discover phase. At any time where there is no valid
IP configuration present at a domain, the domain does only act as DHCP client
and all other router functionality is disabled for the domain. A domain cannot
act as DHCP client and DHCP server at once. So, a 'domain' tag must either
have an 'interface' attribute or must not contain a 'dhcp-server' tag.
Ref #2534
2017-10-16 11:31:43 +02:00
|
|
|
};
|
2016-09-12 12:55:12 +02:00
|
|
|
|
|
|
|
Interface(Genode::Entrypoint &ep,
|
os/timer: interpolate time via timestamps
Previously, the Genode::Timer::curr_time always used the
Timer_session::elapsed_ms RPC as back end. Now, Genode::Timer reads
this remote time only in a periodic fashion independently from the calls
to Genode::Timer::curr_time. If now one calls Genode::Timer::curr_time,
the function takes the last read remote time value and adapts it using
the timestamp difference since the remote-time read. The conversion
factor from timestamps to time is estimated on every remote-time read
using the last read remote-time value and the timestamp difference since
the last remote time read.
This commit also re-works the timeout test. The test now has two stages.
In the first stage, it tests fast polling of the
Genode::Timer::curr_time. This stage checks the error between locally
interpolated and timer-driver time as well as wether the locally
interpolated time is monotone and sufficiently homogeneous. In the
second stage several periodic and one-shot timeouts are scheduled at
once. This stage checks if the timeouts trigger sufficiently precise.
This commit adds the new Kernel::time syscall to base-hw. The syscall is
solely used by the Genode::Timer on base-hw as substitute for the
timestamp. This is because on ARM, the timestamp function uses the ARM
performance counter that stops counting when the WFI (wait for
interrupt) instruction is active. This instruction, however is used by
the base-hw idle contexts that get active when no user thread needs to
be scheduled. Thus, the ARM performance counter is not a good choice for
time interpolation and we use the kernel internal time instead.
With this commit, the timeout library becomes a basic library. That means
that it is linked against the LDSO which then provides it to the program it
serves. Furthermore, you can't use the timeout library anymore without the
LDSO because through the kernel-dependent LDSO make-files we can achieve a
kernel-dependent timeout implementation.
This commit introduces a structured Duration type that shall successively
replace the use of Microseconds, Milliseconds, and integer types for duration
values.
Open issues:
* The timeout test fails on Raspberry PI because of precision errors in the
first stage. However, this does not render the framework unusable in general
on the RPI but merely is an issue when speaking of microseconds precision.
* If we run on ARM with another Kernel than HW the timestamp speed may
continuously vary from almost 0 up to CPU speed. The Timer, however,
only uses interpolation if the timestamp speed remained stable (12.5%
tolerance) for at least 3 observation periods. Currently, one period is
100ms, so its 300ms. As long as this is not the case,
Timer_session::elapsed_ms is called instead.
Anyway, it might happen that the CPU load was stable for some time so
interpolation becomes active and now the timestamp speed drops. In the
worst case, we would now have 100ms of slowed down time. The bad thing
about it would be, that this also affects the timeout of the period.
Thus, it might "freeze" the local time for more than 100ms.
On the other hand, if the timestamp speed suddenly raises after some
stable time, interpolated time can get too fast. This would shorten the
period but nonetheless may result in drifting away into the far future.
Now we would have the problem that we can't deliver the real time
anymore until it has caught up because the output of Timer::curr_time
shall be monotone. So, effectively local time might "freeze" again for
more than 100ms.
It would be a solution to not use the Trace::timestamp on ARM w/o HW but
a function whose return value causes the Timer to never use
interpolation because of its stability policy.
Fixes #2400
2017-04-22 00:52:23 +02:00
|
|
|
Timer::Connection &timer,
|
2016-09-12 12:55:12 +02:00
|
|
|
Mac_address const router_mac,
|
|
|
|
Genode::Allocator &alloc,
|
|
|
|
Mac_address const mac,
|
|
|
|
Domain &domain);
|
2016-08-25 17:48:53 +02:00
|
|
|
|
|
|
|
~Interface();
|
|
|
|
|
2017-09-14 15:10:32 +02:00
|
|
|
void link_closed(Link &link, L3_protocol const prot);
|
2016-08-25 17:48:53 +02:00
|
|
|
|
2017-10-16 13:37:06 +02:00
|
|
|
void dhcp_allocation_expired(Dhcp_allocation &allocation);
|
2017-10-06 13:00:05 +02:00
|
|
|
|
2017-09-14 15:10:32 +02:00
|
|
|
void dissolve_link(Link_side &link_side, L3_protocol const prot);
|
2016-08-25 17:48:53 +02:00
|
|
|
|
nic_router: DHCP client functionality
If the attribute 'interface' is not set in a 'domain' tag, the router tries to
dynamically receive and maintain an IP configuration for that domain by using
DHCP in the client role at all interfaces that connect to the domain. In the
DHCP discover phase, the router simply chooses the first DHCP offer that
arrives. So, no comparison of different DHCP offers is done. In the DHCP
request phase, the server is expected to provide an IP address, a gateway, a
subnet mask, and an IP lease time to the router. If anything substantial goes
wrong during a DHCP exchange, the router discards the outcome of the exchange
and goes back to the DHCP discover phase. At any time where there is no valid
IP configuration present at a domain, the domain does only act as DHCP client
and all other router functionality is disabled for the domain. A domain cannot
act as DHCP client and DHCP server at once. So, a 'domain' tag must either
have an 'interface' attribute or must not contain a 'dhcp-server' tag.
Ref #2534
2017-10-16 11:31:43 +02:00
|
|
|
void send(Ethernet_frame ð, Genode::size_t const eth_size);
|
|
|
|
|
2016-08-25 17:48:53 +02:00
|
|
|
|
2016-09-12 12:55:12 +02:00
|
|
|
/*********
|
|
|
|
** log **
|
|
|
|
*********/
|
|
|
|
|
|
|
|
void print(Genode::Output &output) const;
|
2016-08-25 17:48:53 +02:00
|
|
|
|
|
|
|
|
|
|
|
/***************
|
|
|
|
** Accessors **
|
|
|
|
***************/
|
|
|
|
|
nic_router: DHCP client functionality
If the attribute 'interface' is not set in a 'domain' tag, the router tries to
dynamically receive and maintain an IP configuration for that domain by using
DHCP in the client role at all interfaces that connect to the domain. In the
DHCP discover phase, the router simply chooses the first DHCP offer that
arrives. So, no comparison of different DHCP offers is done. In the DHCP
request phase, the server is expected to provide an IP address, a gateway, a
subnet mask, and an IP lease time to the router. If anything substantial goes
wrong during a DHCP exchange, the router discards the outcome of the exchange
and goes back to the DHCP discover phase. At any time where there is no valid
IP configuration present at a domain, the domain does only act as DHCP client
and all other router functionality is disabled for the domain. A domain cannot
act as DHCP client and DHCP server at once. So, a 'domain' tag must either
have an 'interface' attribute or must not contain a 'dhcp-server' tag.
Ref #2534
2017-10-16 11:31:43 +02:00
|
|
|
Domain &domain() { return _domain; }
|
|
|
|
Mac_address router_mac() const { return _router_mac; }
|
2016-09-12 12:55:12 +02:00
|
|
|
Arp_waiter_list &own_arp_waiters() { return _own_arp_waiters; }
|
|
|
|
Arp_waiter_list &foreign_arp_waiters() { return _foreign_arp_waiters; }
|
2016-08-25 17:48:53 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* _INTERFACE_H_ */
|