My Kernel v0.1.0
icmp.h
1#ifndef KERNEL_NET_ICMP_H
2#define KERNEL_NET_ICMP_H
3
4#include <kernel/error.h>
5#include <kernel/net.h>
6#include <kernel/socket.h>
7#include <kernel/types.h>
8
9extern struct socket_protocol_ops af_inet_icmp_ops;
10
13 u8 type;
14 u8 code;
15 __be u16 checksum;
16};
17
18#define ICMP_HEADER_SIZE 4
19static_assert(sizeof(struct icmp_header) == ICMP_HEADER_SIZE);
20
22enum icmp_type {
23 ICMP_ECHO_REPLY = 0, /* Ping reply */
24 ICMP_ECHO_REQUEST = 8, /* Ping request */
25};
26
28error_t icmp_receive_packet(struct packet *packet);
29
30#endif /* KERNEL_NET_ICMP_H */
ICMP frame header format.
Definition: icmp.h:12
A network packet.
Definition: packet.h:51