Программирование на C++ глазами хакера



             

Параметры сети - часть 2


eHostName.SetWindowText(pFixedInfo->HostName);

CString s=pFixedInfo->DnsServerList.IpAddress.String; chAddr = pFixedInfo->DnsServerList.Next; while(chAddr) { s=s+" "+chAddr->IpAddress.String; chAddr = chAddr->Next; } DNSServers.SetWindowText(s);

switch (pFixedInfo->NodeType) { case 1: eNodeType.SetWindowText("Broadcast"); break; case 2: eNodeType.SetWindowText("Peer to peer"); break; case 4: eNodeType.SetWindowText("Mixed"); break; case 8: eNodeType.SetWindowText("Hybrid"); break; default: eNodeType.SetWindowText("Don't know"); }

eIPRouting.SetWindowText(pFixedInfo->EnableRouting ? "Enabled" : "Disabled"); eWinsProxy.SetWindowText(pFixedInfo->EnableProxy ? "Enabled" : "Disabled");

iAdapterInfo = 0; iErr=GetAdaptersInfo(NULL, &iAdapterInfo); if ((iErr!= 0) && (iErr != ERROR_BUFFER_OVERFLOW)) { AfxMessageBox("GetAdaptersInfo failed"); return; }

if ((pAdapterInfo = (PIP_ADAPTER_INFO) GlobalAlloc(GPTR, iAdapterInfo)) == NULL) { AfxMessageBox("Memory allocation error\n"); return; }

if (GetAdaptersInfo(pAdapterInfo, &iAdapterInfo) != 0) { AfxMessageBox("GetAdaptersInfo failed"); return; }

pAdapter = pAdapterInfo;

eAdaptersInfo.AddString("===========================");

while (pAdapter) { switch (pAdapter->Type) { case MIB_IF_TYPE_ETHERNET: Str="Ethernet adapter: "; break; case MIB_IF_TYPE_PPP: Str="PPP adapter: "; break; case MIB_IF_TYPE_LOOPBACK: Str="Loopback adapter: "; break; case MIB_IF_TYPE_TOKENRING: Str="Token Ring adapter: "; break; case MIB_IF_TYPE_FDDI: Str="FDDI adapter: "; break; case MIB_IF_TYPE_SLIP: Str="Slip adapter: "; break; case MIB_IF_TYPE_OTHER: default: Str="Other adapter: "; } eAdaptersInfo.AddString(Str+pAdapter->AdapterName);

Str= "Description: "; eAdaptersInfo.AddString(Str+pAdapter->Description);




Содержание  Назад  Вперед