]>
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 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
23 * Copyright (c) 1998 Apple Computer, Inc.
29 #include <sys/param.h>
30 #include <sys/systm.h>
31 #include <sys/ioctl.h>
32 #include <sys/errno.h>
33 #include <sys/malloc.h>
34 #include <sys/socket.h>
35 #include <sys/socketvar.h>
36 #include <sys/protosw.h>
37 #include <sys/domain.h>
40 #include <sys/sysctl.h>
44 #include <netat/appletalk.h>
45 #include <netat/at_var.h>
46 #include <netat/ddp.h>
48 struct domain atalkdomain
;
50 extern int ddp_pru_abort(struct socket
*so
);
52 extern int ddp_pru_attach(struct socket
*so
, int proto
,
54 extern int ddp_pru_bind(struct socket
*so
, struct sockaddr
*nam
,
56 extern int ddp_pru_connect(struct socket
*so
, struct sockaddr
*nam
,
59 extern int ddp_pru_control(struct socket
*so
, u_long cmd
, caddr_t data
,
60 struct ifnet
*ifp
, struct proc
*p
);
61 extern int ddp_pru_detach(struct socket
*so
);
62 extern int ddp_pru_disconnect(struct socket
*so
);
64 extern int ddp_pru_peeraddr(struct socket
*so
,
65 struct sockaddr
**nam
);
67 extern int ddp_pru_send(struct socket
*so
, int flags
, struct mbuf
*m
,
68 struct sockaddr
*addr
, struct mbuf
*control
,
71 extern int ddp_pru_shutdown(struct socket
*so
);
72 extern int ddp_pru_sockaddr(struct socket
*so
,
73 struct sockaddr
**nam
);
76 * Dummy usrreqs struct created by Ted for FreeBSD 3.x integration.
77 * Fill in supported functions as appropriate.
79 struct pr_usrreqs ddp_usrreqs
= {
80 ddp_pru_abort
, pru_accept_notsupp
, ddp_pru_attach
, ddp_pru_bind
,
81 ddp_pru_connect
, pru_connect2_notsupp
, ddp_pru_control
, ddp_pru_detach
,
82 ddp_pru_disconnect
, pru_listen_notsupp
, ddp_pru_peeraddr
, pru_rcvd_notsupp
,
83 pru_rcvoob_notsupp
, ddp_pru_send
, pru_sense_null
, ddp_pru_shutdown
,
84 ddp_pru_sockaddr
, sosend
, soreceive
, sopoll
87 struct protosw atalksw
[] = {
88 { SOCK_RAW
, &atalkdomain
, /*protocol*/ 0, PR_ATOMIC
|PR_ADDR
,
89 /*input*/ 0, /*output*/ 0, /*clinput*/ 0, ddp_ctloutput
,
91 ddp_init
, /*fastto*/ 0, /*slowto*/ 0, /*drain*/ 0,
92 /*sysctl*/ 0, &ddp_usrreqs
96 struct domain atalkdomain
=
97 { AF_APPLETALK
, "appletalk", 0, 0, 0,
103 SYSCTL_NODE(_net
, PF_APPLETALK
, appletalk
, CTLFLAG_RW
, 0, "AppleTalk Family");