rasutil.py 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import win32ras
  2. stateStrings = {
  3. win32ras.RASCS_OpenPort : "OpenPort",
  4. win32ras.RASCS_PortOpened : "PortOpened",
  5. win32ras.RASCS_ConnectDevice : "ConnectDevice",
  6. win32ras.RASCS_DeviceConnected : "DeviceConnected",
  7. win32ras.RASCS_AllDevicesConnected : "AllDevicesConnected",
  8. win32ras.RASCS_Authenticate : "Authenticate",
  9. win32ras.RASCS_AuthNotify : "AuthNotify",
  10. win32ras.RASCS_AuthRetry : "AuthRetry",
  11. win32ras.RASCS_AuthCallback : "AuthCallback",
  12. win32ras.RASCS_AuthChangePassword : "AuthChangePassword",
  13. win32ras.RASCS_AuthProject : "AuthProject",
  14. win32ras.RASCS_AuthLinkSpeed : "AuthLinkSpeed",
  15. win32ras.RASCS_AuthAck : "AuthAck",
  16. win32ras.RASCS_ReAuthenticate : "ReAuthenticate",
  17. win32ras.RASCS_Authenticated : "Authenticated",
  18. win32ras.RASCS_PrepareForCallback : "PrepareForCallback",
  19. win32ras.RASCS_WaitForModemReset : "WaitForModemReset",
  20. win32ras.RASCS_WaitForCallback : "WaitForCallback",
  21. win32ras.RASCS_Projected : "Projected",
  22. win32ras.RASCS_StartAuthentication : "StartAuthentication",
  23. win32ras.RASCS_CallbackComplete : "CallbackComplete",
  24. win32ras.RASCS_LogonNetwork : "LogonNetwork",
  25. win32ras.RASCS_Interactive : "Interactive",
  26. win32ras.RASCS_RetryAuthentication : "RetryAuthentication",
  27. win32ras.RASCS_CallbackSetByCaller : "CallbackSetByCaller",
  28. win32ras.RASCS_PasswordExpired : "PasswordExpired",
  29. win32ras.RASCS_Connected : "Connected",
  30. win32ras.RASCS_Disconnected : "Disconnected"
  31. }
  32. def TestCallback( hras, msg, state, error, exterror):
  33. print("Callback called with ", hras, msg, stateStrings[state], error, exterror)
  34. def test(rasName = "_ Divert Off"):
  35. return win32ras.Dial(None, None, (rasName,),TestCallback)