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