.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "TSTRAFFICSERVERVERSIONGET" "3ts" "Apr 16, 2024" "9.2" "Apache Traffic Server" .SH NAME TSTrafficServerVersionGet \- return Traffic Server version information .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 .sp .EX #include .EE .UNINDENT .UNINDENT .INDENT 0.0 .TP .B const char *TSTrafficServerVersionGet(void) .UNINDENT .INDENT 0.0 .TP .B int TSTrafficServerVersionGetMajor(void) .UNINDENT .INDENT 0.0 .TP .B int TSTrafficServerVersionGetMinor(void) .UNINDENT .INDENT 0.0 .TP .B int TSTrafficServerVersionGetPatch(void) .UNINDENT .SH DESCRIPTION .sp \fI\%TSTrafficServerVersionGet()\fP returns a pointer to a string of characters that indicates the Traffic Server release version. This string must not be modified. .sp The other APIs return an integer from the relevant component of the version number string. .SH EXAMPLE .INDENT 0.0 .INDENT 3.5 .sp .EX #include #include #define PLUGIN_NAME \(dqhello_world\(dq int check_ts_version() { const char *ts_version = TSTrafficServerVersionGet(); int result = 0; if (ts_version) { int major_ts_version = 0; int minor_ts_version = 0; int patch_ts_version = 0; if (sscanf(ts_version, \(dq%d.%d.%d\(dq, &major_ts_version, &minor_ts_version, &patch_ts_version) != 3) { return 0; } /* We need at least Traffic Server 3.0 */ if (major_ts_version >= 3) { result = 1; } } return result; } void TSPluginInit (int argc, const char *argv[]) { TSPluginRegistrationInfo info; info.plugin_name = PLUGIN_NAME; info.vendor_name = \(dqMyCompany\(dq; info.support_email = \(dqts\-api\-support@MyCompany.com\(dq; if (TSPluginRegister(&info) != TS_SUCCESS) { TSError(\(dq[%s] Plugin registration failed\(dq, PLUGIN_NAME); } if (!check_ts_version()) { TSError(\(dq[%s] Plugin requires Traffic Server 3.0 or later\(dq, PLUGIN_NAME); return; } TSDebug(PLUGIN_NAME, \(dqHello World!\(dq); } .EE .UNINDENT .UNINDENT .SH SEE ALSO .sp \fBTSAPI(3ts)\fP .SH COPYRIGHT 2024, dev@trafficserver.apache.org .\" Generated by docutils manpage writer. .