MEDIUM: log-format: backend source address %Bi %Bp
%Bi return the backend source IP
%Bp return the backend source port
Add a function pointer in logformat_type to do additional configuration
during the log-format variable parsing.
diff --git a/include/types/log.h b/include/types/log.h
index 0e78024..2f11aab 100644
--- a/include/types/log.h
+++ b/include/types/log.h
@@ -44,6 +44,8 @@
LOG_GLOBAL,
LOG_CLIENTIP,
LOG_CLIENTPORT,
+ LOG_SOURCEPORT,
+ LOG_SOURCEIP,
LOG_DATE,
LOG_DATEGMT,
LOG_MS,
diff --git a/include/types/proxy.h b/include/types/proxy.h
index 6693d82..26cdfe4 100644
--- a/include/types/proxy.h
+++ b/include/types/proxy.h
@@ -138,7 +138,9 @@
#define PR_O2_NODELAY 0x00020000 /* fully interactive mode, never delay outgoing data */
#define PR_O2_USE_PXHDR 0x00040000 /* use Proxy-Connection for proxy requests */
#define PR_O2_CHK_SNDST 0x00080000 /* send the state of each server along with HTTP health checks */
-/* unused: 0x00100000 */
+
+#define PR_O2_SRC_ADDR 0x00100000 /* get the source ip and port for logs */
+
#define PR_O2_FAKE_KA 0x00200000 /* pretend we do keep-alive with server eventhough we close */
/* unused: 0x00400000 */
#define PR_O2_EXP_NONE 0x00000000 /* http-check : no expect rule */
diff --git a/include/types/session.h b/include/types/session.h
index a707aa5..5678e5c 100644
--- a/include/types/session.h
+++ b/include/types/session.h
@@ -84,6 +84,7 @@
#define SN_IGNORE_PRST 0x00080000 /* ignore persistence */
#define SN_BE_TRACK_SC1 0x00100000 /* backend tracks stick-counter 1 */
#define SN_BE_TRACK_SC2 0x00200000 /* backend tracks stick-counter 2 */
+#define SN_BCK_ADDR_SET 0x00400000 /* set if the backend address has been filled */
/* Termination sequence tracing.
*
diff --git a/include/types/stream_interface.h b/include/types/stream_interface.h
index 4f0bfa2..5acbd57 100644
--- a/include/types/stream_interface.h
+++ b/include/types/stream_interface.h
@@ -72,6 +72,7 @@
SI_FL_DONT_WAKE = 0x0020, /* resync in progress, don't wake up */
SI_FL_INDEP_STR = 0x0040, /* independant streams = don't update rex on write */
SI_FL_NOLINGER = 0x0080, /* may close without lingering. One-shot. */
+ SI_FL_SRC_ADDR = 0x1000, /* get the source ip/port with getsockname */
};
/* target types */