Update the format of tuple to string output
This commit is contained in:
@@ -355,7 +355,7 @@ void tuple2_to_str(const struct tuple2 *tuple, char *buf, uint32_t size)
|
||||
inet_ntop(AF_INET6, &tuple->dst_addr.v6, dst_addr, INET6_ADDRSTRLEN);
|
||||
}
|
||||
|
||||
snprintf(buf, size, "%s -> %s", src_addr, dst_addr);
|
||||
snprintf(buf, size, "%s-%s", src_addr, dst_addr);
|
||||
}
|
||||
|
||||
void tuple4_to_str(const struct tuple4 *tuple, char *buf, uint32_t size)
|
||||
@@ -374,7 +374,7 @@ void tuple4_to_str(const struct tuple4 *tuple, char *buf, uint32_t size)
|
||||
inet_ntop(AF_INET6, &tuple->dst_addr.v6, dst_addr, INET6_ADDRSTRLEN);
|
||||
}
|
||||
|
||||
snprintf(buf, size, "%s:%u -> %s:%u",
|
||||
snprintf(buf, size, "%s:%u-%s:%u",
|
||||
src_addr, ntohs(tuple->src_port),
|
||||
dst_addr, ntohs(tuple->dst_port));
|
||||
}
|
||||
@@ -395,7 +395,7 @@ void tuple5_to_str(const struct tuple5 *tuple, char *buf, uint32_t size)
|
||||
inet_ntop(AF_INET6, &tuple->dst_addr.v6, dst_addr, INET6_ADDRSTRLEN);
|
||||
}
|
||||
|
||||
snprintf(buf, size, "%s:%u -> %s:%u, proto: %u",
|
||||
snprintf(buf, size, "%s:%u-%s:%u-%u",
|
||||
src_addr, ntohs(tuple->src_port),
|
||||
dst_addr, ntohs(tuple->dst_port),
|
||||
tuple->ip_proto);
|
||||
@@ -417,7 +417,7 @@ void tuple6_to_str(const struct tuple6 *tuple, char *buf, uint32_t size)
|
||||
inet_ntop(AF_INET6, &tuple->dst_addr.v6, dst_addr, INET6_ADDRSTRLEN);
|
||||
}
|
||||
|
||||
snprintf(buf, size, "%s:%u -> %s:%u, proto: %u, domain: %lu",
|
||||
snprintf(buf, size, "%s:%u-%s:%u-%u-%lu",
|
||||
src_addr, ntohs(tuple->src_port),
|
||||
dst_addr, ntohs(tuple->dst_port),
|
||||
tuple->ip_proto, tuple->domain);
|
||||
|
||||
Reference in New Issue
Block a user