The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
icmp.h
Go to the documentation of this file.
1#pragma once
2
3/**
4 * @file icmp.h
5 * @brief ICMP for IPv4 (RFC 792): echo (ping) and "unreachable".
6 */
7
8#include "ipv4.h"
9
10#define ICMP_ECHO_REPLY 0
11#define ICMP_UNREACHABLE 3
12#define ICMP_ECHO_REQUEST 8
13
14// codes of ICMP_UNREACHABLE
15#define ICMP_PROTOCOL_UNREACHABLE 2
16#define ICMP_PORT_UNREACHABLE 3
17
18/**
19 * an ICMP message (net_lock held): answers an echo request.
20 */
21void icmp_receive(netif_t *netif, const ipv4_header_t *ip, const uint8_t *message,
22 uint32_t length);
23
24/**
25 * tell the sender of a packet that it cannot be delivered (net_lock
26 * held). nothing is sent for a broadcast or an ICMP error.
27 */
28void icmp_send_unreachable(const ipv4_header_t *ip, uint8_t code);
void icmp_receive(netif_t *netif, const ipv4_header_t *ip, const uint8_t *message, uint32_t length)
an ICMP message (net_lock held): answers an echo request.
Definition icmp.c:18
void icmp_send_unreachable(const ipv4_header_t *ip, uint8_t code)
tell the sender of a packet that it cannot be delivered (net_lock held).
Definition icmp.c:52
IPv4 (RFC 791): the header, the checks, and where a packet goes.
unsigned int uint32_t
Definition fb.h:17
unsigned char uint8_t
Definition fb.h:18
struct netif netif_t
Definition netif.h:37