#define NET_CALLER(arg) __builtin_return_address(0)
#endif
+struct net_device;
+
#ifdef CONFIG_NETFILTER
struct nf_conntrack {
atomic_t use;
void (*destroy)(struct nf_conntrack *);
};
-struct nf_ct_info {
- struct nf_conntrack *master;
-};
-
#ifdef CONFIG_BRIDGE_NETFILTER
struct nf_bridge_info {
atomic_t use;
* @nfmark: Can be used for communication between hooks
* @nfcache: Cache info
* @nfct: Associated connection, if any
+ * @nfctinfo: Relationship of this skb to the connection
* @nf_debug: Netfilter debugging
* @nf_bridge: Saved data about a bridged frame - see br_netfilter.c
* @private: Data which is private to the HIPPI implementation
} nh;
union {
- struct ethhdr *ethernet;
unsigned char *raw;
} mac;
#ifdef CONFIG_NETFILTER
unsigned long nfmark;
__u32 nfcache;
- struct nf_ct_info *nfct;
+ __u32 nfctinfo;
+ struct nf_conntrack *nfct;
#ifdef CONFIG_NETFILTER_DEBUG
unsigned int nf_debug;
#endif
#ifdef CONFIG_NET_CLS_ACT
__u32 tc_verd; /* traffic control verdict */
__u32 tc_classid; /* traffic control classid */
- #endif
+#endif
#endif
extern void skb_split(struct sk_buff *skb,
struct sk_buff *skb1, const u32 len);
+static inline void *skb_header_pointer(const struct sk_buff *skb, int offset,
+ int len, void *buffer)
+{
+ int hlen = skb_headlen(skb);
+
+ if (offset + len <= hlen)
+ return skb->data + offset;
+
+ if (skb_copy_bits(skb, offset, buffer, len) < 0)
+ return NULL;
+
+ return buffer;
+}
+
extern void skb_init(void);
extern void skb_add_mtu(int mtu);
extern void skb_iter_abort(const struct sk_buff *skb, struct skb_iter *i);
#ifdef CONFIG_NETFILTER
-static inline void nf_conntrack_put(struct nf_ct_info *nfct)
+static inline void nf_conntrack_put(struct nf_conntrack *nfct)
{
- if (nfct && atomic_dec_and_test(&nfct->master->use))
- nfct->master->destroy(nfct->master);
+ if (nfct && atomic_dec_and_test(&nfct->use))
+ nfct->destroy(nfct);
}
-static inline void nf_conntrack_get(struct nf_ct_info *nfct)
+static inline void nf_conntrack_get(struct nf_conntrack *nfct)
{
if (nfct)
- atomic_inc(&nfct->master->use);
+ atomic_inc(&nfct->use);
}
static inline void nf_reset(struct sk_buff *skb)
{
skb->nf_debug = 0;
#endif
}
+static inline void nf_reset_debug(struct sk_buff *skb)
+{
+#ifdef CONFIG_NETFILTER_DEBUG
+ skb->nf_debug = 0;
+#endif
+}
#ifdef CONFIG_BRIDGE_NETFILTER
static inline void nf_bridge_put(struct nf_bridge_info *nf_bridge)