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 *ip, uint16 seq, uint64 delta_us, uint8 ttl, const uint8 *data, size_t len)
 ICMPv4 echo reply callback type.
 

Functions

int net_icmp_send_echo (netif_t *net, const uint8 ipaddr[4], uint16 ident, uint16 seq, const uint8 *data, size_t size)
 Send an ICMP Echo packet to the specified IP.
 
int net_icmp_send_dest_unreach (netif_t *net, uint8 code, const uint8 *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 *ip, uint16 seq, uint64 delta_us, uint8 ttl, const uint8 *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 code,
const uint8 * 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 ipaddr[4],
uint16 ident,
uint16 seq,
const uint8 * 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.