mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-11 21:45:37 +00:00
nic_router: point to point IP config
This commit is contained in:
parent
44d97986a2
commit
49dc2b264f
@ -27,8 +27,7 @@ Ipv4_config::Ipv4_config(Ipv4_address_prefix interface,
|
|||||||
interface(interface), gateway(gateway), dns_server(dns_server)
|
interface(interface), gateway(gateway), dns_server(dns_server)
|
||||||
{
|
{
|
||||||
if (!valid && (interface_valid || gateway_valid)) {
|
if (!valid && (interface_valid || gateway_valid)) {
|
||||||
error("Bad IP configuration");
|
error("Bad IP configuration ", *this); }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -36,7 +35,7 @@ void Ipv4_config::print(Output &output) const
|
|||||||
{
|
{
|
||||||
if (valid) {
|
if (valid) {
|
||||||
Genode::print(output, "interface ", interface, ", gateway ", gateway,
|
Genode::print(output, "interface ", interface, ", gateway ", gateway,
|
||||||
", DNS server ", dns_server); }
|
", DNS server ", dns_server, " p2p ", point_to_point); }
|
||||||
else {
|
else {
|
||||||
Genode::print(output, "none"); }
|
Genode::print(output, "none"); }
|
||||||
}
|
}
|
||||||
|
@ -25,10 +25,14 @@ struct Net::Ipv4_config
|
|||||||
bool const interface_valid { interface.valid() };
|
bool const interface_valid { interface.valid() };
|
||||||
Ipv4_address const gateway { };
|
Ipv4_address const gateway { };
|
||||||
bool const gateway_valid { gateway.valid() };
|
bool const gateway_valid { gateway.valid() };
|
||||||
|
bool const point_to_point { gateway_valid &&
|
||||||
|
interface_valid &&
|
||||||
|
interface.prefix == 32 };
|
||||||
Ipv4_address const dns_server { };
|
Ipv4_address const dns_server { };
|
||||||
bool const valid { interface_valid &&
|
bool const valid { point_to_point ||
|
||||||
|
(interface_valid &&
|
||||||
(!gateway_valid ||
|
(!gateway_valid ||
|
||||||
interface.prefix_matches(gateway)) };
|
interface.prefix_matches(gateway))) };
|
||||||
|
|
||||||
Ipv4_config(Ipv4_address_prefix interface,
|
Ipv4_config(Ipv4_address_prefix interface,
|
||||||
Ipv4_address gateway,
|
Ipv4_address gateway,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user