Deleted Added
full compact
in_proto.c (54263) in_proto.c (55009)
1/*
2 * Copyright (c) 1982, 1986, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 17 unchanged lines hidden (view full) ---

26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)in_proto.c 8.2 (Berkeley) 2/9/95
1/*
2 * Copyright (c) 1982, 1986, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 17 unchanged lines hidden (view full) ---

26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)in_proto.c 8.2 (Berkeley) 2/9/95
34 * $FreeBSD: head/sys/netinet/in_proto.c 54263 1999-12-07 17:39:16Z shin $
34 * $FreeBSD: head/sys/netinet/in_proto.c 55009 1999-12-22 19:13:38Z shin $
35 */
36
37#include "opt_ipdivert.h"
38#include "opt_ipx.h"
35 */
36
37#include "opt_ipdivert.h"
38#include "opt_ipx.h"
39#include "opt_ipsec.h"
40#include "opt_inet6.h"
39
40#include <sys/param.h>
41#include <sys/kernel.h>
42#include <sys/socket.h>
43#include <sys/domain.h>
44#include <sys/protosw.h>
45#include <sys/queue.h>
46#include <sys/sysctl.h>

--- 7 unchanged lines hidden (view full) ---

54#include <netinet/ip_var.h>
55#include <netinet/ip_icmp.h>
56#include <netinet/igmp_var.h>
57#include <netinet/tcp.h>
58#include <netinet/tcp_timer.h>
59#include <netinet/tcp_var.h>
60#include <netinet/udp.h>
61#include <netinet/udp_var.h>
41
42#include <sys/param.h>
43#include <sys/kernel.h>
44#include <sys/socket.h>
45#include <sys/domain.h>
46#include <sys/protosw.h>
47#include <sys/queue.h>
48#include <sys/sysctl.h>

--- 7 unchanged lines hidden (view full) ---

56#include <netinet/ip_var.h>
57#include <netinet/ip_icmp.h>
58#include <netinet/igmp_var.h>
59#include <netinet/tcp.h>
60#include <netinet/tcp_timer.h>
61#include <netinet/tcp_var.h>
62#include <netinet/udp.h>
63#include <netinet/udp_var.h>
64
65#include <netinet/ipprotosw.h>
66
62/*
63 * TCP/IP protocol family: IP, ICMP, UDP, TCP.
64 */
65
67/*
68 * TCP/IP protocol family: IP, ICMP, UDP, TCP.
69 */
70
71#ifdef IPSEC
72#include <netinet6/ipsec.h>
73#include <netinet6/ah.h>
74#ifdef IPSEC_ESP
75#include <netinet6/esp.h>
76#endif
77#endif /* IPSEC */
78
66#include "gif.h"
67#if NGIF > 0
68#include <netinet/in_gif.h>
69#endif
70
71#ifdef IPXIP
72#include <netipx/ipx_ip.h>
73#endif
74
75#ifdef NSIP
76#include <netns/ns.h>
77#include <netns/ns_if.h>
78#endif
79
80extern struct domain inetdomain;
81static struct pr_usrreqs nousrreqs;
82
79#include "gif.h"
80#if NGIF > 0
81#include <netinet/in_gif.h>
82#endif
83
84#ifdef IPXIP
85#include <netipx/ipx_ip.h>
86#endif
87
88#ifdef NSIP
89#include <netns/ns.h>
90#include <netns/ns_if.h>
91#endif
92
93extern struct domain inetdomain;
94static struct pr_usrreqs nousrreqs;
95
83struct protosw inetsw[] = {
96struct ipprotosw inetsw[] = {
84{ 0, &inetdomain, 0, 0,
85 0, 0, 0, 0,
86 0,
87 ip_init, 0, ip_slowtimo, ip_drain,
88 &nousrreqs
89},
90{ SOCK_DGRAM, &inetdomain, IPPROTO_UDP, PR_ATOMIC|PR_ADDR,
91 udp_input, 0, udp_ctlinput, ip_ctloutput,

--- 27 unchanged lines hidden (view full) ---

119 &rip_usrreqs
120},
121{ SOCK_RAW, &inetdomain, IPPROTO_RSVP, PR_ATOMIC|PR_ADDR,
122 rsvp_input, 0, 0, rip_ctloutput,
123 0,
124 0, 0, 0, 0,
125 &rip_usrreqs
126},
97{ 0, &inetdomain, 0, 0,
98 0, 0, 0, 0,
99 0,
100 ip_init, 0, ip_slowtimo, ip_drain,
101 &nousrreqs
102},
103{ SOCK_DGRAM, &inetdomain, IPPROTO_UDP, PR_ATOMIC|PR_ADDR,
104 udp_input, 0, udp_ctlinput, ip_ctloutput,

--- 27 unchanged lines hidden (view full) ---

132 &rip_usrreqs
133},
134{ SOCK_RAW, &inetdomain, IPPROTO_RSVP, PR_ATOMIC|PR_ADDR,
135 rsvp_input, 0, 0, rip_ctloutput,
136 0,
137 0, 0, 0, 0,
138 &rip_usrreqs
139},
140#ifdef IPSEC
141{ SOCK_RAW, &inetdomain, IPPROTO_AH, PR_ATOMIC|PR_ADDR,
142 ah4_input, 0, 0, 0,
143 0,
144 0, 0, 0, 0,
145 &nousrreqs
146},
147#ifdef IPSEC_ESP
148{ SOCK_RAW, &inetdomain, IPPROTO_ESP, PR_ATOMIC|PR_ADDR,
149 esp4_input, 0, 0, 0,
150 0,
151 0, 0, 0, 0,
152 &nousrreqs
153},
154#endif
155#endif /* IPSEC */
127#if NGIF > 0
128{ SOCK_RAW, &inetdomain, IPPROTO_IPV4, PR_ATOMIC|PR_ADDR,
129 in_gif_input, 0, 0, 0,
130 0,
131 0, 0, 0, 0,
132 &nousrreqs
133},
134# ifdef INET6

--- 59 unchanged lines hidden (view full) ---

194 &rip_usrreqs
195},
196};
197
198extern int in_inithead __P((void **, int));
199
200struct domain inetdomain =
201 { AF_INET, "internet", 0, 0, 0,
156#if NGIF > 0
157{ SOCK_RAW, &inetdomain, IPPROTO_IPV4, PR_ATOMIC|PR_ADDR,
158 in_gif_input, 0, 0, 0,
159 0,
160 0, 0, 0, 0,
161 &nousrreqs
162},
163# ifdef INET6

--- 59 unchanged lines hidden (view full) ---

223 &rip_usrreqs
224},
225};
226
227extern int in_inithead __P((void **, int));
228
229struct domain inetdomain =
230 { AF_INET, "internet", 0, 0, 0,
202 inetsw, &inetsw[sizeof(inetsw)/sizeof(inetsw[0])], 0,
231 (struct protosw *)inetsw,
232 (struct protosw *)&inetsw[sizeof(inetsw)/sizeof(inetsw[0])], 0,
203 in_inithead, 32, sizeof(struct sockaddr_in)
204 };
205
206DOMAIN_SET(inet);
207
208SYSCTL_NODE(_net, PF_INET, inet, CTLFLAG_RW, 0,
209 "Internet Family");
210
211SYSCTL_NODE(_net_inet, IPPROTO_IP, ip, CTLFLAG_RW, 0, "IP");
212SYSCTL_NODE(_net_inet, IPPROTO_ICMP, icmp, CTLFLAG_RW, 0, "ICMP");
213SYSCTL_NODE(_net_inet, IPPROTO_UDP, udp, CTLFLAG_RW, 0, "UDP");
214SYSCTL_NODE(_net_inet, IPPROTO_TCP, tcp, CTLFLAG_RW, 0, "TCP");
215SYSCTL_NODE(_net_inet, IPPROTO_IGMP, igmp, CTLFLAG_RW, 0, "IGMP");
233 in_inithead, 32, sizeof(struct sockaddr_in)
234 };
235
236DOMAIN_SET(inet);
237
238SYSCTL_NODE(_net, PF_INET, inet, CTLFLAG_RW, 0,
239 "Internet Family");
240
241SYSCTL_NODE(_net_inet, IPPROTO_IP, ip, CTLFLAG_RW, 0, "IP");
242SYSCTL_NODE(_net_inet, IPPROTO_ICMP, icmp, CTLFLAG_RW, 0, "ICMP");
243SYSCTL_NODE(_net_inet, IPPROTO_UDP, udp, CTLFLAG_RW, 0, "UDP");
244SYSCTL_NODE(_net_inet, IPPROTO_TCP, tcp, CTLFLAG_RW, 0, "TCP");
245SYSCTL_NODE(_net_inet, IPPROTO_IGMP, igmp, CTLFLAG_RW, 0, "IGMP");
246#ifdef IPSEC
247SYSCTL_NODE(_net_inet, IPPROTO_AH, ipsec, CTLFLAG_RW, 0, "IPSEC");
248#endif /* IPSEC */
216SYSCTL_NODE(_net_inet, IPPROTO_RAW, raw, CTLFLAG_RW, 0, "RAW");
217#ifdef IPDIVERT
218SYSCTL_NODE(_net_inet, IPPROTO_DIVERT, div, CTLFLAG_RW, 0, "DIVERT");
219#endif
220
249SYSCTL_NODE(_net_inet, IPPROTO_RAW, raw, CTLFLAG_RW, 0, "RAW");
250#ifdef IPDIVERT
251SYSCTL_NODE(_net_inet, IPPROTO_DIVERT, div, CTLFLAG_RW, 0, "DIVERT");
252#endif
253