본문 바로가기

Software/Network

[RAS] Ras Dial Status

Ras Dial Status

/*++

Copyright (c) Microsoft Corporation. All rights reserved.

Module Name:

    ras.h

Abstract:

    Remote Access external API

    WINVER values in this file:

        WINVER < 0x400 = Windows NT 3.5, Windows NT 3.51

        WINVER = 0x400 = Windows 95, Windows98, Windows NT4 (default)

        WINVER > 0x400 = Windows NT4 enhancements

        WINVER = 0x500 = Windows 2000

--*/

 

The RASCONNSTATE enumeration type contains values that specify the states that may occur during a RAS connection operation. If you use the RasDial function to establish a RAS connection, you can specify a window, or a RasDialFunc, RasDialFunc1, or RasDialFunc2 callback function to receive notification messages that report the current connection state. You can also use the RasGetConnectStatus function to get the connection state for a specified connection.

 

typedef enum _RASCONNSTATE {

RASCS_OpenPort = 0,

RASCS_PortOpened,

RASCS_ConnectDevice,

RASCS_DeviceConnected,

RASCS_AllDevicesConnected,

RASCS_Authenticate,

RASCS_AuthNotify,

RASCS_AuthRetry,

RASCS_AuthCallback,

RASCS_AuthChangePassword,

RASCS_AuthProject,

RASCS_AuthLinkSpeed,

RASCS_AuthAck,

RASCS_ReAuthenticate,

RASCS_Authenticated,

RASCS_PrepareForCallback,

RASCS_WaitForModemReset,

 

RASCS_WaitForCallback,

RASCS_Projected,

 

#if (WINVER >= 0x400)

RASCS_StartAuthentication,    // Windows 95 only

RASCS_CallbackComplete,       // Windows 95 only

RASCS_LogonNetwork,           // Windows 95 only

#endif

RASCS_SubEntryConnected,

RASCS_SubEntryDisconnected,

 

RASCS_Interactive = RASCS_PAUSED,

RASCS_RetryAuthentication,

RASCS_CallbackSetByCaller,

RASCS_PasswordExpired,

 

RASCS_Connected = RASCS_DONE,

 

RASCS_Disconnected

} RASCONNSTATE ;

 

 

The enumerator values are listed here in the general order in which the connection states occur. However, you should not write code that depends on the order or occurrence of particular RASCONNSTATE connection states, because this may vary between platforms.

 

Enumerator

Meaning

RASCS_OpenPort

   The communication port is about to be opened.

RASCS_PortOpened

The communication port has been opened successfully.

RASCS_ConnectDevice

A device is about to be connected. RasGetConnectStatus can be called to determine the name and type of the device being connected.

RASCS_DeviceConnected

A device has connected successfully. RasGetConnectStatus can be called to determine the name and type of the device being connected.

For a simple modem connection, RASCS_ConnectDevice and RASCS_DeviceConnected will be called only once. For a dial-up X.25 PAD connection, the pair will be called first for the modem, then for the PAD. If a preconnect switch is configured, the pair will be called for the switch before any other devices connect. Likewise, the pair will be called for a postconnect switch after any other devices connect.Windows 95: Note that Windows 95 does not currently support multistage connections such as the X.25 PAD connection described earlier.

RASCS_AllDevicesConnected

All devices in the device chain have successfully connected. At this point, the physical link is established.

RASCS_Authenticate                                

The authentication process is starting. Remote access does not allow the remote client to generate any traffic on the LAN until authentication has been successfully completed. Remote access authentication on a Windows NT or Windows 95 server consists of:

Ø       Validating the user name/ password on the specified domain.

Ø       Projecting the client onto the LAN. This means that the remote access server does what is necessary to send and receive data on the LAN on behalf of the client. For example, the remote access server might need to add a NetBIOS name that corresponds to the client's computer name.

Ø       Call-back processing in which the client hangs up and the server calls back. (The user needs special permissions on the remote access server for this.)

Ø       Calculating the link speed. This is necessary to correctly set transport time-outs to match the relatively slow speed of the remote link.

RASCS_AuthNotify

An authentication event has occurred. If dwError is zero, this event will be immediately followed by one of the more specific authentication states following. If dwError is nonzero, authentication has failed, and the error value indicates why.

RASCS_AuthRetry                                     

he client has requested another validation attempt with a new user name/password/domain. This state does not occur in Windows NT version 3.1.

RASCS_AuthCallback                               

The remote access server has requested a callback number. This occurs only if the user has "Set By Caller" callback privilege on the server.

RASCS_AuthChangePassword               

The client has requested to change the password on the account. This state does not occur in Windows NT version 3.1.

RASCS_AuthProject                                  

The projection phase is starting.

RASCS_AuthLinkSpeed

The link-speed calculation phase is starting.

RASCS_AuthAck                                       

An authentication request is being acknowledged.

RASCS_ReAuthenticate                            

Reauthentication (after callback) is starting.

RASCS_Authenticated                              

The client has successfully completed authentication.

RASCS_PrepareForCallback                    

The line is about to disconnect in preparation for callback.

RASCS_WaitForModemReset                  

The client is delaying in order to give the modem time to reset itself in preparation for callback.

RASCS_WaitForCallback                          

The client is waiting for an incoming call from the remote access server.

RASCS_Projected                                      

This state occurs after the RASCS_AuthProject state. It indicates that projection result information is available. You can access the projection result information by calling RasGetProjectionInfo.

RASCS_StartAuthentication                    

Windows 95 only: Indicates that user authentication is being initiated or retried.

RASCS_CallbackComplete                       

Windows 95 only: Indicates that the client has been called back and is about to resume authentication.

RASCS_LogonNetwork                             

Windows 95 only: Indicates that the client is logging on to the network.

RASCS_SubEntryConnected                   

When dialing a multilink phone-book entry, this state indicates that a subentry has been connected during the dialing process. The dwSubEntry parameter of a RasDialFunc2 callback function indicates the index of the subentry. When the final state of all subentries in the phone-book entry has been determined, the connection state is RASCS_Connected if one or more subentries have been connected successfully.

RASCS_SubEntryDisconnected              

When dialing a multilink phone-book entry, this state indicates that a subentry has been disconnected during the dialing process. The dwSubEntry parameter of a RasDialFunc2 callback function indicates the index of the subentry.

RASCS_Interactive                                    

This state corresponds to the terminal state supported by RASPHONE.EXE. This state does not occur in Windows NT version 3.1.

RASCS_RetryAuthentication                   

This state corresponds to the retry authentication state supported by RASPHONE.EXE. This state does not occur in Windows NT version 3.1.

RASCS_CallbackSetByCaller                   

This state corresponds to the callback state supported by RASPHONE.EXE. This state does not occur in Windows NT version 3.1.

RASCS_PasswordExpired                        

This state corresponds to the change password state supported by RASPHONE.EXE. This state does not occur in Windows NT version 3.1.

RASCS_Connected                                    

Successful connection.

RASCS_Disconnected                               

Disconnection or failed connection.

 

 

                                                                                                                                          

 

 

Remarks

 

The connection process states are divided into three classes: running states, paused states, and terminal states.

An application can easily determine the class of a specific state by performing Boolean bit operations with the RASCS_PAUSED and RASCS_DONE bitmasks. Here are some examples:

 

fDoneState = (state & RASCS_DONE); 

fPausedState = (state & RASCS_PAUSED);

fRunState = !(fDoneState || fPausedState);