tfAddHostStr

Jump to: navigation, search

Table of Contents >> Application Reference >> DNS Resolver


#include <trsocket.h>


int tfAddHostStr (
const char TM_FAR * hostnameStr,
const char TM_FAR * addressStr,
int addressFamily
);


Function Description

Add a hostname, IP address pair to the Hosts Table or update an existing entry if the hostname already exists. IPv4 and IPv6 addresses are supported.



Parameters

  • hostnameStr
    Name to associate with host address
  • addressStr
    IPv4 or IPv6 address in text form
  • addressFamily
    AF_INET or AF_INET6



Returns

  • TM_ENOERROR
    Success.
  • TM_EPERM
    Call tfDnsInit() first.
  • TM_EINVAL
    hostnameStr or addressStr is NULL or hostnameStr or addressStr is zero length or addressStr is not formatted correctly
  • TM_EAFNOSUPPORT
    An address familiy other than AF_INET or AF_INET6 was specified.
  • TM_ENOMEM
    Memory allocation failed



Table of Contents >> Application Reference >> DNS Resolver