Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

108 lines
1.8 KiB

  1. /*++
  2. Copyright (c) 1997 FORE Systems, Inc.
  3. Copyright (c) 1997 Microsoft Corporation
  4. Module Name:
  5. aas.c
  6. Abstract:
  7. ATM ARP Admin Utility.
  8. Usage:
  9. atmarp
  10. Revision History:
  11. Who When What
  12. -------- -------- ---------------------------------------------
  13. josephj 06-10-1998 Created (adapted from atmlane admin utility).
  14. Notes:
  15. Modelled after atmlane utility.
  16. --*/
  17. #include "common.h"
  18. #include "..\atmarpc\ioctl.h"
  19. #include "atmmsg.h"
  20. #define MAX_ATMARPC_ADAPTERS 64
  21. #define MAX_ATMARPC_LISS 64
  22. #define MAX_ATMARPC_NAME_LEN 256
  23. #define MAX_ATMARPC_ARP_ENTRIES 4096
  24. #define MAX_ATMARPC_CONNECTIONS 4096
  25. //
  26. // Globals
  27. //
  28. static CHAR DefaultDeviceName[] = "\\\\.\\ATMARPC";
  29. static CHAR *pDeviceName = DefaultDeviceName;
  30. BOOLEAN
  31. AACCheckVersion(
  32. HANDLE DeviceHandle
  33. )
  34. {
  35. ULONG Version;
  36. ULONG BytesReturned;
  37. printf("In AACCheckversion\n");
  38. if (!DeviceIoControl(
  39. DeviceHandle,
  40. ARPC_IOCTL_QUERY_VERSION,
  41. (PVOID)&Version,
  42. sizeof(Version),
  43. (PVOID)&Version,
  44. sizeof(Version),
  45. &BytesReturned,
  46. 0))
  47. {
  48. DisplayMessage(FALSE, MSG_ERROR_GETTING_ARPC_VERSION_INFO);
  49. return FALSE;
  50. }
  51. if (Version != ARPC_IOCTL_VERSION)
  52. {
  53. DisplayMessage(FALSE, MSG_ERROR_INVALID_ARPC_INFO_VERSION);
  54. return FALSE;
  55. }
  56. return TRUE;
  57. }
  58. void
  59. DoAAC(OPTIONS *po)
  60. {
  61. HANDLE DeviceHandle;
  62. char InterfacesBuffer[1024];
  63. ULONG cbInterfaces = sizeof(InterfacesBuffer);
  64. DisplayMessage(FALSE, MSG_ARPC_BANNER);
  65. DeviceHandle = OpenDevice(pDeviceName);
  66. if (DeviceHandle == INVALID_HANDLE_VALUE)
  67. {
  68. DisplayMessage(FALSE, MSG_ERROR_OPENING_ARPC);
  69. return;
  70. }
  71. //
  72. // First check the version
  73. //
  74. if (!AACCheckVersion(DeviceHandle))
  75. {
  76. CloseDevice(DeviceHandle);
  77. return;
  78. }
  79. CloseDevice(DeviceHandle);
  80. return;
  81. }