]>
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(struct adspcmd
*pb
, CCBPtr sp
)
69 ADSP_OPEN_DATAPtr adspop
;
72 pb
->ioResult
= errRefNum
;
75 mp
= gbuf_alloc(AT_WR_OFFSET
+ DDPL_FRAME_LEN
+ ADSP_FRAME_LEN
+ ADSP_OPEN_FRAME_LEN
,
77 gbuf_rinc(mp
,AT_WR_OFFSET
);
78 gbuf_wset(mp
,DDPL_FRAME_LEN
);
79 adspp
= (ADSP_FRAMEPtr
)gbuf_wptr(mp
);
80 gbuf_winc(mp
,ADSP_FRAME_LEN
);
81 bzero((caddr_t
) gbuf_rptr(mp
),DDPL_FRAME_LEN
+ ADSP_FRAME_LEN
+ ADSP_OPEN_FRAME_LEN
);
82 adspp
->descriptor
= ADSP_CONTROL_BIT
| ADSP_CTL_ODENY
;
83 adspop
= (ADSP_OPEN_DATAPtr
)gbuf_wptr(mp
);
84 gbuf_winc(mp
,ADSP_OPEN_FRAME_LEN
);
85 UAS_ASSIGN(adspop
->dstCID
, pb
->u
.openParams
.remoteCID
);
86 UAS_ASSIGN(adspop
->version
, 0x100);
88 DDPL_FRAME_LEN
+ ADSP_FRAME_LEN
+ ADSP_OPEN_FRAME_LEN
,
89 &pb
->u
.openParams
.remoteAddress
, DDP_ADSP
);
90 adspioc_ack(0, pb
->ioc
, pb
->gref
);