MCPcopy Create free account
hub / github.com/apache/trafficserver / TSPluginInit

Function TSPluginInit

tests/tools/plugins/tunnel_transform.cc:303–331  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

301}
302
303void
304TSPluginInit(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
329Lerror:
330 TSError("[%s] Unable to initialize plugin (disabled)", PLUGIN_NAME);
331}

Callers

nothing calls this directly

Calls 7

TSPluginRegisterFunction · 0.85
TSStatCreateFunction · 0.85
TSHttpHookAddFunction · 0.85
TSContCreateFunction · 0.85
TSLifecycleHookAddFunction · 0.85
TSMutexCreateFunction · 0.85
TSErrorFunction · 0.50

Tested by

no test coverage detected