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.

161 lines
4.0 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. net\routing\netsh\if\showmib.h
  5. Abstract:
  6. Author:
  7. Dave Thaler 7/21/99
  8. Revision History:
  9. --*/
  10. #ifndef __IFMON_SHOWMIB_H__
  11. #define __IFMON_SHOWMIB_H__
  12. #define MAX_NUM_INDICES 6
  13. typedef
  14. DWORD
  15. (*PGET_OPT_FN)(
  16. IN PTCHAR *pptcArguments,
  17. IN DWORD dwCurrentIndex,
  18. OUT PDWORD pdwIndices,
  19. OUT PDWORD pdwNumParsed
  20. );
  21. typedef struct _MIB_OBJECT_PARSER
  22. {
  23. PWCHAR pwszMIBObj;
  24. DWORD dwMinOptArg;
  25. PGET_OPT_FN pfnMIBObjParser;
  26. } MIB_OBJECT_PARSER,*PMIB_OBJECT_PARSER;
  27. DWORD
  28. GetMIBIfIndex(
  29. IN PTCHAR *pptcArguments,
  30. IN DWORD dwCurrentIndex,
  31. OUT PDWORD pdwIndices,
  32. OUT PDWORD pdwNumParsed
  33. );
  34. DWORD
  35. GetMIBIpAddress(
  36. IN PTCHAR *pptcArguments,
  37. IN DWORD dwCurrentIndex,
  38. OUT PDWORD pdwIndices,
  39. OUT PDWORD pdwNumParsed
  40. );
  41. DWORD
  42. GetMIBIpNetIndex(
  43. IN PTCHAR *pptcArguments,
  44. IN DWORD dwCurrentIndex,
  45. OUT PDWORD pdwIndices,
  46. OUT PDWORD pdwNumParsed
  47. );
  48. DWORD
  49. GetMIBTcpConnIndex(
  50. IN PTCHAR *pptcArguments,
  51. IN DWORD dwCurrentIndex,
  52. OUT PDWORD pdwIndices,
  53. OUT PDWORD pdwNumParsed
  54. );
  55. DWORD
  56. GetMIBUdpConnIndex(
  57. IN PTCHAR *pptcArguments,
  58. IN DWORD dwCurrentIndex,
  59. OUT PDWORD pdwIndices,
  60. OUT PDWORD pdwNumParsed
  61. );
  62. typedef
  63. VOID
  64. (PRINT_FN)(
  65. IN MIB_SERVER_HANDLE hMibServer,
  66. IN PMIB_OPAQUE_INFO pInfo
  67. );
  68. typedef PRINT_FN *PPRINT_FN;
  69. PRINT_FN PrintIfTable;
  70. PRINT_FN PrintIfRow;
  71. PRINT_FN PrintIcmp;
  72. PRINT_FN PrintUdpStats;
  73. PRINT_FN PrintUdpTable;
  74. PRINT_FN PrintUdpRow;
  75. PRINT_FN PrintTcpStats;
  76. PRINT_FN PrintTcpTable;
  77. PRINT_FN PrintTcpRow;
  78. PRINT_FN PrintIpStats;
  79. PRINT_FN PrintIpAddrTable;
  80. PRINT_FN PrintIpAddrRow;
  81. PRINT_FN PrintIpNetTable;
  82. PRINT_FN PrintIpNetRow;
  83. typedef struct _MAGIC_TABLE
  84. {
  85. DWORD dwId;
  86. PPRINT_FN pfnPrintFunction;
  87. }MAGIC_TABLE, *PMAGIC_TABLE;
  88. FN_HANDLE_CMD HandleIpMibShowObject;
  89. DWORD
  90. GetMibTagToken(
  91. IN PWCHAR *ppwcArguments,
  92. IN DWORD dwArgCount,
  93. IN DWORD dwNumIndices,
  94. OUT PDWORD pdwRR,
  95. OUT PBOOL pbIndex,
  96. OUT PDWORD pdwIndex
  97. );
  98. #define DISPLAYLEN_PHYSADDR 3*MAXLEN_PHYSADDR + 8
  99. #ifdef UNICODE
  100. #define MakeUnicodePhysAddr(ptszUnicode,pszAddr,dwLen) \
  101. { \
  102. CHAR __szTemp[DISPLAYLEN_PHYSADDR + 1]; \
  103. DWORD __i,__dwTempLen; \
  104. __dwTempLen = (((dwLen) <= MAXLEN_PHYSADDR) ? (dwLen) : MAXLEN_PHYSADDR); \
  105. for(__i = 0; __i < __dwTempLen; __i++) \
  106. { \
  107. sprintf(&(__szTemp[3*__i]),"%02X-",pszAddr[__i]); \
  108. } \
  109. MultiByteToWideChar(GetConsoleOutputCP(), \
  110. 0, \
  111. (__szTemp), \
  112. -1, \
  113. (ptszUnicode), \
  114. 3*__i); \
  115. ptszUnicode[(3*__i) - 1] = TEXT('\0'); \
  116. }
  117. #else
  118. #define MakeUnicodePhysAddr(ptszUnicode,pszAddr,dwLen) \
  119. { \
  120. CHAR __szTemp[DISPLAYLEN_PHYSADDR + 1]; \
  121. DWORD __i,__dwTempLen; \
  122. __dwTempLen = (((dwLen) <= MAXLEN_PHYSADDR) ? (dwLen) : MAXLEN_PHYSADDR); \
  123. for(__i = 0; __i < __dwTempLen; __i++) \
  124. { \
  125. sprintf(&(__szTemp[3*__i]),"%02X-",pszAddr[__i]); \
  126. } \
  127. strncpy((ptszUnicode),__szTemp,3*__i); \
  128. ptszUnicode[(3*__i) - 1] = TEXT('\0'); \
  129. }
  130. #endif //UNICODE
  131. FN_HANDLE_CMD HandleIpShowJoins;
  132. #endif // __IFMON_SHOWMIB_H__