.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "LOCAL OUTBOUND ADDRESS" "3ts" "Apr 16, 2024" "9.2" "Apache Traffic Server" .SH NAME Local outbound address \- get or set the local IP address for outbound connections .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 .sp .EX #include .EE .UNINDENT .UNINDENT .INDENT 0.0 .TP .B sockaddr const *TSHttpTxnOutgoingAddrGet(\fI\%TSHttpTxn\fP txnp) .UNINDENT .INDENT 0.0 .TP .B \fI\%TSReturnCode\fP TSHttpTxnOutgoingAddrSet(\fI\%TSHttpTxn\fP txnp, sockaddr const *addr) .UNINDENT .SH DESCRIPTION .sp These functions concern the local IP address and port, that is the address and port on the Traffic Server side of outbound connections (network connections \fIfrom\fP Traffic Server \fIto\fP another socket). .sp The address and optional the port can be set with \fI\%TSHttpTxnOutgoingAddrSet()\fP\&. This must be done before the outbound connection is made, that is, earlier than the \fI\%TS_HTTP_SEND_REQUEST_HDR_HOOK\fP\&. A good choice is the \fI\%TS_HTTP_POST_REMAP_HOOK\fP, since it is a hook that is always called, and it is the latest hook that is called before the connection is made. The \fIaddr\fP must be populated with the IP address and port to be used. If the port is not relevant it can be set to zero, which means use any available local port. This function returns \fI\%TS_SUCCESS\fP on success and \fI\%TS_ERROR\fP on failure. .sp Even on a successful call to \fI\%TSHttpTxnOutgoingAddrSet()\fP, the local IP address may not match what was passing \fIaddr\fP if \fI\%session sharing\fP is enabled. .sp Conversely \fI\%TSHttpTxnOutgoingAddrGet()\fP retrieves the local address and must be called in the \fI\%TS_HTTP_SEND_REQUEST_HDR_HOOK\fP or later, after the outbound connection has been established. It returns a pointer to a \fBsockaddr\fP which contains the local IP address and port. If there is no valid outbound connection, \fIaddr\fP will be \fBNULL\fP\&. The returned pointer is a transient pointer and must not be referenced after the callback in which \fI\%TSHttpTxnOutgoingAddrGet()\fP was called. .SH COPYRIGHT 2024, dev@trafficserver.apache.org .\" Generated by docutils manpage writer. .