net: data reception system, fixed bugs in rtl8139
[quarnos.git] / resources / net / icmp.h
blob5de7d42b92e7fae4b1168f8102bd7ef0f8638935
1 #ifndef _ICMP_H_
2 #define _ICMP_H_
4 #include "ipv4.h"
5 #include "transport_layer.h"
7 namespace net {
8 class icmp : public transport_layer {
9 private:
10 struct icmp_packet {
11 u8 type;
12 u8 code;
13 u16 checksum;
14 u16 id;
15 u16 sequence;
18 void receive(const ipv4_addr&, const buffer&);
19 public:
20 void set_internet_layer(p<internet_layer> x) {
21 down = x;
22 down->listen(1, delegate<void, const ipv4_addr&, const buffer&>::method(this, &icmp::receive));
25 void ping(const ipv4_addr &addr);
29 #endif