About the variable of "network_header" in the struct sk_buff

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,I really do not know that is it correctly of  asking such a foolish
question in this high-level mailing list,but i could not find the
answer by google it.
As a recruit,i'm now studying netfilter,i want to write a simply test
kernel module by the function of dropping the packet which the
protocol is TCP.For that i have read the "Using Netfilter
hooks"(http://www.topsight.net/article.php/2003050621055083/print),in
the page there is a piece of code below:
      static int check_tcp_packet(struct sk_buff *skb)
          {
              /*........................*/
              if (skb->nh.iph->protocol != IPPROTO_TCP) {
                  return NF_ACCEPT;
              }

              /*................*/
          }

But when i look up the source code of the kernel of 2.6.32,the sk_buff
has changed.It is not a nh,the name is "network_header",as the others
are "transport_header" and "mac_header".Then i found that the
"network_header" is just a sk_buff_data_t(the true is a "unsigned int"
or "unsigned char *") type variable.
So, my question is how to get a IP packet with it protocol or tcp
flags or someother things by the "network_header" variable in the
struct sk_buff.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux