]>
git.saurik.com Git - apple/xnu.git/blob - bsd/netat/at_proto.c
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
26 * Copyright (c) 1998 Apple Computer, Inc.
32 #include <sys/param.h>
33 #include <sys/systm.h>
34 #include <sys/ioctl.h>
35 #include <sys/errno.h>
36 #include <sys/malloc.h>
37 #include <sys/socket.h>
38 #include <sys/socketvar.h>
39 #include <sys/protosw.h>
40 #include <sys/domain.h>
43 #include <sys/sysctl.h>
47 #include <netat/appletalk.h>
48 #include <netat/at_var.h>
49 #include <netat/ddp.h>
51 struct domain atalkdomain
;
53 extern int ddp_pru_abort(struct socket
*so
);
55 extern int ddp_pru_attach(struct socket
*so
, int proto
,
57 extern int ddp_pru_bind(struct socket
*so
, struct sockaddr
*nam
,
59 extern int ddp_pru_connect(struct socket
*so
, struct sockaddr
*nam
,
62 extern int ddp_pru_control(struct socket
*so
, u_long cmd
, caddr_t data
,
63 struct ifnet
*ifp
, struct proc
*p
);
64 extern int ddp_pru_detach(struct socket
*so
);
65 extern int ddp_pru_disconnect(struct socket
*so
);
67 extern int ddp_pru_peeraddr(struct socket
*so
,
68 struct sockaddr
**nam
);
70 extern int ddp_pru_send(struct socket
*so
, int flags
, struct mbuf
*m
,
71 struct sockaddr
*addr
, struct mbuf
*control
,
74 extern int ddp_pru_shutdown(struct socket
*so
);
75 extern int ddp_pru_sockaddr(struct socket
*so
,
76 struct sockaddr
**nam
);
79 * Dummy usrreqs struct created by Ted for FreeBSD 3.x integration.
80 * Fill in supported functions as appropriate.
82 struct pr_usrreqs ddp_usrreqs
= {
83 ddp_pru_abort
, pru_accept_notsupp
, ddp_pru_attach
, ddp_pru_bind
,
84 ddp_pru_connect
, pru_connect2_notsupp
, ddp_pru_control
, ddp_pru_detach
,
85 ddp_pru_disconnect
, pru_listen_notsupp
, ddp_pru_peeraddr
, pru_rcvd_notsupp
,
86 pru_rcvoob_notsupp
, ddp_pru_send
, pru_sense_null
, ddp_pru_shutdown
,
87 ddp_pru_sockaddr
, sosend
, soreceive
, sopoll
90 struct protosw atalksw
[] = {
91 { SOCK_RAW
, &atalkdomain
, /*protocol*/ 0, PR_ATOMIC
|PR_ADDR
,
92 /*input*/ 0, /*output*/ 0, /*clinput*/ 0, ddp_ctloutput
,
94 ddp_init
, /*fastto*/ 0, /*slowto*/ 0, /*drain*/ 0,
95 /*sysctl*/ 0, &ddp_usrreqs
99 struct domain atalkdomain
=
100 { AF_APPLETALK
, "appletalk", 0, 0, 0,
106 SYSCTL_NODE(_net
, PF_APPLETALK
, appletalk
, CTLFLAG_RW
, 0, "AppleTalk Family");