API for v4 of the Internet Control Message Protocol
More...
|
| 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.
|
| |
|
| 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.
|
| |
API for v4 of the Internet Control Message Protocol
◆ ICMP_REASSEMBLY_TIME_EXCEEDED
| #define ICMP_REASSEMBLY_TIME_EXCEEDED 1 |
◆ 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
-
| ip | The IPv4 address the reply is from. |
| seq | The sequence number of the packet. |
| delta_us | The time difference, in microseconds. |
| ttl | The TTL value in the packet. |
| data | Any data in the packet. |
| len | The length of the data, in bytes. |
◆ 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
-
| net | The network device to use. |
| code | The type of message this is. |
| msg | The 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
-
| net | The network device to use. |
| ipaddr | The IPv4 address to send to. |
| ident | A packet identifier. |
| seq | A packet sequence number. |
| data | Data to send with the packet. |
| size | The size of the data to send. |
- Returns
- 0 on success, <0 on failure.