| AnyConnect Secure Mobility Client 5.1.16.194

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