| 307 | } |
| 308 | |
| 309 | void |
| 310 | TSPluginInit(int argc ATS_UNUSED, const char *argv[] ATS_UNUSED) |
| 311 | { |
| 312 | int i; |
| 313 | TSPluginRegistrationInfo info; |
| 314 | TSReturnCode error; |
| 315 | |
| 316 | info.plugin_name = PLUGIN_NAME; |
| 317 | info.vendor_name = "Apache Software Foundation"; |
| 318 | info.support_email = "dev@trafficserver.apache.org"; |
| 319 | |
| 320 | if (TSPluginRegister(&info) != TS_SUCCESS) { |
| 321 | TSError("[%s] Plugin registration failed", PLUGIN_NAME); |
| 322 | } |
| 323 | |
| 324 | /* create an TSTextLogObject to log denied requests to */ |
| 325 | error = TSTextLogObjectCreate("denylist", TS_LOG_MODE_ADD_TIMESTAMP, &ts_log); |
| 326 | if (!ts_log || error == TS_ERROR) { |
| 327 | Dbg(dbg_ctl, "error while creating log"); |
| 328 | } |
| 329 | |
| 330 | sites_mutex = TSMutexCreate(); |
| 331 | |
| 332 | nsites = 0; |
| 333 | for (i = 0; i < MAX_NSITES; i++) { |
| 334 | sites[i] = nullptr; |
| 335 | } |
| 336 | |
| 337 | global_contp = TSContCreate(denylist_plugin, sites_mutex); |
| 338 | read_denylist(global_contp); |
| 339 | |
| 340 | /*TSHttpHookAdd (TS_HTTP_OS_DNS_HOOK, contp); */ |
| 341 | TSHttpHookAdd(TS_HTTP_TXN_START_HOOK, global_contp); |
| 342 | } |
nothing calls this directly
no test coverage detected