1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 #include <asm/segment.h>
23 #include <asm/system.h>
24 #include <linux/types.h>
25 #include <linux/kernel.h>
26 #include <linux/sched.h>
27 #include <linux/string.h>
28 #include <linux/socket.h>
29 #include <netinet/in.h>
30 #include "timer.h"
31 #include "ip.h"
32 #include "tcp.h"
33 #include "sock.h"
34 #include "icmp.h"
35
36 int udp_rcv(struct sk_buff *skb, struct device *dev, struct options *opt,
37 unsigned long daddr, unsigned short len,
38 unsigned long saddr, int redo, struct ip_protocol *protocol);
39
40 void udp_err (int err, unsigned char *header, unsigned long daddr,
41 unsigned long saddr, struct ip_protocol *protocol);
42
43
44 int tcp_rcv(struct sk_buff *skb, struct device *dev, struct options *opt,
45 unsigned long daddr, unsigned short len,
46 unsigned long saddr, int redo, struct ip_protocol *protocol);
47
48 void tcp_err (int err, unsigned char *header, unsigned long daddr,
49 unsigned long saddr, struct ip_protocol *protocol);
50
51 int icmp_rcv(struct sk_buff *skb, struct device *dev, struct options *opt,
52 unsigned long daddr, unsigned short len,
53 unsigned long saddr, int redo, struct ip_protocol *protocol);
54
55
56 static struct ip_protocol tcp_protocol =
57 {
58 tcp_rcv,
59 tcp_err,
60 NULL,
61 IPPROTO_TCP,
62 0,
63 NULL
64 };
65
66 static struct ip_protocol udp_protocol =
67 {
68 udp_rcv,
69 udp_err,
70 &tcp_protocol,
71 IPPROTO_UDP,
72 0,
73 NULL
74 };
75
76 static struct ip_protocol icmp_protocol =
77 {
78 icmp_rcv,
79 NULL,
80 &udp_protocol,
81 IPPROTO_ICMP,
82 0,
83 NULL
84 };
85
86 struct ip_protocol *ip_protocol_base = &icmp_protocol;