/* RASENTRY 'dwfOptions' bit flags.
*/
#define RASEO_UseCountryAndAreaCodes 0x00000001
#define RASEO_SpecificIpAddr 0x00000002
#define RASEO_SpecificNameServers 0x00000004
#define RASEO_IpHeaderCompression 0x00000008
#define RASEO_RemoteDefaultGateway 0x00000010
#define RASEO_DisableLcpExtensions 0x00000020
#define RASEO_TerminalBeforeDial 0x00000040
#define RASEO_TerminalAfterDial 0x00000080
#define RASEO_ModemLights 0x00000100
#define RASEO_SwCompression 0x00000200
#define RASEO_RequireEncryptedPw 0x00000400
#define RASEO_RequireMsEncryptedPw 0x00000800
#define RASEO_RequireDataEncryption 0x00001000
#define RASEO_NetworkLogon 0x00002000
#define RASEO_UseLogonCredentials 0x00004000
#define RASEO_PromoteAlternates 0x00008000
#if (WINVER >= 0x401)
#define RASEO_SecureLocalFiles 0x00010000
#endif
#if (WINVER >= 0x500)
#define RASEO_RequireEAP 0x00020000
#define RASEO_RequirePAP 0x00040000
#define RASEO_RequireSPAP 0x00080000
#define RASEO_Custom 0x00100000
####
$RASOPTIONS = "RASEO_IpHeaderCompression+RASEO_RemoteDefaultGateway+RASEO_SwCompression";
####
my $RASOPTIONS = 0x00000008 | 0x00000010 | 0x00000200;
####
0x00000008 0000 0000 0000 0000 0000 0000 0000 1000
| 0x00000010 0000 0000 0000 0000 0000 0000 0001 0000
| 0x00000200 0000 0000 0000 0000 0000 0010 0000 0000
= 0x00000218 0000 0000 0000 0000 0000 0010 0001 1000
####
# Set options
# RASEO_IpHeaderCompression
# RASEO_RemoteDefaultGateway
# RASEO_SwCompression
# without affecting any other options.
$options |= 0x00000008 | 0x00000010 | 0x00000200;
# Clear those same options again leaving every other option as it was
$options &= ~(0x00000008 | 0x00000010 | 0x00000200);
# do something if all three options are set
# regardless of what other options are set.
if( ($options & (0x00000008 | 0x00000010 | 0x00000200)) == (0x00000008 | 0x00000010 | 0x00000200) ) {
# do something
}
# Do something if ONLY those three options are set
if( $options == (0x00000008 | 0x00000010 | 0x00000200) ) {
# do it
}
####
use constant RASEO_IpHeaderCompression = 0x00000008;