Hi, All !
My application runs under W98SE. Put under W2000 or WinXP not. I use only
the wpcap.lib, the sniffer "Ethereal" works on this W2000 and XP PC, so
there is no adapter problem. The simple working thread looks like below.
Have anybody an idee?
Regards
Rolf Gebhardt
void EventHandler::run()
{
QString s, str;
unsigned int i;
QCustomEvent *event;
unsigned char *data;
struct pcap_pkthdr *header;
for( ;; )
{
// handle of the event associated with the interface
HANDLE evt = pcap_getevent( m_openCapt );
switch( (int)WaitForSingleObject( evt, INFINITE ) )
{
case WAIT_OBJECT_0: // read the packets
pcap_next_ex( m_openCapt, &header, &data );
for( i=0,str=""; i<header->caplen; i++ )
str += s.sprintf( "%.2x ", data[i]
);
event = new QCustomEvent( PACKET_EVT );
event->setData( new QString( str )
);
QThread::postEvent( m_receiver, event );
break;
case WAIT_TIMEOUT:
case WAIT_FAILED:
default:
event = new QCustomEvent( ERROR_EVT );
QThread::postEvent( m_receiver, event );
break;
}
}
}
==================================================================
This is the WinPcap users list. It is archived at
http://www.mail-archive.com/[EMAIL PROTECTED]/
To unsubscribe use
mailto: [EMAIL PROTECTED]
==================================================================