AnyConnect Secure Mobility Client  5.0.01242
GenDefs.h
1 /**************************************************************************
2 * Copyright (c) 2000, 2021-2022 Cisco Systems, Inc.
3 * All Rights Reserved. Cisco Highly Confidential.
4 ***************************************************************************
5 *
6 * File: GenDefs.h
7 * Date: 08/2000
8 *
9 ***************************************************************************
10 * NOTE* This file is for PORTABILITY related defines ONLY.
11 ***************************************************************************
12 * defines base types to be used by all CVC client components
13 ***************************************************************************/
14 #ifndef __GENDEFS_H
15 #define __GENDEFS_H
16 
17 #if defined(PLATFORM_WIN_APP)
18 #define ANYCONNECT_USE_SNAK
19 #endif // PLATFORM_WIN_APP
20 
21 #ifndef _WIN32
22 
23 #ifndef USES_CONVERSION
24 #define USES_CONVERSION
25 #endif
26 
27 #define PRELIM_UNIX_PORT
28 
29 #ifdef HAVE_CONFIG_H
30 #include "config.h"
31 #endif
32 
33 #ifdef HAVE_STDINT_H
34 #ifndef CNI_LINUX_INTERFACE
35 #include <stdint.h>
36 #endif
37 #elif HAVE_INTTYPES_H
38 #include <inttypes.h>
39 #endif
40 
41 #ifdef HAVE_SYS_TYPES_H
42 #ifndef CNI_LINUX_INTERFACE
43 #include <sys/types.h>
44 #else
45 #include <linux/types.h>
46 #undef _UINTPTR_T_DEFINED
47 #undef _INTPTR_T_DEFINED
48 #endif
49 #endif
50 
51 #undef FAR
52 #define FAR
53 #undef PASCAL
54 #define PASCAL
55 
56 #else //_WIN32
57 #define HAVE_STDINT_H
58 #include <stdint.h>
59 #undef HAVE_CONFIG_H
60 #undef HAVE_SYS_TYPES_H
61 #define WORDS_BIGENDIAN 0
62 #if !defined(DWORD)
63 typedef unsigned long DWORD;
64 #endif // !defined(DWORD)
65 
66 #endif //_WIN32
67 
68 
69 #undef TRUE
70 #define TRUE 1
71 
72 #undef FALSE
73 #define FALSE 0
74 
75 #ifdef DDKBUILD //building with the DDK as the source.
76 #include <crtdefs.h>
77 #endif
78 
79 #if !defined(PLATFORM_WIN_APP)
80 // it'd be nice if we could switch to the C99 standard types at some point...
81 #if defined(HAVE_STDINT_H) || defined(HAVE_INTTYPES_H)
82 typedef uint8_t bool8;
83 typedef uint16_t bool16;
84 typedef uint32_t bool32;
85 
86 typedef int8_t int8;
87 typedef int16_t int16;
88 
89 #if (!defined(CNI_LINUX_INTERFACE) || !defined(CONFIG_ISDN_PPP) || !defined(CONFIG_ISDN_PPP_VJ) || !defined(_SLHC_H)) && !defined(PROTYPES_H)
90 typedef int32_t int32;
91 #endif
92 
93 typedef uint8_t uint8;
94 typedef uint16_t uint16;
95 
96 #if !defined(CSSMAPI) && !defined(PROTYPES_H)
97 #ifdef _WIN32
98 typedef unsigned long uint32;
99 #else
100 typedef uint32_t uint32;
101 #endif
102 #endif
103 
104 typedef uint64_t uint64;
105 #else
106 
107 typedef unsigned char uint8;
108 typedef unsigned short uint16;
109 #ifndef CSSMAPI
110 typedef unsigned long uint32;
111 #endif
112 typedef unsigned char uint8_t;
113 typedef unsigned short uint16_t;
114 #if defined(_WIN32) && !defined (HS_TYPES_H_)
115 typedef unsigned long uint32_t;
116 #endif
117 
118 #ifdef _WIN32
119 typedef __int64 int64;
120 typedef unsigned __int64 uint64;
121 typedef __int64 int64_t;
122 typedef unsigned __int64 uint64_t;
123 #else
124 typedef long long int64;
125 typedef unsigned long long int uint64;
126 typedef long long int64_t;
127 typedef unsigned long long int uint64_t;
128 #endif
129 #endif
130 
131 // Definitions for Windows not available in <stdint.h>
132 #ifdef _WIN32
133 typedef unsigned long bool32_t;
134 typedef unsigned char bool8_t;
135 #endif
136 
137 // integer types for doing pointer arithmetic, they should be the
138 // same size as a pointer. Part of the C99 standard, but they aren't
139 // available everywhere yet.
140 // These defs should work with IA32 (x86), ILP32 (sparcv8) and LP64 (sparcv9).
141 // These types are protected with the WIN32 macros (_INTPTR_T_DEFINED), since
142 // some, but not all of the WIN32 SDK's define these types.
143 #ifdef _WIN32
144 #ifndef _INTPTR_T_DEFINED
145 #if defined(_LP64)
146 #warning 64 bit
147 typedef int64 intptr_t;
148 #else
149 typedef int32 intptr_t;
150 #endif
151 #define _INTPTR_T_DEFINED
152 #endif
153 
154 #ifndef _UINTPTR_T_DEFINED
155 #if defined(_LP64)
156 #warning 64 bit
157 typedef uint64 uintptr_t;
158 #else
159 typedef uint32 uintptr_t;
160 #endif
161 #define _UINTPTR_T_DEFINED
162 #endif
163 #endif
164 
165 #ifndef __OBJC__ /* Mac OS X defines this in ObjectiveC land... */
166 typedef int BOOL;
167 #endif
168 
169 #ifndef _WIN32
170 typedef int BOOLEAN;
171 #endif
172 
173 #ifdef _WIN32
174 typedef int mode_t;
175 #endif
176 
177 typedef unsigned char uchar;
178 #ifndef HAVE_SYS_TYPES_H
179 typedef unsigned int uint;
180 typedef unsigned short ushort;
181 typedef unsigned long ulong;
182 #endif
183 
184 #ifndef PLATFORM_ANDROID
185 typedef ulong ULONG;
186 typedef ulong* PULONG;
187 #endif
188 
189 #if defined(PLATFORM_ANDROID)
190 typedef unsigned long ulong;
191 typedef unsigned short ushort;
192 #endif
193 
194 typedef uint32 DWORD;
195 typedef uint32* PDWORD;
196 typedef long LONG;
197 typedef long* PLONG;
198 typedef int INT;
199 typedef int* PINT;
200 typedef uint UINT;
201 typedef uint* PUINT;
202 typedef uint16 USHORT;
203 typedef uint16* PUSHORT;
204 typedef int16 SHORT;
205 typedef int16* PSHORT;
206 typedef uint16 WORD;
207 typedef uint16* PWORD;
208 typedef char CHAR;
209 typedef uchar UCHAR;
210 typedef char* PCHAR;
211 typedef uint8 BYTE;
212 typedef uint8* PBYTE;
213 #define VOID void
214 typedef void* PVOID;
215 #ifdef _WIN32
216 typedef void* HANDLE;
217 #else
218 typedef int HANDLE;
219 typedef int SOCKET;
220 typedef const char* LPCTSTR;
221 typedef const char* LPCSTR;
222 typedef const char* PCTSTR;
223 typedef char* LPTSTR;
224 typedef void* LPVOID;
225 typedef char* LPSTR;
226 typedef long* LPLONG;
227 typedef DWORD* LPDWORD;
228 typedef signed int INT32;
229 
230 
231 typedef struct __WSABUF
232 {
233  unsigned long len;
234  char *buf;
235 } WSABUF, *LPWSABUF;
236 
237 typedef struct OVERLAPPED
238 {
239  void *data;
240  int fd;
241 } OVERLAPPED,*LPOVERLAPPED;
242 
243 typedef struct sockaddr_in SOCKADDR_IN;
244 typedef struct sockaddr_in6 SOCKADDR_IN6;
245 
246 #endif //!_WIN32
247 
248 typedef HANDLE* PHANDLE;
249 typedef uint8 KIRQL;
250 #else // PLATFORM_WIN_APP
251 typedef unsigned long bool32;
252 typedef unsigned long bool32_t;
253 typedef unsigned long ulong;
254 typedef unsigned char BYTE;
255 typedef unsigned long uint32;
256 typedef int32_t int32;
257 typedef unsigned char bool8_t;
258 typedef void* HANDLE;
259 #endif // !defined(PLATFORM_WIN_APP)
260 
261 typedef long STATUSCODE;
262 
263 /* function parameter context */
264 #undef IN
265 #define IN
266 
267 #undef OUT
268 #define OUT
269 
270 #undef INOUT
271 #define INOUT
272 
273 #undef packed
274 #define packed
275 
276 #ifndef CLEAR
277 #define CLEAR(a) memset(&a,0,sizeof(a))
278 #endif
279 
280 #ifndef POINT_BEYOND
281 #define POINT_BEYOND(a,t) (t) &((&a)[1])
282 #endif
283 
284 #ifndef MAX
285 #define MAX(a,b) ((a) > (b) ? (a) : (b))
286 #endif
287 #ifndef MIN
288 #define MIN(a,b) ((a) < (b) ? (a) : (b))
289 #endif
290 
291 #ifndef _WIN32
292 #define _ftime ftime
293 #define _timeb timeb
294 #define __cdecl
295 #define __stdcall
296 #ifndef __fastcall
297 #define __fastcall
298 #endif
299 #ifndef WINAPI
300 #define WINAPI
301 #endif
302 #ifndef CALLBACK
303 #define CALLBACK
304 #endif
305 #endif
306 
307 #ifndef _WIN32
308 #undef INVALID_SOCKET
309 #define INVALID_SOCKET -1
310 #undef INVALID_FD
311 #define INVALID_FD -1
312 #undef SOCKET_ERROR
313 #define SOCKET_ERROR -1
314 #undef SOCKADDR
315 #define SOCKADDR sockaddr
316 #undef SOCKADDR_IN
317 #define SOCKADDR_IN sockaddr_in
318 #undef SOCKADDR_IN6
319 #define SOCKADDR_IN6 sockaddr_in6
320 
321 #if defined(PLATFORM_DARWIN) || defined(PLATFORM_APPLE_SSLVPN) || defined(APPLE_IOS) || defined(PLATFORM_CHROMEBOOK)
322 #define s6_words __u6_addr.__u6_addr16
323 #elif defined(PLATFORM_LINUX)
324 #define s6_words s6_addr16
325 #endif
326 
327 #endif
328 
329 #ifndef _CRT_SECURE_NO_DEPRECATE
330 #define _CRT_SECURE_NO_DEPRECATE
331 #endif
332 
333 
334 #if !defined(_WIN32)
335 
336 #ifndef ZeroMemory
337 #define ZeroMemory ZEROMEM
338 #ifndef PLATFORM_ANDROID
339  #define ZEROMEM(ptr,cnt) \
340  if ( NULL != ptr ) { memset(ptr,0,cnt); }
341 #else
342  // Cius compiler will generate a compilation error for: if( &var )
343  #define ZEROMEM(ptr,cnt) \
344  { \
345  void *pZero = ptr; \
346  if ( NULL != pZero ) { memset(pZero,0,cnt); } \
347  }
348 #endif /* !PLATFORM_ANDROID */
349 #endif /* ZeroMemory */
350 
351 #ifndef SecureZeroMemory
352 #define SECUREZEROMEM(ptr, cnt) \
353  do { \
354  size_t size = (size_t)cnt; \
355  volatile char *vptr = (volatile char *)ptr; \
356  while (size) { \
357  *vptr = 0; \
358  vptr++; \
359  size--; \
360  } \
361  } while(0);
362 #define SecureZeroMemory SECUREZEROMEM
363 #endif /* SecureZeroMemory */
364 #endif /* Windows */
365 
366 
367 
368 #ifndef _WIN32
369 #define _strnicmp strncasecmp
370 #define _stricmp strcasecmp
371 #endif
372 
373 #if !defined(UINT16_MAX)
374 #define UINT16_MAX 0xffffu
375 #endif
376 
377 #ifndef ARRAY_ELEMENT_BYTES
378 // Yields the number of bytes in an element of the array.
379 #define ARRAY_ELEMENT_BYTES(a) (sizeof(a[0]))
380 #endif
381 
382 #ifndef ARRAY_SIZE
383 // Yields the number of elements in the array.
384 #define ARRAY_SIZE(a) (sizeof(a)/ARRAY_ELEMENT_BYTES(a))
385 #endif
386 
387 #if !defined(TO_STR) && !defined(TO_TSTR) && !defined(SYMBOL_TO_STR) && !defined(SYMBOL_TO_TSTR)
388 
389 // use TO_STR(x)/TO_TSTR(x) to stringize (put double quotes around) x
390 // example:
391 // std::string foo = TO_STR(15);
392 // tstring bar = TO_TSTR(15);
393 // becomes
394 // std::string foo = "15";
395 // tstring bar = _T("15");
396 #define TO_STR(x) #x
397 #define TO_TSTR(x) _T(#x)
398 
399 // use SYMBOL_TO_STR(x)/SYMBOL_TO_TSTR(x) to stringize
400 // the definition of symbol x
401 // example:
402 // #define MAX_LEN 15
403 // std::string foo = SYMBOL_TO_STR(MAX_LEN);
404 // tstring bar = SYMBOL_TO_TSTR(MAX_LEN);
405 // becomes
406 // std::string foo = "15";
407 // tstring bar = _T("15");
408 //
409 // Note that TO_STR(MAX_LEN) results in "MAX_LEN". The double macro is required in
410 // order to strinigize the *definition* of a symbol (as opposed to the symbol itself)
411 #define SYMBOL_TO_STR(x) TO_STR(x)
412 #define SYMBOL_TO_TSTR(x) TO_TSTR(x)
413 
414 #endif
415 
416 #if defined(_WIN32)
417 #define systemtime_t __time64_t
418 #define getSystemTimeInSeconds() _time64(NULL)
419 #else
420 #define systemtime_t time_t
421 #define getSystemTimeInSeconds() time(NULL)
422 #endif
423 
424 #ifndef _WIN32
425 #ifndef INFINITE
426 #define INFINITE 0xFFFFFFFF
427 #endif
428 #endif
429 
430 #ifdef _WIN32
431 #define ANY_PATHNAME_DELIMITER "/\\"
432 #define PATHNAME_DELIMITER '\\'
433 #define PATHNAME_DELIMITER_STR "\\"
434 #else
435 #define ANY_PATHNAME_DELIMITER "/"
436 #define PATHNAME_DELIMITER '/'
437 #define PATHNAME_DELIMITER_STR "/"
438 #endif
439 #define URL_URI_DELIMITER '/'
440 #define URL_URI_DELIMITER_STR "/"
441 
442 #ifdef _WIN32
443 #define NEWLINE "\r\n"
444 #else
445 #define NEWLINE "\n"
446 #endif
447 
448 #if defined(_WIN32)
449 #define HOSTSFILE_LOCATION _T("drivers\\etc\\hosts")
450 #else
451 #define HOSTSFILE_LOCATION _T("/etc/hosts")
452 #endif
453 
454 #ifdef _WIN32
455 #define DebugWriteFile(_handle_,_buffer_,_length_,_refCharsWritten_) \
456  WriteFile((_handle_),(_buffer_),(_length_),(_refCharsWritten_),NULL)
457 #else
458 #ifndef INVALID_HANDLE_VALUE
459 #define INVALID_HANDLE_VALUE NULL
460 #endif
461 #define DebugWriteFile(_handle_,_buffer_,_length_,_refCharsWritten_) \
462  fprintf((_handle_), "%s", (_buffer_)); \
463  fflush((_handle_))
464 #endif
465 
466 typedef uint8_t MAC_ADDR[6];
467 
468 #if !defined(_WIN32) || defined(_WIN32_WCE)
469 #ifndef ADDRESS_FAMILY
470 typedef unsigned short ADDRESS_FAMILY;
471 #endif
472 #endif
473 
474 #if __cplusplus >= 201103L
475 #define CPP_11_SUPPORTED
476 #endif
477 #if __cplusplus >= 201402L
478 #define CPP_14_SUPPORTED
479 #endif
480 #if __cplusplus >= 201703L
481 #define CPP_17_SUPPORTED
482 #endif
483 
484 /*
485 ** The PLATFORM_DESKTOP define is used to track AnyConnect desktop platforms.
486 */
487 #if (defined(_WIN32) || defined(PLATFORM_DARWIN) || (defined(PLATFORM_LINUX) && !defined(ANYCONNECT_USE_SNAK) && !defined (PLATFORM_ANDROID) && !defined(PLATFORM_CHROMEBOOK))) \
488  && !defined(PRODUCT_TYPE_SSA) && !defined(PLATFORM_WIN_APP)
489 #define PLATFORM_DESKTOP
490 #endif
491 
492 #if ((defined(_WIN32) && !defined(_WIN32_WCE) && !defined(PLATFORM_WIN_APP)) || defined(PLATFORM_DARWIN) || defined(PLATFORM_LINUX)) && !defined(ANYCONNECT_USE_SNAK) && !defined(PRODUCT_TYPE_SSA)
493 /*
494  ** the FIREWALL_SUPPORTED define is used to track the platforms
495  ** where the firewall feature is supported. This is to avoid repeating the
496  ** platforms in #ifdef clauses in other files.
497  ** Also, when Firewall feature expands to other platforms, they only need to be added in
498  ** one place.
499  */
500 #define FIREWALL_SUPPORTED
501 #endif
502 
503 #if !defined(PRODUCT_TYPE_SSA) && ((defined(_WIN32) && !defined(_WIN32_WCE) && !defined(PLATFORM_WIN_APP)) || defined(PLATFORM_DARWIN) || (defined(PLATFORM_LINUX) && !defined(PLATFORM_CHROMEBOOK)))
504 /*
505 ** the TRUSTED_NETWORK_DETECTION define is used to track the platforms
506 ** where Trusted Network Detection is performed. This is to avoid repeating the
507 ** platforms in #ifdef clauses in other files.
508 ** Also, when TND support expands to other platforms, they only need to be added in
509 ** one place.
510 */
511 #define TRUSTED_NETWORK_DETECTION
512 
513 /*
514  * Android only uses TND to report state to NVM.
515  * Policy-based actions are not supported.
516  */
517 #if !defined(PLATFORM_ANDROID)
518 #define TND_ACTIONS_SUPPORTED
519 #endif
520 #endif
521 
522 #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_ANDROID)
523 #define INTER_MODULE_STATE_NOTIFY
524 #endif
525 
526 #if ((defined(_WIN32) && !defined(PLATFORM_WIN_APP)) || defined(PLATFORM_DARWIN) || defined(PLATFORM_LINUX) || defined(TRUSTED_NETWORK_DETECTION)) && !defined(PRODUCT_TYPE_SSA) && !defined(PLATFORM_ANDROID)
527 /*
528 ** the LOGIN_UTILITIES_SUPPORTED define is used to track the platforms
529 ** that support AnyConnect action triggered by user login. This is to avoid
530 ** repeating the platforms in #ifdef clauses in other files.
531 ** Also, when login support expands to other platforms, they only need to be added in
532 ** one place.
533 */
534 #define LOGIN_UTILITIES_SUPPORTED
535 #endif
536 
537 #if !(defined(PLATFORM_APPLE_SSLVPN) && TARGET_CPU_ARMV6)
538 /*
539 ** A bug was discovered in iPhone testing wherein virtual inline functions do
540 ** not work correctly on ARMv6 processors. To work around this, virtual inline
541 ** function need to be made standard virtual functions on ARMv6. To prevent
542 ** differences in runtime behavior, the VIRTUAL_INLINES_SUPPORTED define is used
543 ** to define some virtual inlines in the header files, letting the functions be
544 ** defined without the inline type in the cpp file for non-supported platforms.
545 */
546 #define VIRTUAL_INLINES_SUPPORTED
547 #endif
548 
549 /*
550  * When changing the SCRIPTING_SUPPORTED definition, you MUST also update the
551  * ClientIfcCommon.h! We duplicate this definition there due to the manner in
552  * which we distribute our code to partners; we cannot include this header from
553  * ClientIfcCommon.h.
554  */
555 #if !defined(PLATFORM_APPLE_SSLVPN) && !defined(PLATFORM_ANDROID) && !defined(PLATFORM_WIN_APP)
556 /*
557 ** the SCRIPTING_SUPPORTED define is used to enable the script manager for launching
558 ** customer provided scripts on events like connection establishment, completion of
559 ** disconnect, and captive portal detection.
560 */
561 #define SCRIPTING_SUPPORTED
562 #endif
563 
564 #if defined(PLATFORM_ANDROID)
565 #define DYNAMIC_UPDATE_LOCAL_POLICY
566 #endif // PLATFORM_ANDROID
567 
568 #if !defined(PRODUCT_TYPE_SSA) && ((defined(_WIN32) && !defined(_WIN32_WCE) && !defined(PLATFORM_WIN_APP)) || defined(PLATFORM_DARWIN) || (defined(PLATFORM_LINUX) && !defined(ANYCONNECT_USE_SNAK)))
569 /*
570 ** the NETWORK_ENVIRONMENT_STATE define is used to track the platforms
571 ** where NETWORK_ENVIRONMENT_STATE check is performed. This is to avoid repeating the
572 ** platforms in #ifdef clauses in other files.
573 ** Also, when NES support expands to other platforms, they only need to be added in
574 ** one place.
575 */
576 #define NETWORK_ENVIRONMENT_STATE
577 #endif
578 
579 
580 #if (defined(_WIN32) && !defined(_WIN32_WCE) && !defined(PLATFORM_WIN_APP)) || defined(PLATFORM_DARWIN) || (defined(PLATFORM_LINUX) && !defined(ANYCONNECT_USE_SNAK))
581 /*
582 ** The AUTOMATIC_HEADEND_SELECTION define is used to track the platforms
583 ** where Automatic Headend Selection is performed. This is to avoid repeating the
584 ** platforms in #ifdef clauses in other files.
585 ** Also, when AHS support expands to other platforms, they only need to be added in
586 ** one place.
587 */
588 #define AUTOMATIC_HEADEND_SELECTION
589 #endif
590 
591 #if (defined(_WIN32) && !defined(_WIN32_WCE) && !defined(PLATFORM_WIN_APP)) || defined(PLATFORM_DARWIN)
592 /*
593  ** the MUS_HOST_SERVICES define is used to track the platforms
594  ** where MUS Host Status check is performed. This is to avoid repeating the
595  ** platforms in #ifdef clauses in other files.
596  */
597 #define MUS_HOST_SERVICES
598 #endif
599 
600 // BUGBUG - initially only enable code signing for Windows
601 #if (defined(_WIN32) && !defined(_WIN32_WCE) && !defined(PLATFORM_WIN_APP)) || defined(PLATFORM_DARWIN) || (defined(PLATFORM_LINUX) && !defined(PLATFORM_LINUX_EMBEDDED_PPC) && !defined(PLATFORM_LINUX_EMBEDDED_ARM) && !defined(PLATFORM_ANDROID) && !defined(PLATFORM_CHROMEBOOK))
602 /*
603  ** the CODE_SIGNING_SUPPORTED define is used to track the platforms
604  ** where code sign verification is support. This is to avoid repeating the
605  ** platforms in #ifdef clauses in other files.
606  **
607  */
608 #define CODE_SIGNING_SUPPORTED
609 #endif
610 
611 #if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(PLATFORM_WIN_APP)
612 #define RSA_SECURID_SUPPORTED
613 #endif
614 
615 #if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(PLATFORM_WIN_APP)
616 #define SAFEWORD_SOFTOKEN_SUPPORTED
617 #endif
618 
619 #if (defined(_WIN32) && !defined(_WIN32_WCE) && !defined(PLATFORM_WIN_APP)) || defined(PLATFORM_DARWIN) || defined(PLATFORM_LINUX) || defined(PLATFORM_APPLE_SSLVPN) || ( defined(PRODUCT_TYPE_SSA) && defined(APPLE_IOS) )
620 /*
621  ** the IPSEC_SUPPORTED define is used to track the platforms
622  ** where the IPSec protocol is supported. This is to avoid repeating the
623  ** platforms in #ifdef clauses in other files.
624  */
625 #define IPSEC_SUPPORTED
626 #endif
627 
628 #if (defined(_WIN32) && !defined(_WIN32_WCE)) || defined(PLATFORM_DARWIN) || (defined(PLATFORM_LINUX) && !defined(PLATFORM_CHROMEBOOK)) || defined(PLATFORM_APPLE_SSLVPN) || defined (PLATFORM_ANDROID)
629 /*
630  ** The IPV6_SUPPORTED define is used to track the platforms
631  ** where full IPv6 capability is supported. This is to avoid repeating the
632  ** platforms in #ifdef clauses in other files.
633  ** Note that this is further narrowed down by method CIPv6Util::IsIPv6FullCapabilitySupported.
634  */
635 #define IPV6_SUPPORTED
636 #endif
637 
638 #if (defined(_WIN32) && !defined(_WIN32_WCE) && !defined(PLATFORM_WIN_APP)) || defined(PLATFORM_DARWIN) || defined(PLATFORM_LINUX) || defined(PLATFORM_APPLE_SSLVPN) || ( defined(PRODUCT_TYPE_SSA) && defined(APPLE_IOS) )
639 /*
640  ** the PLUGIN_PROTOCOL_SUPPORTED define is used to track the platforms
641  ** where modular protocol Plugins are supported. This is to avoid repeating the
642  ** platforms in #ifdef clauses in other files.
643  */
644 #define PLUGIN_PROTOCOL_SUPPORTED
645 #endif
646 
647 #if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(PLATFORM_WIN_APP) && !defined(PRODUCT_TYPE_SSA)
648 /*
649 ** The IPSEC_OVER_SSL define is used to track the platforms
650 ** where the feature "IPsec tunneling over SSL for Oracle" (EDCS-852737) is supported.
651 ** This is to avoid repeating the platforms in #ifdef clauses in other files.
652 ** Also, when the support expands to other platforms, they only need to be added in
653 ** one place.
654 */
655 #define IPSEC_OVER_SSL
656 #endif
657 
658 #if (defined(_WIN32) && !defined(_WIN32_WCE) && !defined(PLATFORM_WIN_APP)) || defined(PLATFORM_DARWIN) || (defined(PLATFORM_LINUX) && !defined(PLATFORM_ANDROID) && !defined(PLATFORM_CHROMEBOOK)) || defined(APPLE_IOS)
659 /*
660  ** the DATA_OBFUSCATING_SUPPORTED define is used to track the platforms
661  ** where data obfuscation using key exchanges are supported. This is to
662  ** avoid repeating the platforms in #ifdef clauses in other files.
663  */
664 #define DATA_OBFUSCATING_SUPPORTED
665 #endif
666 
667 #if !defined(PLATFORM_APPLE_SSLVPN) && !defined(_WIN32_WCE) && !defined(PLATFORM_WIN_APP) && !defined(PRODUCT_TYPE_SSA) && !defined(PLATFORM_ANDROID) && !defined(PLATFORM_CHROMEBOOK)
668 /*
669 ** the HOSTFILE_MODIFICATION_SUPPORTED define is used to track the platforms
670 ** where hosts file modification is performed. This is to avoid repeating the
671 ** platforms in #ifdef clauses in other files.
672 */
673 #define HOSTSFILE_MODIFICATION_SUPPORTED
674 #endif
675 
676 #if defined(_WIN32) || defined(_WIN32_WCE) || defined(PLATFORM_DARWIN) || defined(PLATFORM_LINUX) || defined(PLATFORM_ANDROID) || defined(PLATFORM_APPLE_SSLVPN)|| defined(PLATFORM_WIN_APP)
677 /*
678 ** the SCEP_CERTIFICATE_ENROLLMENT_SUPPORTED define is used to track the platforms
679 ** where SCEP enrollment can be performed. This is to avoid repeating the
680 ** platforms in #ifdef clauses in other files.
681 */
682 #define SCEP_CERTIFICATE_ENROLLMENT_SUPPORTED
683 #endif
684 
685 #if (defined(_WIN32) && !defined(_WIN32_WCE))
686 /*
687 ** these XXX_PROFILE_SUPPORTED defines are used to track the platforms where
688 ** Service Profiles for optional modules are supported.
689 ** All platforms: VPN
690 ** Windows: NAM, Web Security, ISE Posture, FireAMP, NVM and OpenDNS
691  */
692 #define NAM_PROFILE_SUPPORTED
693 #define WEBSEC_PROFILE_SUPPORTED
694 #define ISEPOSTURE_PROFILE_SUPPORTED
695 #define FIREAMP_PROFILE_SUPPORTED
696 #define NVM_PROFILE_SUPPORTED
697 #define OPENDNS_PROFILE_SUPPORTED
698 #elif defined(PLATFORM_DARWIN)
699 /*
700 ** OS X: Web Security, ISE Posture, FireAMP, NVM and OpenDNS
701 */
702 #define WEBSEC_PROFILE_SUPPORTED
703 #define ISEPOSTURE_PROFILE_SUPPORTED
704 #define FIREAMP_PROFILE_SUPPORTED
705 #define NVM_PROFILE_SUPPORTED
706 #define OPENDNS_PROFILE_SUPPORTED
707 #elif defined(PLATFORM_LINUX)
708 #define NVM_PROFILE_SUPPORTED
709 #define ISEPOSTURE_PROFILE_SUPPORTED
710 #endif
711 
712 #if defined(_WIN32) || defined(PLATFORM_DARWIN)
713 /*
714 ** the CLOUD_UPDATE_SUPPORTED define is used to track the platforms
715 ** that support cloud updates (currently from OpenDNS). This is to avoid repeating the
716 ** platforms in #ifdef clauses in other files.
717 */
718 #define CLOUD_UPDATE_SUPPORTED
719 #endif
720 
721 #if (defined(_WIN32) || defined(PLATFORM_DARWIN)) && defined(PLATFORM_DESKTOP)
722 /*
723 ** The DNS_PLUGIN_SUPPORTED define is used to track the platforms where the DNS KDF plugin is
724 ** available. This is to avoid repeating the platforms in #ifdef clauses in other files.
725 ** Also, when support expands to other platforms, they only need to be added in one place.
726 */
727 #define DNS_PLUGIN_SUPPORTED
728 #if defined(_WIN32)
729 /*
730 ** The DNS_PLUGIN_DNS_REQ_HANDLING_SUPPORTED define is used to track the platforms where the DNS KDF plugin is
731 ** available and supports handling of DNS requests during the VPN tunnel (e.g. for split-DNS or tunnel-all-DNS enforcement).
732 **/
733 #define DNS_PLUGIN_DNS_REQ_HANDLING_SUPPORTED
734 #endif // _WIN32
735 /*
736 ** The DYNAMIC_SPLIT_TUNNELING_SUPPORTED define is used to track the platforms where dynamic split tunneling is supported.
737 **/
738 #define DYNAMIC_SPLIT_TUNNELING_SUPPORTED
739 #endif // (_WIN32 || PLATFORM_DARWIN) && PLATFORM_DESKTOP
740 
741 #if defined(PLATFORM_DESKTOP)
742 /*
743 ** The exportStats call is only supported on the Desktop Platforms,
744 ** it should not be included or supported if it is not a Desktop Plat
745 */
746 #define EXPORT_STATS_SUPPORTED
747 #endif
748 
749 #if defined(_WIN32) || defined(PLATFORM_DARWIN) || defined(PLATFORM_LINUX) || defined(PLATFORM_APPLE_SSLVPN)
750 #define AC_CERTIFICATE_POLICY_SUPPORTED
751 #endif
752 
753 #ifndef _TRSTRING
754 #define _tr(String) String
755 #define _TRSTRING
756 #endif
757 
758 #ifndef _C_MYASSERT
759 #define C_MYASSERT(e) typedef char __C_MYASSERT__[(e)?1:-1]
760 #define _C_MYASSERT
761 #endif
762 
763 #if defined(PLATFORM_APPLE_SSLVPN) || defined(APPLE_IOS)
764 #define NETWORK_ORDER_LOOPBACK_INTF_ADDR htonl(0x7f000001) // 127.0.0.1
765 #endif
766 
767 #if !defined(BITS_PER_BYTE)
768 #define BITS_PER_BYTE 8
769 #endif
770 
771 #if defined(PLATFORM_DESKTOP) && defined(PLATFORM_LINUX)
772 #define STATIC_THREAD_LOCAL static __thread
773 #else
774 #define STATIC_THREAD_LOCAL thread_local
775 #endif
776 
777 /*
778 ** The MANUAL_PKCS12_IMPORT_SUPPORTED define is used to track the platforms
779 ** where the manual import of PKCS12 certificates is supported. This is to avoid
780 ** repeating the platforms in #ifdef clauses in other files.
781 
782 ** NOTE: When changing the MANUAL_PKCS12_IMPORT_SUPPORTED definition, you MUST also
783 ** update the ClientIfcCommon.h! We duplicate this definition there due to the manner
784 ** in which we distribute our code to partners; we cannot include this header from
785 ** ClientIfcCommon.h.
786 */
787 #if defined(PLATFORM_APPLE_SSLVPN) || defined(PLATFORM_ANDROID) || defined(PLATFORM_CHROMEBOOK)|| defined(PRODUCT_TYPE_SSA) || defined(PLATFORM_WIN_APP)
788 #define MANUAL_PKCS12_IMPORT_SUPPORTED
789 #endif
790 
791 #if defined(PLATFORM_ANDROID) || defined(PLATFORM_APPLE_SSLVPN) || defined(PLATFORM_CHROMEBOOK)
792 // Zlib is statically linked.
793 #define STATIC_ZLIB
794 #endif
795 
796 #if (defined(PLATFORM_LINUX) && !defined(PLATFORM_ANDROID)) || defined(PLATFORM_DARWIN)
797 // Use zlib dynamic library on the system.
798 #define USE_SYSTEM_ZLIB
799 #endif
800 
801 
802 /*
803  * Platforms that support a single profile.
804  */
805 #if defined(PLATFORM_APPLE_SSLVPN) || defined(PLATFORM_ANDROID) || defined(PLATFORM_CHROMEBOOK)
806 #define USE_SINGLE_PROFILE
807 #endif
808 
809 
810 /*
811  * Platforms that support ACIDEX.
812  */
813 #if defined(PLATFORM_ANDROID) || defined(PLATFORM_APPLE_SSLVPN) || defined(_WIN32) || defined(PLATFORM_DARWIN) || defined(PLATFORM_LINUX) || defined(PLATFORM_CHROMEBOOK)
814 #define ACIDEX_SUPPORTED
815 #endif
816 
817 /*
818  * Platforms that support PerApp.
819  */
820 #if defined(PLATFORM_ANDROID) || defined(PLATFORM_APPLE_SSLVPN)
821 #define PERAPP_SUPPORTED
822 #endif
823 
824 
825 /*
826  * Platforms that support HOSTDATA.
827  */
828 #if defined(PLATFORM_ANDROID) || defined(PLATFORM_APPLE_SSLVPN) || defined(PLATFORM_CHROMEBOOK)
829 #define HOST_DATA_SUPPORTED
830 #endif
831 
832 
833 /*
834  * Platforms that support scripting.
835  *
836  * When changing the SCRIPTING_SUPPORTED definition, you MUST also update the
837  * ClientIfcCommon.h! We duplicate this definition there due to the manner in
838  * which we distribute our code to partners; we cannot include this header from
839  * ClientIfcCommon.h.
840 
841  */
842 #if !defined(PLATFORM_APPLE_SSLVPN) && !defined(PLATFORM_ANDROID) && !defined(PLATFORM_WIN_APP)
843 #define SCRIPTING_SUPPORTED
844 #endif
845 
846 #if defined(PLATFORM_ANDROID)
847 // On Android, modifying the default route may break system network services.
848 #define DONT_TOUCH_IPV4_DEFAULT_ROUTE
849 #endif
850 
851 #if defined(PLATFORM_APPLE_SSLVPN) || defined(PLATFORM_ANDROID) || defined(PLATFORM_CHROMEBOOK) || defined(PLATFORM_WIN_APP)
852 #define SNAK_NO_ROUTE_TABLE_ACCESS
853 #endif
854 
855 #if defined(ANYCONNECT_USE_SNAK) || defined(PLATFORM_APPLE_SSLVPN)
856 #define GLOBAL_SNAK_PLUGIN_VER 2
857 #endif
858 
859 /*
860 ** Supports API for integrating program data (e.g. localization and profile).
861 **
862 ** NOTE: When changing the PROGRAM_DATA_IMPORT_SUPPORTED definition, you MUST also
863 ** update the ClientIfcCommon.h! We duplicate this definition there due to the manner
864 ** in which we distribute our code to partners; we cannot include this header from
865 ** ClientIfcCommon.h.
866 */
867 #if defined(PLATFORM_ANDROID)
868 #define PROGRAM_DATA_IMPORT_SUPPORTED
869 #endif
870 
871 /*
872 ** Credentials for a connection can be prefilled via uri handling or API calls
873 ** if you add a new platform, you need to add it in ClientIfcCommon.h and ConnectPromptInfoBase.h
874 **
875 ** NOTE: When changing the CREDENTIAL_PREFILL_SUPPORTED definition, you MUST also
876 ** update the ClientIfcCommon.h! We duplicate this definition there due to the manner
877 ** in which we distribute our code to partners; we cannot include this header from
878 ** ClientIfcCommon.h.
879 */
880 #if defined(PLATFORM_ANDROID)
881 #define CREDENTIAL_PREFILL_SUPPORTED
882 #endif
883 
884 #if !(defined(_WIN32_WCE) || defined(PLATFORM_APPLE_SSLVPN) || defined(PLATFORM_ANDROID) || defined(PLATFORM_CHROMEBOOK))
885 // support for automatic reconnects
886 #define AUTORECONNECT_SUPPORTED
887 #endif
888 
889 #if !defined(_WIN32_WCE) && !defined(PLATFORM_LINUX_EMBEDDED_PPC) && !defined(PLATFORM_WEBOS_ARM) && !defined(PLATFORM_WEBOS_X86) && !defined(APPLE_IOS) && !defined(PLATFORM_WIN_APP) && !defined(_DOWNLOADER)
890 #define FIPS_SUPPORTED
891 #endif
892 
893 #if !defined(_WIN32_WCE) && !defined(PLATFORM_WIN_APP) && !defined(PLATFORM_APPLE_SSLVPN) && !defined(PLATFORM_LINUX_EMBEDDED_PPC) && !defined(PLATFORM_WEBOS_ARM) && !defined(PLATFORM_WEBOS_X86) && !defined(APPLE_IOS) && !defined(PRODUCT_TYPE_SSA) && !defined(PLATFORM_CHROMEBOOK)
894 #define LEAF_SUPPORTED
895 #endif
896 
897 #if defined(PLATFORM_DESKTOP) && (defined(_WIN32) || defined(PLATFORM_LINUX))
898 /*
899 ** This define is used to track platforms where user logon
900 ** related preferences in client profile are supported.
901 */
902 #define ENFORCE_USER_LOGON_SETTINGS
903 #endif
904 
905 #if !defined(PLATFORM_ANDROID) && !defined(PLATFORM_CHROMEBOOK) // More platforms need to be added
906 #define WIDE_CHAR_SUPPORTED
907 #endif
908 
909 #if defined(_WIN32) && !defined(PRODUCT_TYPE_SSA) && !defined(PLATFORM_WIN_APP)
910 #define TUNNEL_PROXY_SETTINGS_SUPPORTED
911 #endif
912 
913 /*
914 ** Public Proxy support is only implemented on Windows, Linux and Mac desktop platforms
915 */
916 #if defined(PLATFORM_DESKTOP)
917 #define PUBLIC_PROXY_SUPPORTED
918 #endif
919 
920 /*
921 ** NTLM support is only implemented on Windows desktop platforms
922 */
923 #if defined(_WIN32) && defined(PUBLIC_PROXY_SUPPORTED)
924 #define PROXYAUTH_NTLM_SUPPORTED
925 #endif
926 
927 #if defined(PLATFORM_ANDROID) || defined(PRODUCT_TYPE_SSA) || defined(PLATFORM_APPLE_SSLVPN)
928 #define IMPORT_API_SUPPORTED
929 #endif
930 
931 #if defined(PLATFORM_APPLE_SSLVPN) || (defined(PRODUCT_TYPE_SSA) && !(defined(PLATFORM_ANDROID) || defined(APPLE_IOS))) || defined(PLATFORM_CHROMEBOOK)
932 /*
933 ** This serves to tell the IPsec plugin interface to explicitly
934 ** exclude it's global namespace entry points, leaving the only
935 ** plugin interface as a set of static class methods, which the
936 ** loading code will look for directly.
937 */
938 #define IPSEC_AS_INTERNAL_MODULE
939 #endif
940 
941 #if defined(PLATFORM_ANDROID) // More platforms need to be added
942 #define dynamic_cast reinterpret_cast
943 #endif
944 
945 #if defined(PRODUCT_TYPE_SSA) && defined(APPLE_IOS) && !defined(PLATFORM_APPLE_SSLVPN)
946 #define CONFIGURE_REMOTE_WAKEUP_SUPPORTED
947 #endif
948 
949 /*
950 ** The SMARTCARD_SUPPORTED define is used to track the platforms where smartcard
951 ** certificate authentication is supported. This is to avoid repeating the
952 ** platforms in #ifdef clauses in other files.
953 */
954 #if (defined(_WIN32) && !defined(PLATFORM_WIN_APP)) || defined(PLATFORM_DARWIN)
955 #define SMARTCARD_SUPPORTED
956 /*
957 ** The SMARTCARD_REMOVAL_SUPPORTED define is used to track the platforms where smartcard
958 ** removal monitoring is supported. This is to avoid repeating the
959 ** platforms in #ifdef clauses in other files.
960 */
961 #if defined(_WIN32)
962 #define SMARTCARD_REMOVAL_SUPPORTED
963 #endif
964 #endif // (_WIN32 && !PLATFORM_WIN_APP) || PLATFORM_DARWIN
965 
966 #if (defined(PLATFORM_LINUX) || defined(PLATFORM_DARWIN)) && !defined(ANYCONNECT_USE_SNAK) && !defined(PRODUCT_TYPE_SSA)
967 /*
968  ** The CIRCUMVENT_HOST_FILTERING_SUPPORTED define is used to track the platforms
969  ** where AnyConnect can control whether or not pre-existing host filtering is
970  ** circumvented upon applying AnyConnect filtering (only applicable to split-tunneling).
971  */
972 #define CIRCUMVENT_HOST_FILTERING_SUPPORTED
973 #endif
974 
975 #if defined(PLATFORM_LINUX) && defined(PLATFORM_DESKTOP)
976 /*
977  ** The TUNNEL_FROM_ANY_SOURCE_SUPPORTED define is used to track the platforms
978  ** where admin can control whether or not to allow packets from any source addresses
979  ** being tunneled.
980  */
981 #define TUNNEL_FROM_ANY_SOURCE_SUPPORTED
982 #endif
983 
984 #if defined(_WIN32) && !defined(ANYCONNECT_USE_SNAK) && !defined(PRODUCT_TYPE_SSA)
985 /*
986  ** The SKIP_DHCP_SERVER_ROUTE_SUPPORTED define is used to track the platforms
987  ** where the admin can control whether or not the public DHCP server route is created
988  ** upon establishing the VPN tunnel.
989  */
990 #define SKIP_DHCP_SERVER_ROUTE_SUPPORTED
991 #endif
992 
993 #if defined(PLUGIN_PROTOCOL_SUPPORTED) && !defined(PRODUCT_TYPE_SSA)
994 #if (defined(_WIN32) && !defined(_WIN32_WCE))
995 // support Service Control Plugins if defined
996 #define SERVICE_PLUGIN
997 // support PhoneHome Plugin if defined
998 #define PHONEHOME_PLUGIN
999 #elif defined(PLATFORM_DARWIN)
1000 // support Service Control Plugins if defined
1001 #define SERVICE_PLUGIN
1002 // support PhoneHome Plugin if defined
1003 #define PHONEHOME_PLUGIN
1004 #elif defined(PLATFORM_LINUX) && !defined(PLATFORM_ANDROID) && !defined(PLATFORM_CHROMEBOOK)
1005 #define PHONEHOME_PLUGIN
1006 #define SERVICE_PLUGIN
1007 #endif
1008 #endif
1009 
1010 #if (defined (PLATFORM_DARWIN) || defined (PLATFORM_ANDROID) || defined(PLATFORM_APPLE_SSLVPN) || defined(PLATFORM_CHROMEBOOK) || (defined (PLATFORM_LINUX) && !defined (ANYCONNECT_USE_SNAK)))
1011 #define FILE_STORE_SUPPORTED
1012 #endif
1013 
1014 /*
1015 ** the INTERPROCESS_COMMUNICATION_SUPPORTED define is used to track the platforms where the
1016 ** communication between processes is supported. This is to avoid repeating the
1017 ** platforms in #ifdef clauses in other files.
1018 */
1019 #define INTERPROCESS_COMMUNICATION_SUPPORTED
1020 
1021 /*
1022 ** the THREADS_SUPPORTED define is used to track the platforms where
1023 ** threads are supported. This is to avoid repeating the
1024 ** platforms in #ifdef clauses in other files.
1025 */
1026 #define THREADS_SUPPORTED
1027 
1028 #if !defined(PLATFORM_WIN_APP)
1029 /*
1030 ** the CAPTIVE_PORTAL_DETECTION_SUPPORTED define is used to track the platforms where
1031 ** captive portal detection is supported. This is to avoid repeating the
1032 ** platforms in #ifdef clauses in other files.
1033 */
1034 #define CAPTIVE_PORTAL_DETECTION_SUPPORTED
1035 #endif
1036 
1037 #if (defined(_WIN32) || defined(PLATFORM_DARWIN)) && defined(CAPTIVE_PORTAL_DETECTION_SUPPORTED) && defined(PLATFORM_DESKTOP)
1038 /*
1039 ** the SECURE_CAPTIVE_PORTAL_REMEDIATION_SUPPORTED define is used to track the platforms where
1040 ** secure/enhanced captive portal remediation is supported.
1041 */
1042 #define SECURE_CAPTIVE_PORTAL_REMEDIATION_SUPPORTED
1043 
1044 /*
1045 ** The SCPR_FILTERING_VIA_KDF define tracks the platforms where secure captive
1046 ** portal remediation filtering applied via KDF is supported.
1047 */
1048 #if defined(_WIN32) || defined(PLATFORM_DARWIN)
1049 #define SCPR_FILTERING_VIA_KDF
1050 #endif // _WIN32 || PLATFORM_DARWIN
1051 #endif // (_WIN32 || PLATFORM_DARWIN) && CAPTIVE_PORTAL_DETECTION_SUPPORTED && PLATFORM_DESKTOP
1052 
1053 #if (defined(_WIN32) || defined(PLATFORM_DARWIN)) && defined(PLATFORM_DESKTOP)
1054 /*
1055 ** The REMOTE_PEER_ACCESS_HARDENING define is used to track the platforms where hardening of access
1056 ** to the VPN headend/public proxy is available.
1057 */
1058 #define REMOTE_PEER_ACCESS_HARDENING
1059 #endif // (_WIN32 || PLATFORM_DARWIN) && PLATFORM_DESKTOP
1060 
1061 /*
1062 ** the EVENTS_SUPPORTED define is used to track the platforms where
1063 ** events are supported. This is to avoid repeating the
1064 ** platforms in #ifdef clauses in other files.
1065 */
1066 #define EVENTS_SUPPORTED
1067 
1068 #if defined(IPV6_SUPPORTED) && !defined(PLATFORM_WIN_APP) && !defined(PLATFORM_ANDROID) && !defined(PLATFORM_CHROMEBOOK) && !defined(PLATFORM_APPLE_SSLVPN)
1069 /*
1070 ** the MODIFY_HOSTSFILE_SUPPORTED define is used to track the platforms where
1071 ** modification of the system's hosts file is supported. This is to avoid repeating the
1072 ** platforms in #ifdef clauses in other files.
1073 */
1074 #define MODIFY_HOSTSFILE_SUPPORTED
1075 #endif
1076 
1077 #if !defined(PLATFORM_WIN_APP)
1078 /*
1079 ** the HOST_CONFIG_MANAGER_SUPPORTED define is used to track the platforms where
1080 ** broad control of the host OS is supported. This is to avoid repeating the
1081 ** platforms in #ifdef clauses in other files.
1082 */
1083 #define HOST_CONFIG_MANAGER_SUPPORTED
1084 #endif
1085 
1086 #if defined(PRODUCT_TYPE_SSA) || defined(PLATFORM_WIN_APP) || defined(PLATFORM_ANDROID) || defined(PLATFORM_CHROMEBOOK) || defined(PLATFORM_APPLE_SSLVPN)
1087 /*
1088 ** the FILE_SYNCHRONIZER_SUPPORTED define is used to track the platforms where
1089 ** files downloaded directly by VPN API are supported. This is to avoid repeating the
1090 ** platforms in #ifdef clauses in other files.
1091 */
1092 #define FILE_SYNCHRONIZER_SUPPORTED
1093 #endif
1094 
1095 #if defined(_WIN32) || defined(PLATFORM_DARWIN) || (defined(PLATFORM_LINUX) && !defined(PLATFORM_ANDROID) && !defined(PLATFORM_CHROMEBOOK))
1096 /*
1097  ** the SAVE_VPNCONFIG_TO_FILE_SUPPORTED define is used to track the platforms where the
1098  ** writting of the VPN config to file is supported. This is to avoid repeating the
1099  ** platforms in #ifdef clauses in other files.
1100  */
1101 #define SAVE_VPNCONFIG_TO_FILE_SUPPORTED
1102 #endif
1103 
1104 /*
1105 * DSCP preservation is not considered for Downloader. Downloader uses socket transport for IPC.
1106 */
1107 #if (defined(PLATFORM_ANDROID) || defined(PLATFORM_DARWIN) || defined(_WIN32)) && !defined(_DOWNLOADER) && !defined(PRODUCT_TYPE_SSA) && !defined(PLATFORM_WIN_APP)
1108 // Used to enable preservation of Differentiated Services field in the IP packet header.
1109 #define DIFFSERV_PRESERVATION_SUPPORTED
1110 #endif
1111 
1112 #if !defined(PRODUCT_TYPE_SSA) && !defined(PLATFORM_WIN_APP)
1113 /*
1114 ** the ROUTE_MANAGER_SUPPORTED define is used to track the platforms
1115 ** where RouteMgr is supported. This is to avoid repeating the
1116 ** platforms in #ifdef clauses in other files.
1117 */
1118 #define ROUTE_MANAGER_SUPPORTED
1119 #endif
1120 
1121 #if !defined(PRODUCT_TYPE_SSA) && !defined(PLATFORM_WIN_APP)
1122 /*
1123 ** the FILTER_MANAGER_SUPPORTED define is used to track the platforms
1124 ** where FilterMgr is supported. This is to avoid repeating the
1125 ** platforms in #ifdef clauses in other files.
1126 */
1127 #define FILTER_MANAGER_SUPPORTED
1128 #endif
1129 
1130 #if defined(PLATFORM_APPLE_SSLVPN)
1131 // Used to enable the file logging for Apple plugins.
1132 //#define FILE_LOGGING_SUPPORTED
1133 #endif
1134 
1135 /*
1136 ** Legacy Single sign on authentication.
1137 ** Explicitly disabled on mobile platforms due to session fixation vulnerability, as described in CSCvg65072
1138 ** To be removed from desktop platforms in some future AnyConnect release (4.7?)
1139 */
1140 #if defined(PLATFORM_DESKTOP)
1141 #define SSO_V1_SUPPORTED
1142 #endif
1143 
1144 /*
1145 ** Single sign on authentication (requires embedded browser).
1146 */
1147 #if !defined(PLATFORM_WIN_APP)
1148 #define SSO_SUPPORTED
1149 #endif
1150 
1151 #if defined (PLATFORM_DESKTOP) || defined(PLATFORM_ANDROID) || (defined(PLATFORM_APPLE_SSLVPN) && defined(SUBPLATFORM_IPHONE))
1152 #define EXTERNAL_SSO_SUPPORTED
1153 #endif
1154 
1155 
1156 #if !defined(PLATFORM_WIN_APP)
1157 #define MCA_SUPPORTED
1158 #endif
1159 
1160 #define TIMERS_SUPPORTED
1161 
1162 #if !defined(PLATFORM_CHROMEBOOK) && !defined(PLATFORM_WIN_APP)
1163 #define LOAD_EXTERNAL_MODULES
1164 #endif
1165 
1166 #if defined(PLATFORM_ANDROID)
1167 #define SPLIT_DNS_PROXY_SUPPORTED
1168 #endif
1169 
1170 #if (defined(_WIN32) || defined(PLATFORM_DARWIN)) && defined(PLATFORM_DESKTOP)
1171 /*
1172 ** The MGMT_TUNNEL_SUPPORTED define is used to track the platforms where
1173 ** the management tunnel feature is supported.
1174 */
1175 #define MGMT_TUNNEL_SUPPORTED
1176 #endif
1177 
1178 #if (defined(_WIN32) || defined(PLATFORM_DARWIN) || defined(PLATFORM_LINUX)) && defined(PLATFORM_DESKTOP)
1179 /*
1180 ** The SPLIT_DNS_EXCLUDE_SUPPORTED define is used to track the platforms where
1181 ** split DNS for split exclude tunneling is supported.
1182 ** Note: on Linux, due to lack of KDF support, similar to the split include counterpart, only DNS traffic over
1183 ** the tunnel is controlled, i.e. the so-called "DNS fallback for split tunneling" (EDCS-792232).
1184 */
1185 #define SPLIT_DNS_EXCLUDE_SUPPORTED
1186 #endif // (_WIN32 || PLATFORM_DARWIN || PLATFORM_LINUX) && PLATFORM_DESKTOP
1187 
1188 #if (defined(_WIN32) || defined(PLATFORM_DARWIN)) && defined(PLATFORM_DESKTOP)
1189 /*
1190 ** The BYPASS_VIRTUAL_SUBNETS_ONLY_SUPPORTED define is used to track the platforms where
1191 ** limiting the localLAN split exclude to only virtual subnets is supported.
1192 */
1193 #define BYPASS_VIRTUAL_SUBNETS_ONLY_SUPPORTED
1194 #endif // (_WIN32 || PLATFORM_DARWIN) && PLATFORM_DESKTOP
1195 
1196 #if (defined(_WIN32) && defined(PLATFORM_DESKTOP)) || defined(MGMT_TUNNEL_SUPPORTED)
1197 // Machine certificate authentication SSL tunnel connections via agent are supported
1198 // on Windows desktop, and also on all platforms supporting the management tunnel feature.
1199 //
1200 #define SSL_CONNECT_VIA_AGENT_SUPPORTED
1201 #endif
1202 
1203 /*
1204 ** Performance optimization for the tunnel packet processing loop to attempt to process
1205 ** multiple packets before calling back into select().
1206 */
1207 #if !defined(_WIN32)
1208 #define MULTI_TUN_PACKET_PROCESSING_SUPPORTED
1209 #endif
1210 
1211 #if (defined(_WIN32) && defined(_M_ARM64))
1212 /*
1213 ** Disable Hostscan on Windows native ARM64 builds.
1214 */
1215 #define ANYCONNECT_NO_CSD
1216 #endif
1217 #if defined(_WIN32) && defined(PLATFORM_DESKTOP) && !defined(_M_ARM64) && !defined(X86_FOR_ARM64)
1218 /*
1219 ** Connected Standby is supported in Windows desktop but not UWP and not ARM64 (both native ARM64 and the hybrid _WIN32_FOR_ARM64).
1220 */
1221 #define CONNECTED_STANDBY_SUPPORTED
1222 #endif
1223 
1224 #if defined(_WIN32) && defined(PLATFORM_DESKTOP) || defined(PLATFORM_APPLE_SSLVPN)
1225 /*
1226 ** This define is used to track platforms where multi-line logs are readable, and hence supported.
1227 */
1228 #define MULTI_LINE_LOGS_SUPPORTED
1229 #endif
1230 
1231 #if defined(PLATFORM_ANDROID)
1232 #define PBR_SUPPORTED
1233 #endif
1234 
1235 #if (defined(PBR_SUPPORTED) && defined(PLATFORM_APPLE_SSLVPN) && defined(SUBPLATFORM_IPHONE))
1236 #define USERSPACE_DNS_CACHE_SUPPORTED;
1237 #endif
1238 
1239 #if defined (PLATFORM_ANDROID)
1240 #define PCAP_VA_SUPPORTED
1241 #endif
1242 
1243 /*
1244  * Platforms that support Unix Domain Socket.
1245  */
1246 #if defined(PLATFORM_ANDROID)
1247 #define UNIX_DOMAIN_SOCKET_SUPPORTED
1248 #endif
1249 
1250 /*
1251  * Platforms that use dynamic port assignment for IPC.
1252  */
1253 #if defined(PLATFORM_APPLE_SSLVPN)
1254 #define IPC_DYNAMIC_PORT_ASSIGNMENT
1255 #endif
1256 
1257 #if !defined(PLATFORM_WIN_APP)
1258 /*
1259 ** This define is used to track platforms where the MTU adjustment can be cached
1260 ** in a persistent cache (file) and be used across multiple VPN sessions.
1261 */
1262 #define MTU_ADJUSTMENT_CACHING_SUPPORTED
1263 #endif
1264 
1265 #if defined(PLATFORM_DARWIN)
1266 // On Linux based systems, it is possible for an IPC connection to be blocked or go bad without the
1267 // Agent being made aware, especially on macOS where we set the NOSIGPIPE option. Triggering an
1268 // immediate read on the socket when a failure is suspected will expose any existing socket failure.
1269 // However, this is not appropriate to do on Windows and is currently limited to DARWIN to limit
1270 // testing requirements, so this define is used to enable the functionality. Consideration should
1271 // be given to add PLATFORM_LINUX to the defined condition.
1272 #define IPC_DEPOT_SOCKET_FAILURE_DETECTION
1273 #endif
1274 
1275 #if defined(PLATFORM_LINUX) || defined(PLATFORM_ANDROID) || defined(PLATFORM_APPLE_SSLVPN)
1276 /*
1277 ** This is to track platforms where OCSP revocation check for server certificate is supported.
1278 */
1279 #define OCSP_SUPPORTED
1280 #endif
1281 
1282 /*
1283 ** The PRECONNECT_REMINDER_MSG_SUPPORTED define is used to track the platforms
1284 ** support AnyConnect pre-connect reminder message. The message is displayed only
1285 ** during the first connection attempt.
1286 **
1287 */
1288 #if defined(PLATFORM_DESKTOP) && !defined(PLATFORM_DARWIN)
1289 #define PRECONNECT_REMINDER_MSG_SUPPORTED
1290 #endif
1291 
1292 // LOCAL_POLICY_DIR_CHANGE_SUPPORTED involves the Agent detecting the local policy file has been
1293 // changed (by SecureX or other external means) and notifying the API with message
1294 // MESSAGE_ID_EVENT_NOTIFICATION, event code EC_LOCAL_POLICY_FILE_CHANGED.
1295 //
1296 // Note: DYNAMIC_UPDATE_LOCAL_POLICY is a case where the VPN API makes the update to the local
1297 // policy file and informs the Agent of the change. If these two opposite sides of the same
1298 // coin ever need to coexist in the product, further investigation and testing is required to
1299 // determine what additional changes may be necessary.
1300 //
1301 #if defined(PLATFORM_DESKTOP) && !defined(DYNAMIC_UPDATE_LOCAL_POLICY)
1302 //#define LOCAL_POLICY_DIR_CHANGE_SUPPORTED
1303 #endif
1304 
1305 // PROFILE_FILES_DIR_CHANGE_SUPPORTED involves the Agent detecting a profile file has been changed
1306 // (by SecureX or other external means) and notifying the API with message
1307 // MESSAGE_ID_EVENT_NOTIFICATION, event code EC_PROFILE_FILE_CHANGED.
1308 //
1309 #if defined(PLATFORM_DESKTOP)
1310 //#define PROFILE_FILES_DIR_CHANGE_SUPPORTED
1311 #endif
1312 
1313 #if defined(PLATFORM_ANDROID)
1314 // On Android, it's been observed that with certain CLAT46 networks, the local IPv4 address
1315 // obtained from the native public socket does not match any network interface IP addresses
1316 // enumerated from higher-level Android framework. This native IPv4 address is still valid
1317 // however and corresponds to the pseudo IPv4 address of the CLAT46 interface (e.g. 192.0.0.4).
1318 // This define is a workaround to continue allowing VPN tunnel to function in these cases.
1319 // BUGBUG: This workaround may now be redundant for Android with CLAT46 detection in NCSSIPCServer.
1320 #define ALLOW_INVALID_PUBLIC_INTERFACE_ADDRESS
1321 #endif
1322 
1323 /* END OF MACRO HELL */
1324 #endif /*__GENDEFS_H*/