aboutsummaryrefslogtreecommitdiff
path: root/src/pdesc.c
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2020-05-27 20:53:13 +0200
committerToni Uhlig <matzeton@googlemail.com>2020-05-27 20:53:13 +0200
commit011c923648a6998b483a3d5ee8f462fe7100b6a7 (patch)
treee8532bff322a6aed3d94a87284f5aa6e18f5d6b3 /src/pdesc.c
parentd2e92ee748f3b3e826ffcbf665adc45637ad9045 (diff)
re-enabled and improved logging of packet headers and payload (SEND)
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'src/pdesc.c')
-rw-r--r--src/pdesc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/pdesc.c b/src/pdesc.c
index 90a8a2e..78bf1cd 100644
--- a/src/pdesc.c
+++ b/src/pdesc.c
@@ -60,7 +60,7 @@
proxy_desc_t *create_and_insert_proxy_desc(uint16_t id_no, uint16_t icmp_id,
int sock, struct sockaddr_in *addr,
uint32_t dst_ip, uint32_t dst_port,
- uint32_t init_state, uint32_t type) {
+ uint32_t init_state, enum pkt_flag type) {
proxy_desc_t *cur;
pthread_mutex_lock(&chain_lock);
@@ -243,6 +243,12 @@ int queue_packet(int sock_fd, proxy_desc_t *cur, char *buf, size_t bufsiz,
cur->my_seq, state_name[state & (~kFlag_mask)],
ack_val, cur->pkt_type,
((state & kUser_flag) == kUser_flag ? "yes" : "no"));
+ log_sendrecv_hexstr("SEND ICMP", pkt, sizeof(*pkt));
+ log_sendrecv_hexstr("SEND PTNG", pt_pkt, sizeof(*pt_pkt));
+ if (pkt_len - (pt_pkt->data - (char *)pkt) > 0) {
+ log_sendrecv_hexstr("SEND PAYL", pt_pkt->data, pkt_len - (pt_pkt->data - (char *)pkt));
+ }
+
err = sendto(sock_fd, (const void*)pkt, pkt_len, 0,
(struct sockaddr*)&cur->dest_addr, sizeof(struct sockaddr));
if (err < 0) {