Max OS 0.3
Loading...
Searching...
No Matches
icmp.h
Go to the documentation of this file.
1
9#ifndef MAXOS_NET_ICMP_H
10#define MAXOS_NET_ICMP_H
11
12#include <net/ipv4.h>
13#include <cstdint>
14#include <common/outputStream.h>
15
16
17namespace MaxOS::net {
18
19
27 typedef struct PACKED ICMPHeader {
28
29 uint8_t type;
30 uint8_t code;
31
32 uint16_t checksum;
33 uint32_t data;
34
35 } icmp_header_t;
36
52
53}
54
55
56#endif //MAXOS_NET_ICMP_H
A stream that strings can be written to.
Handles the payload of a specific IP protocol.
Definition ipv4.h:66
InternetProtocolHandler * internet_protocol_handler
The Internet protocol handler this payload handler is connected to.
Definition ipv4.h:70
bool handle_internet_protocol_payload(net::InternetProtocolAddress src_ip_be, net::InternetProtocolAddress dst_ip_be, uint8_t *payload_data, uint32_t size) final
Called by the InternetProtocolProvider when a new packet has arrived.
Definition icmp.cpp:43
void request_echo_reply(uint32_t ip_be)
Sends an ICMP echo request to the specified IP address.
Definition icmp.cpp:84
Handles IPv4 packets over Ethernet frames.
Definition ipv4.h:85
Defines classes and structures for handling Internet Protocol version 4 (IPv4) packets.
uint32_t InternetProtocolAddress
An IPv4 address.
Definition ipv4.h:18
Defines OutputStream and GenericOutputStream classes for writing data to streams.
The header of an ICMP packet.
Definition icmp.h:27
uint16_t checksum
checksum to verify integrity
Definition icmp.h:32
uint32_t data
Payload data (Varies by type and code)
Definition icmp.h:33
uint8_t code
The code of the ICMP message.
Definition icmp.h:30
uint8_t type
The type of ICMP message.
Definition icmp.h:29