RE: [WinPcap-users] How to gather STAT without using pcap_loop

2003-02-19 Thread Fulvio Risso
Sorry for the delay.
The easiest way to solve the problem is to use the pcap_read_ex() (which is
no blocking, it does not require to be into a separate thread, it is
source-independent), then call the pcap_stats().
We have such this code in Analyzer.

Please do not use calls declared into the Packet API.

Cheersm

fulvio

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Monday, February 10, 2003 16:09
 To: [EMAIL PROTECTED]
 Subject: [WinPcap-users] How to gather STAT without using pcap_loop


 Hi guys,
 please help me to solve the VEXATA QUAESTIO,

 Is it possible to gather STATS from the adapter without using pcap_loop()
 and the callback method.




 byez  and tnx
 Lorenzo




 ==
  This is the WinPcap users list. It is archived at
  http://www.mail-archive.com/winpcap-users@winpcap.polito.it/

  To unsubscribe use
  mailto: [EMAIL PROTECTED]?body=unsubscribe
 ==



==
 This is the WinPcap users list. It is archived at
 http://www.mail-archive.com/winpcap-users@winpcap.polito.it/

 To unsubscribe use 
 mailto: [EMAIL PROTECTED]?body=unsubscribe
==



RE: [WinPcap-users] How to gather STAT without using pcap_loop

2003-02-10 Thread Jason Copeland
 Is it possible to gather STATS from the adapter without using 
 pcap_loop() and the callback method.

Have you looked at 'BOOLEAN PacketGetStats(LPADAPTER AdapterObject,
struct bpf_stat *s)'?



==
 This is the WinPcap users list. It is archived at
 http://www.mail-archive.com/winpcap-users@winpcap.polito.it/

 To unsubscribe use 
 mailto: [EMAIL PROTECTED]?body=unsubscribe
==



Re: [WinPcap-users] How to gather STAT without using pcap_loop

2003-02-10 Thread lcerulli
 Have you looked at 'BOOLEAN PacketGetStats(LPADAPTER AdapterObject,
 struct bpf_stat *s)'?

Yes i did,
but  is it possible to get the AdapterObject param from the WinPcap API
pcap_t struct that comes out from pcap_open_live ?
Is there a function to retrive the Adapter handle??


i know that i have to use specific pcaket.dll api but i'm writing a Winpcap
wrapper for vb and so i would like to use only specific WinPcap Functions.




tnx
Lorenzo


- Original Message -
From: Jason Copeland [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, February 10, 2003 4:14 PM
Subject: RE: [WinPcap-users] How to gather STAT without using pcap_loop


  Is it possible to gather STATS from the adapter without using
  pcap_loop() and the callback method.

 Have you looked at 'BOOLEAN PacketGetStats(LPADAPTER AdapterObject,
 struct bpf_stat *s)'?



 ==
  This is the WinPcap users list. It is archived at
  http://www.mail-archive.com/winpcap-users@winpcap.polito.it/

  To unsubscribe use
  mailto: [EMAIL PROTECTED]?body=unsubscribe
 ==



==
 This is the WinPcap users list. It is archived at
 http://www.mail-archive.com/winpcap-users@winpcap.polito.it/

 To unsubscribe use 
 mailto: [EMAIL PROTECTED]?body=unsubscribe
==



RE: [WinPcap-users] How to gather STAT without using pcap_loop

2003-02-10 Thread Jason Copeland
  Have you looked at 'BOOLEAN PacketGetStats(LPADAPTER AdapterObject, 
  struct bpf_stat *s)'?
 
 Yes i did,
 but  is it possible to get the AdapterObject param from the 
 WinPcap API pcap_t struct that comes out from pcap_open_live 
 ? Is there a function to retrive the Adapter handle??
 
 
 i know that i have to use specific pcaket.dll api but i'm 
 writing a Winpcap wrapper for vb and so i would like to use 
 only specific WinPcap Functions.

Here ya go:

typedef struct pcap pcap_t;
struct pcap {
#ifdef WIN32
ADAPTER *adapter;
LPPACKET Packet;
#else
int fd;
#endif
[SNIP]
};

I never use these higher level functions, but this should work for you.
you should be able to use your pcap_t structure, and access the
'adapter'
member of the structure.



==
 This is the WinPcap users list. It is archived at
 http://www.mail-archive.com/winpcap-users@winpcap.polito.it/

 To unsubscribe use 
 mailto: [EMAIL PROTECTED]?body=unsubscribe
==