.\" 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 "TSURLHOSTGET" "3ts" "Jan 06, 2024" "9.2" "Apache Traffic Server" .SH NAME TSUrlHostGet \- traffic Server URL component retrieval API .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 .sp .EX #include .EE .UNINDENT .UNINDENT .INDENT 0.0 .TP .B const char *TSUrlHostGet(\fI\%TSMBuffer\fP bufp, \fI\%TSMLoc\fP offset, int *length) .UNINDENT .INDENT 0.0 .TP .B const char *TSUrlSchemeGet(\fI\%TSMBuffer\fP bufp, \fI\%TSMLoc\fP offset, int *length) .UNINDENT .INDENT 0.0 .TP .B const char *TSUrlRawSchemeGet(\fI\%TSMBuffer\fP bufp, \fI\%TSMLoc\fP offset, int *length) .UNINDENT .INDENT 0.0 .TP .B const char *TSUrlUserGet(\fI\%TSMBuffer\fP bufp, \fI\%TSMLoc\fP offset, int *length) .UNINDENT .INDENT 0.0 .TP .B const char *TSUrlPasswordGet(\fI\%TSMBuffer\fP bufp, \fI\%TSMLoc\fP offset, int *length) .UNINDENT .INDENT 0.0 .TP .B int TSUrlPortGet(\fI\%TSMBuffer\fP bufp, \fI\%TSMLoc\fP offset) .UNINDENT .INDENT 0.0 .TP .B int TSUrlRawPortGet(\fI\%TSMBuffer\fP bufp, \fI\%TSMLoc\fP offset) .UNINDENT .INDENT 0.0 .TP .B const char *TSUrlPathGet(\fI\%TSMBuffer\fP bufp, \fI\%TSMLoc\fP offset, int *length) .UNINDENT .INDENT 0.0 .TP .B const char *TSUrlHttpQueryGet(\fI\%TSMBuffer\fP bufp, \fI\%TSMLoc\fP offset, int *length) .UNINDENT .INDENT 0.0 .TP .B const char *TSUrlHttpParamsGet(\fI\%TSMBuffer\fP bufp, \fI\%TSMLoc\fP offset, int *length) .UNINDENT .INDENT 0.0 .TP .B const char *TSUrlHttpFragmentGet(\fI\%TSMBuffer\fP bufp, \fI\%TSMLoc\fP offset, int *length) .UNINDENT .SH DESCRIPTION .sp The URL data structure is a parsed version of a standard internet URL. The Traffic Server URL API provides access to URL data stored in marshal buffers. The URL functions can create, copy, retrieve or delete entire URLs, and retrieve or modify parts of URLs, such as their host, port or scheme information. .sp \fI\%TSUrlSchemeGet()\fP, \fI\%TSUrlRawSchemeGet()\fP, \fI\%TSUrlUserGet()\fP, \fI\%TSUrlPasswordGet()\fP, \fI\%TSUrlHostGet()\fP, \fI\%TSUrlPathGet()\fP, \fI\%TSUrlHttpParamsGet()\fP, \fI\%TSUrlHttpQueryGet()\fP and \fI\%TSUrlHttpFragmentGet()\fP each retrieve an internal pointer to the specified portion of the URL from the marshall buffer \fIbufp\fP\&. The length of the returned string is placed in \fIlength\fP and a pointer to the URL portion is returned. .sp If a request URL does not have a explicit scheme, \fI\%TSUrlRawSchemeGet()\fP will return null and set \fIlength\fP to zero. \fI\%TSUrlSchemeGet()\fP, will return the scheme corresponding to the URL type (HTTP or HTTPS) if there is no explicit scheme. .sp \fI\%TSUrlPortGet()\fP retrieves the port number portion of the URL located at \fIoffset\fP within the marshal buffer \fIbufp\fP\&. If there is no explicit port number in the URL, a canonicalized valued is returned based on the URL scheme. .sp \fI\%TSUrlRawPortGet()\fP also retrieves the port number portion of the URL located at \fIoffset\fP within the marshal buffer \fIbufp\fP\&. If there is no explicit port number in the URL, zero is returned. .SH RETURN VALUES .sp All APIs except \fI\%TSUrlPortGet()\fP and \fI\%TSUrlRawPortGet()\fP return a string, which is not guaranteed to be NULL terminated. You must therefore always use the \fIlength\fP value to determine the actual length of the returned string. .sp \fI\%TSUrlPortGet()\fP simply returns the port number as an integer, possibly canonicalized with \fB80\fP for HTTP and \fB443\fP for HTTPS schemes. If there is neither port nor scheme information available in the URL, \fB0\fP is returned. \fI\%TSUrlRawPortGet()\fP, by contrast, returns 0 in all cases where the port is not explicitly present in the URL. .SH SEE ALSO .sp \fBTSAPI(3ts)\fP, \fBTSUrlCreate(3ts)\fP, \fBTSHttpHdrUrlGet(3ts)\fP, \fBTSUrlHostSet(3ts)\fP, \fBTSUrlStringGet(3ts)\fP, \fBTSUrlPercentEncode(3ts)\fP .SH COPYRIGHT 2024, dev@trafficserver.apache.org .\" Generated by docutils manpage writer. .