]> git.saurik.com Git - apple/xnu.git/blame - bsd/netat/asp.h
xnu-792.13.8.tar.gz
[apple/xnu.git] / bsd / netat / asp.h
CommitLineData
1c79356b 1/*
5d5c5d0d
A
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
8ad349bb 4 * @APPLE_LICENSE_OSREFERENCE_HEADER_START@
1c79356b 5 *
8ad349bb
A
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
10 * License may not be used to create, or enable the creation or
11 * redistribution of, unlawful or unlicensed copies of an Apple operating
12 * system, or to circumvent, violate, or enable the circumvention or
13 * violation of, any terms of an Apple operating system software license
14 * agreement.
15 *
16 * Please obtain a copy of the License at
17 * http://www.opensource.apple.com/apsl/ and read it before using this
18 * file.
19 *
20 * The Original Code and all software distributed under the License are
21 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
22 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
23 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
25 * Please see the License for the specific language governing rights and
26 * limitations under the License.
27 *
28 * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
1c79356b
A
29 */
30/*
31 *
32 * ORIGINS: 82
33 *
34 * (C) COPYRIGHT Apple Computer, Inc. 1992-1996
35 * All Rights Reserved
36 *
37 */
38
39#ifndef _NETAT_ASP_H_
40#define _NETAT_ASP_H_
9bccf70c 41#include <sys/appleapiopts.h>
1c79356b 42
91447636
A
43#ifdef __APPLE_API_OBSOLETE
44
1c79356b
A
45#define ASP_Version 0x100
46
47#define ASPFUNC_CloseSess 1
48#define ASPFUNC_Command 2
49#define ASPFUNC_GetStatus 3
50#define ASPFUNC_OpenSess 4
51#define ASPFUNC_Tickle 5
52#define ASPFUNC_Write 6
53#define ASPFUNC_WriteContinue 7
54#define ASPFUNC_Attention 8
55#define ASPFUNC_CmdReply 9
56
57#define ASPIOC 210 /* AT_MID_ASP */
58#define ASPIOC_ClientBind ((ASPIOC<<8) | 1)
59#define ASPIOC_CloseSession ((ASPIOC<<8) | 2)
60#define ASPIOC_GetLocEntity ((ASPIOC<<8) | 3)
61#define ASPIOC_GetRemEntity ((ASPIOC<<8) | 4)
62#define ASPIOC_GetSession ((ASPIOC<<8) | 5)
63#define ASPIOC_GetStatus ((ASPIOC<<8) | 6)
64#define ASPIOC_ListenerBind ((ASPIOC<<8) | 7)
65#define ASPIOC_OpenSession ((ASPIOC<<8) | 8)
66#define ASPIOC_StatusBlock ((ASPIOC<<8) | 9)
67#define ASPIOC_SetPid ((ASPIOC<<8) |10)
68#define ASPIOC_GetSessId ((ASPIOC<<8) |11)
69#define ASPIOC_EnableSelect ((ASPIOC<<8) |12) /* not needed */
70#define ASPIOC_Look ((ASPIOC<<8) |13)
71
72#define MOREDATA 1
73
74/* The following ASP error codes are defined in Inside AppleTalk: */
75
76#define ASPERR_NoError 0
77#define ASPERR_BadVersNum -1066
78#define ASPERR_BufTooSmall -1067
79#define ASPERR_NoMoreSessions -1068
80#define ASPERR_NoServers -1069
81#define ASPERR_ParamErr -1070
82#define ASPERR_ServerBusy -1071
83#define ASPERR_SessClosed -1072
84#define ASPERR_SizeErr -1073
85#define ASPERR_TooManyClients -1074
86#define ASPERR_NoAck -1075
87
88/* These ASP error codes were apparently defined later: */
89
90#define ASPERR_NoSuchDevice -1058
91#define ASPERR_BindErr -1059
92#define ASPERR_CmdReply -1060
93#define ASPERR_CmdRequest -1061
94#define ASPERR_SystemErr -1062
95#define ASPERR_ProtoErr -1063
96#define ASPERR_NoSuchEntity -1064
97#define ASPERR_RegisterErr -1065
98
99typedef struct {
100 at_inet_t SLSEntityIdentifier;
101 at_retry_t Retry;
102 int StatusBufferSize;
103} asp_status_cmd_t;
104
105typedef struct {
106 at_inet_t SLSEntityIdentifier;
107 at_retry_t Retry;
108 unsigned short TickleInterval;
109 unsigned short SessionTimer;
110} asp_open_cmd_t;
111
112typedef struct {
113 int Primitive;
114 int CmdResult;
115 unsigned short ReqRefNum;
116 unsigned short Filler;
117} asp_cmdreply_req_t;
118
119typedef struct {
120 int Primitive;
121 int CmdResult;
122} asp_cmdreply_ind_t;
123
124typedef struct {
125 int Primitive;
126 unsigned short ReqRefNum;
127 unsigned char ReqType;
128 unsigned char Filler;
129} asp_command_ind_t;
130
131union asp_primitives {
132 int Primitive;
133 asp_cmdreply_ind_t CmdReplyInd;
134 asp_cmdreply_req_t CmdReplyReq;
135 asp_command_ind_t CommandInd;
136};
137
91447636 138#ifdef KERNEL_PRIVATE
1c79356b
A
139
140#define ASPSTATE_Close 0
141#define ASPSTATE_Idle 1
142#define ASPSTATE_WaitingForGetStatusRsp 2
143#define ASPSTATE_WaitingForOpenSessRsp 3
144#define ASPSTATE_WaitingForCommandRsp 4
145#define ASPSTATE_WaitingForWriteContinue 5
146#define ASPSTATE_WaitingForWriteRsp 6
147#define ASPSTATE_WaitingForWriteContinueRsp 7
148#define ASPSTATE_WaitingForCloseSessRsp 8
149#ifdef NOT_USED
150#define ASPSTATE_WaitingForCfgAck 9
151#endif
152
153/*
154 * ATP state block
155 */
156typedef struct {
157 gref_t *atp_gref; /* gref must be the first entry */
158 int pid; /* process id, must be the second entry */
159 gbuf_t *atp_msgq; /* data msg, must be the third entry */
160 unsigned char dflag; /* structure flag, must be the fourth entry */
161 unsigned char filler[3];
162} atp_state_t;
163
164/*
165 * ASP word
166 */
167typedef struct {
168 unsigned char func;
169 unsigned char param1;
170 unsigned short param2;
171} asp_word_t;
172
173/*
174 * ASP session control block
175 */
176typedef struct asp_scb {
177 gref_t *gref; /* read queue pointer, must be the first entry */
178 int pid; /* process id, must be the second entry */
179 atp_state_t *atp_state; /* atp state info, must be the third entry */
180 unsigned char dflag; /* structure flag, must be the fourth entry */
181 unsigned char state;
182 unsigned char sess_id;
183 unsigned char tmo_delta;
184 unsigned char tmo_cnt;
185 unsigned char rem_socket;
186 unsigned char rem_node;
187 unsigned char magic_num;
188 unsigned short snd_seq_num;
189 unsigned short rcv_seq_num;
190 unsigned short filler;
191 unsigned short tickle_tid;
192 unsigned short tickle_interval;
193 unsigned short session_timer;
194 unsigned short attn_tid;
195 unsigned char attn_flag;
196 unsigned char req_flag;
197 gbuf_t *req_msgq;
198 unsigned short wrt_seq_num;
199 unsigned char get_wait;
200 unsigned char ioc_wait;
201 at_retry_t cmd_retry;
202 at_inet_t loc_addr;
203 at_inet_t rem_addr;
204 at_inet_t svc_addr;
205 gbuf_t *sess_ioc;
206 gbuf_t *stat_msg;
207 void (*tmo_func)();
208 struct asp_scb *next_tmo;
209 struct asp_scb *prev_tmo;
210 struct asp_scb *sess_scb;
211 struct asp_scb *next_scb;
212 struct asp_scb *prev_scb;
213 unsigned char sel_on; /* not needed */
214 unsigned char user;
215 unsigned char rcv_cnt;
216 unsigned char snd_stop;
217 unsigned char reply_socket;
218 unsigned char if_num;
219 unsigned char pad[2];
220 atlock_t lock;
221 atlock_t delay_lock;
222 atevent_t event;
223 atevent_t delay_event;
224} asp_scb_t;
225
91447636
A
226#endif /* KERNEL_PRIVATE */
227#endif /* __APPLE_API_OBSOLETE */
1c79356b 228#endif /* _NETAT_ASP_H_ */