add ip iptions to inpcb
[unix-history] / usr / src / sys / netinet / in_proto.c
CommitLineData
8ae0e4b4
KM
1/*
2 * Copyright (c) 1982 Regents of the University of California.
3 * All rights reserved. The Berkeley software License Agreement
4 * specifies the terms and conditions for redistribution.
5 *
707db385 6 * @(#)in_proto.c 6.10 (Berkeley) %G%
8ae0e4b4 7 */
c5707736 8
20666ad3
JB
9#include "param.h"
10#include "socket.h"
11#include "protosw.h"
12#include "domain.h"
13#include "mbuf.h"
59965020 14
20666ad3
JB
15#include "in.h"
16#include "in_systm.h"
c5707736
BJ
17
18/*
19 * TCP/IP protocol family: IP, ICMP, UDP, TCP.
20 */
21int ip_output();
22int ip_init(),ip_slowtimo(),ip_drain();
23int icmp_input();
24int udp_input(),udp_ctlinput();
25int udp_usrreq();
26int udp_init();
27int tcp_input(),tcp_ctlinput();
28int tcp_usrreq();
29int tcp_init(),tcp_fasttimo(),tcp_slowtimo(),tcp_drain();
30int rip_input(),rip_output();
6d45c4ba 31extern int raw_usrreq();
c5707736
BJ
32/*
33 * IMP protocol family: raw interface.
34 * Using the raw interface entry to get the timer routine
35 * in is a kludge.
36 */
37#include "imp.h"
38#if NIMP > 0
39int rimp_output(), hostslowtimo();
40#endif
abe04898 41
279ad67c
MK
42#ifdef NSIP
43int idpip_input();
44#endif
45
abe04898 46extern struct domain inetdomain;
c5707736
BJ
47
48struct protosw inetsw[] = {
abe04898 49{ 0, &inetdomain, 0, 0,
c5707736
BJ
50 0, ip_output, 0, 0,
51 0,
52 ip_init, 0, ip_slowtimo, ip_drain,
53},
abe04898 54{ SOCK_DGRAM, &inetdomain, IPPROTO_UDP, PR_ATOMIC|PR_ADDR,
c5707736
BJ
55 udp_input, 0, udp_ctlinput, 0,
56 udp_usrreq,
57 udp_init, 0, 0, 0,
58},
abe04898 59{ SOCK_STREAM, &inetdomain, IPPROTO_TCP, PR_CONNREQUIRED|PR_WANTRCVD,
c5707736
BJ
60 tcp_input, 0, tcp_ctlinput, 0,
61 tcp_usrreq,
62 tcp_init, tcp_fasttimo, tcp_slowtimo, tcp_drain,
63},
abe04898 64{ SOCK_RAW, &inetdomain, IPPROTO_RAW, PR_ATOMIC|PR_ADDR,
c5707736
BJ
65 rip_input, rip_output, 0, 0,
66 raw_usrreq,
67 0, 0, 0, 0,
68},
279ad67c
MK
69{ SOCK_RAW, &inetdomain, IPPROTO_ICMP, PR_ATOMIC|PR_ADDR,
70 icmp_input, rip_output, 0, 0,
c49e68cc
MK
71 raw_usrreq,
72 0, 0, 0, 0,
73},
279ad67c 74#ifdef NSIP
707db385 75{ SOCK_RAW, &inetdomain, IPPROTO_IDP, PR_ATOMIC|PR_ADDR,
279ad67c
MK
76 idpip_input, rip_output, 0, 0,
77 raw_usrreq,
78 0, 0, 0, 0,
79},
80#endif
81 /* raw wildcard */
82{ SOCK_RAW, &inetdomain, 0, PR_ATOMIC|PR_ADDR,
83 rip_input, rip_output, 0, 0,
dbf57086
MK
84 raw_usrreq,
85 0, 0, 0, 0,
86},
6d45c4ba
BJ
87};
88
89struct domain inetdomain =
abe04898
MK
90 { AF_INET, "internet", 0, 0, 0,
91 inetsw, &inetsw[sizeof(inetsw)/sizeof(inetsw[0])] };
6d45c4ba 92
c5707736 93#if NIMP > 0
abe04898
MK
94extern struct domain impdomain;
95
6d45c4ba 96struct protosw impsw[] = {
abe04898 97{ SOCK_RAW, &impdomain, 0, PR_ATOMIC|PR_ADDR,
c5707736
BJ
98 0, rimp_output, 0, 0,
99 raw_usrreq,
100 0, 0, hostslowtimo, 0,
6d45c4ba 101},
c5707736
BJ
102};
103
6d45c4ba 104struct domain impdomain =
abe04898
MK
105 { AF_IMPLINK, "imp", 0, 0, 0,
106 impsw, &impsw[sizeof (impsw)/sizeof(impsw[0])] };
6d45c4ba 107#endif
77df9bb7
MK
108
109#include "hy.h"
110#if NHY > 0
111/*
112 * HYPERchannel protocol family: raw interface.
113 */
114int rhy_output();
115
116struct protosw hysw[] = {
117{ SOCK_RAW, PF_HYLINK, 0, PR_ATOMIC|PR_ADDR,
118 0, rhy_output, 0, 0,
119 raw_usrreq,
120 0, 0, 0, 0,
121},
122};
123
124struct domain hydomain =
125 { AF_HYLINK, "hy", hysw, &hysw[sizeof (hysw)/sizeof(hysw[0])] };
126#endif