xref: /netbsd-src/sys/netatalk/at_proto.c (revision 3b01aba77a7a698587faaae455bbfe740923c1f5)
1 /*	$NetBSD: at_proto.c,v 1.2 1999/01/14 01:19:29 thorpej Exp $	*/
2 
3 /*
4  * Copyright (c) 1990,1991 Regents of The University of Michigan.
5  * All Rights Reserved.
6  *
7  * Permission to use, copy, modify, and distribute this software and
8  * its documentation for any purpose and without fee is hereby granted,
9  * provided that the above copyright notice appears in all copies and
10  * that both that copyright notice and this permission notice appear
11  * in supporting documentation, and that the name of The University
12  * of Michigan not be used in advertising or publicity pertaining to
13  * distribution of the software without specific, written prior
14  * permission. This software is supplied as is without expressed or
15  * implied warranties of any kind.
16  *
17  * This product includes software developed by the University of
18  * California, Berkeley and its contributors.
19  *
20  *	Research Systems Unix Group
21  *	The University of Michigan
22  *	c/o Wesley Craig
23  *	535 W. William Street
24  *	Ann Arbor, Michigan
25  *	+1-313-764-2278
26  *	netatalk@umich.edu
27  */
28 
29 #include <sys/param.h>
30 #include <sys/systm.h>
31 #include <sys/protosw.h>
32 #include <sys/domain.h>
33 #include <sys/types.h>
34 #include <sys/socket.h>
35 
36 #include <sys/kernel.h>
37 #include <net/if.h>
38 #include <net/radix.h>
39 #include <net/if_ether.h>
40 #include <netinet/in.h>
41 #include <net/route.h>
42 
43 #include <netatalk/at.h>
44 #include <netatalk/ddp.h>
45 #include <netatalk/at_var.h>
46 #include <netatalk/ddp_var.h>
47 #include <netatalk/at_extern.h>
48 
49 
50 struct protosw		atalksw[] = {
51     {
52 	/* Identifiers */
53 	SOCK_DGRAM,	&atalkdomain,	ATPROTO_DDP,	PR_ATOMIC|PR_ADDR,
54 	/*
55 	 * protocol-protocol interface.
56 	 * fields are pr_input, pr_output, pr_ctlinput, and pr_ctloutput.
57 	 * pr_input can be called from the udp protocol stack for iptalk
58 	 * packets bound for a local socket.
59 	 * pr_output can be used by higher level appletalk protocols, should
60 	 * they be included in the kernel.
61 	 */
62 	0,		ddp_output,	0,		0,
63 	/* socket-protocol interface. */
64 	ddp_usrreq,
65 	/* utility routines. */
66 	ddp_init,	0,		0,		0,
67     },
68 };
69 
70 struct domain		atalkdomain = {
71     PF_APPLETALK,	"appletalk",	0,	0,	0,
72     atalksw, &atalksw[sizeof(atalksw)/sizeof(atalksw[0])],
73     0, rn_inithead,
74     32,
75     sizeof(struct sockaddr_at)
76 };
77 
78 
79