| 32 | } |
| 33 | |
| 34 | void |
| 35 | TSPluginInit(int argc, const char *argv[]) |
| 36 | { |
| 37 | (void)argc; // unused |
| 38 | (void)argv; // unused |
| 39 | |
| 40 | // Get the version: |
| 41 | const char *ts_version = TSTrafficServerVersionGet(); |
| 42 | if (!ts_version) { |
| 43 | TSError("[%s] Can't get Traffic Server version.", PLUGIN_NAME); |
| 44 | return; |
| 45 | } |
| 46 | |
| 47 | // Split it in major, minor, patch: |
| 48 | int major_ts_version = 0; |
| 49 | int minor_ts_version = 0; |
| 50 | int patch_ts_version = 0; |
| 51 | |
| 52 | if (sscanf(ts_version, "%d.%d.%d", &major_ts_version, &minor_ts_version, &patch_ts_version) != 3) { |
| 53 | TSError("[%s] Can't extract versions.", PLUGIN_NAME); |
| 54 | return; |
| 55 | } |
| 56 | |
| 57 | TSPluginRegistrationInfo info; |
| 58 | info.plugin_name = PLUGIN_NAME; |
| 59 | info.vendor_name = "Apache Software Foundation"; |
| 60 | info.support_email = "dev@trafficserver.apache.org"; |
| 61 | |
| 62 | // partial compilation |
| 63 | if (TSPluginRegister(&info) != TS_SUCCESS) { |
| 64 | TSError("[%s] Plugin registration failed.", PLUGIN_NAME); |
| 65 | } |
| 66 | |
| 67 | Dbg(dbg_ctl, "Running in Apache Traffic Server: v%d.%d.%d", major_ts_version, minor_ts_version, patch_ts_version); |
| 68 | } |
nothing calls this directly
no test coverage detected