GV,
When one passes a PacketBuf with thousands of packets, and that is passed to 
Res = (BOOLEAN)DeviceIoControl(AdapterObject->hFile,
The low level routine sends many of the packets auromatically. We only get to 
see TotBytesTransfered += BytesTransfered; which in my case is many hunreds of 
packets. Is there any way to get a caount back of how many were sent at the 
lower level?

Dennis




________________________________
From: Gianluca Varenni <[email protected]>
To: [email protected]
Sent: Thursday, August 13, 2009 2:27:21 PM
Subject: Re: [Winpcap-users] Anyone have current Packet32 source?


Can you elaborate on that? Which packets do you want to count?
 
Have a nice day
GV
----- Original Message ----- 
>From: Dennis Drew 
>To: [email protected] 
>Sent: Thursday, August 13, 2009 11:59 AM
>Subject: Re: [Winpcap-users] Anyone have current Packet32 source?
>
>
>Hmmm... the "find" function cannot detect that embedded within () I guess. 
>Thanks GV...
>
>So do you have any idea how at this low level I could determine the packet 
>count so I could display it on my application screen? There is a byte count 
>but that is not the same...
>
>Thanks,
>Dennis
>
>
>
>
________________________________
From: Gianluca Varenni <[email protected]>
>To: [email protected]
>Sent: Thursday, August 13, 2009 11:35:04 AM
>Subject: Re: [Winpcap-users] Anyone have current Packet32 source?
>
>
>The code in the compiled DLL is the same as the one that we ship as a source 
>package (I'm the person who builds the packages). Remember that the same 
>sources generate different binaries, depending on the build configuration you 
>use (NT4, NT5x, NT6x). 
> 
>The code you sent actually makes use of the Sync flag, here
> 
> 
>  
>Res = (BOOLEAN)DeviceIoControl(AdapterObject->hFile,
>(Sync)?BIOCSENDPACKETSSYNC:BIOCSENDPACKETSNOSYNC,
>(PCHAR)PacketBuff + TotBytesTransfered,
>Size - TotBytesTransfered,
>NULL,
>0,
> 
>Have a nice day
>GV
>----- Original Message ----- 
>>From: Dennis Drew 
>>To: [email protected] 
>>Sent: Thursday, August 13, 2009 11:03 AM
>>Subject: [Winpcap-users] Anyone have current Packet32 source?
>>
>>
>>Anyone have current Packet32 source?
>> 
>>The code I see in the packetNtx download is not the same as the code supplied 
>>as a compiled .dll. This code section does not repond the the Sync flag and 
>>it also runs VERY, very slow... like one packet per second so the loop at 
>>"do{" must be broken.
>> 
>>Any help on pointing me to a fully functional packet dll will be appreciated.
>> 
>>Thnaks,
>>Dennis (The other Dennis!)
>> 
>>INT PacketSendPackets( EMCallBack CB, LPADAPTER AdapterObject, PVOID 
>>PacketBuff, ULONG Size, BOOLEAN Sync)
>>{
>>BOOLEAN Res;
>>DWORD BytesTransfered, TotBytesTransfered=0;
>>LARGE_INTEGER StartTicks, CurTicks, TargetTicks, TimeFreq;
>>TRACE_ENTER(structtimeval BufStartTime;intnCt = 0, nCount = 
>>0;"PacketSendPackets");#ifdef
>>{
>>TRACE_PRINT(
>>TRACE_EXIT(
>>}HAVE_WANPACKET_APIif(AdapterObject->Flags == 
>>INFO_FLAG_NDISWAN_ADAPTER)"PacketSendPackets: packet sending not allowed on 
>>wan adapters");"PacketSendPackets");return0;#endif// 
>>HAVE_WANPACKET_API#ifdefHAVE_NPFIM_APIif(AdapterObject->Flags == 
>>INFO_FLAG_NPFIM_DEVICE)
>>{
>>TRACE_PRINT("PacketSendPackets: packet sending not allowed on npfim 
>>adapters");
>>TRACE_EXIT("PacketSendPackets");
>>return 0;
>>}#endif// HAVE_NPFIM_API#ifdef
>>{
>>TRACE_PRINT(
>>TRACE_EXIT(
>>}HAVE_AIRPCAP_APIif(AdapterObject->Flags == 
>>INFO_FLAG_AIRPCAP_CARD)"PacketSendPackets: packet sending not allowed on 
>>airpcap adapters");"PacketSendPackets");return0;#endif// 
>>HAVE_AIRPCAP_API{if(AdapterObject->Flags == INFO_FLAG_NDIS_ADAPTER)// Obtain 
>>starting timestamp of the bufferBufStartTime.tv_sec = ((
>>BufStartTime.tv_usec = 
>>((structtimeval*)(PacketBuff))->tv_sec;structtimeval*)(PacketBuff))->tv_usec;//
>> Retrieve the reference time countersQueryPerformanceCounter(&StartTicks);
>>QueryPerformanceFrequency(&TimeFreq);
>>CurTicks.QuadPart = StartTicks.QuadPart;do{// Send the data to the 
>>driver//TODO Res is NEVER checked, this is REALLY bad.Res = 
>>(BOOLEAN)DeviceIoControl(AdapterObject->hFile,
>>(Sync)?BIOCSENDPACKETSSYNC:BIOCSENDPACKETSNOSYNC,
>>(PCHAR)PacketBuff + TotBytesTransfered,
>>Size - TotBytesTransfered,
>>NULL,
>>0,
>>&BytesTransfered,
>>NULL);
>>TotBytesTransfered += BytesTransfered;// Exit from the loop on termination or 
>>errorif(TotBytesTransfered >= Size || Res != TRUE)break;// calculate the time 
>>interval to wait before sending the next packetTargetTicks.QuadPart = 
>>StartTicks.QuadPart +
>>(LONGLONG)
>>((((
>>(((
>>(TimeFreq.QuadPart) / 1000000;
>>}structtimeval*)((PCHAR)PacketBuff + TotBytesTransfered))->tv_sec - 
>>BufStartTime.tv_sec) * 1000000 +structtimeval*)((PCHAR)PacketBuff + 
>>TotBytesTransfered))->tv_usec - BufStartTime.tv_usec)) * // Wait until the 
>>time interval has elapsedQueryPerformanceCounter(&CurTicks);
>>}
>>}while( CurTicks.QuadPart <= TargetTicks.QuadPart )while(TRUE);else{
>>TRACE_PRINT1(
>>TotBytesTransfered = 0;
>>}
>>TRACE_EXIT(
>>}"Request to write on an unknown device type (%u)", 
>>AdapterObject->Flags);"PacketSendPackets");returnTotBytesTransfered; 
________________________________
_______________________________________________
>>Winpcap-users mailing list
>>[email protected]
>>https://www.winpcap.org/mailman/listinfo/winpcap-users
>>
________________________________
_______________________________________________
>Winpcap-users mailing list
>[email protected]
>https://www.winpcap.org/mailman/listinfo/winpcap-users
>
_______________________________________________
Winpcap-users mailing list
[email protected]
https://www.winpcap.org/mailman/listinfo/winpcap-users

Reply via email to