Форум: "Сети";
Поиск по всему сайту: delphimaster.net;
Текущий архив: 2002.04.18;
Скачать: [xml.tar.bz2];




Вниз

Сетевой трафик 


serge_sss   (2002-01-27 11:02) [0]

Можно где-нибудь найти исходник проги, для учета сетевого трафика
на одной или нескольких машинах



VuDZ   (2002-01-27 19:25) [1]

вот. основное - выделю:

// tests.cpp : Defines the entry point for the console application.
//

#define UNICODE
#include "windows.h"
#include <conio.h>
#include <Iphlpapi.h>
#include <iostream.h>
#include <stdio.h>
#include <lm.h>

int main(int argc, char* argv[], char* env[])
{
IP_INTERFACE_INFO * prebuf = new IP_INTERFACE_INFO;
DWORD rec = sizeof (IP_INTERFACE_INFO);
if ( GetInterfaceInfo(prebuf, &rec) == ERROR_INSUFFICIENT_BUFFER)
{
delete (prebuf);
prebuf = (IP_INTERFACE_INFO *)new char[rec];
if (GetInterfaceInfo(prebuf, &rec) != NO_ERROR)
return -1;
}

MIB_IFROW * buf = new MIB_IFROW;
buf->dwIndex = prebuf->Adapter->Index;
if ( GetIfEntry(buf) != NO_ERROR)
return -1;

cout << "Stats:\n";
cout << "number of incoming packets\n";
cout << " that were discarded even though they did not have errors " << buf->dwInDiscards << endl;
cout << " that were discarded because of errors " << buf->dwInErrors << endl;

cout << "number of outgoing packets\n";
cout << " that were discarded even though they did not have errors " << buf->dwOutDiscards << endl;
cout << " that were discarded because of errors " << buf->dwOutErrors << endl;

cout << "the Maximum Transmission Unit (MTU) " << buf->dwMtu << endl;
cout << "speed of the interface in bits per second " << buf->dwSpeed << endl;

cout << "incoming:\n";
cout << " number of octets of data received through this interface " << buf->dwInOctets << endl;
cout << " number of unicast packets received through this interface " << buf->dwInUcastPkts << endl;
cout << " non-unicast packets received through this interface " << buf->dwInNUcastPkts << endl;
cout << " number of incoming packets with unknown protocol " << buf->dwInUnknownProtos << endl;

cout << "outgoing:\n";
cout << " number of octets of data sent through this interface " << buf->dwOutOctets << endl;
cout << " number of unicast packets sent through this interface " << buf->dwOutUcastPkts << endl;
cout << " number of non-unicast packets sent through this interface " << buf->dwOutNUcastPkts << endl;


cout << endl << "output queue length " << buf->dwOutQLen << endl;

getch();
return 0;
}



Vks   (2002-02-05 15:49) [2]

господа, переведите с идиотского на русский, что это С - я понял, и куда это девать?????



VuDZ   (2002-02-05 15:54) [3]

Vks
ты чисто канкретно что ли?
если ты не могёшь допереть куды это вставлять, то RIP...

PS я фигею, дорогая редакция...
PPS на асме подойдёт вариант? :D




Форум: "Сети";
Поиск по всему сайту: delphimaster.net;
Текущий архив: 2002.04.18;
Скачать: [xml.tar.bz2];




Наверх





Память: 0.72 MB
Время: 0.046 c
1-57802           LazorenkoX            2002-04-04 22:00  2002.04.18  
Консоль вопрос 2


1-57754           voland0               2002-04-05 12:37  2002.04.18  
Помогите!!! onStartDrag в TDBGrid не наступает!!!


3-57599           Vlad_Leon             2002-03-27 09:13  2002.04.18  
Как узнать пароль?


4-57927           alexey1               2002-02-13 04:09  2002.04.18  
icons


7-57902           777                   2002-01-23 08:44  2002.04.18  
Модем в он-лайне?