* @brief Plugin new instance entry point. * * Processes the configuration and initializes the plugin instance. * @param argc plugin arguments number * @param argv plugin arguments * @param instance new plugin instance pointer (initialized in this function) * @param errBuf error message buffer * @param errBufSize error message buffer size * @return TS_SUCCES if success or TS_ERROR if failur
| 117 | * @return TS_SUCCES if success or TS_ERROR if failure |
| 118 | */ |
| 119 | TSReturnCode |
| 120 | TSRemapNewInstance(int argc, char *argv[], void **instance, char * /* errBuf ATS_UNUSED */, int /* errBufSize ATS_UNUSED */) |
| 121 | { |
| 122 | AccessControlConfig *config = new AccessControlConfig(); |
| 123 | if (nullptr != config && config->init(argc, argv)) { |
| 124 | *instance = config; |
| 125 | } else { |
| 126 | AccessControlDebug("failed to initialize the " PLUGIN_NAME " plugin"); |
| 127 | *instance = nullptr; |
| 128 | delete config; |
| 129 | return TS_ERROR; |
| 130 | } |
| 131 | return TS_SUCCESS; |
| 132 | } |
| 133 | |
| 134 | /** |
| 135 | * @brief Plugin instance deletion clean-up entry point. |