The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
icmp.h File Reference

ICMP for IPv4 (RFC 792): echo (ping) and "unreachable". More...

#include "ipv4.h"

Go to the source code of this file.

Macros

#define ICMP_ECHO_REPLY   0
#define ICMP_UNREACHABLE   3
#define ICMP_ECHO_REQUEST   8
#define ICMP_PROTOCOL_UNREACHABLE   2
#define ICMP_PORT_UNREACHABLE   3

Functions

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.
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).

Detailed Description

ICMP for IPv4 (RFC 792): echo (ping) and "unreachable".

Macro Definition Documentation

◆ ICMP_ECHO_REPLY

#define ICMP_ECHO_REPLY   0

◆ ICMP_UNREACHABLE

#define ICMP_UNREACHABLE   3

◆ ICMP_ECHO_REQUEST

#define ICMP_ECHO_REQUEST   8

◆ ICMP_PROTOCOL_UNREACHABLE

#define ICMP_PROTOCOL_UNREACHABLE   2

◆ ICMP_PORT_UNREACHABLE

#define ICMP_PORT_UNREACHABLE   3

Function Documentation

◆ 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.

◆ 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).

nothing is sent for a broadcast or an ICMP error.