projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
put vax headers in their place
[unix-history]
/
usr
/
src
/
sys
/
kern
/
uipc_proto.c
diff --git
a/usr/src/sys/kern/uipc_proto.c
b/usr/src/sys/kern/uipc_proto.c
index
c212286
..
57a6f62
100644
(file)
--- a/
usr/src/sys/kern/uipc_proto.c
+++ b/
usr/src/sys/kern/uipc_proto.c
@@
-1,11
+1,13
@@
-/* uipc_proto.c 4.
14 82/01/25
*/
+/* uipc_proto.c 4.
25 82/10/09
*/
#include "../h/param.h"
#include "../h/socket.h"
#include "../h/protosw.h"
#include "../h/mbuf.h"
#include "../h/param.h"
#include "../h/socket.h"
#include "../h/protosw.h"
#include "../h/mbuf.h"
-#include "../net/in.h"
-#include "../net/in_systm.h"
+#include <time.h>
+#include "../h/kernel.h"
+#include "../netinet/in.h"
+#include "../netinet/in_systm.h"
/*
* Protocol configuration table and routines to search it.
/*
* Protocol configuration table and routines to search it.
@@
-23,29
+25,37
@@
int piusrreq();
*/
int ip_output();
int ip_init(),ip_slowtimo(),ip_drain();
*/
int ip_output();
int ip_init(),ip_slowtimo(),ip_drain();
-int icmp_input(),icmp_ctlinput();
-int icmp_drain();
+int icmp_input();
int udp_input(),udp_ctlinput();
int udp_usrreq();
int udp_init();
int tcp_input(),tcp_ctlinput();
int tcp_usrreq();
int tcp_init(),tcp_fasttimo(),tcp_slowtimo(),tcp_drain();
int udp_input(),udp_ctlinput();
int udp_usrreq();
int udp_init();
int tcp_input(),tcp_ctlinput();
int tcp_usrreq();
int tcp_init(),tcp_fasttimo(),tcp_slowtimo(),tcp_drain();
-int rip_input(),rip_output(),rip_ctlinput();
-int rip_usrreq(),rip_slowtimo();
+int rip_input(),rip_output();
/*
/*
- * IMP protocol family: raw interface
+ * IMP protocol family: raw interface.
+ * Using the raw interface entry to get the timer routine
+ * in is a kludge.
*/
#include "imp.h"
#if NIMP > 0
*/
#include "imp.h"
#if NIMP > 0
-int imp_usrreq(),imp_output(),imp_ctlinput();
+int rimp_output(), hostslowtimo();
+#endif
+
+/*
+ * PUP-I protocol family: raw interface
+ */
+#include "pup.h"
+#if NPUP > 0
+int rpup_output();
#endif
/*
* Sundries.
*/
#endif
/*
* Sundries.
*/
-int raw_init(),raw_usrreq(),raw_input();
+int raw_init(),raw_usrreq(),raw_input()
,raw_ctlinput()
;
struct protosw protosw[] = {
{ SOCK_STREAM, PF_UNIX, 0, PR_CONNREQUIRED,
struct protosw protosw[] = {
{ SOCK_STREAM, PF_UNIX, 0, PR_CONNREQUIRED,
@@
-73,10
+83,10
@@
struct protosw protosw[] = {
0,
ip_init, 0, ip_slowtimo, ip_drain,
},
0,
ip_init, 0, ip_slowtimo, ip_drain,
},
-{ 0,
0,
IPPROTO_ICMP, 0,
- icmp_input, 0,
icmp_ctlinput,
0,
+{ 0,
PF_INET,
IPPROTO_ICMP, 0,
+ icmp_input, 0,
0,
0,
0,
0,
- 0, 0, 0,
icmp_drain
,
+ 0, 0, 0,
0
,
},
{ SOCK_DGRAM, PF_INET, IPPROTO_UDP, PR_ATOMIC|PR_ADDR,
udp_input, 0, udp_ctlinput, 0,
},
{ SOCK_DGRAM, PF_INET, IPPROTO_UDP, PR_ATOMIC|PR_ADDR,
udp_input, 0, udp_ctlinput, 0,
@@
-89,20
+99,28
@@
struct protosw protosw[] = {
tcp_init, tcp_fasttimo, tcp_slowtimo, tcp_drain,
},
{ 0, 0, 0, 0,
tcp_init, tcp_fasttimo, tcp_slowtimo, tcp_drain,
},
{ 0, 0, 0, 0,
- raw_input, 0,
0,
0,
+ raw_input, 0,
raw_ctlinput,
0,
raw_usrreq,
raw_init, 0, 0, 0,
},
raw_usrreq,
raw_init, 0, 0, 0,
},
-{ SOCK_RAW, PF_INET, IPPROTO_RAW, PR_ATOMIC,
- rip_input, rip_output,
rip_ctlinput,
0,
- r
ip
_usrreq,
+{ SOCK_RAW, PF_INET, IPPROTO_RAW, PR_ATOMIC
|PR_ADDR
,
+ rip_input, rip_output,
0,
0,
+ r
aw
_usrreq,
0, 0, 0, 0,
}
#if NIMP > 0
,
{ SOCK_RAW, PF_IMPLINK, 0, PR_ATOMIC|PR_ADDR,
0, 0, 0, 0,
}
#if NIMP > 0
,
{ SOCK_RAW, PF_IMPLINK, 0, PR_ATOMIC|PR_ADDR,
- 0, imp_output, imp_ctlinput, 0,
- imp_usrreq,
+ 0, rimp_output, 0, 0,
+ raw_usrreq,
+ 0, 0, hostslowtimo, 0,
+}
+#endif
+#if NPUP > 0
+,
+{ SOCK_RAW, PF_PUP, 0, PR_ATOMIC|PR_ADDR,
+ 0, rpup_output, 0, 0,
+ raw_usrreq,
0, 0, 0, 0,
}
#endif
0, 0, 0, 0,
}
#endif
@@
-123,10
+141,11
@@
pfinit()
{
register struct protosw *pr;
{
register struct protosw *pr;
-COUNT(PFINIT);
for (pr = protoswLAST; pr >= protosw; pr--)
if (pr->pr_init)
(*pr->pr_init)();
for (pr = protoswLAST; pr >= protosw; pr--)
if (pr->pr_init)
(*pr->pr_init)();
+ pffasttimo();
+ pfslowtimo();
}
/*
}
/*
@@
-139,7
+158,6
@@
pffindtype(family, type)
{
register struct protosw *pr;
{
register struct protosw *pr;
-COUNT(PFFINDTYPE);
if (family == 0)
return (0);
for (pr = protosw; pr <= protoswLAST; pr++)
if (family == 0)
return (0);
for (pr = protosw; pr <= protoswLAST; pr++)
@@
-157,7
+175,6
@@
pffindproto(family, protocol)
{
register struct protosw *pr;
{
register struct protosw *pr;
-COUNT(PFFINDPROTO);
if (family == 0)
return (0);
for (pr = protosw; pr <= protoswLAST; pr++)
if (family == 0)
return (0);
for (pr = protosw; pr <= protoswLAST; pr++)
@@
-166,6
+183,17
@@
COUNT(PFFINDPROTO);
return (0);
}
return (0);
}
+pfctlinput(cmd, arg)
+ int cmd;
+ caddr_t arg;
+{
+ register struct protosw *pr;
+
+ for (pr = protosw; pr <= protoswLAST; pr++)
+ if (pr->pr_ctlinput)
+ (*pr->pr_ctlinput)(cmd, arg);
+}
+
/*
* Slow timeout on all protocols.
*/
/*
* Slow timeout on all protocols.
*/
@@
-173,18
+201,18
@@
pfslowtimo()
{
register struct protosw *pr;
{
register struct protosw *pr;
-COUNT(PFSLOWTIMO);
for (pr = protoswLAST; pr >= protosw; pr--)
if (pr->pr_slowtimo)
(*pr->pr_slowtimo)();
for (pr = protoswLAST; pr >= protosw; pr--)
if (pr->pr_slowtimo)
(*pr->pr_slowtimo)();
+ timeout(pfslowtimo, 0, hz / PR_SLOWHZ);
}
pffasttimo()
{
register struct protosw *pr;
}
pffasttimo()
{
register struct protosw *pr;
-COUNT(PFSLOWTIMO);
for (pr = protoswLAST; pr >= protosw; pr--)
if (pr->pr_fasttimo)
(*pr->pr_fasttimo)();
for (pr = protoswLAST; pr >= protosw; pr--)
if (pr->pr_fasttimo)
(*pr->pr_fasttimo)();
+ timeout(pffasttimo, 0, hz / PR_FASTHZ);
}
}