KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
ICMPv4

API for v4 of the Internet Control Message Protocol More...

Topics

 Unreachable Values
 Valid values for net_icmp_send_dest_unreach().
 

Macros

#define ICMP_REASSEMBLY_TIME_EXCEEDED   1
 Valid values for the code in the net_icmp_send_time_exceeded() function.
 

Typedefs

typedef void(* net_echo_cb) (const uint8_t *ip, uint16_t seq, uint64_t delta_us, uint8_t ttl, const uint8_t *data, size_t len)
 ICMPv4 echo reply callback type.
 

Functions

int net_icmp_send_echo (netif_t *net, const uint8_t ipaddr[4], uint16_t ident, uint16_t seq, const uint8_t *data, size_t size)
 Send an ICMP Echo packet to the specified IP.
 
int net_icmp_send_dest_unreach (netif_t *net, uint8_t code, const uint8_t *msg)
 Send an ICMP Destination Unreachable packet in reply to the given message.
 

Detailed Description

API for v4 of the Internet Control Message Protocol

Macro Definition Documentation

◆ ICMP_REASSEMBLY_TIME_EXCEEDED

#define ICMP_REASSEMBLY_TIME_EXCEEDED   1

Valid values for the code in the net_icmp_send_time_exceeded() function.

Typedef Documentation

◆ net_echo_cb

typedef void(* net_echo_cb) (const uint8_t *ip, uint16_t seq, uint64_t delta_us, uint8_t ttl, const uint8_t *data, size_t len)

ICMPv4 echo reply callback type.

Parameters
ipThe IPv4 address the reply is from.
seqThe sequence number of the packet.
delta_usThe time difference, in microseconds.
ttlThe TTL value in the packet.
dataAny data in the packet.
lenThe length of the data, in bytes.

Function Documentation

◆ net_icmp_send_dest_unreach()

int net_icmp_send_dest_unreach ( netif_t * net,
uint8_t code,
const uint8_t * msg )

Send an ICMP Destination Unreachable packet in reply to the given message.

Parameters
netThe network device to use.
codeThe type of message this is.
msgThe message that caused this error.
Returns
0 on success, <0 on failure.

◆ net_icmp_send_echo()

int net_icmp_send_echo ( netif_t * net,
const uint8_t ipaddr[4],
uint16_t ident,
uint16_t seq,
const uint8_t * data,
size_t size )

Send an ICMP Echo packet to the specified IP.

Parameters
netThe network device to use.
ipaddrThe IPv4 address to send to.
identA packet identifier.
seqA packet sequence number.
dataData to send with the packet.
sizeThe size of the data to send.
Returns
0 on success, <0 on failure.