]>
git.saurik.com Git - apple/xnu.git/blob - bsd/netat/adsp_CLListen.c
a7215f0947bd63056799a4b244c6be74431decab
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
30 * From Mike Shoemaker v01.02 04/19/90 mbs
31 * Modified, April 9, 1997 by Tuyen Nguyen for MacOSX.
34 #include <sys/errno.h>
35 #include <sys/types.h>
36 #include <sys/param.h>
37 #include <machine/spl.h>
38 #include <sys/systm.h>
39 #include <sys/kernel.h>
41 #include <sys/filedesc.h>
42 #include <sys/fcntl.h>
44 #include <sys/socket.h>
46 #include <netat/sysglue.h>
47 #include <netat/appletalk.h>
48 #include <netat/at_pcb.h>
49 #include <netat/debug.h>
50 #include <netat/adsp.h>
51 #include <netat/adsp_internal.h>
57 * --> ccbRefNum refnum of connection end
58 * --> filterAddress filter for incoming open connection requests
61 * <-- remoteCID connection identifier of remote connection end
62 * <-- remoteAddress internet address of remote connection end
63 * <-- sendSeq initial send sequence number to use
64 * <-- sendWindow initial size of remote end's receive buffer
65 * <-- attnSendSeq initial attention send sequence number to use
68 * errRefNum bad connection refnum
69 * errState not a connection listener
70 * errAborted request aborted by a Remove call
72 int adspCLListen(sp
, pb
) /* (DSPPBPtr pb) */
74 register struct adspcmd
*pb
;
76 register struct adspcmd
*clpb
;
80 pb
->ioResult
= errRefNum
;
84 if (sp
->state
!= sListening
) { /* But this isn't a connection listener! */
85 pb
->ioResult
= errState
;
89 if ((mp
= gbuf_copym(pb
->mp
))) { /* keep a copy of the parameter block */
90 pb
->ioResult
= 1; /* not done */
91 adspioc_ack(0, (gbuf_t
*)pb
->ioc
, pb
->gref
); /* release user ioctl block */
92 clpb
= (struct adspcmd
*)gbuf_rptr(mp
);
95 if (qAddToEnd((struct qlink
**)&sp
->opb
, (struct qlink
*)clpb
)) /* Add to list of listeners */
96 return EFAULT
; /* bogus, but discriminate from other errors */
98 pb
->ioResult
= errDSPQueueSize
;