HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_NetUtil.h File Reference
#include "UT_API.h"
#include <netinet/in.h>
+ Include dependency graph for UT_NetUtil.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  UT_Array< T >
 

Functions

UT_API bool UTresolveCanonicalHostname (UT_String &host, UT_StringHolder &error)
 
UT_API UT_StringHolder UTipAddressToHostname (const UT_StringRef &ip_address, UT_StringHolder &error)
 
UT_API UT_StringHolder UTipAddressToHostname (const UT_IpAddress &address, UT_StringHolder &error)
 
UT_API bool UTgetHostnameByAlias (UT_StringHolder &host, const char *alias, UT_StringHolder &error)
 Convert either an IP address or host alias to its given name. More...
 
UT_API void UTstripDomainName (UT_String &host)
 
UT_API void UTstripDomainName (UT_WorkBuffer &host)
 
UT_API bool UTdoPortsMatch (const UT_String &host1, const UT_String &host2)
 
UT_API bool UTdoPortsMatch (const UT_WorkBuffer &host1, const UT_WorkBuffer &host2)
 
UT_API bool UTatHostnameDelimeter (const char *p)
 Check if string is at a delimeter (at end of string or at '.') More...
 
UT_API bool UTisHostnameAllNonAlpha (const char *str)
 Check if rest of string is non alpha character from a hostname. More...
 
UT_API bool UTgetLocalInterfaces (UT_Array< UT_IpAddressV4 > &local_addrs)
 Get list of IP addresses for local interfaces on this machine. More...
 

Detailed Description

Common network utilities

Definition in file UT_NetUtil.h.

Function Documentation

UT_API bool UTatHostnameDelimeter ( const char *  p)

Check if string is at a delimeter (at end of string or at '.')

UT_API bool UTdoPortsMatch ( const UT_String host1,
const UT_String host2 
)

Check if the ports match both hosts ports {@

UT_API bool UTdoPortsMatch ( const UT_WorkBuffer host1,
const UT_WorkBuffer host2 
)
UT_API bool UTgetHostnameByAlias ( UT_StringHolder host,
const char *  alias,
UT_StringHolder error 
)

Convert either an IP address or host alias to its given name.

UT_API bool UTgetLocalInterfaces ( UT_Array< UT_IpAddressV4 > &  local_addrs)

Get list of IP addresses for local interfaces on this machine.

UT_API UT_StringHolder UTipAddressToHostname ( const UT_StringRef ip_address,
UT_StringHolder error 
)

Convert an IP address to a hostname {@

UT_API UT_StringHolder UTipAddressToHostname ( const UT_IpAddress address,
UT_StringHolder error 
)
UT_API bool UTisHostnameAllNonAlpha ( const char *  str)

Check if rest of string is non alpha character from a hostname.

UT_API bool UTresolveCanonicalHostname ( UT_String host,
UT_StringHolder error 
)

Given host, resolves it to the canonical name if possible. If false is returned, then host is untouched.

UT_API void UTstripDomainName ( UT_String host)

Remove the domain name and append back the port number if provided. i.e. matane.local -> matane, matane.local:3080 -> matane:3080 {@

UT_API void UTstripDomainName ( UT_WorkBuffer host)