/********************************************************************** * Copyright (c) Digital Equipment Corporation 1984, 1985, 1986. * * All Rights Reserved. * * Reference "/usr/src/COPYRIGHT" for applicable restrictions. * **********************************************************************/ /* * Copyright (c) 1982 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * * SCCSID: @(#)in_proto.c 3.0 4/21/86 * Based on: @(#)in_proto.c 6.8 (Berkeley) 6/8/85 */ #include <sys/param.h> #include <sys/socket.h> #include <sys/protosw.h> #include <sys/domain.h> #include <sys/mbuf.h> #include <netinet/in.h> #include <netinet/in_systm.h> #include <netinet/tcp.h> /* for #define tcp_usrreq ... */ /* * TCP/IP protocol family: IP, ICMP, UDP, TCP. */ int ip_output(); int ip_init(),ip_slowtimo(),ip_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 rip_input(),rip_output(); extern int raw_usrreq(); #ifndef UNIX_DOMAIN int raw_init(); #endif UNIX_DOMAIN /* * IMP protocol family: raw interface. * Using the raw interface entry to get the timer routine * in is a kludge. */ #if NIMP > 0 int rimp_output(), hostslowtimo(); #endif #ifdef NSIP int idpip_input(); #endif extern struct domain inetdomain; struct protosw inetsw[] = { { 0, &inetdomain, IPPROTO_IP, 0, 0, ip_output, 0, 0, 0, ip_init, 0, ip_slowtimo, ip_drain, 0, 0, 0, }, { SOCK_DGRAM, &inetdomain, IPPROTO_UDP, PR_ATOMIC|PR_ADDR, udp_input, 0, udp_ctlinput, 0, udp_usrreq, udp_init, 0, 0, 0, 0, 0, 0, }, { SOCK_STREAM, &inetdomain, IPPROTO_TCP, PR_CONNREQUIRED|PR_WANTRCVD, tcp_input, 0, tcp_ctlinput, 0, tcp_usrreq, tcp_init, tcp_fasttimo, tcp_slowtimo, tcp_drain, 0, 0, 0, }, { SOCK_RAW, &inetdomain, IPPROTO_RAW, PR_ATOMIC|PR_ADDR, rip_input, rip_output, 0, 0, raw_usrreq, #ifdef UNIX_DOMAIN 0, 0, 0, 0, #else UNIX_DOMAIN raw_init, 0, 0, 0, #endif UNIX_DOMAIN 0, 0, 0, }, { SOCK_RAW, &inetdomain, IPPROTO_ICMP, PR_ATOMIC|PR_ADDR, icmp_input, rip_output, 0, 0, raw_usrreq, 0, 0, 0, 0, 0, 0, 0, }, #ifdef NSIP { SOCK_RAW, &inetdomain, IPPROTO_PUP, PR_ATOMIC|PR_ADDR, idpip_input, rip_output, 0, 0, raw_usrreq, 0, 0, 0, 0, 0, 0, 0, }, #endif /* raw wildcard */ { SOCK_RAW, &inetdomain, 0, PR_ATOMIC|PR_ADDR, rip_input, rip_output, 0, 0, raw_usrreq, 0, 0, 0, 0, 0, 0, 0, }, }; struct domain inetdomain = { AF_INET, "internet", 0, 0, 0, inetsw, &inetsw[sizeof(inetsw)/sizeof(inetsw[0])] }; #if NIMP > 0 extern struct domain impdomain; struct protosw impsw[] = { { SOCK_RAW, &impdomain, 0, PR_ATOMIC|PR_ADDR, 0, rimp_output, 0, 0, raw_usrreq, 0, 0, hostslowtimo, 0, 0, 0, 0, }, }; struct domain impdomain = { AF_IMPLINK, "imp", 0, 0, 0, impsw, &impsw[sizeof (impsw)/sizeof(impsw[0])] }; #endif