2222#include " ip4/arp.hpp"
2323#include " ip4/ip4.hpp"
2424#include " ip4/udp.hpp"
25- #include " ip4/icmpv4 .hpp"
25+ #include " ip4/icmp4 .hpp"
2626#include " dns/client.hpp"
2727#include " tcp/tcp.hpp"
2828#include < vector>
@@ -53,6 +53,9 @@ namespace net {
5353 IP4::addr gateway () override
5454 { return gateway_; }
5555
56+ IP4::addr dns () override
57+ { return dns_server; }
58+
5659 IP4& ip_obj () override
5760 { return ip4_; }
5861
@@ -71,9 +74,18 @@ namespace net {
7174 /* * Get the UDP-object belonging to this stack */
7275 UDP& udp () override { return udp_; }
7376
77+ /* * Get the ICMP-object belonging to this stack */
78+ ICMPv4& icmp () override { return icmp_; }
79+
7480 /* * Get the DHCP client (if any) */
7581 auto dhclient () { return dhcp_; }
7682
83+ /* *
84+ * Error report in accordance with RFC 1122
85+ * An ICMP error message has been received - forward to transport layer (UDP or TCP)
86+ */
87+ void error_report (Error_type type, Error_code code, Packet_ptr orig_pckt) override ;
88+
7789 /* *
7890 * Set the forwarding delegate used by this stack.
7991 * If set it will get all incoming packets not intended for this stack.
@@ -125,7 +137,7 @@ namespace net {
125137 void resolve (const std::string& hostname,
126138 resolve_func<IP4> func) override
127139 {
128- dns .resolve (this ->dns_server , hostname, func);
140+ dns_ .resolve (this ->dns_server , hostname, func);
129141 }
130142
131143 void set_gateway (IP4::addr gateway) override
@@ -253,7 +265,7 @@ namespace net {
253265 TCP tcp_;
254266
255267 // we need this to store the cache per-stack
256- DNSClient dns ;
268+ DNSClient dns_ ;
257269
258270 std::shared_ptr<net::DHClient> dhcp_{};
259271
0 commit comments