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.

133 lines
2.9 KiB

  1. /*++
  2. Copyright (c) 1990-1998 Microsoft Corporation, All Rights Reserved.
  3. Module Name:
  4. atmsmapp.h
  5. Abstract:
  6. Header file of the user mode app that controls the sample driver.
  7. Author:
  8. Anil Francis Thomas (10/98)
  9. Environment:
  10. User mode
  11. Revision History:
  12. --*/
  13. #ifndef _ATMSMAPP_H_
  14. #define _ATMSMAPP_H_
  15. #define NSAP_ADDR_LEN 20
  16. #define MAX_DESTINATIONS 0
  17. #define DELIMITOR_CHARS " ,;"
  18. typedef struct _ProgramOptions {
  19. BOOLEAN fLocalIntf; // Local Interface Specified
  20. BOOLEAN fEnumInterfaces; // Enumerate all interfaces
  21. BOOLEAN fPMP; // Is point to multipoint
  22. USHORT usDrvAction; // Start. Stop
  23. USHORT usSendRecvAction; // Send or Recv
  24. DWORD dwPktSize; // Send Pkts Size
  25. DWORD dwPktInterval; // Send Pkt Interval
  26. DWORD dwNumPkts; // Send Number of Pkts
  27. DWORD dwNumDsts; // Send to destinations
  28. HANDLE hDriver; // Handle - to the driver
  29. HANDLE hReceive; // Handle - open for recv
  30. HANDLE hSend; // Handle - send to dsts
  31. UCHAR ucLocalIntf[NSAP_ADDR_LEN]; // Local Interface
  32. UCHAR ucDstAddrs[MAX_DESTINATIONS][NSAP_ADDR_LEN]; // destinations
  33. } PROGRAM_OPTIONS, *PPROGRAM_OPTIONS;
  34. // usDrvAction
  35. #define START_DRV 1
  36. #define STOP_DRV 2
  37. // usSendRecvAction
  38. #define RECEIVE_PKTS 1
  39. #define SEND_PKTS 2
  40. #define DEFAULT_PKT_SIZE 512
  41. #define MAX_PKT_SIZE 9180
  42. #define DEFAULT_PKT_INTERVAL 10 // millisecs
  43. #define DEFAULT_NUM_OF_PKTS 10
  44. #define MAX_BYTE_VALUE 0xFF
  45. #define CharToHex(c, ucRet) { \
  46. \
  47. if(c >= '0' && c <= '9') \
  48. ucRet = (UCHAR)(c - '0'); \
  49. else \
  50. if(c >= 'A' && c <= 'F') \
  51. ucRet = (UCHAR)(10 + (c - 'A')); \
  52. else \
  53. if(c >= 'a' && c <= 'f') \
  54. ucRet = (UCHAR)(10 + (c - 'a')); \
  55. else \
  56. ucRet = (UCHAR)-1; \
  57. \
  58. }
  59. extern PROGRAM_OPTIONS g_ProgramOptions;
  60. void
  61. Usage(
  62. );
  63. BOOL
  64. ParseCommandLine(
  65. int argc,
  66. char *argv[]
  67. );
  68. void
  69. EnumerateInterfaces(
  70. );
  71. DWORD
  72. DoSendPacketsToDestinations(
  73. );
  74. DWORD
  75. DoRecvPacketsOnAdapter(
  76. );
  77. BOOL WINAPI
  78. CtrlCHandler(
  79. DWORD dwCtrlType
  80. );
  81. BOOL
  82. GetSpecifiedDstAddrs(
  83. char *pStr
  84. );
  85. BOOL
  86. GetATMAddrs(
  87. char *pStr,
  88. UCHAR ucAddr[]
  89. );
  90. UINT FindOption(
  91. char *lptOpt,
  92. char **ppVal
  93. );
  94. char *
  95. FormatATMAddr(
  96. UCHAR ucAddr[]
  97. );
  98. #endif // _ATMSMAPP_H_