Blame view

net/netfilter/nf_conntrack_l3proto_generic.c 2.06 KB
9fb9cbb10   Yasuyuki Kozakai   [NETFILTER]: Add ...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
  /*
   * (C) 2003,2004 USAGI/WIDE Project <http://www.linux-ipv6.org>
   *
   * Based largely upon the original ip_conntrack code which
   * had the following copyright information:
   *
   * (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.
   *
   * Author:
   *	Yasuyuki Kozakai @USAGI	<yasuyuki.kozakai@toshiba.co.jp>
   */
9fb9cbb10   Yasuyuki Kozakai   [NETFILTER]: Add ...
17
18
19
20
21
22
23
24
25
26
27
  #include <linux/types.h>
  #include <linux/ip.h>
  #include <linux/netfilter.h>
  #include <linux/module.h>
  #include <linux/skbuff.h>
  #include <linux/icmp.h>
  #include <linux/sysctl.h>
  #include <net/ip.h>
  
  #include <linux/netfilter_ipv4.h>
  #include <net/netfilter/nf_conntrack.h>
605dcad6c   Martin Josefsson   [NETFILTER]: nf_c...
28
  #include <net/netfilter/nf_conntrack_l4proto.h>
9fb9cbb10   Yasuyuki Kozakai   [NETFILTER]: Add ...
29
30
31
  #include <net/netfilter/nf_conntrack_l3proto.h>
  #include <net/netfilter/nf_conntrack_core.h>
  #include <net/netfilter/ipv4/nf_conntrack_ipv4.h>
8ce8439a3   Jan Engelhardt   [NETFILTER]: nf_c...
32
33
  static bool generic_pkt_to_tuple(const struct sk_buff *skb, unsigned int nhoff,
  				 struct nf_conntrack_tuple *tuple)
9fb9cbb10   Yasuyuki Kozakai   [NETFILTER]: Add ...
34
35
36
  {
  	memset(&tuple->src.u3, 0, sizeof(tuple->src.u3));
  	memset(&tuple->dst.u3, 0, sizeof(tuple->dst.u3));
8ce8439a3   Jan Engelhardt   [NETFILTER]: nf_c...
37
  	return true;
9fb9cbb10   Yasuyuki Kozakai   [NETFILTER]: Add ...
38
  }
8ce8439a3   Jan Engelhardt   [NETFILTER]: nf_c...
39
40
  static bool generic_invert_tuple(struct nf_conntrack_tuple *tuple,
  				 const struct nf_conntrack_tuple *orig)
9fb9cbb10   Yasuyuki Kozakai   [NETFILTER]: Add ...
41
42
43
  {
  	memset(&tuple->src.u3, 0, sizeof(tuple->src.u3));
  	memset(&tuple->dst.u3, 0, sizeof(tuple->dst.u3));
8ce8439a3   Jan Engelhardt   [NETFILTER]: nf_c...
44
  	return true;
9fb9cbb10   Yasuyuki Kozakai   [NETFILTER]: Add ...
45
46
47
48
49
50
51
  }
  
  static int generic_print_tuple(struct seq_file *s,
  			    const struct nf_conntrack_tuple *tuple)
  {
  	return 0;
  }
ffc306904   Yasuyuki Kozakai   [NETFILTER]: nf_c...
52
53
  static int generic_get_l4proto(const struct sk_buff *skb, unsigned int nhoff,
  			       unsigned int *dataoff, u_int8_t *protonum)
9fb9cbb10   Yasuyuki Kozakai   [NETFILTER]: Add ...
54
55
56
57
  {
  	/* Never track !!! */
  	return -NF_ACCEPT;
  }
61075af51   Patrick McHardy   [NETFILTER]: nf_c...
58
  struct nf_conntrack_l3proto nf_conntrack_l3proto_generic __read_mostly = {
9fb9cbb10   Yasuyuki Kozakai   [NETFILTER]: Add ...
59
60
61
62
63
  	.l3proto	 = PF_UNSPEC,
  	.name		 = "unknown",
  	.pkt_to_tuple	 = generic_pkt_to_tuple,
  	.invert_tuple	 = generic_invert_tuple,
  	.print_tuple	 = generic_print_tuple,
ffc306904   Yasuyuki Kozakai   [NETFILTER]: nf_c...
64
  	.get_l4proto	 = generic_get_l4proto,
9fb9cbb10   Yasuyuki Kozakai   [NETFILTER]: Add ...
65
  };
e4bd8bce3   Patrick McHardy   [NETFILTER]: nf_c...
66
  EXPORT_SYMBOL_GPL(nf_conntrack_l3proto_generic);