-
Notifications
You must be signed in to change notification settings - Fork 0
/
AppleTalk.h
2542 lines (2298 loc) · 82.6 KB
/
AppleTalk.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
File: AppleTalk.h
Contains: AppleTalk Interfaces.
Version: Technology: System 8.5
Release: Universal Interfaces 3.4
Copyright: © 1985-2001 by Apple Computer, Inc., all rights reserved
Bugs?: For bug reports, consult the following page on
the World Wide Web:
http://developer.apple.com/bugreporter/
*/
#ifndef __APPLETALK__
#define __APPLETALK__
#ifndef __MACTYPES__
#include <MacTypes.h>
#endif
#ifndef __OSUTILS__
#include <OSUtils.h>
#endif
#if PRAGMA_ONCE
#pragma once
#endif
#ifdef __cplusplus
extern "C" {
#endif
#if PRAGMA_IMPORT
#pragma import on
#endif
#if PRAGMA_STRUCT_ALIGN
#pragma options align=mac68k
#elif PRAGMA_STRUCT_PACKPUSH
#pragma pack(push, 2)
#elif PRAGMA_STRUCT_PACK
#pragma pack(2)
#endif
enum {
/* Driver unit numbers (ADSP is dynamic) */
mppUnitNum = 9, /* MPP unit number */
atpUnitNum = 10, /* ATP unit number */
xppUnitNum = 40 /* XPP unit number */
};
enum {
/* Driver refNums (ADSP is dynamic) */
mppRefNum = -10, /* MPP reference number */
atpRefNum = -11, /* ATP reference number */
xppRefNum = -41 /* XPP reference number */
};
enum {
/* .MPP csCodes */
lookupReply = 242, /* This command queued to ourself */
writeLAP = 243, /* Write out LAP packet */
detachPH = 244, /* Detach LAP protocol handler */
attachPH = 245, /* Attach LAP protocol handler */
writeDDP = 246, /* Write out DDP packet */
closeSkt = 247, /* Close DDP socket */
openSkt = 248, /* Open DDP socket */
loadNBP = 249, /* Load NBP command-executing code */
lastResident = 249, /* Last resident command */
confirmName = 250, /* Confirm name */
lookupName = 251, /* Look up name on internet */
removeName = 252, /* Remove name from Names Table */
registerName = 253, /* Register name in Names Table */
killNBP = 254, /* Kill outstanding NBP request */
unloadNBP = 255, /* Unload NBP command code */
setSelfSend = 256, /* MPP: Set to allow writes to self */
SetMyZone = 257, /* Set my zone name */
GetATalkInfo = 258, /* get AppleTalk information */
ATalkClosePrep = 259 /* AppleTalk close query */
};
enum {
/* .ATP csCodes */
nSendRequest = 248, /* NSendRequest code */
relRspCB = 249, /* Release RspCB */
closeATPSkt = 250, /* Close ATP socket */
addResponse = 251, /* Add response code | Require open skt */
sendResponse = 252, /* Send response code */
getRequest = 253, /* Get request code */
openATPSkt = 254, /* Open ATP socket */
sendRequest = 255, /* Send request code */
relTCB = 256, /* Release TCB */
killGetReq = 257, /* Kill GetRequest */
killSendReq = 258, /* Kill SendRequest */
killAllGetReq = 259 /* Kill all getRequests for a skt */
};
enum {
/* .XPP csCodes */
openSess = 255, /* Open session */
closeSess = 254, /* Close session */
userCommand = 253, /* User command */
userWrite = 252, /* User write */
getStatus = 251, /* Get status */
afpCall = 250, /* AFP command (buffer has command code) */
getParms = 249, /* Get parameters */
abortOS = 248, /* Abort open session request */
closeAll = 247, /* Close all open sessions */
xCall = 246 /* .XPP extended calls */
};
enum {
/* Transition Queue transition types */
ATTransOpen = 0, /*AppleTalk has opened*/
ATTransClose = 2, /*AppleTalk is about to close*/
ATTransClosePrep = 3, /*Is it OK to close AppleTalk ?*/
ATTransCancelClose = 4 /*Cancel the ClosePrep transition*/
};
enum {
afpByteRangeLock = 1, /*AFPCall command codes*/
afpVolClose = 2, /*AFPCall command codes*/
afpDirClose = 3, /*AFPCall command codes*/
afpForkClose = 4, /*AFPCall command codes*/
afpCopyFile = 5, /*AFPCall command codes*/
afpDirCreate = 6, /*AFPCall command codes*/
afpFileCreate = 7, /*AFPCall command codes*/
afpDelete = 8, /*AFPCall command codes*/
afpEnumerate = 9, /*AFPCall command codes*/
afpFlush = 10, /*AFPCall command codes*/
afpForkFlush = 11, /*AFPCall command codes*/
afpGetDirParms = 12, /*AFPCall command codes*/
afpGetFileParms = 13, /*AFPCall command codes*/
afpGetForkParms = 14, /*AFPCall command codes*/
afpGetSInfo = 15, /*AFPCall command codes*/
afpGetSParms = 16, /*AFPCall command codes*/
afpGetVolParms = 17, /*AFPCall command codes*/
afpLogin = 18, /*AFPCall command codes*/
afpContLogin = 19, /*AFPCall command codes*/
afpLogout = 20, /*AFPCall command codes*/
afpMapID = 21, /*AFPCall command codes*/
afpMapName = 22, /*AFPCall command codes*/
afpMove = 23, /*AFPCall command codes*/
afpOpenVol = 24, /*AFPCall command codes*/
afpOpenDir = 25, /*AFPCall command codes*/
afpOpenFork = 26, /*AFPCall command codes*/
afpRead = 27, /*AFPCall command codes*/
afpRename = 28, /*AFPCall command codes*/
afpSetDirParms = 29, /*AFPCall command codes*/
afpSetFileParms = 30, /*AFPCall command codes*/
afpSetForkParms = 31, /*AFPCall command codes*/
afpSetVolParms = 32, /*AFPCall command codes*/
afpWrite = 33, /*AFPCall command codes*/
afpGetFlDrParms = 34, /*AFPCall command codes*/
afpSetFlDrParms = 35, /*AFPCall command codes*/
afpDTOpen = 48, /*AFPCall command codes*/
afpDTClose = 49, /*AFPCall command codes*/
afpGetIcon = 51, /*AFPCall command codes*/
afpGtIcnInfo = 52, /*AFPCall command codes*/
afpAddAPPL = 53, /*AFPCall command codes*/
afpRmvAPPL = 54, /*AFPCall command codes*/
afpGetAPPL = 55, /*AFPCall command codes*/
afpAddCmt = 56, /*AFPCall command codes*/
afpRmvCmt = 57, /*AFPCall command codes*/
afpGetCmt = 58, /*AFPCall command codes*/
afpAddIcon = 192 /*Special code for ASP Write commands*/
};
enum {
xppLoadedBit = 5, /* XPP bit in PortBUse */
scbMemSize = 192, /* Size of memory for SCB */
xppFlagClr = 0 /* Cs for AFPCommandBlock */
};
enum {
xppFlagSet = 128 /* StartEndFlag & NewLineFlag fields. */
};
enum {
lapSize = 20,
ddpSize = 26,
nbpSize = 26,
atpSize = 56
};
enum {
atpXOvalue = 32, /*ATP exactly-once bit */
atpEOMvalue = 16, /*ATP End-Of-Message bit */
atpSTSvalue = 8, /*ATP Send-Transmission-Status bit */
atpTIDValidvalue = 2, /*ATP trans. ID valid bit */
atpSendChkvalue = 1 /*ATP send checksum bit */
};
enum {
zipGetLocalZones = 5,
zipGetZoneList = 6,
zipGetMyZone = 7
};
enum {
LAPMgrPtr = 0x0B18 /*Entry point for LAP Manager*/
};
enum {
LAPMgrCall = 2, /*Offset to LAP routines*/
LAddAEQ = 23, /*LAPAddATQ routine selector*/
LRmvAEQ = 24 /*LAPRmvATQ routine selector*/
};
#define MPPioCompletion MPP.ioCompletion
#define MPPioResult MPP.ioResult
#define MPPioRefNum MPP.ioRefNum
#define MPPcsCode MPP.csCode
#define LAPprotType LAP.protType
#define LAPwdsPointer LAP.u.wdsPointer
#define LAPhandler LAP.u.handler
#define DDPsocket DDP.socket
#define DDPchecksumFlag DDP.checksumFlag
#define DDPwdsPointer DDP.u.wdsPointer
#define DDPlistener DDP.u.listener
#define NBPinterval NBP.interval
#define NBPcount NBP.count
#define NBPntQElPtr NBP.nbpPtrs.ntQElPtr
#define NBPentityPtr NBP.nbpPtrs.entityPtr
#define NBPverifyFlag NBP.parm.verifyFlag
#define NBPretBuffPtr NBP.parm.Lookup.retBuffPtr
#define NBPretBuffSize NBP.parm.Lookup.retBuffSize
#define NBPmaxToGet NBP.parm.Lookup.maxToGet
#define NBPnumGotten NBP.parm.Lookup.numGotten
#define NBPconfirmAddr NBP.parm.Confirm.confirmAddr
#define NBPnKillQEl NBPKILL.nKillQEl
#define NBPnewSocket NBP.parm.Confirm.newSocket
#define ATPioCompletion ATP.ioCompletion
#define ATPioResult ATP.ioResult
#define ATPuserData ATP.userData
#define ATPreqTID ATP.reqTID
#define ATPioRefNum ATP.ioRefNum
#define ATPcsCode ATP.csCode
#define ATPatpSocket ATP.atpSocket
#define ATPatpFlags ATP.atpFlags
#define ATPaddrBlock ATP.addrBlock
#define ATPreqLength ATP.reqLength
#define ATPreqPointer ATP.reqPointer
#define ATPbdsPointer ATP.bdsPointer
#define ATPtimeOutVal SREQ.timeOutVal
#define ATPnumOfResps SREQ.numOfResps
#define ATPretryCount SREQ.retryCount
#define ATPnumOfBuffs OTH1.u.numOfBuffs
#define ATPbitMap OTH1.u.bitMap
#define ATPrspNum OTH1.u.rspNum
#define ATPbdsSize OTH2.bdsSize
#define ATPtransID OTH2.transID
#define ATPaKillQEl KILL.aKillQEl
enum {
tLAPRead = 0,
tLAPWrite = 1,
tDDPRead = 2,
tDDPWrite = 3,
tNBPLookup = 4,
tNBPConfirm = 5,
tNBPRegister = 6,
tATPSndRequest = 7,
tATPGetRequest = 8,
tATPSdRsp = 9,
tATPAddRsp = 10,
tATPRequest = 11,
tATPResponse = 12
};
typedef SInt8 ABCallType;
enum {
lapProto = 0,
ddpProto = 1,
nbpProto = 2,
atpProto = 3
};
typedef UInt8 ABProtoType;
typedef Byte ABByte;
struct LAPAdrBlock {
UInt8 dstNodeID;
UInt8 srcNodeID;
ABByte lapProtType;
UInt8 filler; /* Filler for proper byte alignment*/
};
typedef struct LAPAdrBlock LAPAdrBlock;
typedef struct ATQEntry ATQEntry;
typedef ATQEntry * ATQEntryPtr;
typedef CALLBACK_API_C( long , ATalkTransitionEventProcPtr )(long eventCode, ATQEntryPtr qElem, void *eventParameter);
typedef STACK_UPP_TYPE(ATalkTransitionEventProcPtr) ATalkTransitionEventUPP;
typedef ATalkTransitionEventUPP ATalkTransitionEvent;
struct ATQEntry {
struct ATQEntry * qLink; /*next queue entry*/
short qType; /*queue type*/
ATalkTransitionEventUPP CallAddr; /*your routine descriptor*/
};
/*
Real definition of EntityName is 3 PACKED strings of any length (32 is just an example). No
offests for Asm since each String address must be calculated by adding length byte to last string ptr.
In Pascal, String(32) will be 34 bytes long since fields never start on an odd byte unless they are
only a byte long. So this will generate correct looking interfaces for Pascal and C, but they will not
be the same, which is OK since they are not used.
*/
struct EntityName {
Str32Field objStr;
Str32Field typeStr;
Str32Field zoneStr;
};
typedef struct EntityName EntityName;
typedef EntityName * EntityPtr;
struct AddrBlock {
UInt16 aNet;
UInt8 aNode;
UInt8 aSocket;
};
typedef struct AddrBlock AddrBlock;
struct RetransType {
UInt8 retransInterval;
UInt8 retransCount;
};
typedef struct RetransType RetransType;
struct BDSElement {
short buffSize;
void * buffPtr;
short dataSize;
long userBytes;
};
typedef struct BDSElement BDSElement;
typedef BDSElement BDSType[8];
typedef BDSElement * BDSPtr;
typedef char BitMapType;
struct ATLAPRec {
ABCallType abOpcode;
SInt8 filler; /* Filler for proper byte alignment*/
short abResult;
long abUserReference;
LAPAdrBlock lapAddress;
short lapReqCount;
short lapActCount;
void * lapDataPtr;
};
typedef struct ATLAPRec ATLAPRec;
typedef ATLAPRec * ATLAPRecPtr;
typedef ATLAPRecPtr * ATLAPRecHandle;
struct ATDDPRec {
ABCallType abOpcode;
SInt8 filler; /* Filler for proper byte alignment*/
short abResult;
long abUserReference;
short ddpType;
short ddpSocket;
AddrBlock ddpAddress;
short ddpReqCount;
short ddpActCount;
void * ddpDataPtr;
short ddpNodeID;
};
typedef struct ATDDPRec ATDDPRec;
typedef ATDDPRec * ATDDPRecPtr;
typedef ATDDPRecPtr * ATDDPRecHandle;
struct ATNBPRec {
ABCallType abOpcode;
SInt8 filler; /* Filler for proper byte alignment*/
short abResult;
long abUserReference;
EntityPtr nbpEntityPtr;
void * nbpBufPtr;
short nbpBufSize;
short nbpDataField;
AddrBlock nbpAddress;
RetransType nbpRetransmitInfo;
};
typedef struct ATNBPRec ATNBPRec;
typedef ATNBPRec * ATNBPRecPtr;
typedef ATNBPRecPtr * ATNBPRecHandle;
struct ATATPRec {
ABCallType abOpcode;
SInt8 filler1; /* Filler for proper byte alignment*/
short abResult;
long abUserReference;
short atpSocket;
AddrBlock atpAddress;
short atpReqCount;
void * atpDataPtr;
BDSPtr atpRspBDSPtr;
BitMapType atpBitMap;
SInt8 filler2; /* Filler for proper byte alignment*/
short atpTransID;
short atpActCount;
long atpUserData;
Boolean atpXO;
Boolean atpEOM;
short atpTimeOut;
short atpRetries;
short atpNumBufs;
short atpNumRsp;
short atpBDSSize;
long atpRspUData;
void * atpRspBuf;
short atpRspSize;
};
typedef struct ATATPRec ATATPRec;
typedef ATATPRec * ATATPRecPtr;
typedef ATATPRecPtr * ATATPRecHandle;
struct AFPCommandBlock {
UInt8 cmdByte;
UInt8 startEndFlag;
short forkRefNum;
long rwOffset;
long reqCount;
UInt8 newLineFlag;
char newLineChar;
};
typedef struct AFPCommandBlock AFPCommandBlock;
typedef union MPPParamBlock MPPParamBlock;
typedef union ATPParamBlock ATPParamBlock;
typedef union XPPParamBlock XPPParamBlock;
typedef MPPParamBlock * MPPPBPtr;
typedef ATPParamBlock * ATPPBPtr;
typedef XPPParamBlock * XPPParmBlkPtr;
typedef CALLBACK_API_REGISTER68K( void , MPPCompletionProcPtr, (MPPPBPtr thePBptr) );
typedef CALLBACK_API_REGISTER68K( void , ATPCompletionProcPtr, (ATPPBPtr thePBptr) );
typedef CALLBACK_API_REGISTER68K( void , XPPCompletionProcPtr, (XPPParmBlkPtr thePBptr) );
typedef CALLBACK_API_REGISTER68K( void , AttnRoutineProcPtr, (short sessRefnum, short attnBytes) );
typedef REGISTER_UPP_TYPE(MPPCompletionProcPtr) MPPCompletionUPP;
typedef REGISTER_UPP_TYPE(ATPCompletionProcPtr) ATPCompletionUPP;
typedef REGISTER_UPP_TYPE(XPPCompletionProcPtr) XPPCompletionUPP;
typedef REGISTER_UPP_TYPE(AttnRoutineProcPtr) AttnRoutineUPP;
struct WDSElement {
short entryLength;
Ptr entryPtr;
};
typedef struct WDSElement WDSElement;
struct NTElement {
AddrBlock nteAddress; /*network address of entity*/
SInt8 filler;
SInt8 entityData[99]; /*Object, Type & Zone*/
};
typedef struct NTElement NTElement;
struct NamesTableEntry {
Ptr qNext; /*ptr to next NTE*/
NTElement nt;
};
typedef struct NamesTableEntry NamesTableEntry;
typedef CALLBACK_API_REGISTER68K( Boolean , MPPProtocolHandlerProcPtr, (Ptr SCCAddr1, Ptr SCCAddr2, Ptr MPPLocalVars, Ptr nextFreeByteInRHA, Ptr ReadPacketAndReadRestPtr, short numBytesLeftToReadInPacket) );
typedef CALLBACK_API_REGISTER68K( Boolean , DDPSocketListenerProcPtr, (Ptr SCCAddr1, Ptr SCCAddr2, Ptr MPPLocalVars, Ptr nextFreeByteInRHA, Ptr ReadPacketAndReadRestPtr, UInt8 packetDestinationNumber, short numBytesLeftToReadInPacket) );
typedef REGISTER_UPP_TYPE(MPPProtocolHandlerProcPtr) MPPProtocolHandlerUPP;
typedef REGISTER_UPP_TYPE(DDPSocketListenerProcPtr) DDPSocketListenerUPP;
/*
MPPProtocolHandlerProcs and DDPSocketListenerProcs cannot be written
in or called from a high-level language without the help of mixed mode
or assembly glue because they use the following parameter-passing conventions:
typedef Boolean (*MPPProtocolHandlerProcPtr)(Ptr SCCAddr1, Ptr SCCAddr2,
Ptr MPPLocalVars, Ptr nextFreeByteInRHA, Ptr ReadPacketAndReadRestPtr,
short numBytesLeftToReadInPacket);
In:
=> SCCAddr1 A0.L
=> SCCAddr2 A1.L
=> MPPLocalVars A2.L
=> nextFreeByteInRHA A3.L
=> ReadPacketAndReadRestPtr A4.L
=> numBytesLeftToReadInPacket D1.W
Out:
<= Boolean Z bit of CCR
typedef Boolean (*DDPSocketListenerProcPtr)(Ptr SCCAddr1, Ptr SCCAddr2,
Ptr MPPLocalVars, Ptr nextFreeByteInRHA, Ptr ReadPacketAndReadRestPtr,
UInt8 packetDestinationNumber, short numBytesLeftToReadInPacket);
In:
=> SCCAddr1 A0.L
=> SCCAddr2 A1.L
=> MPPLocalVars A2.L
=> nextFreeByteInRHA A3.L
=> ReadPacketAndReadRestPtr A4.L
=> packetDestinationNumber D0.B
=> numBytesLeftToReadInPacket D1.W
Out:
<= Boolean Z bit of CCR
*/
struct MPPparms {
QElem * qLink; /*next queue entry*/
short qType; /*queue type*/
short ioTrap; /*routine trap*/
Ptr ioCmdAddr; /*routine address*/
ATPCompletionUPP ioCompletion; /*ATPCompletionUPP or MPPCompletionUPP*/
OSErr ioResult; /*result code*/
long userData; /*Command result (ATP user bytes)*/
short reqTID; /*request transaction ID*/
short ioRefNum; /*driver reference number*/
short csCode; /*Call command code*/
};
typedef struct MPPparms MPPparms;
struct LAPparms {
QElem * qLink; /*next queue entry*/
short qType; /*queue type*/
short ioTrap; /*routine trap*/
Ptr ioCmdAddr; /*routine address*/
ATPCompletionUPP ioCompletion; /*ATPCompletionUPP or MPPCompletionUPP*/
OSErr ioResult; /*result code*/
long userData; /*Command result (ATP user bytes)*/
short reqTID; /*request transaction ID*/
short ioRefNum; /*driver reference number*/
short csCode; /*Call command code*/
UInt8 protType; /*ALAP protocol Type */
UInt8 filler;
union {
void * wdsPointer; /*-> write data structure*/
MPPProtocolHandlerUPP handler; /*-> protocol handler routine*/
} u;
};
typedef struct LAPparms LAPparms;
struct DDPparms {
QElem * qLink; /*next queue entry*/
short qType; /*queue type*/
short ioTrap; /*routine trap*/
Ptr ioCmdAddr; /*routine address*/
ATPCompletionUPP ioCompletion; /*ATPCompletionUPP or MPPCompletionUPP*/
OSErr ioResult; /*result code*/
long userData; /*Command result (ATP user bytes)*/
short reqTID; /*request transaction ID*/
short ioRefNum; /*driver reference number*/
short csCode; /*Call command code*/
UInt8 socket; /*socket number */
UInt8 checksumFlag; /*check sum flag */
union {
void * wdsPointer; /*-> write data structure*/
DDPSocketListenerUPP listener; /*->write data structure or -> Listener*/
} u;
};
typedef struct DDPparms DDPparms;
union NBPPtrs {
Ptr ntQElPtr;
Ptr entityPtr;
};
typedef union NBPPtrs NBPPtrs;
union LookupConfirmParams {
UInt8 verifyFlag;
struct {
void * retBuffPtr;
short retBuffSize;
short maxToGet;
short numGotten;
} Lookup;
struct {
AddrBlock confirmAddr;
UInt8 newSocket;
SInt8 filler; /* Filler for proper byte alignment*/
} Confirm;
};
typedef union LookupConfirmParams LookupConfirmParams;
struct NBPparms {
QElem * qLink; /*next queue entry*/
short qType; /*queue type*/
short ioTrap; /*routine trap*/
Ptr ioCmdAddr; /*routine address*/
ATPCompletionUPP ioCompletion; /*ATPCompletionUPP or MPPCompletionUPP*/
OSErr ioResult; /*result code*/
long userData; /*Command result (ATP user bytes)*/
short reqTID; /*request transaction ID*/
short ioRefNum; /*driver reference number*/
short csCode; /*Call command code*/
UInt8 interval; /*retry interval */
UInt8 count; /*retry count */
NBPPtrs nbpPtrs;
LookupConfirmParams parm;
};
typedef struct NBPparms NBPparms;
struct SetSelfparms {
QElem * qLink; /*next queue entry*/
short qType; /*queue type*/
short ioTrap; /*routine trap*/
Ptr ioCmdAddr; /*routine address*/
ATPCompletionUPP ioCompletion; /*ATPCompletionUPP or MPPCompletionUPP*/
OSErr ioResult; /*result code*/
long userData; /*Command result (ATP user bytes)*/
short reqTID; /*request transaction ID*/
short ioRefNum; /*driver reference number*/
short csCode; /*Call command code*/
UInt8 newSelfFlag; /*self-send toggle flag */
UInt8 oldSelfFlag; /*previous self-send state */
};
typedef struct SetSelfparms SetSelfparms;
struct NBPKillparms {
QElem * qLink; /*next queue entry*/
short qType; /*queue type*/
short ioTrap; /*routine trap*/
Ptr ioCmdAddr; /*routine address*/
ATPCompletionUPP ioCompletion; /*ATPCompletionUPP or MPPCompletionUPP*/
OSErr ioResult; /*result code*/
long userData; /*Command result (ATP user bytes)*/
short reqTID; /*request transaction ID*/
short ioRefNum; /*driver reference number*/
short csCode; /*Call command code*/
void * nKillQEl; /*ptr to i/o queue element to cancel */
};
typedef struct NBPKillparms NBPKillparms;
struct GetAppleTalkInfoParm {
QElem * qLink; /*next queue entry*/
short qType; /*queue type*/
short ioTrap; /*routine trap*/
Ptr ioCmdAddr; /*routine address*/
ATPCompletionUPP ioCompletion; /*ATPCompletionUPP or MPPCompletionUPP*/
OSErr ioResult; /*result code*/
long userData; /*Command result (ATP user bytes)*/
short reqTID; /*request transaction ID*/
short ioRefNum; /*driver reference number*/
short csCode; /*Call command code*/
/*max. concurrent NBP requests*/
short version; /*requested info version*/
void * varsPtr; /*pointer to well known MPP vars*/
void * DCEPtr; /*pointer to MPP DCE*/
short portID; /*port number [0..7]*/
long configuration; /*32-bit configuration word*/
short selfSend; /*non zero if SelfSend enabled*/
short netLo; /*low value of network range*/
short netHi; /*high value of network range*/
long ourAdd; /*our 24-bit AppleTalk address*/
long routerAddr; /*24-bit address of (last) router*/
short numOfPHs; /*max. number of protocol handlers*/
short numOfSkts; /*max. number of static sockets*/
short numNBPEs; /*max. concurrent NBP requests*/
void * nTQueue; /*pointer to registered name queue*/
short LAlength; /*length in bytes of data link addr*/
void * linkAddr; /*data link address returned*/
Ptr zoneName; /*zone name returned*/
};
typedef struct GetAppleTalkInfoParm GetAppleTalkInfoParm;
struct ATalkClosePrepParm {
QElem * qLink; /*next queue entry*/
short qType; /*queue type*/
short ioTrap; /*routine trap*/
Ptr ioCmdAddr; /*routine address*/
ATPCompletionUPP ioCompletion; /*ATPCompletionUPP or MPPCompletionUPP*/
OSErr ioResult; /*result code*/
long userData; /*Command result (ATP user bytes)*/
short reqTID; /*request transaction ID*/
short ioRefNum; /*driver reference number*/
short csCode; /*Call command code*/
Ptr appName; /*pointer to application name in buffer*/
};
typedef struct ATalkClosePrepParm ATalkClosePrepParm;
union MPPParamBlock {
MPPparms MPP; /*General MPP parms*/
LAPparms LAP; /*ALAP calls*/
DDPparms DDP; /*DDP calls*/
NBPparms NBP; /*NBP calls*/
SetSelfparms SETSELF;
NBPKillparms NBPKILL;
GetAppleTalkInfoParm GAIINFO;
ATalkClosePrepParm ATALKCLOSE;
};
struct XPPPrmBlk {
QElem * qLink;
short qType;
short ioTrap;
Ptr ioCmdAddr;
XPPCompletionUPP ioCompletion;
OSErr ioResult;
long cmdResult;
short ioVRefNum;
short ioRefNum;
short csCode;
short sessRefnum; /*Offset to session refnum */
UInt8 aspTimeout; /*Timeout for ATP */
UInt8 aspRetry; /*Retry count for ATP */
short cbSize; /*Command block size */
Ptr cbPtr; /*Command block pointer */
short rbSize; /*Reply buffer size */
Ptr rbPtr; /*Reply buffer pointer */
short wdSize; /*Write Data size*/
Ptr wdPtr; /*Write Data pointer*/
UInt8 ccbStart[296]; /*CCB memory allocated for driver afpWrite max size(CCB)=296 all other calls=150*/
};
typedef struct XPPPrmBlk XPPPrmBlk;
struct ASPGetparmsBlk {
QElem * qLink;
short qType;
short ioTrap;
Ptr ioCmdAddr;
XPPCompletionUPP ioCompletion;
OSErr ioResult;
long cmdResult;
short ioVRefNum;
short ioRefNum;
short csCode;
short aspMaxCmdSize; /*For SPGetParms*/
short aspQuantumSize;
short numSesss;
};
typedef struct ASPGetparmsBlk ASPGetparmsBlk;
struct ASPAbortPrm {
QElem * qLink;
short qType;
short ioTrap;
Ptr ioCmdAddr;
XPPCompletionUPP ioCompletion;
OSErr ioResult;
long cmdResult;
short ioVRefNum;
short ioRefNum;
short csCode;
Ptr abortSCBPtr; /*SCB pointer for AbortOS */
};
typedef struct ASPAbortPrm ASPAbortPrm;
struct ASPOpenPrm {
QElem * qLink;
short qType;
short ioTrap;
Ptr ioCmdAddr;
XPPCompletionUPP ioCompletion;
OSErr ioResult;
long cmdResult;
short ioVRefNum;
short ioRefNum;
short csCode;
short sessRefnum; /*Offset to session refnum */
UInt8 aspTimeout; /*Timeout for ATP */
UInt8 aspRetry; /*Retry count for ATP */
AddrBlock serverAddr; /*Server address block */
Ptr scbPointer; /*SCB pointer */
AttnRoutineUPP attnRoutine; /*Attention routine pointer*/
};
typedef struct ASPOpenPrm ASPOpenPrm;
typedef ASPOpenPrm * ASPOpenPrmPtr;
struct AFPLoginPrm {
QElem * qLink;
short qType;
short ioTrap;
Ptr ioCmdAddr;
XPPCompletionUPP ioCompletion;
OSErr ioResult;
long cmdResult;
short ioVRefNum;
short ioRefNum;
short csCode;
short sessRefnum; /*Offset to session refnum */
UInt8 aspTimeout; /*Timeout for ATP */
UInt8 aspRetry; /*Retry count for ATP */
short cbSize; /*Command block size */
void * cbPtr; /*Command block pointer */
short rbSize; /*Reply buffer size */
void * rbPtr; /*Reply buffer pointer */
AddrBlock afpAddrBlock; /*block in AFP login */
void * afpSCBPtr; /*SCB pointer in AFP login */
AttnRoutineUPP afpAttnRoutine; /*routine pointer in AFP login */
UInt8 ccbFill[144]; /*CCB memory allocated for driver Login needs only 150 bytes BUT CCB really starts in the middle of AFPSCBPtr and also clobbers AFPAttnRoutine. */
};
typedef struct AFPLoginPrm AFPLoginPrm;
struct XCallParam {
QElem * qLink;
short qType;
short ioTrap;
Ptr ioCmdAddr;
XPPCompletionUPP ioCompletion;
OSErr ioResult;
long cmdResult;
short ioVRefNum;
short ioRefNum;
short csCode;
short xppSubCode;
UInt8 xppTimeout; /*retry interval (seconds)*/
UInt8 xppRetry; /*retry count*/
short filler1;
void * zipBuffPtr; /*pointer to buffer (must be 578 bytes)*/
short zipNumZones; /*no. of zone names in this response*/
UInt8 zipLastFlag; /*non-zero if no more zones*/
UInt8 filler2; /*filler*/
UInt8 zipInfoField[70]; /*on initial call, set first word to zero*/
};
typedef struct XCallParam XCallParam;
union XPPParamBlock {
XPPPrmBlk XPP;
ASPGetparmsBlk GETPARM;
ASPAbortPrm ABORT;
ASPOpenPrm OPEN;
AFPLoginPrm LOGIN;
XCallParam XCALL;
};
struct ATPparms {
QElem * qLink; /*next queue entry*/
short qType; /*queue type*/
short ioTrap; /*routine trap*/
Ptr ioCmdAddr; /*routine address*/
ATPCompletionUPP ioCompletion; /*ATPCompletionUPP or MPPCompletionUPP*/
OSErr ioResult; /*result code*/
long userData; /*Command result (ATP user bytes)*/
short reqTID; /*request transaction ID*/
short ioRefNum; /*driver reference number*/
short csCode; /*Call command code*/
UInt8 atpSocket; /*currbitmap for requests or ATP socket number*/
UInt8 atpFlags; /*control information*/
AddrBlock addrBlock; /*source/dest. socket address*/
short reqLength; /*request/response length*/
void * reqPointer; /*->request/response Data*/
void * bdsPointer; /*->response BDS */
};
typedef struct ATPparms ATPparms;
struct SendReqparms {
QElem * qLink; /*next queue entry*/
short qType; /*queue type*/
short ioTrap; /*routine trap*/
Ptr ioCmdAddr; /*routine address*/
ATPCompletionUPP ioCompletion; /*ATPCompletionUPP or MPPCompletionUPP*/
OSErr ioResult; /*result code*/
long userData; /*Command result (ATP user bytes)*/
short reqTID; /*request transaction ID*/
short ioRefNum; /*driver reference number*/
short csCode; /*Call command code*/
UInt8 atpSocket; /*currbitmap for requests or ATP socket number*/
UInt8 atpFlags; /*control information*/
AddrBlock addrBlock; /*source/dest. socket address*/
short reqLength; /*request/response length*/
void * reqPointer; /*->request/response Data*/
void * bdsPointer; /*->response BDS */
UInt8 numOfBuffs; /*numOfBuffs */
UInt8 timeOutVal; /*timeout interval */
UInt8 numOfResps; /*number of responses actually received */
UInt8 retryCount; /*number of retries */
short intBuff; /*used internally for NSendRequest */
UInt8 TRelTime; /*TRelease time for extended send request */
SInt8 filler0;
};
typedef struct SendReqparms SendReqparms;
struct ATPmisc1 {
QElem * qLink; /*next queue entry*/
short qType; /*queue type*/
short ioTrap; /*routine trap*/
Ptr ioCmdAddr; /*routine address*/
ATPCompletionUPP ioCompletion; /*ATPCompletionUPP or MPPCompletionUPP*/
OSErr ioResult; /*result code*/
long userData; /*Command result (ATP user bytes)*/
short reqTID; /*request transaction ID*/
short ioRefNum; /*driver reference number*/
short csCode; /*Call command code*/
UInt8 atpSocket; /*currbitmap for requests or ATP socket number*/
UInt8 atpFlags; /*control information*/
AddrBlock addrBlock; /*source/dest. socket address*/
short reqLength; /*request/response length*/
void * reqPointer; /*->request/response Data*/
void * bdsPointer; /*->response BDS */
union {
UInt8 bitMap; /*bitmap received */
UInt8 numOfBuffs; /*number of responses being sent*/
UInt8 rspNum; /*sequence number*/
} u;
};
typedef struct ATPmisc1 ATPmisc1;
struct ATPmisc2 {
QElem * qLink; /*next queue entry*/
short qType; /*queue type*/
short ioTrap; /*routine trap*/
Ptr ioCmdAddr; /*routine address*/
ATPCompletionUPP ioCompletion; /*ATPCompletionUPP or MPPCompletionUPP*/
OSErr ioResult; /*result code*/
long userData; /*Command result (ATP user bytes)*/
short reqTID; /*request transaction ID*/
short ioRefNum; /*driver reference number*/
short csCode; /*Call command code*/
UInt8 atpSocket; /*currbitmap for requests or ATP socket number*/
UInt8 atpFlags; /*control information*/
AddrBlock addrBlock; /*source/dest. socket address*/
short reqLength; /*request/response length*/
void * reqPointer; /*->request/response Data*/
void * bdsPointer; /*->response BDS */
UInt8 filler;
UInt8 bdsSize; /*number of BDS elements */
short transID; /*transaction ID recd. */
};
typedef struct ATPmisc2 ATPmisc2;
struct Killparms {
QElem * qLink; /*next queue entry*/
short qType; /*queue type*/
short ioTrap; /*routine trap*/
Ptr ioCmdAddr; /*routine address*/
ATPCompletionUPP ioCompletion; /*ATPCompletionUPP or MPPCompletionUPP*/
OSErr ioResult; /*result code*/
long userData; /*Command result (ATP user bytes)*/
short reqTID; /*request transaction ID*/
short ioRefNum; /*driver reference number*/
short csCode; /*Call command code*/
UInt8 atpSocket; /*currbitmap for requests or ATP socket number*/
UInt8 atpFlags; /*control information*/
AddrBlock addrBlock; /*source/dest. socket address*/
short reqLength; /*request/response length*/
void * reqPointer; /*->request/response Data*/
void * bdsPointer; /*->response BDS */
void * aKillQEl; /*ptr to i/o queue element to cancel*/
};
typedef struct Killparms Killparms;
union ATPParamBlock {
ATPparms ATP; /*General ATP parms*/
SendReqparms SREQ; /*sendrequest parms*/
ATPmisc1 OTH1; /*and a few others*/
ATPmisc2 OTH2; /*and a few others*/
Killparms KILL; /*and a few others*/
};
#if CALL_NOT_IN_CARBON
/*
* NewATalkTransitionEventUPP()
*
* Availability:
* Non-Carbon CFM: available as macro/inline
* CarbonLib: not available
* Mac OS X: not available
*/
EXTERN_API_C( ATalkTransitionEventUPP )
NewATalkTransitionEventUPP(ATalkTransitionEventProcPtr userRoutine);
#if !OPAQUE_UPP_TYPES
enum { uppATalkTransitionEventProcInfo = 0x00000FF1 }; /* 4_bytes Func(4_bytes, 4_bytes, 4_bytes) */
#ifdef __cplusplus
inline ATalkTransitionEventUPP NewATalkTransitionEventUPP(ATalkTransitionEventProcPtr userRoutine) { return (ATalkTransitionEventUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppATalkTransitionEventProcInfo, GetCurrentArchitecture()); }
#else
#define NewATalkTransitionEventUPP(userRoutine) (ATalkTransitionEventUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppATalkTransitionEventProcInfo, GetCurrentArchitecture())
#endif
#endif
/*
* NewMPPCompletionUPP()
*
* Availability:
* Non-Carbon CFM: available as macro/inline
* CarbonLib: not available
* Mac OS X: not available
*/
EXTERN_API_C( MPPCompletionUPP )
NewMPPCompletionUPP(MPPCompletionProcPtr userRoutine);
#if !OPAQUE_UPP_TYPES
enum { uppMPPCompletionProcInfo = 0x00009802 }; /* register no_return_value Func(4_bytes:A0) */
#ifdef __cplusplus
inline MPPCompletionUPP NewMPPCompletionUPP(MPPCompletionProcPtr userRoutine) { return (MPPCompletionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMPPCompletionProcInfo, GetCurrentArchitecture()); }
#else
#define NewMPPCompletionUPP(userRoutine) (MPPCompletionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMPPCompletionProcInfo, GetCurrentArchitecture())
#endif
#endif
/*
* NewATPCompletionUPP()
*
* Availability:
* Non-Carbon CFM: available as macro/inline
* CarbonLib: not available
* Mac OS X: not available
*/
EXTERN_API_C( ATPCompletionUPP )
NewATPCompletionUPP(ATPCompletionProcPtr userRoutine);
#if !OPAQUE_UPP_TYPES
enum { uppATPCompletionProcInfo = 0x00009802 }; /* register no_return_value Func(4_bytes:A0) */
#ifdef __cplusplus
inline ATPCompletionUPP NewATPCompletionUPP(ATPCompletionProcPtr userRoutine) { return (ATPCompletionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppATPCompletionProcInfo, GetCurrentArchitecture()); }
#else
#define NewATPCompletionUPP(userRoutine) (ATPCompletionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppATPCompletionProcInfo, GetCurrentArchitecture())
#endif
#endif
/*
* NewXPPCompletionUPP()
*
* Availability:
* Non-Carbon CFM: available as macro/inline
* CarbonLib: not available
* Mac OS X: not available
*/
EXTERN_API_C( XPPCompletionUPP )
NewXPPCompletionUPP(XPPCompletionProcPtr userRoutine);
#if !OPAQUE_UPP_TYPES
enum { uppXPPCompletionProcInfo = 0x00009802 }; /* register no_return_value Func(4_bytes:A0) */
#ifdef __cplusplus
inline XPPCompletionUPP NewXPPCompletionUPP(XPPCompletionProcPtr userRoutine) { return (XPPCompletionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppXPPCompletionProcInfo, GetCurrentArchitecture()); }
#else
#define NewXPPCompletionUPP(userRoutine) (XPPCompletionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppXPPCompletionProcInfo, GetCurrentArchitecture())
#endif
#endif
/*
* NewAttnRoutineUPP()
*
* Availability:
* Non-Carbon CFM: available as macro/inline
* CarbonLib: not available
* Mac OS X: not available