usb: getting string descriptors, minor improvements
[quarnos.git] / resources / net / icmp.h
blob164fe1da8eaf34f57c260051fcbe664ee57a1726
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;
17 p<internet_layer> down;
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