Skip to content

UDP tools

Types

mira_sniffer_udp_message_t

typedef struct mira_sniffer_udp_message_t mira_sniffer_udp_message_t;

Type for storing a parsed UDP message.

Structs

mira_sniffer_udp_message_t

Type for storing a parsed UDP message.

Name Type Description
msg uint8_t[255] Storage for UDP payload
payload_len uint8_t Length of payload stored in msg
checksum uint16_t UDP payload checksum
dst_port uint16_t UDP destination port
src_port uint16_t UDP source port
dst_address mira_net_address_t IPv6 destination address
src_address mira_net_address_t IPv6 source address

Functions

mira_sniffer_udp_payload_get

mira_status_t mira_sniffer_udp_payload_get(mira_sniffer_udp_message_t *msg, uint8_t *packet, uint8_t packet_len);

This function takes an unmodified packet from the logger callback and returns the contained UDP payload if the packet is an UDP message.

Note

Only unfragmented packets will be parsed. For more information regarding fragmentation, see Mira UDP

Parameters

Name Description
msg Destination storage for udp message
src Source packet to extract payload from
len Length of Source packet

Return value

Name Description
MIRA_SUCCESS UDP payload available in msg
MIRA_ERROR_INVALID_VALUE msg is NULL
MIRA_ERROR_NOT_SUPPORTED packet is not an UDP packet or it is fragmented
Back to top