[pso] HELP cum se obtin numerele porturilor??

Mihai Iancu pso@cursuri.cs.pub.ro
Mon, 14 Jun 2004 08:34:24 -0700 (PDT)


--0-2052939536-1087227264=:62087
Content-Type: text/plain; charset=us-ascii

Primul cast anuleaza efectul celui de al doilea, adica (__u32*) e degeaba.
 
Incearca tcp = (struct tcphdr*)((__u32 *)ip+ip->ihl);

George Ombas <geoupb@yahoo.com> wrote:
Eu folosesc pt tema 2 masini virtuale folosind
bridged connection 
Am vrut sa obtin numerele porturilor astfel:

struct sk_buff *sb = *skb;
struct iphdr *ip = sb->nh.iph;
struct tcphdr *tcp = (struct
tcphdr*)((__u32*)(ip+ip->ihl));

if(ip->protocol == IPPROTO_TCP){

ports=tcp->source;
portd=tcp->dest;
................................
Am facut asa si pentru hook in
si pentru hook out.
Problema este ca pentru pachetele care au ca 
sursa statia care are inserat modulul
obtin port sursa=0 si port destinatie=0.





__________________________________
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 
_______________________________________________
pso mailing list
pso@cursuri.cs.pub.ro
http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/pso

		
---------------------------------
Do you Yahoo!?
Friends.  Fun. Try the all-new Yahoo! Messenger
--0-2052939536-1087227264=:62087
Content-Type: text/html; charset=us-ascii

<DIV>Primul cast anuleaza efectul celui de al doilea, adica (__u32*) e degeaba.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Incearca tcp = (struct tcphdr*)((__u32 *)ip+ip-&gt;ihl);<BR><BR><B><I>George Ombas &lt;geoupb@yahoo.com&gt;</I></B> wrote:</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">Eu folosesc pt tema 2 masini virtuale folosind<BR>bridged connection <BR>Am vrut sa obtin numerele porturilor astfel:<BR><BR>struct sk_buff *sb = *skb;<BR>struct iphdr *ip = sb-&gt;nh.iph;<BR>struct tcphdr *tcp = (struct<BR>tcphdr*)((__u32*)(ip+ip-&gt;ihl));<BR><BR>if(ip-&gt;protocol == IPPROTO_TCP){<BR><BR>ports=tcp-&gt;source;<BR>portd=tcp-&gt;dest;<BR>................................<BR>Am facut asa si pentru hook in<BR>si pentru hook out.<BR>Problema este ca pentru pachetele care au ca <BR>sursa statia care are inserat modulul<BR>obtin port sursa=0 si port destinatie=0.<BR><BR><BR><BR><BR><BR>__________________________________<BR>Do you Yahoo!?<BR>Friends. Fun. Try the all-new Yahoo! Messenger.<BR>http://messenger.yahoo.com/ <BR>_______________________________________________<BR>pso mailing
 list<BR>pso@cursuri.cs.pub.ro<BR>http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/pso<BR></BLOCKQUOTE><p>
		<hr size=1>Do you Yahoo!?<br>Friends.  Fun. <a href="http://messenger.yahoo.com/">Try the all-new Yahoo! Messenger</a>
--0-2052939536-1087227264=:62087--