aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlns <matzeton@googlemail.com>2019-01-29 19:15:17 +0100
committerlns <matzeton@googlemail.com>2019-01-29 19:15:17 +0100
commit9d9173684fc05c0f5b4fe1ba4ee9f754585841a9 (patch)
treec00d340432dd7315c01f29eb4ff448d662304af3
parent8a7a9a83ae7b15755cf7c459872670abca4cbd14 (diff)
trimmed xfr debug output + icmp id/seq output, replaced invalid UTF8 char 'oe'
Signed-off-by: lns <matzeton@googlemail.com>
-rw-r--r--src/pdesc.c18
-rw-r--r--src/pkt.c10
-rw-r--r--src/ptunnel.c4
-rw-r--r--src/ptunnel.h2
4 files changed, 21 insertions, 13 deletions
diff --git a/src/pdesc.c b/src/pdesc.c
index 51fa3ab..a754864 100644
--- a/src/pdesc.c
+++ b/src/pdesc.c
@@ -208,12 +208,18 @@ int queue_packet(int icmp_sock, uint8_t type, char *buf, int num_bytes,
pkt->checksum = htons(calc_icmp_checksum((uint16_t*)pkt, pkt_len));
/* Send it! */
- pt_log(kLog_sendrecv, "Send: %d [%d] bytes [seq = %d] "
- "[type = %s] [ack = %d] [icmp = %d] [user = %s]\n",
- pkt_len, num_bytes, *seq, state_name[state & (~kFlag_mask)],
- ack_val, type, ((state & kUser_flag) == kUser_flag ? "yes" : "no"));
- err = sendto(icmp_sock, (const void*)pkt, pkt_len, 0,
- (struct sockaddr*)dest_addr, sizeof(struct sockaddr));
+ pt_log(kLog_sendrecv, "Send: %4d [%4d] bytes "
+ "[id = 0x%04X] [seq = %d] "
+ "[seq_no = %d] [type = %s] "
+ "[ack = %d] [icmp = %d] "
+ "[user = %s]\n",
+ pkt_len, num_bytes,
+ icmp_id, *ping_seq,
+ *seq, state_name[state & (~kFlag_mask)],
+ ack_val, type,
+ ((state & kUser_flag) == kUser_flag ? "yes" : "no"));
+ err = sendto(icmp_sock, (const void*)pkt, pkt_len, 0,
+ (struct sockaddr*)dest_addr, sizeof(struct sockaddr));
if (err < 0) {
pt_log(kLog_error, "Failed to send ICMP packet: %s\n", strerror(errno));
free(pkt);
diff --git a/src/pkt.c b/src/pkt.c
index 27f492f..70a294f 100644
--- a/src/pkt.c
+++ b/src/pkt.c
@@ -128,11 +128,13 @@ void handle_packet(char *buf, unsigned bytes, int is_pcap, struct sockaddr_in *a
pt_log(kLog_error, "Dropping packet with invalid state.\n");
return;
}
- pt_log(kLog_sendrecv, "Recv: %d [%d] bytes "
- "[seq = %d] [type = %s] "
+ pt_log(kLog_sendrecv, "Recv: %4d [%4d] bytes "
+ "[id = 0x%04X] [seq = %d] "
+ "[seq_no = %d] [type = %s] "
"[ack = %d] [icmp = %d] "
- "[user = %s] [pcap = %d]\n",
- bytes, ntohl(pt_pkt->data_len),
+ "[user = %s] [pcap = %d]\n",
+ bytes, ntohl(pt_pkt->data_len),
+ pkt->identifier, ntohs(pkt->seq),
pt_pkt->seq_no, state_name[pt_pkt->state & (~kFlag_mask)],
ntohl(pt_pkt->ack), pkt->type,
(pkt_flag == kUser_flag ? "yes" : "no"), is_pcap);
diff --git a/src/ptunnel.c b/src/ptunnel.c
index 8766acf..e56ab69 100644
--- a/src/ptunnel.c
+++ b/src/ptunnel.c
@@ -34,7 +34,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*
* Contacting the author:
- * You can get in touch with me, Daniel Stødle (that's the Norwegian letter oe,
+ * You can get in touch with me, Daniel Stoedle (that's the Norwegian letter oe,
* in case your text editor didn't realize), here: <daniels@cs.uit.no>
*
* The official ptunnel website is here:
@@ -98,7 +98,7 @@ char pcap_filter_program[] = "icmp";
/** The chain of client/proxy connections */
proxy_desc_t *chain = 0;
-const char *state_name[kNum_proto_types] = { "start", "ack", "data",
+const char *state_name[kNum_proto_types] = { "start", "ack ", "data ",
"close", "authenticate" };
/* Let the fun begin! */
diff --git a/src/ptunnel.h b/src/ptunnel.h
index d93f997..5a63acc 100644
--- a/src/ptunnel.h
+++ b/src/ptunnel.h
@@ -32,7 +32,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*
* Contacting the author:
- * You can get in touch with me, Daniel Stødle (that's the Norwegian letter oe,
+ * You can get in touch with me, Daniel Stoedle (that's the Norwegian letter oe,
* in case your text editor didn't realize), here: <daniels@cs.uit.no>
*
* The official ptunnel website is here: