.\" 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 "TSPLUGININIT" "3ts" "Apr 16, 2024" "9.2" "Apache Traffic Server" .SH NAME TSPluginInit \- traffic Server plugin loading and registration .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 .sp .EX #include .EE .UNINDENT .UNINDENT .INDENT 0.0 .TP .B void TSPluginInit(int argc, const char *argv[]) .UNINDENT .INDENT 0.0 .TP .B \fI\%TSReturnCode\fP TSPluginRegister(\fI\%TSPluginRegistrationInfo\fP *plugin_info) .UNINDENT .SH DESCRIPTION .sp \fI\%TSPluginInit()\fP must be defined by all plugins. Traffic Server calls this initialization routine when it loads the plugin and sets \fIargc\fP and \fIargv\fP appropriately based on the values in \fI\%plugin.config\fP\&. .sp \fIargc\fP is a count of the number of arguments in the argument vector, \fIargv\fP\&. The count is at least one because the first argument in the argument vector is the plugins name, which must exist in order for the plugin to be loaded. .sp \fI\%TSPluginRegister()\fP registers the appropriate SDK version specific in \fIsdk_version\fP for your plugin. Use this function to make sure that the version of Traffic Server on which your plugin is running supports the plugin. .SH RETURN VALUES .sp \fI\%TSPluginRegister()\fP returns \fBTS_ERROR\fP if the plugin registration failed. .SH EXAMPLES .INDENT 0.0 .INDENT 3.5 .sp .EX #include #define PLUGIN_NAME \(dqhello_world\(dq void TSPluginInit (int argc, const char * argv[]) { TSPluginRegistrationInfo info; info.plugin_name = PLUGIN_NAME; info.vendor_name = \(dqMyCompany\(dq; info.support_email = \(dqts\-api\-support@MyCompany.com\(dq; if (TSPluginRegister(&info) != TS_SUCCESS) { TSError(\(dq[%s] Plugin registration failed\(dq, PLUGIN_NAME); } } .EE .UNINDENT .UNINDENT .SH SEE ALSO .sp \fBTSAPI(3ts)\fP, \fBTSInstallDirGet(3ts)\fP .SH COPYRIGHT 2024, dev@trafficserver.apache.org .\" Generated by docutils manpage writer. .