mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-10-19 09:59:04 +00:00
080774a243
Add ctnetlink subsystem for userspace-access to ip_conntrack table. This allows reading and updating of existing entries, as well as creating new ones (and new expect's) via nfnetlink. Please note the 'strange' byte order: nfattr (tag+length) are in host byte order, while the payload is always guaranteed to be in network byte order. This allows a simple userspace process to encapsulate netlink messages into arch-independent udp packets by just processing/swapping the headers and not knowing anything about the actual payload. Signed-off-by: Harald Welte <laforge@netfilter.org> Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
70 lines
1.7 KiB
C
70 lines
1.7 KiB
C
/* The "unknown" protocol. This is what is used for protocols we
|
|
* don't understand. It's returned by ip_ct_find_proto().
|
|
*/
|
|
|
|
/* (C) 1999-2001 Paul `Rusty' Russell
|
|
* (C) 2002-2004 Netfilter Core Team <coreteam@netfilter.org>
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
* published by the Free Software Foundation.
|
|
*/
|
|
|
|
#include <linux/types.h>
|
|
#include <linux/init.h>
|
|
#include <linux/netfilter.h>
|
|
#include <linux/if.h>
|
|
|
|
#include <linux/netfilter_ipv4/ip_nat.h>
|
|
#include <linux/netfilter_ipv4/ip_nat_rule.h>
|
|
#include <linux/netfilter_ipv4/ip_nat_protocol.h>
|
|
|
|
static int unknown_in_range(const struct ip_conntrack_tuple *tuple,
|
|
enum ip_nat_manip_type manip_type,
|
|
const union ip_conntrack_manip_proto *min,
|
|
const union ip_conntrack_manip_proto *max)
|
|
{
|
|
return 1;
|
|
}
|
|
|
|
static int unknown_unique_tuple(struct ip_conntrack_tuple *tuple,
|
|
const struct ip_nat_range *range,
|
|
enum ip_nat_manip_type maniptype,
|
|
const struct ip_conntrack *conntrack)
|
|
{
|
|
/* Sorry: we can't help you; if it's not unique, we can't frob
|
|
anything. */
|
|
return 0;
|
|
}
|
|
|
|
static int
|
|
unknown_manip_pkt(struct sk_buff **pskb,
|
|
unsigned int iphdroff,
|
|
const struct ip_conntrack_tuple *tuple,
|
|
enum ip_nat_manip_type maniptype)
|
|
{
|
|
return 1;
|
|
}
|
|
|
|
static unsigned int
|
|
unknown_print(char *buffer,
|
|
const struct ip_conntrack_tuple *match,
|
|
const struct ip_conntrack_tuple *mask)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static unsigned int
|
|
unknown_print_range(char *buffer, const struct ip_nat_range *range)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
struct ip_nat_protocol ip_nat_unknown_protocol = {
|
|
"unknown", 0, THIS_MODULE,
|
|
unknown_manip_pkt,
|
|
unknown_in_range,
|
|
unknown_unique_tuple,
|
|
unknown_print,
|
|
unknown_print_range
|
|
};
|