ArvernOS
Loading...
Searching...
No Matches
icmpv4.h File Reference
#include <net/ipv4.h>
#include <net/net.h>
#include <stdint.h>
Include dependency graph for icmpv4.h:

Data Structures

struct  icmpv4_echo_t
 
struct  icmpv4_reply_t
 

Functions

void icmpv4_receive_packet (net_interface_t *interface, uint8_t *packet, ipv4_header_t *header)
 
int icmpv4_send_packet (net_interface_t *interface, uint8_t ip[4], icmpv4_reply_t *reply)
 

Detailed Description

Function Documentation

◆ icmpv4_receive_packet()

void icmpv4_receive_packet ( net_interface_t * interface,
uint8_t * packet,
ipv4_header_t * header )

Receives a ICMPv4 packet.

Parameters
interfacethe interface on which the ICMPv4 packet has been received
packetthe ICMPv4 packet
ipv4_headerthe IPv4 header

◆ icmpv4_send_packet()

int icmpv4_send_packet ( net_interface_t * interface,
uint8_t ip[4],
icmpv4_reply_t * reply )

"Pings" an IPv4 address, i.e. sends an ICMPv4 packet to it and waits for an ICMPv4 reply.

Parameters
interfacethe interface to use to send the ICMPv4 request
ipthe IPv4 address to ping
replythe ICMPv4 reply
Returns
0 on success, something else otherwise

Create ICMPv4 ECHO packet.