|
|
|
date: Mon, 3 Apr 2006 12:45:59 +0200,
group: microsoft.public.platformsdk.networking
back
Re: RAW Sockets, how to read sent data?
"Arkady Frenkel" schrieb im Newsbeitrag
news:%23SXGbzxVGHA.2480@TK2MSFTNGP11.phx.gbl...
> If you use raw socket with WSAIoctl( SIO_RCVALL) it have to read data on
> both directions, check
> http://www.codeguru.com/network/ipmon.html
>
> Arkady
thanks a lot i'll have a look at it soon;
this is my line of code (i firist tried SIO_RCVALL) but it does not show up
sent data...
[code] WSAIoctl(sock, SIO_RCVALL_MCAST, &optval, sizeof(optval), NULL, 0,
&dwBytesRet, NULL, NULL); [/code]
greets
ludwig moser
date: Mon, 3 Apr 2006 14:56:01 +0200
author: Ludwig Moser
Re: RAW Sockets, how to read sent data?
You just doubled the same string ( if and else are the same as UDP too ) ,
look at:
if( szSourceIP == pHostent->h_addr_list[0])
printf("[TCP]\t%s:%d\t<-\t%s:%d\n",szSourceIP,ntohs(pTcpheader->sport),
szDestIP,ntohs(pTcpheader->dport));
else
printf("[TCP]\t%s:%d\t->\t%s:%d\n",szSourceIP,ntohs(pTcpheader->sport),
szDestIP,ntohs(pTcpheader->dport));
Arkady
"Ludwig Moser" wrote in message
news:2882e$4433928d$d52ff9ab$7407@news.chello.at...
>> Hi!
>>
>> Do you mean that with your app you can see outgoing packets and with
>> ipmon you do see ( at least partly ) ?
>> OTOH admin rights mean allow all ( no partly admin rights :) AFAIK ).
>> And for raw sockets you do have to have them starting from W2K, in
>> previous OS you do come overcome that demand setting registry key
>>
>> Arkady
>
> i mean, my program does not see outgoing traffic
> ipmon sees outgoing traffic >>sometimes<<
> (saw ONE outgoing package in my last test, this test did not bring any
> outgoing packages...)
>
> did ms change something in the last servicepack?
> (i am running windows mce 2005 SP2 with all latest patches)
>
> Ludwig
> PS: my program was showing up >>SOME<< outgoing packages in university!
> -> this totally confuses me; did you see any mistakes in code?
>
date: Wed, 5 Apr 2006 13:23:24 +0200
author: Arkady Frenkel
Re: RAW Sockets, how to read sent data?
> You just doubled the same string ( if and else are the same as UDP too ) ,
> look at:
> if( szSourceIP == pHostent->h_addr_list[0])
>
> printf("[TCP]\t%s:%d\t<-\t%s:%d\n",szSourceIP,ntohs(pTcpheader->sport),
> szDestIP,ntohs(pTcpheader->dport));
>
> else
>
> printf("[TCP]\t%s:%d\t->\t%s:%d\n",szSourceIP,ntohs(pTcpheader->sport),
> szDestIP,ntohs(pTcpheader->dport));
>
> Arkady
true, saw that mistake too while in university;
finally i dropped all the code and started all over.
i think the code is more clear now.
and it DOES show outgoing traffic now,
but still not ALL outgoing.
possibly its just not as fast at reading out while receiving..?
eg:
[TCP] 213.239.203.47:80 -> 192.168.1.2:2299
[TCP] 213.239.203.47:80 -> 192.168.1.2:2299
[TCP] 213.239.203.47:80 -> 192.168.1.2:2299
[TCP] 213.239.203.47:80 -> 192.168.1.2:2299
[TCP] 213.239.203.47:80 -> 192.168.1.2:2301
[TCP] 213.239.203.47:80 -> 192.168.1.2:2299
[TCP] 213.239.203.47:80 -> 192.168.1.2:2299
[TCP] 213.239.203.47:80 -> 192.168.1.2:2301
[TCP] 213.239.203.47:80 -> 192.168.1.2:2301
[TCP] 213.239.203.47:80 -> 192.168.1.2:2301
[TCP] 213.239.203.47:80 -> 192.168.1.2:2303
[TCP] 213.239.203.47:80 -> 192.168.1.2:2301
[TCP] 192.168.1.2:2301 -> 213.239.203.47:80 <==
[TCP] 213.239.203.47:80 -> 192.168.1.2:2301
[TCP] 192.168.1.2:2301 -> 213.239.203.47:80 <==
[TCP] 213.239.203.47:80 -> 192.168.1.2:2301
[TCP] 213.239.203.47:80 -> 192.168.1.2:2303
[TCP] 213.239.203.47:80 -> 192.168.1.2:2303
[TCP] 213.239.203.47:80 -> 192.168.1.2:2303
[TCP] 213.239.203.47:80 -> 192.168.1.2:2303
[TCP] 213.239.203.47:80 -> 192.168.1.2:2303
the two marked lines should not be that near together
cause when i click in Firefox it requests a document with pix -> more than
one tcp will be opened from webserver to me.
first marked line should be like 8 lines further up (tested on a page with
more than one pix)
any ideas?
greets
ludwig
date: Wed, 5 Apr 2006 18:14:44 +0200
author: Ludwig Moser
Re: RAW Sockets, how to read sent data?
To understand what happen, you need to enter into content of packet and see
what is the data inside, maybe that all, maybe not. But the speed of reading
is the same so IMHO that not the problem. Check content and see if all data
there
Arkady
"Ludwig Moser" wrote in message
news:82ba4$4433ecb8$d52ff9ab$29367@news.chello.at...
>> You just doubled the same string ( if and else are the same as UDP too )
>> , look at:
>> if( szSourceIP == pHostent->h_addr_list[0])
>>
>> printf("[TCP]\t%s:%d\t<-\t%s:%d\n",szSourceIP,ntohs(pTcpheader->sport),
>> szDestIP,ntohs(pTcpheader->dport));
>>
>> else
>>
>> printf("[TCP]\t%s:%d\t->\t%s:%d\n",szSourceIP,ntohs(pTcpheader->sport),
>> szDestIP,ntohs(pTcpheader->dport));
>>
>> Arkady
>
> true, saw that mistake too while in university;
> finally i dropped all the code and started all over.
>
> i think the code is more clear now.
> and it DOES show outgoing traffic now,
> but still not ALL outgoing.
> possibly its just not as fast at reading out while receiving..?
>
> eg:
> [TCP] 213.239.203.47:80 -> 192.168.1.2:2299
> [TCP] 213.239.203.47:80 -> 192.168.1.2:2299
> [TCP] 213.239.203.47:80 -> 192.168.1.2:2299
> [TCP] 213.239.203.47:80 -> 192.168.1.2:2299
> [TCP] 213.239.203.47:80 -> 192.168.1.2:2301
> [TCP] 213.239.203.47:80 -> 192.168.1.2:2299
> [TCP] 213.239.203.47:80 -> 192.168.1.2:2299
> [TCP] 213.239.203.47:80 -> 192.168.1.2:2301
> [TCP] 213.239.203.47:80 -> 192.168.1.2:2301
> [TCP] 213.239.203.47:80 -> 192.168.1.2:2301
> [TCP] 213.239.203.47:80 -> 192.168.1.2:2303
> [TCP] 213.239.203.47:80 -> 192.168.1.2:2301
> [TCP] 192.168.1.2:2301 -> 213.239.203.47:80 <==
> [TCP] 213.239.203.47:80 -> 192.168.1.2:2301
> [TCP] 192.168.1.2:2301 -> 213.239.203.47:80 <==
> [TCP] 213.239.203.47:80 -> 192.168.1.2:2301
> [TCP] 213.239.203.47:80 -> 192.168.1.2:2303
> [TCP] 213.239.203.47:80 -> 192.168.1.2:2303
> [TCP] 213.239.203.47:80 -> 192.168.1.2:2303
> [TCP] 213.239.203.47:80 -> 192.168.1.2:2303
> [TCP] 213.239.203.47:80 -> 192.168.1.2:2303
>
> the two marked lines should not be that near together
> cause when i click in Firefox it requests a document with pix -> more than
> one tcp will be opened from webserver to me.
> first marked line should be like 8 lines further up (tested on a page with
> more than one pix)
>
> any ideas?
> greets
> ludwig
>
>
date: Thu, 6 Apr 2006 09:57:21 +0200
author: Arkady Frenkel
|
|