| 160 | } |
| 161 | |
| 162 | void |
| 163 | TSPluginInit(int argc, const char *argv[]) |
| 164 | { |
| 165 | // clang-format off |
| 166 | static const TSHttpHookID http[] = { |
| 167 | TS_HTTP_READ_REQUEST_HDR_HOOK, |
| 168 | TS_HTTP_OS_DNS_HOOK, |
| 169 | TS_HTTP_SEND_REQUEST_HDR_HOOK, |
| 170 | TS_HTTP_READ_CACHE_HDR_HOOK, |
| 171 | TS_HTTP_READ_RESPONSE_HDR_HOOK, |
| 172 | TS_HTTP_SEND_RESPONSE_HDR_HOOK, |
| 173 | TS_HTTP_SELECT_ALT_HOOK, |
| 174 | TS_HTTP_TXN_START_HOOK, |
| 175 | TS_HTTP_TXN_CLOSE_HOOK, |
| 176 | TS_HTTP_SSN_START_HOOK, |
| 177 | TS_HTTP_SSN_CLOSE_HOOK, |
| 178 | TS_HTTP_CACHE_LOOKUP_COMPLETE_HOOK, |
| 179 | TS_HTTP_PRE_REMAP_HOOK, |
| 180 | TS_HTTP_POST_REMAP_HOOK, |
| 181 | }; |
| 182 | |
| 183 | static const TSLifecycleHookID lifecycle[] = { |
| 184 | TS_LIFECYCLE_PORTS_INITIALIZED_HOOK, |
| 185 | TS_LIFECYCLE_PORTS_READY_HOOK, |
| 186 | TS_LIFECYCLE_CACHE_READY_HOOK, |
| 187 | TS_LIFECYCLE_SERVER_SSL_CTX_INITIALIZED_HOOK, |
| 188 | TS_LIFECYCLE_CLIENT_SSL_CTX_INITIALIZED_HOOK, |
| 189 | TS_LIFECYCLE_MSG_HOOK, |
| 190 | }; |
| 191 | |
| 192 | // clang-format on |
| 193 | |
| 194 | (void)argc; // unused |
| 195 | (void)argv; // unused |
| 196 | |
| 197 | TSPluginRegistrationInfo info; |
| 198 | |
| 199 | info.plugin_name = (char *)PLUGIN_NAME; |
| 200 | info.vendor_name = (char *)"Apache Software Foundation"; |
| 201 | info.support_email = (char *)"dev@trafficserver.apache.org"; |
| 202 | |
| 203 | for (unsigned i = 0; i < countof(http); ++i) { |
| 204 | TSHttpHookAdd(http[i], TSContCreate(HttpHookTracer, TSMutexCreate())); |
| 205 | } |
| 206 | |
| 207 | for (unsigned i = 0; i < countof(lifecycle); ++i) { |
| 208 | TSLifecycleHookAdd(lifecycle[i], TSContCreate(LifecycleHookTracer, TSMutexCreate())); |
| 209 | } |
| 210 | |
| 211 | TSReleaseAssert(TSPluginRegister(&info) == TS_SUCCESS); |
| 212 | } |
nothing calls this directly
no test coverage detected