TSIpStringToAddr(3ts)

TSIpStringToAddr3ts

Tsipstringtoaddr api function

Usage

#include <ts/experimental.h>
TSReturnCode TSIpStringToAddr(const char *str, int str_len, sockaddr *addr)

Overview

str is expected to be an explicit address, not a hostname. No hostname resolution is done. This attempts to recognize and process a port value if present. It is set appropriately, or to zero if no port was found or it was malformed.

It is intended to deal with the brackets that can optionally surround an IP address (usually IPv6) which in turn are used to differentiate between an address and an attached port. E.g.


    

[FE80:9312::192:168:1:1]:80

Return values

It returns TS_SUCCESS on success, or TS_ERROR on failure.

Notes

This API may be changed in the future version since it is experimental.

Releases

3 releases since Debian 10 (Buster); the text changed 2 times.

  1. 10
  2. 11
  3. 12

From trafficserver-dev 9.2.5+ds-0+deb12u4 in Debian 12 (Bookworm). Parsed by carta from the page's man source.