.\" Man page generated from reStructuredText. . .TH "TSREMAPINIT" "3ts" "Mar 08, 2019" "7.1" "Apache Traffic Server" .SH NAME TSRemapInit \- traffic Server remap plugin entry points . .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 .. .SH SYNOPSIS .sp \fI#include \fP \fI#include \fP .INDENT 0.0 .TP .B TSReturnCode TSRemapInit(TSRemapInterface *\fI\ api_info\fP, char *\fI\ errbuf\fP, int\fI\ errbuf_size\fP) .UNINDENT .INDENT 0.0 .TP .B void TSRemapDone(void) .UNINDENT .INDENT 0.0 .TP .B \fI\%TSRemapStatus\fP TSRemapDoRemap(void *\fI\ ih\fP, TSHttpTxn\fI\ rh\fP, TSRemapRequestInfo *\fI\ rri\fP) .UNINDENT .INDENT 0.0 .TP .B TSReturnCode TSRemapNewInstance(int\fI\ argc\fP, char *\fI\ argv[]\fP, void **\fI\ ih\fP, char *\fI\ errbuf\fP, int\fI\ errbuf_size\fP) .UNINDENT .INDENT 0.0 .TP .B void TSRemapDeleteInstance(void\fI\ *\fP) .UNINDENT .INDENT 0.0 .TP .B void TSRemapOSResponse(void *\fI\ ih\fP, TSHttpTxn\fI\ rh\fP, int\fI\ os_response_type\fP) .UNINDENT .SH DESCRIPTION .sp The Traffic Server remap interface provides a simplified mechanism for plugins to manipulate HTTP transactions. A remap plugin is not global; it is configured on a per\-remap rule basis, which enables you to customize how URLs are redirected based on individual rules in \fBremap.config\fP\&. Writing a remap plugin consists of implementing one or more of the remap entry points and configuring \fBremap.config\fP to route the transaction through your plugin. Multiple remap plugins can be specified for a single remap rule, resulting in a remap plugin chain where each plugin is given an opportunity to examine the HTTP transaction. .sp \fI\%TSRemapInit()\fP is a required entry point. This function will be called once when Traffic Server loads the plugin. If the optional \fI\%TSRemapDone()\fP entry point is available, Traffic Server will call then when unloading the remap plugin. .sp A remap plugin may be invoked for different remap rules. Traffic Server will call the entry point each time a plugin is specified in a remap rule. When a remap plugin instance is no longer required, Traffic Server will call \fI\%TSRemapDeleteInstance()\fP\&. .sp \fI\%TSRemapDoRemap()\fP is called for each HTTP transaction. This is a mandatory entry point. In this function, the remap plugin may examine and modify the HTTP transaction. .SH TYPES .INDENT 0.0 .TP .B TSRemapStatus Status return value for remap callback. .INDENT 7.0 .TP .B TSREMAP_DID_REMAP The remap callback modified the request. .UNINDENT .INDENT 7.0 .TP .B TSREMAP_DID_REMAP_STOP The remap callback modified the request and that no more remapping callbacks should be invoked. .UNINDENT .INDENT 7.0 .TP .B TSREMAP_NO_REMAP The remap callback did not modify the request. .UNINDENT .INDENT 7.0 .TP .B TSREMAP_NO_REMAP_STOP The remap callback did not modify the request and that no further remapping callbacks should be invoked. .UNINDENT .INDENT 7.0 .TP .B TSREMAP_ERROR The remapping attempt in general failed and the transaction should fail with an error return to the user agent. .UNINDENT .UNINDENT .SH RETURN VALUES .sp \fI\%TSRemapInit()\fP and \fI\%TSRemapNewInstance()\fP should return \fBTS_SUCCESS\fP on success, and \fBTS_ERROR\fP otherwise. A return value of \fBTS_ERROR\fP is unrecoverable. .sp \fI\%TSRemapDoRemap()\fP returns a status code that indicates whether the HTTP transaction has been modified and whether Traffic Server should continue to evaluate the chain of remap plugins. If the transaction was modified, the plugin should return \fI\%TSREMAP_DID_REMAP\fP or \fI\%TSREMAP_DID_REMAP_STOP\fP; otherwise it should return \fI\%TSREMAP_NO_REMAP\fP or \fI\%TSREMAP_NO_REMAP_STOP\fP\&. If Traffic Server should not send the transaction to subsequent plugins in the remap chain, return \fI\%TSREMAP_NO_REMAP_STOP\fP or \fI\%TSREMAP_DID_REMAP_STOP\fP\&. Returning \fI\%TSREMAP_ERROR\fP causes Traffic Server to stop evaluating the remap chain and respond with an error. .SH SEE ALSO .sp \fBTSAPI(3ts)\fP .SH COPYRIGHT 2019, dev@trafficserver.apache.org .\" Generated by docutils manpage writer. .