[pso] Porturi si protocol
Mihai Iancu
pso@cursuri.cs.pub.ro
Sun, 30 May 2004 09:44:10 -0700 (PDT)
--0-775355323-1085935450=:88103
Content-Type: text/plain; charset=us-ascii
Asa se obtin porturile
struct iphdr *ip = skb->nh.iph
struct tcphdr *tcp = (struct tcphdr*)((__u32*)(ip+ip->ihl))
... ntohs(tcp->dest))
... ntohs(tcp->source)
Enjoy
iana ionel cristian <iana_ionelcristian@yahoo.com> wrote:
--- Ioana Cutcutache wrote:
> In primul rand ar trebui sa folosesti ntohs ca sa
> vezi valoarea reala a unui port.
> Eu am mai avut o problema ca la pachetele ce intrau
> vedeam numerele porturilor aiurea si asta din cauza
> ca accesam header-ul tcp prin h.th si se pare ca nu
> era bine sa accesez asa. Nu prea am inteles de ce
> aparea aceasta problema, dar daca accesam de la
> nh.iph + nh.iph->ihl (deci daca consideram ca
> header-ul tcp se gasea imediat dupa cel ip)
>
treaba e ca mie nu-mi merge asa, si oricum as vrea sa
primesc o explicatie logica la ce se intampla.
deci de unde luam porturile si de ce?
__________________________________
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-775355323-1085935450=:88103
Content-Type: text/html; charset=us-ascii
<DIV>Asa se obtin porturile </DIV>
<DIV> </DIV>
<DIV>struct iphdr *ip = skb->nh.iph<BR>struct tcphdr *tcp = (struct tcphdr*)((__u32*)(ip+ip->ihl))<BR>... ntohs(tcp->dest))<BR>... ntohs(tcp->source)<BR></DIV>
<DIV> </DIV>
<DIV>Enjoy</DIV>
<DIV><BR><B><I>iana ionel cristian <iana_ionelcristian@yahoo.com></I></B> wrote:</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid"><BR>--- Ioana Cutcutache <IOANA_C@PCNET.RO>wrote:<BR>> In primul rand ar trebui sa folosesti ntohs ca sa<BR>> vezi valoarea reala a unui port. <BR>> Eu am mai avut o problema ca la pachetele ce intrau<BR>> vedeam numerele porturilor aiurea si asta din cauza<BR>> ca accesam header-ul tcp prin h.th si se pare ca nu<BR>> era bine sa accesez asa. Nu prea am inteles de ce<BR>> aparea aceasta problema, dar daca accesam de la<BR>> nh.iph + nh.iph->ihl (deci daca consideram ca<BR>> header-ul tcp se gasea imediat dupa cel ip) <BR>> <BR><BR>treaba e ca mie nu-mi merge asa, si oricum as vrea sa<BR>primesc o explicatie logica la ce se intampla.<BR>deci de unde luam porturile si de ce?<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</BLOCKQUOTE><p>
<hr size=1><font face=arial size=-1>Do you Yahoo!?<br>Friends. Fun. <a href="http://messenger.yahoo.com/">Try the all-new Yahoo! Messenger</a>
--0-775355323-1085935450=:88103--