Source code of Windows XP (NT5)
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.

172 lines
5.3 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. atmsample.h
  5. Abstract:
  6. Common header file defined for ATM Sample client. This file defines the
  7. IOCTLs used for communicating with the driver
  8. Author:
  9. Anil Francis Thomas (10/98)
  10. Environment:
  11. Kernel \ User
  12. Revision History:
  13. DChen 092499 Cleanup
  14. --*/
  15. #ifndef _ATMSAMPLE__
  16. #define _ATMSAMPLE__
  17. #define ATMSM_SERVICE_NAME "AtmSmDrv"
  18. #define ATMSM_SERVICE_NAME_L L"AtmSmDrv"
  19. #define ATM_SAMPLE_CLIENT_DOS_NAME_L L"\\\\.\\ATMSampleClient"
  20. #define ATM_SAMPLE_CLIENT_DOS_NAME "\\\\.\\ATMSampleClient"
  21. #ifndef NSAP_ADDRESS_LEN
  22. #define NSAP_ADDRESS_LEN 20
  23. #endif
  24. #define ACCESS_FROM_CTL_CODE(ctrlCode) (((ULONG)(ctrlCode & 0x0000C000)) >> 14)
  25. #define METHOD_FROM_CTL_CODE(ctrlCode) ((ULONG)(ctrlCode & 0x0000C0003))
  26. #define FILE_DEVICE_ATMSM 0x00009900
  27. #define _ATMSM_CTL_CODE(function, method, access) \
  28. CTL_CODE(FILE_DEVICE_ATMSM, function, method, access)
  29. //
  30. // IOCTL function codes
  31. //
  32. enum _ATMSM_IOCTL
  33. {
  34. DIOC_ENUMERATE_ADAPTERS,
  35. DIOC_OPEN_FOR_RECV,
  36. DIOC_RECV_DATA,
  37. DIOC_CLOSE_RECV_HANDLE,
  38. DIOC_CONNECT_TO_DSTS,
  39. DIOC_SEND_TO_DSTS,
  40. DIOC_CLOSE_SEND_HANDLE,
  41. ATMSM_NUM_IOCTLS
  42. };
  43. #define ATMSM_MIN_FUNCTION_CODE DIOC_ENUMERATE_ADAPTERS
  44. #define ATMSM_MAX_FUNCTION_CODE DIOC_CLOSE_SEND_HANDLE
  45. ////////////////////////////////////////////////////////////////////
  46. // IOCTL to enumerate adapters //
  47. ////////////////////////////////////////////////////////////////////
  48. #define IOCTL_ENUMERATE_ADAPTERS \
  49. _ATMSM_CTL_CODE(DIOC_ENUMERATE_ADAPTERS, METHOD_BUFFERED, \
  50. FILE_READ_ACCESS)
  51. // - IN -
  52. // None
  53. // - OUT -
  54. // The structure contains an array of adapter ATM addresses
  55. typedef struct _AdapterInfo
  56. {
  57. ULONG ulNumAdapters;
  58. UCHAR ucLocalATMAddr[1][NSAP_ADDRESS_LEN];
  59. } ADAPTER_INFO, *PADAPTER_INFO;
  60. /////////////////////////////////////////////////////////////////////
  61. // IOCTL to open the adapter for recv //
  62. /////////////////////////////////////////////////////////////////////
  63. #define IOCTL_OPEN_FOR_RECV \
  64. _ATMSM_CTL_CODE(DIOC_OPEN_FOR_RECV, METHOD_BUFFERED, \
  65. FILE_READ_ACCESS)
  66. // - IN -
  67. // structure used for opening for recv
  68. // Note! - Only 1 open for Recv is permitted per adapter
  69. //
  70. typedef struct _OpenForRecvInfo
  71. {
  72. UCHAR ucLocalATMAddr[NSAP_ADDRESS_LEN];
  73. } OPEN_FOR_RECV_INFO, *POPEN_FOR_RECV_INFO;
  74. // - OUT -
  75. // return is a context handle, used in read IOCTL
  76. /////////////////////////////////////////////////////////////////////
  77. // IOCTL to recv packets from an adapter opened for recvs //
  78. /////////////////////////////////////////////////////////////////////
  79. #define IOCTL_RECV_DATA \
  80. _ATMSM_CTL_CODE(DIOC_RECV_DATA, METHOD_OUT_DIRECT, \
  81. FILE_READ_ACCESS)
  82. // - IN -
  83. // context obtained when the adapter was opened for read
  84. // and a buffer for reading
  85. // - OUT -
  86. // data in the the buffer
  87. /////////////////////////////////////////////////////////////////////
  88. // IOCTL to stop receiving //
  89. /////////////////////////////////////////////////////////////////////
  90. #define IOCTL_CLOSE_RECV_HANDLE \
  91. _ATMSM_CTL_CODE(DIOC_CLOSE_RECV_HANDLE, METHOD_BUFFERED, \
  92. FILE_READ_ACCESS)
  93. // - IN -
  94. // context obtained when the adapter was opened for read
  95. /////////////////////////////////////////////////////////////////////
  96. // IOCTL to connect to destinations //
  97. /////////////////////////////////////////////////////////////////////
  98. #define IOCTL_CONNECT_TO_DSTS \
  99. _ATMSM_CTL_CODE(DIOC_CONNECT_TO_DSTS, METHOD_BUFFERED, \
  100. FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  101. // - IN -
  102. // Connect to 1 or multiple destinations (P-P or PMP connections)
  103. // The structure contains an array of destinations ATM addresses
  104. //
  105. typedef struct _ConnectInfo
  106. {
  107. ULONG bPMP;
  108. ULONG ulNumDsts;
  109. UCHAR ucLocalATMAddr[NSAP_ADDRESS_LEN];
  110. UCHAR ucDstATMAddrs[1][NSAP_ADDRESS_LEN];
  111. }CONNECT_INFO, *PCONNECT_INFO;
  112. // - OUT -
  113. // return is a context handle, used in send IOCTL
  114. /////////////////////////////////////////////////////////////////////
  115. // IOCTL to send to destinations //
  116. /////////////////////////////////////////////////////////////////////
  117. #define IOCTL_SEND_TO_DSTS \
  118. _ATMSM_CTL_CODE(DIOC_SEND_TO_DSTS, METHOD_IN_DIRECT, \
  119. FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  120. // - IN -
  121. // context obtained when the adapter was opened for sends
  122. // - OUT -
  123. // a buffer and size that needs to be send
  124. /////////////////////////////////////////////////////////////////////
  125. // IOCTL to stop receiving //
  126. /////////////////////////////////////////////////////////////////////
  127. #define IOCTL_CLOSE_SEND_HANDLE \
  128. _ATMSM_CTL_CODE(DIOC_CLOSE_SEND_HANDLE, METHOD_BUFFERED, \
  129. FILE_READ_ACCESS)
  130. // - IN -
  131. // context obtained when the adapter was opened for sends
  132. #endif // _ATMSAMPLE__