Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2002.04.18;
Скачать: CL | DM;

Вниз

Сетевой трафик   Найти похожие ветки 

 
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



Страницы: 1 вся ветка

Текущий архив: 2002.04.18;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.013 c
3-57617
ZDN
2002-03-26 08:54
2002.04.18
Помогите чайнику немытому, пожалуйста!


1-57671
Darkwin
2002-04-05 19:22
2002.04.18
Debuger


1-57709
mike.dld
2002-04-06 00:22
2002.04.18
Delphi4 vs Delphi6


1-57668
khodov
2002-04-06 21:28
2002.04.18
Люди!!! Ткните мне, пожалуйста, пальцем в утечку памяти.


3-57611
bill133
2002-03-22 23:23
2002.04.18
Какая БД лучше