4.4BSD snapshot (revision 8.1); add 1993 to copyright
[unix-history] / usr / src / sys / netinet / in_proto.c
CommitLineData
8ae0e4b4 1/*
e7a3707f
KB
2 * Copyright (c) 1982, 1986, 1993
3 * The Regents of the University of California. All rights reserved.
8ae0e4b4 4 *
dbf0c423 5 * %sccs.include.redist.c%
2b6b6284 6 *
e7a3707f 7 * @(#)in_proto.c 8.1 (Berkeley) %G%
8ae0e4b4 8 */
c5707736 9
5548a02f
KB
10#include <sys/param.h>
11#include <sys/socket.h>
12#include <sys/protosw.h>
13#include <sys/domain.h>
14#include <sys/mbuf.h>
59965020 15
c46785cb 16#include <net/if.h>
5548a02f 17#include <net/radix.h>
c46785cb 18#include <net/route.h>
5c48f39f 19
c46785cb
KB
20#include <netinet/in.h>
21#include <netinet/in_systm.h>
22#include <netinet/ip.h>
23#include <netinet/ip_var.h>
24#include <netinet/ip_icmp.h>
25#include <netinet/in_pcb.h>
26#include <netinet/igmp_var.h>
27#include <netinet/tcp.h>
28#include <netinet/tcp_fsm.h>
29#include <netinet/tcp_seq.h>
30#include <netinet/tcp_timer.h>
31#include <netinet/tcp_var.h>
32#include <netinet/tcpip.h>
33#include <netinet/tcp_debug.h>
34#include <netinet/udp.h>
35#include <netinet/udp_var.h>
c5707736
BJ
36/*
37 * TCP/IP protocol family: IP, ICMP, UDP, TCP.
38 */
abe04898 39
279ad67c 40#ifdef NSIP
c46785cb 41void idpip_input(), nsip_ctlinput();
279ad67c
MK
42#endif
43
b4dc7708 44#ifdef TPIP
c46785cb
KB
45void tpip_input(), tpip_ctlinput(), tp_ctloutput();
46int tp_init(), tp_slowtimo(), tp_drain(), tp_usrreq();
b4dc7708
KS
47#endif
48
49#ifdef EON
c46785cb 50void eoninput(), eonctlinput(), eonprotoinit();
69d96ae2 51#endif /* EON */
b4dc7708 52
abe04898 53extern struct domain inetdomain;
c5707736
BJ
54
55struct protosw inetsw[] = {
abe04898 56{ 0, &inetdomain, 0, 0,
c5707736
BJ
57 0, ip_output, 0, 0,
58 0,
1e57600e 59 ip_init, 0, ip_slowtimo, ip_drain, ip_sysctl
c5707736 60},
abe04898 61{ SOCK_DGRAM, &inetdomain, IPPROTO_UDP, PR_ATOMIC|PR_ADDR,
65386213 62 udp_input, 0, udp_ctlinput, ip_ctloutput,
c5707736 63 udp_usrreq,
5082da2b 64 udp_init, 0, 0, 0, udp_sysctl
c5707736 65},
abe04898 66{ SOCK_STREAM, &inetdomain, IPPROTO_TCP, PR_CONNREQUIRED|PR_WANTRCVD,
65386213 67 tcp_input, 0, tcp_ctlinput, tcp_ctloutput,
c5707736
BJ
68 tcp_usrreq,
69 tcp_init, tcp_fasttimo, tcp_slowtimo, tcp_drain,
70},
abe04898 71{ SOCK_RAW, &inetdomain, IPPROTO_RAW, PR_ATOMIC|PR_ADDR,
f75daae6 72 rip_input, rip_output, 0, rip_ctloutput,
b4dc7708 73 rip_usrreq,
c5707736
BJ
74 0, 0, 0, 0,
75},
279ad67c 76{ SOCK_RAW, &inetdomain, IPPROTO_ICMP, PR_ATOMIC|PR_ADDR,
f75daae6 77 icmp_input, rip_output, 0, rip_ctloutput,
b4dc7708 78 rip_usrreq,
1e57600e 79 0, 0, 0, 0, icmp_sysctl
c49e68cc 80},
69d96ae2
AC
81{ SOCK_RAW, &inetdomain, IPPROTO_IGMP, PR_ATOMIC|PR_ADDR,
82 igmp_input, rip_output, 0, rip_ctloutput,
83 rip_usrreq,
84 igmp_init, igmp_fasttimo, 0, 0,
85},
b4dc7708
KS
86#ifdef TPIP
87{ SOCK_SEQPACKET,&inetdomain, IPPROTO_TP, PR_CONNREQUIRED|PR_WANTRCVD,
d6fa15c2 88 tpip_input, 0, tpip_ctlinput, tp_ctloutput,
b4dc7708
KS
89 tp_usrreq,
90 tp_init, 0, tp_slowtimo, tp_drain,
91},
92#endif
93/* EON (ISO CLNL over IP) */
94#ifdef EON
95{ SOCK_RAW, &inetdomain, IPPROTO_EON, 0,
96 eoninput, 0, eonctlinput, 0,
97 0,
98 eonprotoinit, 0, 0, 0,
99},
100#endif
279ad67c 101#ifdef NSIP
707db385 102{ SOCK_RAW, &inetdomain, IPPROTO_IDP, PR_ATOMIC|PR_ADDR,
448b28fe 103 idpip_input, rip_output, nsip_ctlinput, 0,
b4dc7708 104 rip_usrreq,
279ad67c
MK
105 0, 0, 0, 0,
106},
107#endif
108 /* raw wildcard */
109{ SOCK_RAW, &inetdomain, 0, PR_ATOMIC|PR_ADDR,
f75daae6 110 rip_input, rip_output, 0, rip_ctloutput,
b4dc7708 111 rip_usrreq,
d6fa15c2 112 rip_init, 0, 0, 0,
dbf57086 113},
6d45c4ba
BJ
114};
115
116struct domain inetdomain =
abe04898 117 { AF_INET, "internet", 0, 0, 0,
5c48f39f
KS
118 inetsw, &inetsw[sizeof(inetsw)/sizeof(inetsw[0])], 0,
119 rn_inithead, 32, sizeof(struct sockaddr_in) };
6d45c4ba 120
c46785cb 121#include "imp.h"
c5707736 122#if NIMP > 0
abe04898 123extern struct domain impdomain;
c46785cb 124int rimp_output(), hostslowtimo();
abe04898 125
6d45c4ba 126struct protosw impsw[] = {
abe04898 127{ SOCK_RAW, &impdomain, 0, PR_ATOMIC|PR_ADDR,
c5707736 128 0, rimp_output, 0, 0,
b4dc7708 129 rip_usrreq,
c5707736 130 0, 0, hostslowtimo, 0,
6d45c4ba 131},
c5707736
BJ
132};
133
6d45c4ba 134struct domain impdomain =
abe04898
MK
135 { AF_IMPLINK, "imp", 0, 0, 0,
136 impsw, &impsw[sizeof (impsw)/sizeof(impsw[0])] };
6d45c4ba 137#endif
77df9bb7
MK
138
139#include "hy.h"
140#if NHY > 0
141/*
142 * HYPERchannel protocol family: raw interface.
143 */
144int rhy_output();
65386213 145extern struct domain hydomain;
77df9bb7
MK
146
147struct protosw hysw[] = {
65386213 148{ SOCK_RAW, &hydomain, 0, PR_ATOMIC|PR_ADDR,
77df9bb7 149 0, rhy_output, 0, 0,
b4dc7708 150 rip_usrreq,
77df9bb7
MK
151 0, 0, 0, 0,
152},
153};
154
155struct domain hydomain =
1e7612a6 156 { AF_HYLINK, "hy", 0, 0, 0, hysw, &hysw[sizeof (hysw)/sizeof(hysw[0])] };
77df9bb7 157#endif