/* uipc_proto.c 4.6 81/11/20 */
#include "../h/protosw.h"
#include "../net/inet_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_input(),ip_output();
int ip_init(),ip_slowtimo(),ip_drain();
int udp_input(),udp_ctlinput();
int udp_usrreq(),udp_sense();
int tcp_input(),tcp_ctlinput();
int tcp_usrreq(),tcp_sense();
int tcp_init(),tcp_fasttimo(),tcp_slowtimo(),tcp_drain();
int rip_input(),rip_ctlinput();
int rip_usrreq(),rip_sense();
struct protosw protosw
[] = {
{ SOCK_STREAM
, PF_LOCAL
, 0, PR_CONNREQUIRED
,
{ SOCK_DGRAM
, PF_LOCAL
, 0, PR_ATOMIC
|PR_ADDR
,
{ SOCK_RDM
, PF_LOCAL
, 0, PR_ATOMIC
|PR_ADDR
,
{ SOCK_RAW
, PF_LOCAL
, 0, PR_ATOMIC
|PR_ADDR
,
ip_input
, ip_output
, 0, 0,
ip_init
, 0, ip_slowtimo
, ip_drain
,
{ SOCK_DGRAM
, PF_INET
, IPPROTO_UDP
, PR_ATOMIC
|PR_ADDR
,
udp_input
, 0, udp_ctlinput
, 0,
udp_usrreq
, udp_sense
, MLEN
,
{ SOCK_STREAM
, PF_INET
, IPPROTO_TCP
, PR_CONNREQUIRED
,
tcp_input
, 0, tcp_ctlinput
, 0,
tcp_usrreq
, tcp_sense
, MLEN
,
tcp_init
, tcp_fasttimo
, tcp_slowtimo
, tcp_drain
,
{ SOCK_RAW
, PF_INET
, IPPROTO_RAW
, PR_ATOMIC
|PR_ADDR
,
rip_input
, 0, rip_ctlinput
, 0,
rip_usrreq
, rip_sense
, MLEN
,
#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
)