-
Notifications
You must be signed in to change notification settings - Fork 640
Add format codes for local FQDN #2429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -4781,6 +4781,7 @@ DOC_START | |||||
| >p Client source port | ||||||
| >eui Client source EUI (MAC address, EUI-48 or EUI-64 identifier) | ||||||
| >la Local IP address the client connected to | ||||||
| >lA Local FQDN for address the client connected to | ||||||
| >lp Local port number the client connected to | ||||||
| >qos Client connection TOS/DSCP value set by Squid | ||||||
| >nfmark Client connection netfilter packet MARK set by Squid | ||||||
|
|
@@ -4805,6 +4806,7 @@ DOC_START | |||||
| <A Server FQDN or peer name | ||||||
| <p Server port number of the last server or peer connection | ||||||
| <la Local IP address of the last server or peer connection | ||||||
| <lA Local FQDN for address of the last server or peer connection | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here and elsewhere in this PR, please avoid the term "local FQDN". It is confusing (e.g., was some special a "local" DNS resolver used to obtain that FQDN?) and not descriptive enough ("address of the last server or peer connection" matches two different addresses, not one). I do not insist on any specific wording, but something like this would address the problem:
Suggested change
N.B. |
||||||
| <lp Local port number of the last server or peer connection | ||||||
| <qos Server connection TOS/DSCP value set by Squid | ||||||
| <nfmark Server connection netfilter packet MARK set by Squid | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,6 +17,7 @@ | |
| #include "format/Format.h" | ||
| #include "format/Quoting.h" | ||
| #include "format/Token.h" | ||
| #include "fqdncache.h" | ||
| #include "http/Stream.h" | ||
| #include "HttpRequest.h" | ||
| #include "MemBuf.h" | ||
|
|
@@ -491,6 +492,12 @@ Format::Format::assemble(MemBuf &mb, const AccessLogEntry::Pointer &al, int logS | |
| out = al->tcpClient->local.toStr(tmp, sizeof(tmp)); | ||
| break; | ||
|
|
||
| case LFT_CLIENT_LOCAL_FQDN: | ||
| // May be too late for ours, but FQDN_LOOKUP_IF_MISS might help the next caller. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please mimic existing I suggest naming the new flag Same for |
||
| if (al->tcpClient) | ||
| out = fqdncache_gethostbyaddr(al->tcpClient->local, FQDN_LOOKUP_IF_MISS); | ||
| break; | ||
|
|
||
| case LFT_CLIENT_LOCAL_TOS: | ||
| if (al->tcpClient) { | ||
| sb.appendf("0x%x", static_cast<uint32_t>(al->tcpClient->tos)); | ||
|
|
@@ -532,6 +539,12 @@ Format::Format::assemble(MemBuf &mb, const AccessLogEntry::Pointer &al, int logS | |
| out = al->hier.tcpServer->local.toStr(tmp, sizeof(tmp)); | ||
| break; | ||
|
|
||
| case LFT_SERVER_LOCAL_FQDN: | ||
| // May be too late for ours, but FQDN_LOOKUP_IF_MISS might help the next caller. | ||
| if (al->hier.tcpServer) | ||
| out = fqdncache_gethostbyaddr(al->hier.tcpServer->local, FQDN_LOOKUP_IF_MISS); | ||
| break; | ||
|
|
||
| case LFT_SERVER_LOCAL_PORT: | ||
| if (al->hier.tcpServer) { | ||
| outint = al->hier.tcpServer->local.port(); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please document (in
cf.dada.pre) that these FQDNs are provided on a best-effort basis (i.e. that, when the corresponding DNS lookups are needed, Squid does not wait for them to complete when logging transactions).