The manual
ginnOS
The reference: libc, the libraries and the kernel
Toggle main menu visibility
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
*/
21
void
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
*/
28
void
icmp_send_unreachable
(
const
ipv4_header_t *ip,
uint8_t
code);
icmp_receive
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
icmp_send_unreachable
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.h
IPv4 (RFC 791): the header, the checks, and where a packet goes.
uint32_t
unsigned int uint32_t
Definition
fb.h:17
uint8_t
unsigned char uint8_t
Definition
fb.h:18
netif_t
struct netif netif_t
netif
Definition
netif.h:37
src
kernel
net
icmp.h
Generated by
1.18.0