HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_NetUtil.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: UT_NetUtil.h (UT Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __UT_NETUTIL_H_INCLUDED__
12 #define __UT_NETUTIL_H_INCLUDED__
13 
14 #include "UT_API.h"
15 
16 #ifdef _WIN32
17  #include <ws2tcpip.h>
18 #else
19  #include <netinet/in.h>
20 #endif
21 
22 /// @file
23 /// Common network utilities
24 
25 class UT_String;
26 class UT_WorkBuffer;
27 
28 /// Given host, resolves it to the canonical name if possible.
29 /// If false is returned, then host is untouched.
31 
32 // Remove the domain name and append back the port number if provided.
33 // i.e. matane.local -> matane, matane.local:3080 -> matane:3080
34 UT_API extern void UTstripDomainName(UT_String& host);
35 UT_API extern void UTstripDomainName(UT_WorkBuffer& host);
36 
37 // Check if the ports match both hosts ports
38 UT_API extern bool UTdoPortsMatch(const UT_String& host1, const UT_String& host2);
39 UT_API extern bool UTdoPortsMatch(const UT_WorkBuffer& host1, const UT_WorkBuffer& host2);
40 
41 // Check if string is at a delimeter (at end of string or at '.')
42 UT_API extern bool UTatHostnameDelimeter(const char* p);
43 // Check if rest of string is non alpha character from a hostname
44 UT_API extern bool UTisHostnameAllNonAlpha(const char* str);
45 #endif // __UT_NETUTIL_H_INCLUDED__
UT_API bool UTatHostnameDelimeter(const char *p)
#define UT_API
Definition: UT_API.h:13
UT_API bool UTresolveCanonicalHostname(UT_String &host)
UT_API bool UTisHostnameAllNonAlpha(const char *str)
UT_API bool UTdoPortsMatch(const UT_String &host1, const UT_String &host2)
GLfloat GLfloat p
Definition: glew.h:16321
UT_API void UTstripDomainName(UT_String &host)