Rtos API example
socket_callback_t Struct Reference
ICMP socket instruction. More...
#include <socket_api.h>
Data Fields | |
uint8_t | event_type |
Socket Callback Event check list below. | |
int8_t | socket_id |
Socket id queue which socket cause call back. | |
int8_t | interface_id |
Network Interface ID where Packet came. | |
uint16_t | d_len |
Data length if event type is SOCKET_DATA. | |
uint8_t | LINK_LQI |
LINK LQI info if interface cuold give. |
Detailed Description
ICMP socket instruction.
ICMP header is comprised of 4 bytes. The first byte is for type, second for code and the last two are for checksum that must always be zero. The stack will calculate the checksum automatically when sending the packet. The payload comes after the header and it can be of any length. It can also be set to 0.
This applies for reading and sending.
ICMP TYPE ICMP Code ICMP Checksum (2 bytes) Payload n bytes -------- -------- -------- -------- -------- -------- ....... ------- 0xXX 0xXX 0x00 0x00 0xXX 0xXX ...... 0xXX
Example data flow for ping:
ICMP echo request with 4-bytes payload (Ping6). 0x80, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03
ICMP echo response for the message above. 0x81, 0x00, 0xXX, 0xXX, 0x00, 0x01, 0x02, 0x03
Socket Callback function structure type.
Definition at line 187 of file socket_api.h.
Field Documentation
uint16_t d_len |
Data length if event type is SOCKET_DATA.
Definition at line 191 of file socket_api.h.
uint8_t event_type |
Socket Callback Event check list below.
Definition at line 188 of file socket_api.h.
int8_t interface_id |
Network Interface ID where Packet came.
Definition at line 190 of file socket_api.h.
uint8_t LINK_LQI |
LINK LQI info if interface cuold give.
Definition at line 192 of file socket_api.h.
int8_t socket_id |
Socket id queue which socket cause call back.
Definition at line 189 of file socket_api.h.
Generated on Sun Jul 17 2022 08:25:42 by 1.7.2