--- /dev/null
+#ifndef __LINUX_IF_ARP_WRAPPER_H
+#define __LINUX_IF_ARP_WRAPPER_H 1
+
+#include_next <linux/if_arp.h>
+
+#include <linux/version.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
+
+#ifdef __KERNEL__
+#include <linux/skbuff.h>
+
+static inline struct arphdr *arp_hdr(const struct sk_buff *skb)
+{
+ return (struct arphdr *)skb_network_header(skb);
+}
+#endif /* __KERNEL__ */
+
+#endif /* linux kernel < 2.6.22 */
+
+#endif
--- /dev/null
+#ifndef __LINUX_NETFILTER_IPV4_WRAPPER_H
+#define __LINUX_NETFILTER_IPV4_WRAPPER_H 1
+
+#include_next <linux/netfilter_ipv4.h>
+
+#include <linux/version.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
+
+#ifdef __KERNEL__
+
+#define NF_INET_PRE_ROUTING NF_IP_PRE_ROUTING
+#define NF_INET_POST_ROUTING NF_IP_POST_ROUTING
+#define NF_INET_FORWARD NF_IP_FORWARD
+
+#endif /* __KERNEL__ */
+
+#endif /* linux kernel < 2.6.25 */
+
+#endif
skb->dst = (struct dst_entry *)&__fake_rtable;
dst_hold(skb->dst);
- return NF_HOOK(PF_INET, NF_IP_PRE_ROUTING, skb, skb->dev, NULL,
+ return NF_HOOK(PF_INET, NF_INET_PRE_ROUTING, skb, skb->dev, NULL,
snat_pre_route_finish);
ipv4_error:
static int
snat_skb_finish(struct sk_buff *skb)
{
- NF_HOOK(PF_INET, NF_IP_POST_ROUTING, skb, NULL, skb->dev,
+ NF_HOOK(PF_INET, NF_INET_POST_ROUTING, skb, NULL, skb->dev,
dp_xmit_skb_push);
return 0;
/* Take the Ethernet header back off for netfilter hooks. */
skb_pull(nskb, ETH_HLEN);
- NF_HOOK(PF_INET, NF_IP_FORWARD, nskb, skb->dev, nskb->dev,
+ NF_HOOK(PF_INET, NF_INET_FORWARD, nskb, skb->dev, nskb->dev,
snat_skb_finish);
}