logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

TSPluginInit - traffic Server plugin loading and registration

Description

TSPluginInit()  must  be defined by all plugins. Traffic Server calls this initialization routine when it
       loads the plugin and sets argc and argv appropriately based on the values in plugin.config.

       argc is a count of the number of arguments in the argument vector,  argv.  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.

       TSPluginRegister() registers the appropriate SDK version specific in sdk_version  for  your  plugin.  Use
       this  function  to  make sure that the version of Traffic Server on which your plugin is running supports
       the plugin.

Examples

          #include <ts/ts.h>
          #define PLUGIN_NAME "hello_world"

          void
          TSPluginInit (int argc, const char * argv[])
          {
             TSPluginRegistrationInfo info;
             info.plugin_name = PLUGIN_NAME;
             info.vendor_name = "MyCompany";
             info.support_email = "ts-api-support@MyCompany.com";

             if (TSPluginRegister(&info) != TS_SUCCESS) {
                TSError("[%s] Plugin registration failed", PLUGIN_NAME);
             }
          }

Name

       TSPluginInit - traffic Server plugin loading and registration

Return Values

TSPluginRegister() returns TS_ERROR if the plugin registration failed.

See Also

TSAPI(3ts), TSInstallDirGet(3ts)

Synopsis

          #include <ts/ts.h>

       voidTSPluginInit(intargc,constchar*argv[])TSReturnCodeTSPluginRegister(TSPluginRegistrationInfo*plugin_info)

See Also