1/*
2 * Copyright (c) 2012, 2015 The Linux Foundation. All rights reserved.
3 * Permission to use, copy, modify, and/or distribute this software for any
4 * purpose with or without fee is hereby granted, provided that the above
5 * copyright notice and this permission notice appear in all copies.
6 *
7 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
10 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
12 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
13 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
14 */
15
16#ifndef _MC_NETFILTER_H_
17#define _MC_NETFILTER_H_
18
19int __init mc_netfilter_init(void);
20void mc_netfilter_exit(void);
21
22#include <linux/version.h>
23#include <linux/netfilter.h>
24#include <linux/netdevice.h>
25
26#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0))
27unsigned int mc_pre_routing_hook(const struct nf_hook_ops *ops, struct sk_buff *skb,
28				 const struct net_device *in, const struct net_device *out,
29				 int(*okfn)(struct sk_buff *));
30
31unsigned int mc_forward_hook(const struct nf_hook_ops *ops, struct sk_buff *skb,
32			     const struct net_device *in, const struct net_device *out,
33			     int(*okfn)(struct sk_buff *));
34#else
35unsigned int mc_pre_routing_hook(unsigned int hooknum, struct sk_buff *skb,
36				 const struct net_device *in, const struct net_device *out,
37				 int(*okfn)(struct sk_buff *));
38
39unsigned int mc_forward_hook(unsigned int hooknum, struct sk_buff *skb,
40			     const struct net_device *in, const struct net_device *out,
41			     int(*okfn)(struct sk_buff *));
42#endif
43#endif
44