From ce002378b84507a065b43702de0c86f62468ef9b Mon Sep 17 00:00:00 2001 From: Daniel Roethlisberger Date: Sun, 15 Mar 2015 18:39:36 +0100 Subject: [PATCH] Use more intuitive letters for new format specs %D for Destination host, %p for the (more interesting) destination port, %S for Source host, %q for the (less interesting) source port. --- log.c | 20 ++++++++++---------- main.c | 8 ++++---- sslsplit.1 | 12 ++++++++++++ 3 files changed, 26 insertions(+), 14 deletions(-) diff --git a/log.c b/log.c index e2b9ee6..97d0d2e 100644 --- a/log.c +++ b/log.c @@ -386,6 +386,14 @@ log_content_format_pathspec(const char *logspec, elem = addrbuf; elem_len = strlen(addrbuf); break; + case 'D': + elem = dsthost; + elem_len = strlen(dsthost); + break; + case 'p': + elem = dstport; + elem_len = strlen(dstport); + break; case 's': if (snprintf(addrbuf, sizeof(addrbuf), "%s,%s", srchost, srcport) < 0) { @@ -395,19 +403,11 @@ log_content_format_pathspec(const char *logspec, elem = addrbuf; elem_len = strlen(addrbuf); break; - case 'f': - elem = dsthost; - elem_len = strlen(dsthost); - break; - case 'h': - elem = dstport; - elem_len = strlen(dstport); - break; - case 't': + case 'S': elem = srchost; elem_len = strlen(srchost); break; - case 'v': + case 'q': elem = srcport; elem_len = strlen(srcport); break; diff --git a/main.c b/main.c index 366c59f..50ecff3 100644 --- a/main.c +++ b/main.c @@ -154,11 +154,11 @@ main_usage(void) " -F pathspec content log: full data to sep files with %% subst (excl. -L/-S):\n" " %%T - initial connection time as an ISO 8601 UTC timestamp\n" " %%d - destination host and port\n" -" %%f - destination host\n" -" %%h - destination port\n" +" %%D - destination host\n" +" %%p - destination port\n" " %%s - source host and port\n" -" %%t - source host\n" -" %%v - source port\n" +" %%S - source host\n" +" %%q - source port\n" #ifdef HAVE_LOCAL_PROCINFO " %%x - base name of local process (requires -i)\n" " %%X - full path to local process (requires -i)\n" diff --git a/sslsplit.1 b/sslsplit.1 index fe9d5e6..022fbe5 100644 --- a/sslsplit.1 +++ b/sslsplit.1 @@ -394,10 +394,22 @@ The initial connection time as an ISO 8601 UTC timestamp. The destination host and port, separated by a comma, IPv6 addresses using underscore instead of colon. .TP +.I %D +The destination host, IPv6 addresses using underscore instead of colon. +.TP +.I %p +The destination port. +.TP .I %s The source host and port, separated by a comma, IPv6 addresses using underscore instead of colon. .TP +.I %S +The source host, IPv6 addresses using underscore instead of colon. +.TP +.I %q +The source port. +.TP .I %x The name of the local process. Requires \fB-i\fP to be used.