/* uipc_proto.c 4.18 82/03/13 */
#include "../h/protosw.h"
#include "../net/in_systm.h"
* Protocol configuration table and routines to search it.
* SHOULD INCLUDE A HEADER FILE GIVING DESIRED PROTOCOLS
* Local protocol handler.
* TCP/IP protocol family: IP, ICMP, UDP, TCP.
int ip_init(),ip_slowtimo(),ip_drain();
int icmp_input(),icmp_ctlinput();
int udp_input(),udp_ctlinput();
int tcp_input(),tcp_ctlinput();
int tcp_init(),tcp_fasttimo(),tcp_slowtimo(),tcp_drain();
int rip_input(),rip_output(),rip_ctlinput(),rip_usrreq();
* IMP protocol family: raw interface
int rimp_usrreq(),rimp_output(),rimp_ctlinput();
* PUP-I protocol family: raw interface
int rpup_output(),rpup_ctlinput();
int raw_init(),raw_usrreq(),raw_input();
struct protosw protosw
[] = {
{ SOCK_STREAM
, PF_UNIX
, 0, PR_CONNREQUIRED
,
{ SOCK_DGRAM
, PF_UNIX
, 0, PR_ATOMIC
|PR_ADDR
,
{ SOCK_RDM
, PF_UNIX
, 0, PR_ATOMIC
|PR_ADDR
,
{ SOCK_RAW
, PF_UNIX
, 0, PR_ATOMIC
|PR_ADDR
,
ip_init
, 0, ip_slowtimo
, ip_drain
,
icmp_input
, 0, icmp_ctlinput
, 0,
{ SOCK_DGRAM
, PF_INET
, IPPROTO_UDP
, PR_ATOMIC
|PR_ADDR
,
udp_input
, 0, udp_ctlinput
, 0,
{ SOCK_STREAM
, PF_INET
, IPPROTO_TCP
, PR_CONNREQUIRED
|PR_WANTRCVD
,
tcp_input
, 0, tcp_ctlinput
, 0,
tcp_init
, tcp_fasttimo
, tcp_slowtimo
, tcp_drain
,
{ SOCK_RAW
, PF_INET
, IPPROTO_RAW
, PR_ATOMIC
|PR_ADDR
,
rip_input
, rip_output
, rip_ctlinput
, 0,
{ SOCK_RAW
, PF_IMPLINK
, 0, PR_ATOMIC
|PR_ADDR
,
0, rimp_output
, rimp_ctlinput
, 0,
{ SOCK_RAW
, PF_PUP
, 0, PR_ATOMIC
|PR_ADDR
,
0, rpup_output
, rpup_ctlinput
, 0,
#define NPROTOSW (sizeof(protosw) / sizeof(protosw[0]))
struct protosw
*protoswLAST
= &protosw
[NPROTOSW
-1];
* Operations on protocol table and protocol families.
* Initialize all protocols.
register struct protosw
*pr
;
for (pr
= protoswLAST
; pr
>= protosw
; pr
--)
* Find a standard protocol in a protocol family
register struct protosw
*pr
;
for (pr
= protosw
; pr
<= protoswLAST
; pr
++)
if (pr
->pr_family
== family
&& pr
->pr_type
== type
)
* Find a specified protocol in a specified protocol family.
pffindproto(family
, protocol
)
register struct protosw
*pr
;
for (pr
= protosw
; pr
<= protoswLAST
; pr
++)
if (pr
->pr_family
== family
&& pr
->pr_protocol
== protocol
)
* Slow timeout on all protocols.
register struct protosw
*pr
;
for (pr
= protoswLAST
; pr
>= protosw
; pr
--)
register struct protosw
*pr
;
for (pr
= protoswLAST
; pr
>= protosw
; pr
--)