TSPluginInit

    void (int argc, const char* argv[])

    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 .

    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.

    1. void
    2. TSPluginInit (int argc, const char * argv[])
    3. {
    4. TSPluginRegistrationInfo info;
    5. info.support_email = "ts-api-support@MyCompany.com";
    6. if (TSPluginRegister(&info) != TS_SUCCESS) {
    7. TSError("[%s] Plugin registration failed", PLUGIN_NAME);
    8. }

    TSAPI(3ts), TSInstallDirGet(3ts)