.\" Man page generated from reStructuredText. . .TH "TSREMAPINIT" "3ts" "January 24, 2017" "7.0" "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 TSRemapStatus 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 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 \fBTSREMAP_DID_REMAP\fP or \fBTSREMAP_DID_REMAP_STOP\fP; otherwise it should return \fBTSREMAP_NO_REMAP\fP or \fBTSREMAP_NO_REMAP_STOP\fP\&. If Traffic Server should not send the transaction to subsequent plugins in the remap chain, return \fBTSREMAP_NO_REMAP_STOP\fP or \fBTSREMAP_DID_REMAP_STOP\fP\&. Returning \fBTSREMAP_ERROR\fP causes Traffic Server to stop evaluating the remap chain and respond with an error. .SH SEE ALSO .sp \fITSAPI(3ts)\fP .SH COPYRIGHT 2015, dev@trafficserver.apache.org .\" Generated by docutils manpage writer. .