우분투에서 skbuff.h

minsu9101의 이미지

안에 nh 라는 멤버를 못찾아서 물어봤더니
network_header 로 바귀었다고 하더라구요
struct iphdr *iph = (struct iphdr*)(*pskb)->nh.iph;
이 부분에서 nh가 바뀐건 알았는데 이번에는 iph 가 문제더군요
커널 버전 2.6.17.13 에 있는 skbuff.h에는 iph가 존재하는데
2.6.29.6 버전에는 없더라구요
iph라는 변수가 2.6.29.6 버전에서는 어떻게 바뀐건가요???

#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/netfilter.h>
#include <linux/netfilter_ipv4.h>
#include <linux/ip.h>			// iphdr
#include <linux/tcp.h>			// tcphdr
#include <linux/netdevice.h> 		// net_device
 
unsigned int hook_simple( unsigned int hook_no,
    struct sk_buff **pskb,
    const struct net_device *dev_in,
    const struct net_device *dev_out,
    int (*handler)( struct sk_buff * ) )
{
  // IP 헤더
	struct iphdr *iph = (struct iphdr*)(*pskb)->nh.iph;
  // IP 부분을 건너뛴 곳에서부터 TCP 헤더의 시작
	struct tcphdr *th = (struct tcphdr*)( (*pskb)->data + ( iph->ihl * 4 ) );
mithrandir의 이미지

http://www.linuxquestions.org/questions/programming-9/help-needed-with-sk_buff-773851/

이런 말씀 드리면 기분 나쁠지 모르겠지만, 본인이 직접 검색을 해보시는게 어떠십니까;;

언제나 삽질 - http://tisphie.net/typo/
프로그래밍 언어 개발 - http://langdev.net

언제나 삽질 - http://tisphie.net/typo/
프로그래밍 언어 개발 - http://langdev.net

minsu9101의 이미지

알겠습니다 ㅋㅋ