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

Function TSPluginInit

example/plugins/c-api/basic_auth/basic_auth.cc:212–243  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

210}
211
212void
213TSPluginInit(int argc ATS_UNUSED, const char *argv[] ATS_UNUSED)
214{
215 int i, cc;
216 TSPluginRegistrationInfo info;
217
218 info.plugin_name = PLUGIN_NAME;
219 info.vendor_name = "Apache Software Foundation";
220 info.support_email = "dev@trafficserver.apache.org";
221
222 if (TSPluginRegister(&info) != TS_SUCCESS) {
223 TSError("[%s] Plugin registration failed", PLUGIN_NAME);
224 }
225
226 /* Build translation table */
227 for (i = 0, cc = 0; i < 256; i++) {
228 base64_codes[i] = 0;
229 }
230 for (i = 'A'; i <= 'Z'; i++) {
231 base64_codes[i] = cc++;
232 }
233 for (i = 'a'; i <= 'z'; i++) {
234 base64_codes[i] = cc++;
235 }
236 for (i = '0'; i <= '9'; i++) {
237 base64_codes[i] = cc++;
238 }
239 base64_codes[static_cast<unsigned>('+')] = cc++;
240 base64_codes[static_cast<unsigned>('/')] = cc++;
241
242 TSHttpHookAdd(TS_HTTP_OS_DNS_HOOK, TSContCreate(auth_plugin, nullptr));
243}

Callers

nothing calls this directly

Calls 4

TSPluginRegisterFunction · 0.85
TSHttpHookAddFunction · 0.85
TSContCreateFunction · 0.85
TSErrorFunction · 0.50

Tested by

no test coverage detected