aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/netfilter/nf_tables_ipv4.h
blob: cba143fbd2e4fca9f5d0280dda035215ebd922fb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#ifndef _NF_TABLES_IPV4_H_
#define _NF_TABLES_IPV4_H_

#include <net/netfilter/nf_tables.h>
#include <net/ip.h>

static inline void
nft_set_pktinfo_ipv4(struct nft_pktinfo *pkt,
		     const struct nf_hook_ops *ops,
		     struct sk_buff *skb,
		     const struct net_device *in,
		     const struct net_device *out)
{
	struct iphdr *ip;

	nft_set_pktinfo(pkt, ops, skb, in, out);

	ip = ip_hdr(pkt->skb);
	pkt->tprot = ip->protocol;
	pkt->xt.thoff = ip_hdrlen(pkt->skb);
	pkt->xt.fragoff = ntohs(ip->frag_off) & IP_OFFSET;
}

extern struct nft_af_info nft_af_ipv4;

#endif