rpms/west-chamber-kmod/F-12 compat_skbuff.h, NONE, 1.1 compat_xtables.h, NONE, 1.1 compat_xtnu.h, NONE, 1.1 west-chamber-kmod.spec, 1.10, 1.11 west-chamber-kmodtool-excludekernel-filterfile, 1.1, NONE

Chen Lei supercyper at rpmfusion.org
Thu Aug 5 09:36:29 CEST 2010


Author: supercyper

Update of /cvs/free/rpms/west-chamber-kmod/F-12
In directory se02.es.rpmfusion.net:/tmp/cvs-serv22238

Modified Files:
	west-chamber-kmod.spec 
Added Files:
	compat_skbuff.h compat_xtables.h compat_xtnu.h 
Removed Files:
	west-chamber-kmodtool-excludekernel-filterfile 
Log Message:



--- NEW FILE compat_skbuff.h ---
#ifndef COMPAT_SKBUFF_H
#define COMPAT_SKBUFF_H 1

struct tcphdr;
struct udphdr;

#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 30)
static inline void skb_dst_set(struct sk_buff *skb, struct dst_entry *dst)
{
	skb->dst = dst;
}

static inline struct dst_entry *skb_dst(const struct sk_buff *skb)
{
	return skb->dst;
}

static inline struct rtable *skb_rtable(const struct sk_buff *skb)
{
	return (void *)skb->dst;
}
#endif

#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 19)
#	define skb_ifindex(skb) \
		(((skb)->input_dev != NULL) ? (skb)->input_dev->ifindex : 0)
#	define skb_nfmark(skb) (((struct sk_buff *)(skb))->nfmark)
#elif LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 32)
#	define skb_ifindex(skb) (skb)->iif
#	define skb_nfmark(skb) (((struct sk_buff *)(skb))->mark)
#else
#	define skb_ifindex(skb) (skb)->skb_iif
#	define skb_nfmark(skb) (((struct sk_buff *)(skb))->mark)
#endif

#ifdef CONFIG_NETWORK_SECMARK
#	define skb_secmark(skb) ((skb)->secmark)
#else
#	define skb_secmark(skb) 0
#endif

#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 21)
#	define ip_hdr(skb) ((skb)->nh.iph)
#	define ip_hdrlen(skb) (ip_hdr(skb)->ihl * 4)
#	define ipv6_hdr(skb) ((skb)->nh.ipv6h)
#	define skb_network_header(skb) ((skb)->nh.raw)
#	define skb_transport_header(skb) ((skb)->h.raw)
static inline void skb_reset_network_header(struct sk_buff *skb)
{
	skb->nh.raw = skb->data;
}
static inline struct tcphdr *tcp_hdr(const struct sk_buff *skb)
{
	return (void *)skb_transport_header(skb);
}
static inline struct udphdr *udp_hdr(const struct sk_buff *skb)
{
	return (void *)skb_transport_header(skb);
}
#endif

#endif /* COMPAT_SKBUFF_H */


--- NEW FILE compat_xtables.h ---
#ifndef _XTABLES_COMPAT_H
#define _XTABLES_COMPAT_H 1

#include <linux/kernel.h>
#include <linux/version.h>
#include "compat_skbuff.h"
#include "compat_xtnu.h"

#define DEBUGP Use__pr_debug__instead

#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 17)
#	warning Kernels below 2.6.17 not supported.
#endif

#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
#	if !defined(CONFIG_NF_CONNTRACK_MARK)
#		warning You have CONFIG_NF_CONNTRACK enabled, but CONFIG_NF_CONNTRACK_MARK is not (please enable).
#	endif
#	include <net/netfilter/nf_conntrack.h>
#elif defined(CONFIG_IP_NF_CONNTRACK) || defined(CONFIG_IP_NF_CONNTRACK_MODULE)
#	if !defined(CONFIG_IP_NF_CONNTRACK_MARK)
#		warning You have CONFIG_IP_NF_CONNTRACK enabled, but CONFIG_IP_NF_CONNTRACK_MARK is not (please enable).
#	endif
#	include <linux/netfilter_ipv4/ip_conntrack.h>
#	define nf_conn ip_conntrack
#	define nf_ct_get ip_conntrack_get
#	define nf_conntrack_untracked ip_conntrack_untracked
#else
#	warning You need either CONFIG_NF_CONNTRACK or CONFIG_IP_NF_CONNTRACK.
#endif

#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 17)
#	define skb_init_secmark(skb)
#	define skb_linearize	xtnu_skb_linearize
#endif

#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 19)
#	define neigh_hh_output xtnu_neigh_hh_output
#	define IPPROTO_UDPLITE 136
#	define CSUM_MANGLED_0 ((__force __sum16)0xffff)
#endif

#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 24)
#	define NF_INET_PRE_ROUTING  NF_IP_PRE_ROUTING
#	define NF_INET_LOCAL_IN     NF_IP_LOCAL_IN
#	define NF_INET_FORWARD      NF_IP_FORWARD
#	define NF_INET_LOCAL_OUT    NF_IP_LOCAL_OUT
#	define NF_INET_POST_ROUTING NF_IP_POST_ROUTING
#	define ip_local_out         xtnu_ip_local_out
#	define ip_route_output_key  xtnu_ip_route_output_key
#	include "compat_nfinetaddr.h"
#endif

#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 23)
#	define init_net               xtnu_ip_route_output_key /* yes */
#	define init_net__loopback_dev (&loopback_dev)
#	define init_net__proc_net     proc_net
#else
#	define init_net__loopback_dev init_net.loopback_dev
#	define init_net__proc_net     init_net.proc_net
#endif

#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 34)
#	define xt_match              xtnu_match
#	define xt_register_match     xtnu_register_match
#	define xt_unregister_match   xtnu_unregister_match
#	define xt_register_matches   xtnu_register_matches
#	define xt_unregister_matches xtnu_unregister_matches
#endif

#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 19)
#	define csum_replace2 xtnu_csum_replace2
#	define csum_replace4 xtnu_csum_replace4
#	define inet_proto_csum_replace4 xtnu_proto_csum_replace4
#elif LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 24)
#	define csum_replace2 nf_csum_replace2
#	define csum_replace4 nf_csum_replace4
#	define inet_proto_csum_replace4 xtnu_proto_csum_replace4
#endif

#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34)
#	define ipt_unregister_table(tbl) ipt_unregister_table(&init_net, (tbl))
#	define ip6t_unregister_table(tbl) ip6t_unregister_table(&init_net, (tbl))
#else
#	define ipt_unregister_table(tbl) ipt_unregister_table(tbl)
#	define ip6t_unregister_table(tbl) ip6t_unregister_table(tbl)
#endif


#if !defined(NIP6) && !defined(NIP6_FMT)
#	define NIP6(addr) \
		ntohs((addr).s6_addr16[0]), \
		ntohs((addr).s6_addr16[1]), \
		ntohs((addr).s6_addr16[2]), \
		ntohs((addr).s6_addr16[3]), \
		ntohs((addr).s6_addr16[4]), \
		ntohs((addr).s6_addr16[5]), \
		ntohs((addr).s6_addr16[6]), \
		ntohs((addr).s6_addr16[7])
#	define NIP6_FMT "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x"
#endif
#if !defined(NIPQUAD) && !defined(NIPQUAD_FMT)
#	define NIPQUAD(addr) \
		((const unsigned char *)&addr)[0], \
		((const unsigned char *)&addr)[1], \
		((const unsigned char *)&addr)[2], \
		((const unsigned char *)&addr)[3]
#	define NIPQUAD_FMT "%u.%u.%u.%u"
#endif

#define ip_route_me_harder    xtnu_ip_route_me_harder
#define skb_make_writable     xtnu_skb_make_writable
#define xt_target             xtnu_target
#define xt_register_target    xtnu_register_target
#define xt_unregister_target  xtnu_unregister_target
#define xt_register_targets   xtnu_register_targets
#define xt_unregister_targets xtnu_unregister_targets

#define xt_request_find_match xtnu_request_find_match

#endif /* _XTABLES_COMPAT_H */


--- NEW FILE compat_xtnu.h ---
#ifndef _COMPAT_XTNU_H
#define _COMPAT_XTNU_H 1

#include <linux/list.h>
#include <linux/netfilter/x_tables.h>
#include <linux/spinlock.h>

#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 18)
typedef _Bool bool;
enum { false = 0, true = 1, };
#endif
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 19)
typedef __u16 __bitwise __sum16;
typedef __u32 __bitwise __wsum;
#endif

struct flowi;
struct hh_cache;
struct module;
struct net_device;
struct rtable;
struct sk_buff;

#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 27)
enum {
	NFPROTO_UNSPEC =  0,
	NFPROTO_IPV4   =  2,
	NFPROTO_ARP    =  3,
	NFPROTO_BRIDGE =  7,
	NFPROTO_IPV6   = 10,
	NFPROTO_DECNET = 12,
	NFPROTO_NUMPROTO,
};

struct xt_mtchk_param {
	const char *table;
	const void *entryinfo;
	const struct xt_match *match;
	void *matchinfo;
	unsigned int hook_mask;
	u_int8_t family;
};

struct xt_mtdtor_param {
	const struct xt_match *match;
	void *matchinfo;
	u_int8_t family;
};

struct xt_target_param {
	const struct net_device *in, *out;
	unsigned int hooknum;
	const struct xt_target *target;
	const void *targinfo;
	u_int8_t family;
};

struct xt_tgchk_param {
	const char *table;
	const void *entryinfo;
	const struct xt_target *target;
	void *targinfo;
	unsigned int hook_mask;
	u_int8_t family;
};

struct xt_tgdtor_param {
	const struct xt_target *target;
	void *targinfo;
	u_int8_t family;
};
#endif

#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 34)
struct xt_action_param {
	union {
		const struct xt_match *match;
		const struct xt_target *target;
	};
	union {
		const void *matchinfo, *targinfo;
	};
	const struct net_device *in, *out;
	int fragoff;
	unsigned int thoff, hooknum;
	u_int8_t family;
	bool hotdrop;
};
#endif

struct xtnu_match {
	/*
	 * Making it smaller by sizeof(void *) on purpose to catch
	 * lossy translation, if any.
	 */
	char name[sizeof(((struct xt_match *)NULL)->name) - 1 - sizeof(void *)];
	uint8_t revision;
	bool (*match)(const struct sk_buff *, struct xt_action_param *);
	int (*checkentry)(const struct xt_mtchk_param *);
	void (*destroy)(const struct xt_mtdtor_param *);
	struct module *me;
	const char *table;
	unsigned int matchsize, hooks;
	unsigned short proto, family;

	void *__compat_match;
};

struct xtnu_target {
	char name[sizeof(((struct xt_target *)NULL)->name) - 1 - sizeof(void *)];
	uint8_t revision;
	unsigned int (*target)(struct sk_buff **,
		const struct xt_action_param *);
	int (*checkentry)(const struct xt_tgchk_param *);
	void (*destroy)(const struct xt_tgdtor_param *);
	struct module *me;
	const char *table;
	unsigned int targetsize, hooks;
	unsigned short proto, family;

	void *__compat_target;
};

static inline struct xtnu_match *xtcompat_numatch(const struct xt_match *m)
{
	void *q;
	memcpy(&q, m->name + sizeof(m->name) - sizeof(void *), sizeof(void *));
	return q;
}

static inline struct xtnu_target *xtcompat_nutarget(const struct xt_target *t)
{
	void *q;
	memcpy(&q, t->name + sizeof(t->name) - sizeof(void *), sizeof(void *));
	return q;
}

#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 19)
static inline __wsum csum_unfold(__sum16 n)
{
	return (__force __wsum)n;
}
#endif

extern int xtnu_ip_local_out(struct sk_buff *);
extern int xtnu_ip_route_me_harder(struct sk_buff **, unsigned int);
extern int xtnu_skb_make_writable(struct sk_buff **, unsigned int);
extern int xtnu_register_match(struct xtnu_match *);
extern int xtnu_ip_route_output_key(void *, struct rtable **, struct flowi *);
extern void xtnu_unregister_match(struct xtnu_match *);
extern int xtnu_register_matches(struct xtnu_match *, unsigned int);
extern void xtnu_unregister_matches(struct xtnu_match *, unsigned int);
extern int xtnu_register_target(struct xtnu_target *);
extern void xtnu_unregister_target(struct xtnu_target *);
extern int xtnu_register_targets(struct xtnu_target *, unsigned int);
extern void xtnu_unregister_targets(struct xtnu_target *, unsigned int);
extern struct xt_match *xtnu_request_find_match(unsigned int,
	const char *, uint8_t);
extern int xtnu_neigh_hh_output(struct hh_cache *, struct sk_buff *);
extern void xtnu_csum_replace2(__u16 __bitwise *, __be16, __be16);
extern void xtnu_csum_replace4(__u16 __bitwise *, __be32, __be32);
extern void xtnu_proto_csum_replace4(__u16 __bitwise *, struct sk_buff *,
	__be32, __be32, bool);
extern int xtnu_skb_linearize(struct sk_buff *);

extern void *HX_memmem(const void *, size_t, const void *, size_t);

#endif /* _COMPAT_XTNU_H */


Index: west-chamber-kmod.spec
===================================================================
RCS file: /cvs/free/rpms/west-chamber-kmod/F-12/west-chamber-kmod.spec,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- west-chamber-kmod.spec	27 Jul 2010 07:49:40 -0000	1.10
+++ west-chamber-kmod.spec	5 Aug 2010 07:36:28 -0000	1.11
@@ -3,8 +3,8 @@
 # "buildforkernels newest" macro for just that build; immediately after
 # queuing that build enable the macro again for subsequent builds; that way
 # a new akmod package will only get build when a new one is actually needed
-%define buildforkernels newest
-#define buildforkernels current
+#define buildforkernels newest
+%define buildforkernels current
 #define buildforkernels akmods
 
 %define svndate 20100405
@@ -13,7 +13,7 @@
 Name:		west-chamber-kmod
 Summary:	Kernel module (kmod) for west-chamber
 Version:	0.0.1
-Release:	4.%{?svndate}svn%{?dist}.8
+Release:	5.%{?svndate}svn%{?dist}
 License:	GPLv2+
 Group:		System Environment/Kernel
 URL:		http://code.google.com/p/scholarzhang/
@@ -23,14 +23,16 @@
 #  svn export -r %{svnver} http://scholarzhang.googlecode.com/svn/trunk/west-chamber west-chamber-%{svndate}
 #  tar -cjvf west-chamber-%{svndate}.tar.bz2 west-chamber-%{svndate}
 Source0:	west-chamber-%{svndate}.tar.bz2
-Source11:	west-chamber-kmodtool-excludekernel-filterfile
-BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+# Header files extracted from xtables-addons 1.28
+Source1:	compat_xtables.h
+Source2:	compat_skbuff.h
+Source3:	compat_xtnu.h
 # get the needed BuildRequires (in parts depending on what we build for)
 BuildRequires:	%{_bindir}/kmodtool
 %{!?kernels:BuildRequires: buildsys-build-rpmfusion-kerneldevpkgs-%{?buildforkernels:%{buildforkernels}}%{!?buildforkernels:current}-%{_target_cpu} }
 
 # kmodtool does its magic here
-%{expand:%(kmodtool --target %{_target_cpu} --repo rpmfusion --kmodname %{name} --filterfile %{SOURCE11} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null) }
+%{expand:%(kmodtool --target %{_target_cpu} --repo rpmfusion --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null) }
 
 %description
 West-chamber is extensions named after the famous Chinese ancient friction - 
@@ -43,14 +45,21 @@
 # error out if there was something wrong with kmodtool
 %{?kmodtool_check}
 # print kmodtool output for debugging purposes:
-kmodtool  --target %{_target_cpu} --repo rpmfusion --kmodname %{name} --filterfile %{SOURCE11} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null
+kmodtool  --target %{_target_cpu} --repo rpmfusion --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null
 
 %setup -q -c -T -a 0
-#do not build bundled xtables-addons modules
+
 pushd west-chamber-%{svndate}
+# do not build bundled xtables-addons modules
 sed -i '/compat_xtables.o/d' extensions/Kbuild
 sed -i '/build_ipset/d' extensions/Kbuild
+
+# remove bundled files from xtables-addons
+rm -rf include extensions/compat* 
+
+cp -p %{SOURCE1} %{SOURCE2} %{SOURCE3} extensions/
 popd
+
 for kernel_version in %{?kernel_versions} ; do
 	cp -a west-chamber-%{svndate} _kmod_build_${kernel_version%%___*}
 done
@@ -59,14 +68,12 @@
 %build
 for kernel_version  in %{?kernel_versions} ; do
 	export XA_ABSTOPSRCDIR=${PWD}/_kmod_build_${kernel_version%%___*}
-	make %{?_smp_mflags} V=1 -C "${kernel_version##*___}" SUBDIRS=${PWD}/_kmod_build_${kernel_version%%___*}/extensions modules
+	make %{?_smp_mflags} V=1 -C "${kernel_version##*___}" M=${PWD}/_kmod_build_${kernel_version%%___*}/extensions modules
 done
 
 
 %install
-rm -rf %{buildroot}
 for kernel_version  in %{?kernel_versions} ; do
-	find _kmod_build_${kernel_version%%___*}/extensions -name "*.ko" -exec mv {} _kmod_build_${kernel_version%%___*}/extensions ";"
 	install -dm 755 %{buildroot}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}
 	install -pm 755 _kmod_build_${kernel_version%%___*}/extensions/*.ko %{buildroot}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}
 done
@@ -78,31 +85,35 @@
 
 
 %changelog
-* Tue Jul 27 2010 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 0.0.1-4.20100405svn.8
+* Thu Aug 05 2010 Chen Lei <supercyper at 163.com> - 0.0.1-5.20100405svn
+- Renew header files to work with xtables-addons >= 1.27
+
+* Fri Jun 18 2010 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 0.0.1-4.20100405svn.8
 - rebuild for new kernel
 
-* Wed Jul 07 2010 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 0.0.1-4.20100405svn.7
+* Fri May 28 2010 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 0.0.1-4.20100405svn.7
 - rebuild for new kernel
 
-* Fri Jun 18 2010 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 0.0.1-4.20100405svn.6
+* Thu May 20 2010 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 0.0.1-4.20100405svn.6
 - rebuild for new kernel
 
-* Sat May 01 2010 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 0.0.1-4.20100405svn.5
+* Mon May 17 2010 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 0.0.1-4.20100405svn.5
 - rebuild for new kernel
 
-* Thu Apr 29 2010 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 0.0.1-4.20100405svn.4
+* Fri May 07 2010 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 0.0.1-4.20100405svn.4
 - rebuild for new kernel
 
-* Thu Apr 22 2010 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 0.0.1-4.20100405svn.3
+* Tue May 04 2010 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 0.0.1-4.20100405svn.3
 - rebuild for new kernel
 
-* Mon Apr 19 2010 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 0.0.1-4.20100405svn.2
+* Thu Apr 29 2010 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 0.0.1-4.20100405svn.2
 - rebuild for new kernel
 
-* Sat Apr 17 2010 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 0.0.1-4.20100405svn.1
+* Sun Apr 25 2010 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 0.0.1-4.20100405svn.1
 - rebuild for new kernel
 
-* Thu Apr 15 2010 Caius 'kaio' Chance <kaio at fedoraproject.org> - 0.0.1-4.20100405svn-- Changed 'buildforkernels' to current.
+* Thu Apr 15 2010 Caius 'kaio' Chance <kaio at fedoraproject.org> - 0.0.1-4.20100405svn
+- Changed 'buildforkernels' to current.
 
 * Mon Apr 05 2010 Caius 'kaio' Chance <kaio at fedoraproject.org> - 0.0.1-3.20100405svn
 - svn 84


--- west-chamber-kmodtool-excludekernel-filterfile DELETED ---



More information about the rpmfusion-commits mailing list