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.

78 lines
2.1 KiB

  1. #include <precomp.h>
  2. #include "wzcutil.h"
  3. VOID PrintMACAddress(PRAW_DATA prdMAC, BOOL bError)
  4. {
  5. if (bError)
  6. printf("#Err#");
  7. else if (prdMAC == NULL || prdMAC->dwDataLen == 0)
  8. printf("(null)");
  9. else
  10. {
  11. UINT i;
  12. for (i = 0; i < prdMAC->dwDataLen; i++)
  13. {
  14. printf("%02x", prdMAC->pData[i]);
  15. if (i < prdMAC->dwDataLen-1)
  16. printf(":");
  17. }
  18. }
  19. }
  20. VOID PrintSSID(PRAW_DATA prdSSID, BOOL bError)
  21. {
  22. if (bError)
  23. printf("#Err#");
  24. else if (prdSSID == NULL || prdSSID->dwDataLen == 0)
  25. printf("(null)");
  26. else
  27. {
  28. UINT i;
  29. for (i = 0; i < prdSSID->dwDataLen; i++)
  30. printf("%c", prdSSID->pData[i]);
  31. }
  32. }
  33. VOID PrintConfigList(PRAW_DATA prdBSSIDList, BOOL bError)
  34. {
  35. if (bError)
  36. printf("#Err#");
  37. else if (prdBSSIDList == NULL || prdBSSIDList->dwDataLen == 0)
  38. printf("(null)");
  39. else
  40. {
  41. UINT i;
  42. PWZC_802_11_CONFIG_LIST pConfigList;
  43. pConfigList = (PWZC_802_11_CONFIG_LIST)prdBSSIDList->pData;
  44. printf("%d entries\n", pConfigList->NumberOfItems);
  45. for (i = 0; i < pConfigList->NumberOfItems; i++)
  46. {
  47. UINT j;
  48. PWZC_WLAN_CONFIG pConfig;
  49. RAW_DATA rdBuffer;
  50. pConfig = &(pConfigList->Config[i]);
  51. rdBuffer.dwDataLen = pConfig->Ssid.SsidLength;
  52. rdBuffer.pData = pConfig->Ssid.Ssid;
  53. printf(" %02d:{%2d:", i, rdBuffer.dwDataLen);
  54. PrintSSID(&rdBuffer, FALSE);
  55. printf("}");
  56. for (j = rdBuffer.dwDataLen; j < 40; j++)
  57. printf("_");
  58. // print the MAC address for this BSSID
  59. rdBuffer.dwDataLen = 6;
  60. rdBuffer.pData = pConfig->MacAddress;
  61. printf("\n mac=");
  62. PrintMACAddress(&rdBuffer, FALSE);
  63. printf(" im=%d pri=%d am=%d\n",
  64. pConfig->InfrastructureMode,
  65. pConfig->Privacy,
  66. pConfig->AuthenticationMode);
  67. }
  68. }
  69. }