| 301 | } |
| 302 | |
| 303 | void |
| 304 | TSPluginInit(int /* argc ATS_UNUSED */, const char ** /* argv ATS_UNUSED */) |
| 305 | { |
| 306 | TSPluginRegistrationInfo info; |
| 307 | |
| 308 | info.plugin_name = PLUGIN_NAME; |
| 309 | info.vendor_name = "Apache Software Foundation"; |
| 310 | info.support_email = "dev@trafficserver.apache.org"; |
| 311 | |
| 312 | if (TSPluginRegister(&info) != TS_SUCCESS) { |
| 313 | TSError("[%s] Plugin registration failed", PLUGIN_NAME); |
| 314 | |
| 315 | goto Lerror; |
| 316 | } |
| 317 | |
| 318 | stat_ua_bytes_sent = |
| 319 | TSStatCreate("tunnel_transform.ua.bytes_sent", TS_RECORDDATATYPE_INT, TS_STAT_NON_PERSISTENT, TS_STAT_SYNC_SUM); |
| 320 | stat_os_bytes_sent = |
| 321 | TSStatCreate("tunnel_transform.os.bytes_sent", TS_RECORDDATATYPE_INT, TS_STAT_NON_PERSISTENT, TS_STAT_SYNC_SUM); |
| 322 | stat_error = TSStatCreate("tunnel_transform.error", TS_RECORDDATATYPE_INT, TS_STAT_NON_PERSISTENT, TS_STAT_SYNC_SUM); |
| 323 | stat_test_done = TSStatCreate("tunnel_transform.test.done", TS_RECORDDATATYPE_INT, TS_STAT_NON_PERSISTENT, TS_STAT_SYNC_SUM); |
| 324 | |
| 325 | TSHttpHookAdd(TS_HTTP_TUNNEL_START_HOOK, TSContCreate(transform_plugin, nullptr)); |
| 326 | TSLifecycleHookAdd(TS_LIFECYCLE_MSG_HOOK, TSContCreate(handleMsg, TSMutexCreate())); |
| 327 | return; |
| 328 | |
| 329 | Lerror: |
| 330 | TSError("[%s] Unable to initialize plugin (disabled)", PLUGIN_NAME); |
| 331 | } |
nothing calls this directly
no test coverage detected