Add IP proto utils function
This commit is contained in:
@@ -81,7 +81,7 @@ static inline void udp_hdr_set_checksum(struct udphdr *hdr, uint16_t sum)
|
||||
static inline int udp_hdr_to_str(const struct udphdr *hdr, char *buf, size_t size)
|
||||
{
|
||||
memset(buf, 0, size);
|
||||
return snprintf(buf, size, "UDP: src_port=%u dst_port=%u total_len=%u checksum=%u",
|
||||
return snprintf(buf, size, "UDP: src_port=%u dst_port=%u total_len=%u checksum=0x%x",
|
||||
udp_hdr_get_src_port(hdr), udp_hdr_get_dst_port(hdr),
|
||||
udp_hdr_get_total_len(hdr), udp_hdr_get_checksum(hdr));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user