]>
git.saurik.com Git - apple/xnu.git/blob - bsd/netat/adsp_CLDeny.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@
25 * From Mike Shoemaker 9/6/90
26 * Modified, April 9, 1997 by Tuyen Nguyen for MacOSX.
29 #include <sys/errno.h>
30 #include <sys/types.h>
31 #include <sys/param.h>
32 #include <machine/spl.h>
33 #include <sys/systm.h>
34 #include <sys/kernel.h>
36 #include <sys/filedesc.h>
37 #include <sys/fcntl.h>
39 #include <sys/socket.h>
41 #include <netat/sysglue.h>
42 #include <netat/appletalk.h>
43 #include <netat/ddp.h>
44 #include <netat/at_pcb.h>
45 #include <netat/debug.h>
46 #include <netat/adsp.h>
47 #include <netat/adsp_internal.h>
53 * --> ccbRefNum refnum of connection listener
54 * --> remoteCID connection identifier of remote connection end
55 * --> remoteAddress internet address of remote connection end
61 * errRefNum bad connection refnum
62 * errState not a connection listener
63 * errAborted request aborted by a Remove call
65 int adspCLDeny(sp
, pb
) /* (DSPPBPtr pb) */
71 ADSP_OPEN_DATAPtr adspop
;
74 pb
->ioResult
= errRefNum
;
77 mp
= gbuf_alloc(AT_WR_OFFSET
+ DDPL_FRAME_LEN
+ ADSP_FRAME_LEN
+ ADSP_OPEN_FRAME_LEN
,
79 gbuf_rinc(mp
,AT_WR_OFFSET
);
80 gbuf_wset(mp
,DDPL_FRAME_LEN
);
81 adspp
= (ADSP_FRAMEPtr
)gbuf_wptr(mp
);
82 gbuf_winc(mp
,ADSP_FRAME_LEN
);
83 bzero((caddr_t
) gbuf_rptr(mp
),DDPL_FRAME_LEN
+ ADSP_FRAME_LEN
+ ADSP_OPEN_FRAME_LEN
);
84 adspp
->descriptor
= ADSP_CONTROL_BIT
| ADSP_CTL_ODENY
;
85 adspop
= (ADSP_OPEN_DATAPtr
)gbuf_wptr(mp
);
86 gbuf_winc(mp
,ADSP_OPEN_FRAME_LEN
);
87 UAS_ASSIGN(adspop
->dstCID
, pb
->u
.openParams
.remoteCID
);
88 UAS_ASSIGN(adspop
->version
, 0x100);
90 DDPL_FRAME_LEN
+ ADSP_FRAME_LEN
+ ADSP_OPEN_FRAME_LEN
,
91 &pb
->u
.openParams
.remoteAddress
, DDP_ADSP
);
92 adspioc_ack(0, pb
->ioc
, pb
->gref
);