home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 October: Mac OS SDK / Dev.CD Oct 00 SDK1.toast / Development Kits / Mac OS / Apple Remote Access API / Documentation / ARA API < prev    next >
MacBinary  |  1994-09-15  |  141.1 KB  |  [ONLN/HLX2]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
10% dexvert MacBinary (archive/macBinary) fallback Supported
100% file MacBinary II, inited, Thu Sep 15 07:00:00 1994, modified Thu Sep 15 07:00:00 1994, creator 'HLX2', type 'ONLN', 139745 bytes "ARA API" , at 0x22261 4554 bytes resource default (weak)
99% file data default
100% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[ONLN]
macFileCreator[HLX2]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 07 41 52 41 20 41 50 | 49 00 00 00 00 00 00 00 |..ARA AP|I.......|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 4f 4e 4c 4e 48 4c 58 | 32 01 00 00 00 00 00 00 |.ONLNHLX|2.......|
|00000050| 00 00 00 00 02 21 e1 00 | 00 11 ca aa 9d d9 b0 aa |.....!..|........|
|00000060| 9d d9 b0 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 47 2c 00 00 |........|....G,..|
|00000080| f0 a8 0d 41 70 70 6c 65 | 20 52 65 6d 6f 74 65 20 |...Apple| Remote |
|00000090| 41 63 63 65 73 73 0d 41 | 70 70 6c 69 63 61 74 69 |Access.A|pplicati|
|000000a0| 6f 6e 20 50 72 6f 67 72 | 61 6d 6d 69 6e 67 20 49 |on Progr|amming I|
|000000b0| 6e 74 65 72 66 61 63 65 | 20 28 41 50 49 29 0d 45 |nterface| (API).E|
|000000c0| 78 74 65 72 6e 61 6c 20 | 52 65 66 65 72 65 6e 63 |xternal |Referenc|
|000000d0| 65 20 53 70 65 63 69 66 | 69 63 61 74 69 6f 6e 73 |e Specif|ications|
|000000e0| 0d 4e 6f 74 65 3a 20 54 | 68 65 20 41 70 70 6c 65 |.Note: T|he Apple|
|000000f0| 20 52 65 6d 6f 74 65 20 | 41 63 63 65 73 73 20 41 | Remote |Access A|
|00000100| 50 49 20 70 72 6f 76 69 | 64 65 73 20 61 6e 20 61 |PI provi|des an a|
|00000110| 70 70 6c 69 63 61 74 69 | 6f 6e 20 70 72 6f 67 72 |pplicati|on progr|
|00000120| 61 6d 6d 69 6e 67 20 69 | 6e 74 65 72 66 61 63 65 |amming i|nterface|
|00000130| 20 74 6f 20 74 68 65 20 | 52 65 6d 6f 74 65 20 41 | to the |Remote A|
|00000140| 63 63 65 73 73 20 4d 61 | 6e 61 67 65 72 2e 20 20 |ccess Ma|nager. |
|00000150| 49 74 20 73 75 70 70 6f | 72 74 73 20 63 61 6c 6c |It suppo|rts call|
|00000160| 73 20 74 6f 20 6c 6f 61 | 64 20 61 6e 64 20 75 6e |s to loa|d and un|
|00000170| 6c 6f 61 64 20 74 68 65 | 20 52 65 6d 6f 74 65 20 |load the| Remote |
|00000180| 41 63 63 65 73 73 20 4d | 61 6e 61 67 65 72 20 28 |Access M|anager (|
|00000190| 52 41 4d 29 2c 20 63 72 | 65 61 74 65 20 61 6e 64 |RAM), cr|eate and|
|000001a0| 20 74 65 72 6d 69 6e 61 | 74 65 20 63 6f 6e 6e 65 | termina|te conne|
|000001b0| 63 74 69 6f 6e 73 2c 20 | 72 65 74 72 69 65 76 65 |ctions, |retrieve|
|000001c0| 20 74 68 65 20 63 75 72 | 72 65 6e 74 20 52 41 4d | the cur|rent RAM|
|000001d0| 20 73 74 61 74 75 73 2c | 20 61 6e 64 20 74 6f 20 | status,| and to |
|000001e0| 64 65 74 65 72 6d 69 6e | 65 20 69 66 20 61 20 73 |determin|e if a s|
|000001f0| 70 65 63 69 66 69 65 64 | 20 6e 65 74 77 6f 72 6b |pecified| network|
|00000200| 20 61 64 64 72 65 73 73 | 20 69 73 20 6c 6f 63 61 | address| is loca|
|00000210| 6c 20 6f 72 20 72 65 6d | 6f 74 65 2e 20 20 4f 70 |l or rem|ote. Op|
|00000220| 74 69 6f 6e 61 6c 6c 79 | 2c 20 74 68 65 20 41 70 |tionally|, the Ap|
|00000230| 70 6c 65 20 52 65 6d 6f | 74 65 20 41 63 63 65 73 |ple Remo|te Acces|
|00000240| 73 20 41 50 49 20 63 61 | 6e 20 64 69 73 70 6c 61 |s API ca|n displa|
|00000250| 79 20 61 20 75 73 65 72 | 20 69 6e 74 65 72 66 61 |y a user| interfa|
|00000260| 63 65 20 73 68 6f 77 69 | 6e 67 20 74 68 65 20 70 |ce showi|ng the p|
|00000270| 72 6f 63 65 73 73 20 6f | 66 20 61 20 63 6f 6e 6e |rocess o|f a conn|
|00000280| 65 63 74 69 6f 6e 2e 20 | 20 54 68 65 20 70 61 72 |ection. | The par|
|00000290| 61 6d 65 74 65 72 73 20 | 66 6f 72 20 74 68 65 20 |ameters |for the |
|000002a0| 63 6f 6e 6e 65 63 74 20 | 63 61 6c 6c 20 63 61 6e |connect |call can|
|000002b0| 20 62 65 20 61 20 63 6f | 6e 6e 65 63 74 69 6f 6e | be a co|nnection|
|000002c0| 20 64 6f 63 75 6d 65 6e | 74 2c 20 63 72 65 61 74 | documen|t, creat|
|000002d0| 65 64 20 77 69 74 68 20 | 74 68 65 20 52 65 6d 6f |ed with |the Remo|
|000002e0| 74 65 20 41 63 63 65 73 | 73 20 61 70 70 6c 69 63 |te Acces|s applic|
|000002f0| 61 74 69 6f 6e 2e 20 54 | 68 65 20 70 61 72 61 6d |ation. T|he param|
|00000300| 65 74 65 72 73 20 6f 66 | 20 74 68 65 20 63 6f 6e |eters of| the con|
|00000310| 6e 65 63 74 69 6f 6e 2c | 20 68 6f 77 65 76 65 72 |nection,| however|
|00000320| 2c 20 6d 61 79 20 6e 6f | 74 20 62 65 20 73 70 65 |, may no|t be spe|
|00000330| 63 69 66 69 65 64 20 6f | 75 74 20 72 69 67 68 74 |cified o|ut right|
|00000340| 20 77 68 65 6e 20 63 6f | 6e 6e 65 63 74 69 6e 67 | when co|nnecting|
|00000350| 20 74 6f 20 41 52 41 20 | 32 2e 30 2e 20 20 54 68 | to ARA |2.0. Th|
|00000360| 65 73 65 20 73 70 65 63 | 69 66 69 63 61 74 69 6f |ese spec|ificatio|
|00000370| 6e 73 20 61 6c 73 6f 20 | 69 6e 63 6c 75 64 65 20 |ns also |include |
|00000380| 68 6f 77 20 74 6f 20 74 | 65 6c 6c 20 69 66 20 41 |how to t|ell if A|
|00000390| 70 70 6c 65 20 52 65 6d | 6f 74 65 20 41 63 63 65 |pple Rem|ote Acce|
|000003a0| 73 73 20 69 73 20 69 6e | 73 74 61 6c 6c 65 64 2c |ss is in|stalled,|
|000003b0| 20 61 6e 64 20 68 6f 77 | 20 74 6f 20 64 65 61 6c | and how| to deal|
|000003c0| 20 77 69 74 68 20 74 68 | 65 20 73 65 72 69 61 6c | with th|e serial|
|000003d0| 20 70 6f 72 74 20 77 68 | 65 6e 20 41 70 70 6c 65 | port wh|en Apple|
|000003e0| 20 52 65 6d 6f 74 65 20 | 41 63 63 65 73 73 20 69 | Remote |Access i|
|000003f0| 73 20 69 6e 20 61 6e 73 | 77 65 72 20 6d 6f 64 65 |s in ans|wer mode|
|00000400| 2e 0d 41 6c 74 68 6f 75 | 67 68 20 65 76 65 72 79 |..Althou|gh every|
|00000410| 20 61 74 74 65 6d 70 74 | 20 68 61 73 20 62 65 65 | attempt| has bee|
|00000420| 6e 20 6d 61 64 65 20 74 | 6f 20 76 65 72 69 66 79 |n made t|o verify|
|00000430| 20 74 68 65 20 61 63 63 | 75 72 61 63 79 20 6f 66 | the acc|uracy of|
|00000440| 20 74 68 65 20 69 6e 66 | 6f 72 6d 61 74 69 6f 6e | the inf|ormation|
|00000450| 20 70 72 65 73 65 6e 74 | 65 64 2c 20 74 68 69 73 | present|ed, this|
|00000460| 20 64 6f 63 75 6d 65 6e | 74 20 6d 61 79 20 63 6f | documen|t may co|
|00000470| 6e 74 61 69 6e 20 65 72 | 72 6f 72 73 20 61 6e 64 |ntain er|rors and|
|00000480| 20 69 73 20 73 75 62 6a | 65 63 74 20 74 6f 20 63 | is subj|ect to c|
|00000490| 68 61 6e 67 65 2e 20 20 | 41 52 41 20 32 2e 30 20 |hange. |ARA 2.0 |
|000004a0| 66 65 61 74 75 72 65 73 | 20 61 72 65 20 6e 6f 74 |features| are not|
|000004b0| 20 67 75 61 72 61 6e 74 | 65 65 64 2e 0d 47 65 73 | guarant|eed..Ges|
|000004c0| 74 61 6c 74 73 0d 57 68 | 65 6e 20 66 75 6c 6c 79 |talts.Wh|en fully|
|000004d0| 20 69 6e 73 74 61 6c 6c | 65 64 2c 20 52 65 6d 6f | install|ed, Remo|
|000004e0| 74 65 20 41 63 63 65 73 | 73 20 64 65 66 69 6e 65 |te Acces|s define|
|000004f0| 73 20 73 65 76 65 72 61 | 6c 20 6e 65 77 20 67 65 |s severa|l new ge|
|00000500| 73 74 61 6c 74 20 73 65 | 6c 65 63 74 6f 72 73 2e |stalt se|lectors.|
|00000510| 20 20 42 65 6c 6f 77 20 | 61 72 65 20 74 68 65 20 | Below |are the |
|00000520| 6e 65 77 20 64 65 66 69 | 6e 65 73 20 61 6e 64 20 |new defi|nes and |
|00000530| 65 78 70 6c 61 6e 61 74 | 69 6f 6e 20 6f 66 20 74 |explanat|ion of t|
|00000540| 68 65 69 72 20 75 73 65 | 2e 0d 54 6f 20 73 65 65 |heir use|..To see|
|00000550| 20 69 66 20 73 65 72 69 | 61 6c 20 70 6f 72 74 20 | if seri|al port |
|00000560| 61 72 62 69 74 72 61 74 | 69 6f 6e 20 69 73 20 69 |arbitrat|ion is i|
|00000570| 6e 73 74 61 6c 6c 65 64 | 2c 20 63 61 6c 6c 20 5f |nstalled|, call _|
|00000580| 47 65 73 74 61 6c 74 20 | 75 73 69 6e 67 20 74 68 |Gestalt |using th|
|00000590| 65 73 65 20 64 65 66 69 | 6e 65 73 2e 0d 23 64 65 |ese defi|nes..#de|
|000005a0| 66 69 6e 65 20 67 65 73 | 74 61 6c 74 41 72 62 69 |fine ges|taltArbi|
|000005b0| 74 6f 72 41 74 74 72 09 | 09 09 09 27 61 72 62 20 |torAttr.|...'arb |
|000005c0| 27 0d 23 64 65 66 69 6e | 65 20 67 65 73 74 61 6c |'.#defin|e gestal|
|000005d0| 74 53 65 72 69 61 6c 41 | 72 62 69 74 72 61 74 69 |tSerialA|rbitrati|
|000005e0| 6f 6e 45 78 69 73 74 73 | 09 09 30 0d 46 6f 72 20 |onExists|..0.For |
|000005f0| 65 78 61 6d 70 6c 65 3a | 0d 4f 53 45 72 72 20 69 |example:|.OSErr i|
|00000600| 6f 3b 0d 2f 2f 20 63 68 | 65 63 6b 20 74 6f 20 73 |o;.// ch|eck to s|
|00000610| 65 65 20 69 66 20 73 65 | 72 69 61 6c 20 70 6f 72 |ee if se|rial por|
|00000620| 74 20 61 72 62 69 74 72 | 61 74 69 6e 67 20 69 73 |t arbitr|ating is|
|00000630| 20 69 6e 73 74 61 6c 6c | 65 64 c9 0d 6c 6f 6e 67 | install|ed..long|
|00000640| 20 61 74 74 72 69 62 73 | 3b 0d 69 6f 20 3d 20 47 | attribs|;.io = G|
|00000650| 65 73 74 61 6c 74 28 67 | 65 73 74 61 6c 74 41 72 |estalt(g|estaltAr|
|00000660| 62 69 74 6f 72 41 74 74 | 72 2c 20 26 61 74 74 72 |bitorAtt|r, &attr|
|00000670| 69 62 73 29 3b 0d 69 66 | 20 28 20 28 28 69 6f 20 |ibs);.if| ( ((io |
|00000680| 3d 3d 20 6e 6f 45 72 72 | 29 20 26 26 20 28 61 74 |== noErr|) && (at|
|00000690| 74 72 69 62 73 20 26 20 | 28 31 20 3c 3c 20 67 65 |tribs & |(1 << ge|
|000006a0| 73 74 61 6c 74 53 65 72 | 69 61 6c 41 72 62 69 74 |staltSer|ialArbit|
|000006b0| 72 61 74 69 6f 6e 45 78 | 69 73 74 73 29 29 29 20 |rationEx|ists))) |
|000006c0| 29 0d 20 20 20 7b 0d 20 | 20 20 2f 2f 20 68 61 76 |). {. | // hav|
|000006d0| 65 20 73 65 72 69 61 6c | 20 70 6f 72 74 20 61 72 |e serial| port ar|
|000006e0| 62 69 74 72 61 74 69 6f | 6e 0d 20 20 20 7d 0d 65 |bitratio|n. }.e|
|000006f0| 6c 73 65 0d 20 20 20 7b | 0d 20 20 20 2f 2f 20 6e |lse. {|. // n|
|00000700| 6f 20 73 65 72 69 61 6c | 20 70 6f 72 74 20 61 72 |o serial| port ar|
|00000710| 62 69 74 72 61 74 69 6f | 6e 0d 20 20 20 7d 0d 4d |bitratio|n. }.M|
|00000720| 6f 72 65 20 69 6e 66 6f | 72 6d 61 74 69 6f 6e 20 |ore info|rmation |
|00000730| 6f 6e 20 73 65 72 69 61 | 6c 20 70 6f 72 74 20 61 |on seria|l port a|
|00000740| 72 62 69 74 72 61 74 69 | 6f 6e 20 69 73 20 64 69 |rbitrati|on is di|
|00000750| 73 63 75 73 73 65 64 20 | 69 6e 20 61 20 73 65 63 |scussed |in a sec|
|00000760| 74 69 6f 6e 20 62 65 6c | 6f 77 2e 0d 54 6f 20 73 |tion bel|ow..To s|
|00000770| 65 65 20 69 66 20 52 65 | 6d 6f 74 65 20 41 63 63 |ee if Re|mote Acc|
|00000780| 65 73 73 20 43 6f 6e 6e | 65 63 74 69 6f 6e 20 49 |ess Conn|ection I|
|00000790| 6e 74 65 72 66 61 63 65 | 20 69 73 20 61 76 61 69 |nterface| is avai|
|000007a0| 6c 61 62 6c 65 20 75 73 | 65 20 74 68 65 73 65 20 |lable us|e these |
|000007b0| 64 65 66 69 6e 65 73 3a | 0d 23 64 65 66 69 6e 65 |defines:|.#define|
|000007c0| 20 67 65 73 74 61 6c 74 | 52 65 6d 6f 74 65 41 63 | gestalt|RemoteAc|
|000007d0| 63 65 73 73 41 74 74 72 | 09 09 09 27 73 74 72 6d |cessAttr|...'strm|
|000007e0| 27 0d 23 64 65 66 69 6e | 65 20 67 65 73 74 61 6c |'.#defin|e gestal|
|000007f0| 74 52 65 6d 6f 74 65 41 | 63 63 65 73 73 45 78 69 |tRemoteA|ccessExi|
|00000800| 73 74 73 09 09 09 30 0d | 54 6f 20 63 68 65 63 6b |sts...0.|To check|
|00000810| 20 69 66 20 52 65 6d 6f | 74 65 20 41 63 63 65 73 | if Remo|te Acces|
|00000820| 73 20 73 75 70 70 6f 72 | 74 20 69 73 20 61 76 61 |s suppor|t is ava|
|00000830| 69 6c 61 62 6c 65 20 69 | 6e 20 74 68 65 20 41 6c |ilable i|n the Al|
|00000840| 69 61 73 20 4d 61 6e 61 | 67 65 72 20 75 73 65 20 |ias Mana|ger use |
|00000850| 74 68 65 73 65 20 64 65 | 66 69 6e 65 73 3a 0d 23 |these de|fines:.#|
|00000860| 64 65 66 69 6e 65 20 67 | 65 73 74 61 6c 74 41 6c |define g|estaltAl|
|00000870| 69 61 73 4d 67 72 41 74 | 74 72 20 09 09 09 27 61 |iasMgrAt|tr ...'a|
|00000880| 6c 69 73 27 09 2f 2f 20 | 61 73 20 64 65 66 69 6e |lis'.// |as defin|
|00000890| 65 64 20 69 6e 20 47 65 | 73 74 61 6c 74 45 71 75 |ed in Ge|staltEqu|
|000008a0| 2e 68 0d 23 64 65 66 69 | 6e 65 20 67 65 73 74 61 |.h.#defi|ne gesta|
|000008b0| 6c 74 41 6c 69 61 73 4d | 67 72 53 75 70 70 6f 72 |ltAliasM|grSuppor|
|000008c0| 74 73 52 65 6d 6f 74 65 | 41 70 70 6c 65 74 61 6c |tsRemote|Appletal|
|000008d0| 6b 09 31 0d 54 6f 20 75 | 73 65 20 41 52 41 20 32 |k.1.To u|se ARA 2|
|000008e0| 2e 30 20 66 65 61 74 75 | 72 65 73 2c 20 63 61 6c |.0 featu|res, cal|
|000008f0| 6c 20 5f 47 65 73 74 61 | 6c 74 20 75 73 69 6e 67 |l _Gesta|lt using|
|00000900| 20 74 68 65 73 65 20 64 | 65 66 69 6e 65 73 2e 0d | these d|efines..|
|00000910| 23 64 65 66 69 6e 65 20 | 67 65 73 74 61 6c 74 52 |#define |gestaltR|
|00000920| 65 6d 6f 74 65 41 63 63 | 65 73 73 43 61 6c 6c 4f |emoteAcc|essCallO|
|00000930| 6e 6c 79 09 09 09 31 09 | 2f 2f 20 63 68 65 63 6b |nly...1.|// check|
|00000940| 73 20 66 6f 72 20 41 52 | 41 20 63 6c 69 65 6e 74 |s for AR|A client|
|00000950| 0d 23 64 65 66 69 6e 65 | 20 67 65 73 74 61 6c 74 |.#define| gestalt|
|00000960| 52 65 6d 6f 74 65 41 63 | 63 65 73 73 4d 50 53 65 |RemoteAc|cessMPSe|
|00000970| 72 76 65 72 09 09 09 32 | 09 2f 2f 20 63 68 65 63 |rver...2|.// chec|
|00000980| 6b 73 20 66 6f 72 20 41 | 52 41 20 6d 75 6c 74 69 |ks for A|RA multi|
|00000990| 2d 70 6f 72 74 20 73 65 | 72 76 65 72 0d 23 64 65 |-port se|rver.#de|
|000009a0| 66 69 6e 65 20 67 65 73 | 74 61 6c 74 52 65 6d 6f |fine ges|taltRemo|
|000009b0| 74 65 41 63 63 65 73 73 | 56 65 72 73 32 09 09 09 |teAccess|Vers2...|
|000009c0| 33 09 2f 2f 20 63 68 65 | 63 6b 73 20 66 6f 72 20 |3.// che|cks for |
|000009d0| 41 52 41 20 32 2e 30 20 | 66 65 61 74 75 72 65 73 |ARA 2.0 |features|
|000009e0| 0d 53 65 72 69 61 6c 20 | 50 6f 72 74 20 41 72 62 |.Serial |Port Arb|
|000009f0| 69 74 72 61 74 69 6f 6e | 0d 57 68 65 6e 20 69 6e |itration|.When in|
|00000a00| 73 74 61 6c 6c 65 64 20 | 52 65 6d 6f 74 65 20 41 |stalled |Remote A|
|00000a10| 63 63 65 73 73 20 70 72 | 6f 76 69 64 65 73 20 73 |ccess pr|ovides s|
|00000a20| 65 72 69 61 6c 20 70 6f | 72 74 20 61 72 62 69 74 |erial po|rt arbit|
|00000a30| 72 61 74 69 6f 6e 20 74 | 68 72 6f 75 67 68 74 20 |ration t|hrought |
|00000a40| 74 68 65 20 53 65 72 69 | 61 6c 20 50 6f 72 74 20 |the Seri|al Port |
|00000a50| 41 72 62 69 74 72 61 74 | 6f 72 20 74 6f 6f 6c 2e |Arbitrat|or tool.|
|00000a60| 20 20 20 41 6c 6c 20 73 | 65 72 69 61 6c 20 64 72 | All s|erial dr|
|00000a70| 69 76 65 72 73 20 72 65 | 67 69 73 74 65 72 65 64 |ivers re|gistered|
|00000a80| 20 77 69 74 68 20 74 68 | 65 20 43 6f 6d 6d 75 6e | with th|e Commun|
|00000a90| 69 63 61 74 69 6f 6e 73 | 20 52 65 73 6f 75 72 63 |ications| Resourc|
|00000aa0| 65 20 4d 61 6e 61 67 65 | 72 20 61 72 65 20 61 72 |e Manage|r are ar|
|00000ab0| 62 69 74 72 61 74 65 64 | 20 62 79 20 74 68 65 20 |bitrated| by the |
|00000ac0| 53 65 72 69 61 6c 20 50 | 6f 72 74 20 41 72 62 69 |Serial P|ort Arbi|
|00000ad0| 74 72 61 74 6f 72 2e 20 | 20 20 0d 54 6f 20 63 68 |trator. | .To ch|
|00000ae0| 65 63 6b 20 74 6f 20 73 | 65 65 20 69 66 20 74 68 |eck to s|ee if th|
|00000af0| 65 20 53 65 72 69 61 6c | 20 50 6f 72 74 20 41 72 |e Serial| Port Ar|
|00000b00| 62 69 74 72 61 74 6f 72 | 20 69 73 20 69 6e 73 74 |bitrator| is inst|
|00000b10| 61 6c 6c 65 64 2c 20 63 | 68 65 63 6b 20 74 68 65 |alled, c|heck the|
|00000b20| 20 67 65 73 74 61 6c 74 | 53 65 72 69 61 6c 41 72 | gestalt|SerialAr|
|00000b30| 62 69 74 72 61 74 69 6f | 6e 45 78 69 73 74 73 20 |bitratio|nExists |
|00000b40| 66 6c 61 67 20 6f 66 20 | 74 68 65 20 67 65 73 74 |flag of |the gest|
|00000b50| 61 6c 74 41 72 62 69 74 | 6f 72 41 74 74 72 20 47 |altArbit|orAttr G|
|00000b60| 65 73 74 61 6c 74 20 73 | 65 6c 65 63 74 6f 72 20 |estalt s|elector |
|00000b70| 20 28 73 65 65 20 d2 47 | 65 73 74 61 6c 74 73 d3 | (see .G|estalts.|
|00000b80| 20 73 65 63 74 69 6f 6e | 20 66 6f 72 20 74 68 65 | section| for the|
|00000b90| 73 65 20 64 65 66 69 6e | 65 73 20 61 6e 64 20 61 |se defin|es and a|
|00000ba0| 6e 20 65 78 61 6d 70 6c | 65 20 6f 66 20 74 68 69 |n exampl|e of thi|
|00000bb0| 73 20 63 61 6c 6c 29 2e | 0d 49 66 20 73 65 72 69 |s call).|.If seri|
|00000bc0| 61 6c 20 70 6f 72 74 20 | 61 72 62 69 74 72 61 74 |al port |arbitrat|
|00000bd0| 69 6f 6e 20 69 73 20 70 | 72 65 73 65 6e 74 2c 20 |ion is p|resent, |
|00000be0| 63 61 6c 6c 20 4f 70 65 | 6e 44 72 69 76 65 72 20 |call Ope|nDriver |
|00000bf0| 77 68 65 6e 20 79 6f 75 | 20 77 61 6e 74 20 74 6f |when you| want to|
|00000c00| 20 75 73 65 20 61 20 73 | 65 72 69 61 6c 20 70 6f | use a s|erial po|
|00000c10| 72 74 2e 20 20 49 66 20 | 74 68 65 20 64 72 69 76 |rt. If |the driv|
|00000c20| 65 72 20 72 65 71 75 65 | 73 74 65 64 20 69 73 20 |er reque|sted is |
|00000c30| 6e 6f 74 20 6f 70 65 6e | 2c 20 4f 70 65 6e 44 72 |not open|, OpenDr|
|00000c40| 69 76 65 72 20 77 69 6c | 6c 20 72 65 74 75 72 6e |iver wil|l return|
|00000c50| 20 61 20 72 65 73 75 6c | 74 20 6f 66 20 6e 6f 45 | a resul|t of noE|
|00000c60| 72 72 20 61 6e 64 20 74 | 68 65 20 72 65 66 65 72 |rr and t|he refer|
|00000c70| 65 6e 63 65 20 6e 75 6d | 62 65 72 20 6f 66 20 74 |ence num|ber of t|
|00000c80| 68 65 20 64 72 69 76 65 | 72 2e 20 20 49 66 20 74 |he drive|r. If t|
|00000c90| 68 65 20 64 72 69 76 65 | 72 20 72 65 71 75 65 73 |he drive|r reques|
|00000ca0| 74 65 64 20 69 73 20 6f | 70 65 6e 20 28 69 6e 20 |ted is o|pen (in |
|00000cb0| 75 73 65 29 2c 20 4f 70 | 65 6e 44 72 69 76 65 72 |use), Op|enDriver|
|00000cc0| 20 77 69 6c 6c 20 72 65 | 74 75 72 6e 20 74 68 65 | will re|turn the|
|00000cd0| 20 65 72 72 6f 72 20 70 | 6f 72 74 49 6e 55 73 65 | error p|ortInUse|
|00000ce0| 2e 20 20 57 68 65 6e 20 | 79 6f 75 20 61 72 65 20 |. When |you are |
|00000cf0| 66 69 6e 69 73 68 65 64 | 20 75 73 69 6e 67 20 74 |finished| using t|
|00000d00| 68 65 20 64 72 69 76 65 | 72 2c 20 63 61 6c 6c 20 |he drive|r, call |
|00000d10| 43 6c 6f 73 65 44 72 69 | 76 65 72 2e 20 20 4f 70 |CloseDri|ver. Op|
|00000d20| 65 6e 44 72 69 76 65 72 | 20 61 6e 64 20 43 6c 6f |enDriver| and Clo|
|00000d30| 73 65 44 72 69 76 65 72 | 20 63 61 6c 6c 73 20 73 |seDriver| calls s|
|00000d40| 68 6f 75 6c 64 20 61 6c | 77 61 79 73 20 62 65 20 |hould al|ways be |
|00000d50| 62 61 6c 61 6e 63 65 64 | 2c 20 20 61 6c 74 68 6f |balanced|, altho|
|00000d60| 75 67 68 20 74 68 65 20 | 53 65 72 69 61 6c 20 50 |ugh the |Serial P|
|00000d70| 6f 72 74 20 41 72 62 69 | 74 72 61 74 6f 72 20 77 |ort Arbi|trator w|
|00000d80| 69 6c 6c 20 70 72 6f 74 | 65 63 74 20 61 67 61 69 |ill prot|ect agai|
|00000d90| 6e 73 74 20 6d 75 6c 74 | 69 70 6c 65 20 6f 70 65 |nst mult|iple ope|
|00000da0| 6e 2f 63 6c 6f 73 65 20 | 63 61 6c 6c 73 2e 20 0d |n/close |calls. .|
|00000db0| 49 66 20 73 65 72 69 61 | 6c 20 70 6f 72 74 20 61 |If seria|l port a|
|00000dc0| 72 62 69 74 72 61 74 69 | 6f 6e 20 69 73 20 6e 6f |rbitrati|on is no|
|00000dd0| 74 20 70 72 65 73 65 6e | 74 2c 20 64 6f 20 6e 6f |t presen|t, do no|
|00000de0| 74 20 75 73 65 20 4f 70 | 65 6e 44 72 69 76 65 72 |t use Op|enDriver|
|00000df0| 20 74 6f 20 64 65 74 65 | 72 6d 69 6e 65 20 69 66 | to dete|rmine if|
|00000e00| 20 74 68 65 20 64 72 69 | 76 65 72 20 69 73 20 6f | the dri|ver is o|
|00000e10| 70 65 6e 2e 20 20 49 74 | 20 77 69 6c 6c 20 72 65 |pen. It| will re|
|00000e20| 74 75 72 6e 20 79 6f 75 | 20 61 20 72 65 73 75 6c |turn you| a resul|
|00000e30| 74 20 6f 66 20 6e 6f 45 | 72 72 20 61 6e 64 20 74 |t of noE|rr and t|
|00000e40| 68 65 20 72 65 66 65 72 | 65 6e 63 65 20 6e 75 6d |he refer|ence num|
|00000e50| 62 65 72 2c 20 61 6c 6c | 6f 77 69 6e 67 20 79 6f |ber, all|owing yo|
|00000e60| 75 20 61 63 63 65 73 73 | 20 74 6f 20 61 20 64 72 |u access| to a dr|
|00000e70| 69 76 65 72 20 74 68 61 | 74 20 61 6e 6f 74 68 65 |iver tha|t anothe|
|00000e80| 72 20 61 70 70 6c 69 63 | 61 74 69 6f 6e 20 69 73 |r applic|ation is|
|00000e90| 20 75 73 69 6e 67 2e 20 | 20 20 54 6f 20 64 65 74 | using. | To det|
|00000ea0| 65 72 6d 69 6e 65 20 69 | 66 20 74 68 65 20 73 65 |ermine i|f the se|
|00000eb0| 72 69 61 6c 20 64 72 69 | 76 65 72 20 72 65 71 75 |rial dri|ver requ|
|00000ec0| 65 73 74 65 64 20 69 73 | 20 6f 70 65 6e 20 62 79 |ested is| open by|
|00000ed0| 20 61 6e 6f 74 68 65 72 | 20 61 70 70 6c 69 63 61 | another| applica|
|00000ee0| 74 69 6f 6e 2c 20 79 6f | 75 20 6d 75 73 74 20 77 |tion, yo|u must w|
|00000ef0| 61 6c 6b 20 74 68 65 20 | 44 43 45 20 28 44 65 76 |alk the |DCE (Dev|
|00000f00| 69 63 65 20 43 6f 6e 74 | 72 6f 6c 20 45 6e 74 72 |ice Cont|rol Entr|
|00000f10| 79 29 20 75 6e 69 74 20 | 74 61 62 6c 65 20 28 73 |y) unit |table (s|
|00000f20| 65 65 20 44 65 76 69 63 | 65 20 44 72 69 76 65 72 |ee Devic|e Driver|
|00000f30| 20 63 68 61 70 74 65 72 | 20 6f 66 20 49 6e 73 69 | chapter| of Insi|
|00000f40| 64 65 20 4d 61 63 69 6e | 74 6f 73 68 20 76 6f 6c |de Macin|tosh vol|
|00000f50| 20 49 49 29 2e 0d 49 74 | 20 69 73 20 69 6d 70 6f | II)..It| is impo|
|00000f60| 72 74 61 6e 74 20 74 6f | 20 75 73 65 20 74 68 65 |rtant to| use the|
|00000f70| 20 6e 65 77 20 6d 65 74 | 68 6f 64 20 69 66 20 73 | new met|hod if s|
|00000f80| 65 72 69 61 6c 20 70 6f | 72 74 20 61 72 62 69 74 |erial po|rt arbit|
|00000f90| 72 61 74 69 6f 6e 20 69 | 73 20 61 76 61 69 6c 61 |ration i|s availa|
|00000fa0| 62 6c 65 2e 20 20 52 65 | 6d 6f 74 65 20 41 63 63 |ble. Re|mote Acc|
|00000fb0| 65 73 73 2c 20 77 68 65 | 6e 20 73 65 74 20 75 70 |ess, whe|n set up|
|00000fc0| 20 66 6f 72 20 61 6e 73 | 77 65 72 69 6e 67 20 63 | for ans|wering c|
|00000fd0| 61 6c 6c 73 2c 20 69 73 | 20 70 61 73 73 69 76 65 |alls, is| passive|
|00000fe0| 6c 79 20 75 73 69 6e 67 | 20 61 20 70 61 72 74 69 |ly using| a parti|
|00000ff0| 63 75 6c 61 72 20 73 65 | 72 69 61 6c 20 64 72 69 |cular se|rial dri|
|00001000| 76 65 72 2e 20 20 49 66 | 20 79 6f 75 20 75 73 65 |ver. If| you use|
|00001010| 20 74 68 65 20 6e 65 77 | 20 6d 65 74 68 6f 64 2c | the new| method,|
|00001020| 20 74 68 65 20 53 65 72 | 69 61 6c 20 50 6f 72 74 | the Ser|ial Port|
|00001030| 20 41 72 62 69 74 72 61 | 74 6f 72 20 77 69 6c 6c | Arbitra|tor will|
|00001040| 20 67 69 76 65 20 75 70 | 20 74 68 65 20 70 61 73 | give up| the pas|
|00001050| 73 69 76 65 20 63 6c 61 | 69 6d 20 61 6e 64 20 61 |sive cla|im and a|
|00001060| 6c 6c 6f 77 20 79 6f 75 | 72 20 4f 70 65 6e 44 72 |llow you|r OpenDr|
|00001070| 69 76 65 72 20 63 61 6c | 6c 20 74 6f 20 72 65 74 |iver cal|l to ret|
|00001080| 75 72 6e 20 6e 6f 45 72 | 72 2e 20 20 4c 61 74 65 |urn noEr|r. Late|
|00001090| 72 2c 20 77 68 65 6e 20 | 79 6f 75 20 63 61 6c 6c |r, when |you call|
|000010a0| 20 43 6c 6f 73 65 44 72 | 69 76 65 72 2c 20 52 65 | CloseDr|iver, Re|
|000010b0| 6d 6f 74 65 20 41 63 63 | 65 73 73 20 77 69 6c 6c |mote Acc|ess will|
|000010c0| 20 61 67 61 69 6e 20 70 | 61 73 73 69 76 65 6c 79 | again p|assively|
|000010d0| 20 63 6c 61 69 6d 20 74 | 68 65 20 70 6f 72 74 20 | claim t|he port |
|000010e0| 61 6e 64 20 73 65 74 75 | 70 20 74 68 65 20 6d 6f |and setu|p the mo|
|000010f0| 64 65 6d 20 66 6f 72 20 | 61 6e 73 77 65 72 69 6e |dem for |answerin|
|00001100| 67 2e 20 0d 42 65 6c 6f | 77 20 69 73 20 61 20 63 |g. .Belo|w is a c|
|00001110| 6f 64 65 20 65 78 61 6d | 70 6c 65 20 69 6e 20 43 |ode exam|ple in C|
|00001120| 20 69 6c 6c 75 73 74 72 | 61 74 69 6e 67 20 68 6f | illustr|ating ho|
|00001130| 77 20 74 6f 20 75 73 65 | 20 73 65 72 69 61 6c 20 |w to use| serial |
|00001140| 70 6f 72 74 20 64 72 69 | 76 65 72 73 20 75 6e 64 |port dri|vers und|
|00001150| 65 72 20 74 68 65 20 6e | 65 77 20 61 6e 64 20 6f |er the n|ew and o|
|00001160| 6c 64 20 6d 65 74 68 6f | 64 73 3a 0d 23 69 6e 63 |ld metho|ds:.#inc|
|00001170| 6c 75 64 65 20 3c 47 65 | 73 74 61 6c 74 45 71 75 |lude <Ge|staltEqu|
|00001180| 2e 68 3e 0d 23 69 6e 63 | 6c 75 64 65 20 3c 53 79 |.h>.#inc|lude <Sy|
|00001190| 73 45 71 75 2e 68 3e 0d | 23 69 6e 63 6c 75 64 65 |sEqu.h>.|#include|
|000011a0| 20 3c 44 65 76 69 63 65 | 73 2e 68 3e 0d 23 69 6e | <Device|s.h>.#in|
|000011b0| 63 6c 75 64 65 20 3c 73 | 74 64 69 6f 2e 68 3e 0d |clude <s|tdio.h>.|
|000011c0| 23 64 65 66 69 6e 65 20 | 67 65 73 74 61 6c 74 41 |#define |gestaltA|
|000011d0| 72 62 69 74 6f 72 41 74 | 74 72 20 09 09 09 27 61 |rbitorAt|tr ...'a|
|000011e0| 72 62 20 27 0d 23 64 65 | 66 69 6e 65 20 67 65 73 |rb '.#de|fine ges|
|000011f0| 74 61 6c 74 53 65 72 69 | 61 6c 41 72 62 69 74 72 |taltSeri|alArbitr|
|00001200| 61 74 69 6f 6e 45 78 69 | 73 74 73 09 30 0d 23 64 |ationExi|sts.0.#d|
|00001210| 65 66 69 6e 65 20 64 52 | 41 4d 42 61 73 65 64 09 |efine dR|AMBased.|
|00001220| 09 09 09 09 30 78 30 30 | 34 30 0d 23 64 65 66 69 |....0x00|40.#defi|
|00001230| 6e 65 20 64 4f 70 65 6e | 65 64 09 09 09 09 09 30 |ne dOpen|ed.....0|
|00001240| 78 30 30 32 30 0d 42 6f | 6f 6c 65 61 6e 20 53 65 |x0020.Bo|olean Se|
|00001250| 72 69 61 6c 41 72 62 69 | 74 72 61 74 69 6f 6e 45 |rialArbi|trationE|
|00001260| 78 69 73 74 73 28 76 6f | 69 64 29 0d 7b 0d 09 6c |xists(vo|id).{..l|
|00001270| 6f 6e 67 09 72 65 73 70 | 6f 6e 73 65 3b 0d 09 4f |ong.resp|onse;..O|
|00001280| 53 45 72 72 09 65 72 72 | 3b 0d 09 0d 09 65 72 72 |SErr.err|;....err|
|00001290| 20 3d 20 47 65 73 74 61 | 6c 74 28 67 65 73 74 61 | = Gesta|lt(gesta|
|000012a0| 6c 74 41 72 62 69 74 6f | 72 41 74 74 72 2c 20 26 |ltArbito|rAttr, &|
|000012b0| 72 65 73 70 6f 6e 73 65 | 29 3b 0d 09 69 66 20 28 |response|);..if (|
|000012c0| 65 72 72 29 0d 09 09 72 | 65 74 75 72 6e 20 66 61 |err)...r|eturn fa|
|000012d0| 6c 73 65 3b 0d 09 72 65 | 74 75 72 6e 20 28 28 72 |lse;..re|turn ((r|
|000012e0| 65 73 70 6f 6e 73 65 20 | 3e 3e 20 67 65 73 74 61 |esponse |>> gesta|
|000012f0| 6c 74 53 65 72 69 61 6c | 41 72 62 69 74 72 61 74 |ltSerial|Arbitrat|
|00001300| 69 6f 6e 45 78 69 73 74 | 73 29 20 26 20 31 29 3b |ionExist|s) & 1);|
|00001310| 0d 7d 0d 42 6f 6f 6c 65 | 61 6e 20 44 72 69 76 65 |.}.Boole|an Drive|
|00001320| 72 49 73 4f 70 65 6e 28 | 53 74 72 69 6e 67 50 74 |rIsOpen(|StringPt|
|00001330| 72 20 64 72 69 76 65 72 | 4e 61 6d 65 29 0d 7b 0d |r driver|Name).{.|
|00001340| 09 42 6f 6f 6c 65 61 6e | 20 63 61 6e 4f 70 65 6e |.Boolean| canOpen|
|00001350| 20 3d 20 66 61 6c 73 65 | 3b 0d 09 42 6f 6f 6c 65 | = false|;..Boole|
|00001360| 61 6e 20 6d 61 74 63 68 | 20 3d 20 66 61 6c 73 65 |an match| = false|
|00001370| 3b 0d 09 73 68 6f 72 74 | 09 69 6e 64 65 78 20 3d |;..short|.index =|
|00001380| 20 30 3b 0d 09 73 68 6f | 72 74 09 63 6f 75 6e 74 | 0;..sho|rt.count|
|00001390| 3b 0d 09 44 43 74 6c 48 | 61 6e 64 6c 65 09 64 63 |;..DCtlH|andle.dc|
|000013a0| 65 48 61 6e 64 6c 65 3b | 0d 09 53 74 72 69 6e 67 |eHandle;|..String|
|000013b0| 50 74 72 09 6e 61 6d 65 | 50 74 72 3b 0d 09 44 43 |Ptr.name|Ptr;..DC|
|000013c0| 74 6c 48 61 6e 64 6c 65 | 09 2a 74 68 65 55 6e 69 |tlHandle|.*theUni|
|000013d0| 74 54 61 62 6c 65 3b 0d | 09 0d 09 2f 2f 20 74 68 |tTable;.|...// th|
|000013e0| 69 73 20 69 73 20 74 68 | 65 20 6c 6f 77 20 6d 65 |is is th|e low me|
|000013f0| 6d 6f 72 79 20 67 6c 6f | 62 61 6c 20 63 6f 6e 74 |mory glo|bal cont|
|00001400| 61 69 6e 69 6e 67 20 74 | 68 65 20 6e 75 6d 62 65 |aining t|he numbe|
|00001410| 72 20 6f 66 20 65 6e 74 | 72 69 65 73 20 0d 09 2f |r of ent|ries ../|
|00001420| 2f 20 69 6e 20 74 68 65 | 20 55 6e 69 74 20 54 61 |/ in the| Unit Ta|
|00001430| 62 6c 65 0d 09 63 6f 75 | 6e 74 20 3d 20 2a 28 73 |ble..cou|nt = *(s|
|00001440| 68 6f 72 74 20 2a 29 55 | 6e 69 74 4e 74 72 79 43 |hort *)U|nitNtryC|
|00001450| 6e 74 3b 0d 09 0d 09 74 | 68 65 55 6e 69 74 54 61 |nt;....t|heUnitTa|
|00001460| 62 6c 65 20 3d 20 2a 28 | 44 43 74 6c 48 61 6e 64 |ble = *(|DCtlHand|
|00001470| 6c 65 20 2a 2a 29 55 54 | 61 62 6c 65 42 61 73 65 |le **)UT|ableBase|
|00001480| 3b 0d 09 0d 09 77 68 69 | 6c 65 20 28 20 21 6d 61 |;....whi|le ( !ma|
|00001490| 74 63 68 20 26 26 20 28 | 69 6e 64 65 78 20 3c 20 |tch && (|index < |
|000014a0| 63 6f 75 6e 74 29 29 20 | 7b 0d 09 09 2f 2f 20 67 |count)) |{...// g|
|000014b0| 65 74 20 68 61 6e 64 6c | 65 20 74 6f 20 61 20 64 |et handl|e to a d|
|000014c0| 65 76 69 63 65 20 63 6f | 6e 74 72 6f 6c 20 65 6e |evice co|ntrol en|
|000014d0| 74 72 79 0d 09 09 64 63 | 65 48 61 6e 64 6c 65 20 |try...dc|eHandle |
|000014e0| 3d 20 74 68 65 55 6e 69 | 74 54 61 62 6c 65 5b 69 |= theUni|tTable[i|
|000014f0| 6e 64 65 78 5d 3b 0d 09 | 09 0d 09 09 69 66 20 28 |ndex];..|....if (|
|00001500| 64 63 65 48 61 6e 64 6c | 65 29 20 7b 0d 09 09 09 |dceHandl|e) {....|
|00001510| 69 66 20 28 21 28 20 28 | 2a 2a 64 63 65 48 61 6e |if (!( (|**dceHan|
|00001520| 64 6c 65 29 2e 64 43 74 | 6c 46 6c 61 67 73 20 26 |dle).dCt|lFlags &|
|00001530| 20 64 52 41 4d 42 61 73 | 65 64 29 20 29 0d 09 09 | dRAMBas|ed) )...|
|00001540| 09 09 2f 2f 20 52 41 4d | 20 62 61 73 65 64 20 64 |..// RAM| based d|
|00001550| 72 69 76 65 72 73 20 68 | 61 76 65 20 61 20 68 61 |rivers h|ave a ha|
|00001560| 6e 64 6c 65 20 74 6f 20 | 74 68 65 69 72 20 64 72 |ndle to |their dr|
|00001570| 69 76 65 72 0d 09 09 09 | 09 6e 61 6d 65 50 74 72 |iver....|.namePtr|
|00001580| 20 3d 20 28 53 74 72 69 | 6e 67 50 74 72 29 28 2a | = (Stri|ngPtr)(*|
|00001590| 2a 64 63 65 48 61 6e 64 | 6c 65 29 2e 64 43 74 6c |*dceHand|le).dCtl|
|000015a0| 44 72 69 76 65 72 2b 31 | 38 3b 0d 09 09 09 65 6c |Driver+1|8;....el|
|000015b0| 73 65 0d 09 09 09 09 2f | 2f 20 52 4f 4d 20 62 61 |se...../|/ ROM ba|
|000015c0| 73 65 64 20 64 72 69 76 | 65 72 73 20 68 61 76 65 |sed driv|ers have|
|000015d0| 20 61 20 70 6f 69 6e 74 | 65 72 20 74 6f 20 74 68 | a point|er to th|
|000015e0| 65 69 72 20 64 72 69 76 | 65 72 0d 09 09 09 09 6e |eir driv|er.....n|
|000015f0| 61 6d 65 50 74 72 20 3d | 20 28 53 74 72 69 6e 67 |amePtr =| (String|
|00001600| 50 74 72 29 20 28 2a 28 | 44 43 74 6c 50 74 72 29 |Ptr) (*(|DCtlPtr)|
|00001610| 64 63 65 48 61 6e 64 6c | 65 29 2e 64 43 74 6c 44 |dceHandl|e).dCtlD|
|00001620| 72 69 76 65 72 2b 31 38 | 3b 0d 09 09 09 2f 2f 20 |river+18|;....// |
|00001630| 6e 6f 74 20 63 61 73 65 | 20 73 65 6e 73 69 74 69 |not case| sensiti|
|00001640| 76 65 2c 20 64 69 61 63 | 72 69 74 69 63 61 6c 20 |ve, diac|ritical |
|00001650| 6d 61 72 6b 73 20 63 6f | 75 6e 74 0d 09 09 09 69 |marks co|unt....i|
|00001660| 66 20 28 52 65 6c 53 74 | 72 69 6e 67 28 64 72 69 |f (RelSt|ring(dri|
|00001670| 76 65 72 4e 61 6d 65 2c | 20 6e 61 6d 65 50 74 72 |verName,| namePtr|
|00001680| 2c 20 66 61 6c 73 65 2c | 20 74 72 75 65 29 20 3d |, false,| true) =|
|00001690| 3d 20 30 29 20 7b 0d 09 | 09 09 09 6d 61 74 63 68 |= 0) {..|...match|
|000016a0| 20 3d 20 74 72 75 65 3b | 0d 09 09 09 09 63 61 6e | = true;|.....can|
|000016b0| 4f 70 65 6e 20 3d 20 28 | 28 2a 2a 64 63 65 48 61 |Open = (|(**dceHa|
|000016c0| 6e 64 6c 65 29 2e 64 43 | 74 6c 46 6c 61 67 73 20 |ndle).dC|tlFlags |
|000016d0| 26 20 64 4f 70 65 6e 65 | 64 29 20 3f 20 74 72 75 |& dOpene|d) ? tru|
|000016e0| 65 20 3a 20 66 61 6c 73 | 65 3b 0d 09 09 09 7d 0d |e : fals|e;....}.|
|000016f0| 09 09 7d 0d 09 09 69 6e | 64 65 78 2b 2b 3b 0d 09 |..}...in|dex++;..|
|00001700| 7d 0d 09 72 65 74 75 72 | 6e 20 63 61 6e 4f 70 65 |}..retur|n canOpe|
|00001710| 6e 3b 0d 7d 0d 42 6f 6f | 6c 65 61 6e 20 43 52 4d |n;.}.Boo|lean CRM|
|00001720| 49 6e 73 74 61 6c 6c 65 | 64 28 76 6f 69 64 29 0d |Installe|d(void).|
|00001730| 7b 0d 09 6c 6f 6e 67 09 | 72 65 73 70 6f 6e 73 65 |{..long.|response|
|00001740| 3b 0d 09 4f 53 45 72 72 | 09 65 72 72 3b 0d 09 0d |;..OSErr|.err;...|
|00001750| 09 65 72 72 20 3d 20 47 | 65 73 74 61 6c 74 28 67 |.err = G|estalt(g|
|00001760| 65 73 74 61 6c 74 43 52 | 4d 41 74 74 72 2c 20 26 |estaltCR|MAttr, &|
|00001770| 72 65 73 70 6f 6e 73 65 | 29 3b 0d 09 69 66 20 28 |response|);..if (|
|00001780| 65 72 72 29 0d 09 09 72 | 65 74 75 72 6e 20 66 61 |err)...r|eturn fa|
|00001790| 6c 73 65 3b 0d 09 72 65 | 74 75 72 6e 20 28 28 72 |lse;..re|turn ((r|
|000017a0| 65 73 70 6f 6e 73 65 20 | 3e 3e 20 67 65 73 74 61 |esponse |>> gesta|
|000017b0| 6c 74 43 52 4d 50 72 65 | 73 65 6e 74 29 20 26 20 |ltCRMPre|sent) & |
|000017c0| 31 29 3b 0d 7d 0d 53 74 | 72 32 35 35 09 67 44 72 |1);.}.St|r255.gDr|
|000017d0| 69 76 65 72 4e 61 6d 65 | 73 5b 5d 20 3d 20 7b 22 |iverName|s[] = {"|
|000017e0| 5c 70 2e 4e 6f 44 72 76 | 72 22 2c 20 0d 09 09 09 |\p.NoDrv|r", ....|
|000017f0| 09 09 09 20 20 22 5c 70 | 2e 41 4f 75 74 22 2c 20 |... "\p|.AOut", |
|00001800| 0d 09 09 09 09 09 09 20 | 20 22 5c 70 2e 42 49 6e |....... | "\p.BIn|
|00001810| 22 2c 20 0d 09 09 09 09 | 09 09 20 20 22 5c 70 2e |", .....|.. "\p.|
|00001820| 42 4f 75 74 22 2c 0d 09 | 09 09 09 09 09 20 20 22 |BOut",..|..... "|
|00001830| 5c 70 2e 41 70 70 6c 65 | 43 44 22 2c 0d 09 09 09 |\p.Apple|CD",....|
|00001840| 09 09 09 20 20 22 5c 70 | 2e 4d 50 50 22 2c 0d 09 |... "\p|.MPP",..|
|00001850| 09 09 09 09 09 20 20 22 | 5c 70 2e 41 53 59 43 30 |..... "|\p.ASYC0|
|00001860| 30 22 2c 0d 09 09 09 09 | 09 09 20 20 22 5c 70 2e |0",.....|.. "\p.|
|00001870| 41 49 6e 22 0d 09 09 09 | 09 09 09 20 7d 3b 0d 23 |AIn"....|... };.#|
|00001880| 64 65 66 69 6e 65 20 54 | 45 53 54 5f 43 41 4c 4c |define T|EST_CALL|
|00001890| 0d 6d 61 69 6e 28 29 0d | 7b 0d 09 4f 53 45 72 72 |.main().|{..OSErr|
|000018a0| 09 65 72 72 20 3d 20 6e | 6f 45 72 72 3b 0d 09 73 |.err = n|oErr;..s|
|000018b0| 68 6f 72 74 09 69 3b 0d | 09 73 68 6f 72 74 09 6e |hort.i;.|.short.n|
|000018c0| 75 6d 44 72 69 76 65 72 | 73 3b 0d 09 0d 09 70 72 |umDriver|s;....pr|
|000018d0| 69 6e 74 66 28 22 54 65 | 73 74 20 6f 66 20 73 65 |intf("Te|st of se|
|000018e0| 72 69 61 6c 20 70 6f 72 | 74 20 73 74 75 66 66 5c |rial por|t stuff\|
|000018f0| 6e 22 29 3b 0d 09 69 66 | 20 28 43 52 4d 49 6e 73 |n");..if| (CRMIns|
|00001900| 74 61 6c 6c 65 64 28 29 | 29 0d 09 09 70 72 69 6e |talled()|)...prin|
|00001910| 74 66 28 22 43 6f 6d 6d | 75 6e 69 63 61 74 69 6f |tf("Comm|unicatio|
|00001920| 6e 20 52 65 73 6f 75 72 | 63 65 20 4d 61 6e 61 67 |n Resour|ce Manag|
|00001930| 65 72 20 69 73 20 69 6e | 73 74 61 6c 6c 65 64 2e |er is in|stalled.|
|00001940| 5c 6e 22 29 3b 0d 09 69 | 66 20 28 53 65 72 69 61 |\n");..i|f (Seria|
|00001950| 6c 41 72 62 69 74 72 61 | 74 69 6f 6e 45 78 69 73 |lArbitra|tionExis|
|00001960| 74 73 28 29 29 0d 09 09 | 70 72 69 6e 74 66 28 22 |ts())...|printf("|
|00001970| 53 65 72 69 61 6c 20 41 | 72 62 69 74 72 61 74 69 |Serial A|rbitrati|
|00001980| 6f 6e 20 65 78 69 73 74 | 73 5c 6e 22 29 3b 0d 09 |on exist|s\n");..|
|00001990| 09 0d 23 69 66 64 65 66 | 20 54 45 53 54 5f 43 41 |..#ifdef| TEST_CA|
|000019a0| 4c 4c 0d 09 6e 75 6d 44 | 72 69 76 65 72 73 20 3d |LL..numD|rivers =|
|000019b0| 20 73 69 7a 65 6f 66 28 | 67 44 72 69 76 65 72 4e | sizeof(|gDriverN|
|000019c0| 61 6d 65 73 29 20 2f 20 | 73 69 7a 65 6f 66 28 53 |ames) / |sizeof(S|
|000019d0| 74 72 32 35 35 29 3b 0d | 09 66 6f 72 20 28 69 20 |tr255);.|.for (i |
|000019e0| 3d 20 30 3b 20 69 20 3c | 20 6e 75 6d 44 72 69 76 |= 0; i <| numDriv|
|000019f0| 65 72 73 3b 20 69 2b 2b | 29 0d 09 09 70 72 69 6e |ers; i++|)...prin|
|00001a00| 74 66 28 22 44 72 69 76 | 65 72 49 73 4f 70 65 6e |tf("Driv|erIsOpen|
|00001a10| 28 25 23 73 29 5c 74 72 | 65 74 75 72 6e 65 64 20 |(%#s)\tr|eturned |
|00001a20| 25 73 5c 6e 22 2c 20 0d | 09 09 09 09 67 44 72 69 |%s\n", .|....gDri|
|00001a30| 76 65 72 4e 61 6d 65 73 | 5b 69 5d 2c 20 44 72 69 |verNames|[i], Dri|
|00001a40| 76 65 72 49 73 4f 70 65 | 6e 28 67 44 72 69 76 65 |verIsOpe|n(gDrive|
|00001a50| 72 4e 61 6d 65 73 5b 69 | 5d 29 3f 22 54 72 75 65 |rNames[i|])?"True|
|00001a60| 20 22 3a 22 46 61 6c 73 | 65 22 29 3b 0d 23 65 6e | ":"Fals|e");.#en|
|00001a70| 64 69 66 0d 23 69 66 64 | 65 66 20 54 45 53 54 5f |dif.#ifd|ef TEST_|
|00001a80| 4f 50 45 4e 0d 09 73 68 | 6f 72 74 09 72 65 66 4e |OPEN..sh|ort.refN|
|00001a90| 75 6d 3b 0d 09 69 66 20 | 28 21 44 72 69 76 65 72 |um;..if |(!Driver|
|00001aa0| 49 73 4f 70 65 6e 28 22 | 5c 70 2e 41 49 6e 22 29 |IsOpen("|\p.AIn")|
|00001ab0| 29 0d 09 09 65 72 72 20 | 3d 20 4f 70 65 6e 44 72 |)...err |= OpenDr|
|00001ac0| 69 76 65 72 28 22 5c 70 | 2e 41 49 6e 22 2c 20 26 |iver("\p|.AIn", &|
|00001ad0| 72 65 66 4e 75 6d 29 3b | 0d 09 69 66 20 28 65 72 |refNum);|..if (er|
|00001ae0| 72 29 0d 09 09 70 72 69 | 6e 74 66 28 22 4f 70 65 |r)...pri|ntf("Ope|
|00001af0| 6e 44 72 69 76 65 72 20 | 72 65 74 75 72 6e 65 64 |nDriver |returned|
|00001b00| 20 25 64 5c 6e 22 2c 20 | 65 72 72 29 3b 0d 09 65 | %d\n", |err);..e|
|00001b10| 72 72 20 3d 20 43 6c 6f | 73 65 44 72 69 76 65 72 |rr = Clo|seDriver|
|00001b20| 28 72 65 66 4e 75 6d 29 | 3b 0d 09 69 66 20 28 65 |(refNum)|;..if (e|
|00001b30| 72 72 29 0d 09 09 70 72 | 69 6e 74 66 28 22 43 6c |rr)...pr|intf("Cl|
|00001b40| 6f 73 65 44 72 69 76 65 | 72 20 72 65 74 75 72 6e |oseDrive|r return|
|00001b50| 65 64 20 25 64 5c 6e 22 | 2c 20 65 72 72 29 3b 0d |ed %d\n"|, err);.|
|00001b60| 23 65 6e 64 69 66 0d 7d | 0d 41 70 70 6c 65 20 52 |#endif.}|.Apple R|
|00001b70| 65 6d 6f 74 65 20 41 63 | 63 65 73 73 20 41 50 49 |emote Ac|cess API|
|00001b80| 0d 43 6f 6d 6d 6f 6e 20 | 50 61 72 61 6d 65 74 65 |.Common |Paramete|
|00001b90| 72 73 0d 54 68 65 20 54 | 52 65 6d 6f 74 65 41 63 |rs.The T|RemoteAc|
|00001ba0| 63 65 73 73 50 61 72 61 | 6d 42 6c 6f 63 6b 20 69 |cessPara|mBlock i|
|00001bb0| 73 20 61 20 75 6e 69 6f | 6e 20 6f 66 20 20 61 6c |s a unio|n of al|
|00001bc0| 6c 20 6f 66 20 74 68 65 | 20 61 76 61 69 6c 61 62 |l of the| availab|
|00001bd0| 6c 65 20 41 70 70 6c 65 | 20 52 65 6d 6f 74 65 20 |le Apple| Remote |
|00001be0| 41 63 63 65 73 73 20 41 | 50 49 20 63 6f 6d 6d 61 |Access A|PI comma|
|00001bf0| 6e 64 73 2e 20 20 54 68 | 65 20 54 52 65 6d 6f 74 |nds. Th|e TRemot|
|00001c00| 65 41 63 63 65 73 73 50 | 61 72 6d 48 65 61 64 65 |eAccessP|armHeade|
|00001c10| 72 20 69 73 20 61 20 73 | 74 72 75 63 74 20 77 68 |r is a s|truct wh|
|00001c20| 69 63 68 20 63 6f 6e 73 | 69 73 74 73 20 6f 66 20 |ich cons|ists of |
|00001c30| 61 20 44 43 6f 6e 74 72 | 6f 6c 50 61 72 61 6d 48 |a DContr|olParamH|
|00001c40| 65 61 64 65 72 20 66 6f | 6c 6c 6f 77 65 64 20 62 |eader fo|llowed b|
|00001c50| 79 20 61 20 44 45 78 74 | 65 6e 64 65 64 50 61 72 |y a DExt|endedPar|
|00001c60| 61 6d 20 77 68 69 63 68 | 20 69 73 20 66 6f 6c 6c |am which| is foll|
|00001c70| 6f 77 65 64 20 62 79 20 | 61 20 44 52 65 6d 6f 74 |owed by |a DRemot|
|00001c80| 65 41 63 63 65 73 73 50 | 61 72 6d 48 65 61 64 65 |eAccessP|armHeade|
|00001c90| 72 2e 20 20 54 68 65 20 | 65 78 74 65 6e 64 65 64 |r. The |extended|
|00001ca0| 43 6f 64 65 20 20 69 73 | 20 75 73 65 64 20 74 6f |Code is| used to|
|00001cb0| 20 73 70 65 63 69 66 79 | 20 74 68 65 20 41 70 70 | specify| the App|
|00001cc0| 6c 65 20 52 65 6d 6f 74 | 65 20 41 63 63 65 73 73 |le Remot|e Access|
|00001cd0| 20 41 50 49 20 20 63 6f | 6d 6d 61 6e 64 20 77 61 | API co|mmand wa|
|00001ce0| 6e 74 65 64 2e 20 20 54 | 68 65 20 72 65 73 75 6c |nted. T|he resul|
|00001cf0| 74 53 74 72 50 74 72 20 | 66 69 65 6c 64 20 72 65 |tStrPtr |field re|
|00001d00| 74 75 72 6e 73 20 61 20 | 50 61 73 63 61 6c 20 73 |turns a |Pascal s|
|00001d10| 74 72 69 6e 67 20 74 6f | 20 69 6e 64 69 63 61 74 |tring to| indicat|
|00001d20| 65 20 77 68 61 74 20 65 | 72 72 6f 72 20 6f 63 63 |e what e|rror occ|
|00001d30| 75 72 72 65 64 2e 20 20 | 49 66 20 79 6f 75 20 61 |urred. |If you a|
|00001d40| 72 65 20 6e 6f 74 20 69 | 6e 74 65 72 65 73 74 65 |re not i|ntereste|
|00001d50| 64 20 69 6e 20 74 68 65 | 20 73 74 72 69 6e 67 2c |d in the| string,|
|00001d60| 20 73 65 74 20 74 68 69 | 73 20 66 69 65 6c 64 20 | set thi|s field |
|00001d70| 74 6f 20 6e 69 6c 2e 20 | 20 49 66 20 79 6f 75 20 |to nil. | If you |
|00001d80| 64 6f 20 70 61 73 73 20 | 61 20 70 6f 69 6e 74 65 |do pass |a pointe|
|00001d90| 72 20 68 6f 77 65 76 65 | 72 2c 20 69 74 20 6d 75 |r howeve|r, it mu|
|00001da0| 73 74 20 70 6f 69 6e 74 | 20 74 6f 20 61 20 62 75 |st point| to a bu|
|00001db0| 66 66 65 72 20 6f 66 20 | 61 74 20 6c 65 61 73 74 |ffer of |at least|
|00001dc0| 20 32 35 36 20 62 79 74 | 65 73 20 69 6e 20 6c 65 | 256 byt|es in le|
|00001dd0| 6e 67 74 68 2e 20 20 49 | 66 20 74 68 65 20 72 65 |ngth. I|f the re|
|00001de0| 73 75 6c 74 20 6f 66 20 | 74 68 65 20 63 61 6c 6c |sult of |the call|
|00001df0| 20 68 61 70 70 65 6e 73 | 20 74 6f 20 62 65 20 6e | happens| to be n|
|00001e00| 6f 45 72 72 2c 20 74 68 | 65 6e 20 74 68 65 20 6c |oErr, th|en the l|
|00001e10| 65 6e 67 74 68 20 62 79 | 74 65 20 6f 66 20 74 68 |ength by|te of th|
|00001e20| 65 20 73 74 72 69 6e 67 | 20 77 69 6c 6c 20 62 65 |e string| will be|
|00001e30| 20 7a 65 72 6f 2e 20 20 | 20 53 69 6e 63 65 20 74 | zero. | Since t|
|00001e40| 68 69 73 20 76 65 72 73 | 69 6f 6e 20 6f 66 20 52 |his vers|ion of R|
|00001e50| 65 6d 6f 74 65 20 41 63 | 63 65 73 73 20 6f 6e 6c |emote Ac|cess onl|
|00001e60| 79 20 64 65 61 6c 73 20 | 77 69 74 68 20 74 68 65 |y deals |with the|
|00001e70| 20 75 73 65 72 20 70 6f | 72 74 2c 20 74 68 65 20 | user po|rt, the |
|00001e80| 70 61 72 61 6d 65 74 65 | 72 20 70 6f 72 74 47 6c |paramete|r portGl|
|00001e90| 6f 62 61 6c 73 50 74 72 | 20 73 68 6f 75 6c 64 20 |obalsPtr| should |
|00001ea0| 61 6c 77 61 79 73 20 62 | 65 20 73 65 74 20 74 6f |always b|e set to|
|00001eb0| 20 7a 65 72 6f 2e 20 20 | 54 68 65 20 63 73 43 6f | zero. |The csCo|
|00001ec0| 64 65 20 66 69 65 6c 64 | 20 73 68 6f 75 6c 64 20 |de field| should |
|00001ed0| 6e 6f 72 6d 61 6c 6c 79 | 20 73 65 74 20 74 6f 20 |normally| set to |
|00001ee0| 52 41 4d 5f 45 58 54 45 | 4e 44 45 44 5f 43 41 4c |RAM_EXTE|NDED_CAL|
|00001ef0| 4c 20 61 6e 64 20 74 68 | 65 20 65 78 74 65 6e 64 |L and th|e extend|
|00001f00| 65 64 54 79 70 65 20 69 | 73 20 73 65 74 20 74 6f |edType i|s set to|
|00001f10| 20 52 45 4d 4f 54 45 41 | 43 43 45 53 53 4e 41 4d | REMOTEA|CCESSNAM|
|00001f20| 45 2e 20 20 54 68 65 73 | 65 20 63 6f 6e 73 74 61 |E. Thes|e consta|
|00001f30| 6e 74 73 20 61 72 65 20 | 64 65 66 69 6e 65 64 20 |nts are |defined |
|00001f40| 69 6e 20 52 65 6d 6f 74 | 65 41 63 63 65 73 73 49 |in Remot|eAccessI|
|00001f50| 6e 74 65 72 66 61 63 65 | 2e 68 2e 0d 23 64 65 66 |nterface|.h..#def|
|00001f60| 69 6e 65 20 44 43 6f 6e | 74 72 6f 6c 50 61 72 61 |ine DCon|trolPara|
|00001f70| 6d 48 65 61 64 65 72 20 | 5c 0d 09 51 45 6c 65 6d |mHeader |\..QElem|
|00001f80| 09 2a 71 4c 69 6e 6b 3b | 09 2f 2f 20 6e 65 78 74 |.*qLink;|.// next|
|00001f90| 20 71 75 65 75 65 20 65 | 6e 74 72 79 20 5c 0d 09 | queue e|ntry \..|
|00001fa0| 73 68 6f 72 74 09 71 54 | 79 70 65 3b 09 09 2f 2f |short.qT|ype;..//|
|00001fb0| 20 71 75 65 75 65 20 74 | 79 70 65 20 5c 0d 09 73 | queue t|ype \..s|
|00001fc0| 68 6f 72 74 09 69 6f 54 | 72 61 70 3b 09 2f 2f 20 |hort.ioT|rap;.// |
|00001fd0| 72 6f 75 74 69 6e 65 20 | 74 72 61 70 20 5c 0d 09 |routine |trap \..|
|00001fe0| 50 74 72 09 69 6f 43 6d | 64 41 64 64 72 3b 09 2f |Ptr.ioCm|dAddr;./|
|00001ff0| 2f 20 72 6f 75 74 69 6e | 65 20 61 64 64 72 65 73 |/ routin|e addres|
|00002000| 73 20 5c 0d 09 50 72 6f | 63 50 74 72 09 69 6f 43 |s \..Pro|cPtr.ioC|
|00002010| 6f 6d 70 6c 65 74 69 6f | 6e 3b 09 2f 2f 20 63 6f |ompletio|n;.// co|
|00002020| 6d 70 6c 65 74 69 6f 6e | 20 72 6f 75 74 69 6e 65 |mpletion| routine|
|00002030| 20 5c 0d 09 4f 53 45 72 | 72 09 69 6f 52 65 73 75 | \..OSEr|r.ioResu|
|00002040| 6c 74 3b 09 2f 2f 20 72 | 65 73 75 6c 74 20 63 6f |lt;.// r|esult co|
|00002050| 64 65 20 5c 0d 09 6c 6f | 6e 67 09 75 73 65 72 44 |de \..lo|ng.userD|
|00002060| 61 74 61 3b 09 2f 2f 20 | 66 6f 72 20 75 73 65 20 |ata;.// |for use |
|00002070| 62 79 20 74 68 65 20 75 | 73 65 72 20 5c 0d 09 73 |by the u|ser \..s|
|00002080| 68 6f 72 74 09 75 6e 75 | 73 65 64 3b 09 2f 2f 20 |hort.unu|sed;.// |
|00002090| 75 6e 75 73 65 64 20 66 | 69 65 6c 64 20 5c 0d 09 |unused f|ield \..|
|000020a0| 73 68 6f 72 74 09 69 6f | 52 65 66 4e 75 6d 3b 09 |short.io|RefNum;.|
|000020b0| 2f 2f 20 64 72 69 76 65 | 72 20 72 65 66 65 72 65 |// drive|r refere|
|000020c0| 6e 63 65 20 6e 75 6d 62 | 65 72 20 5c 0d 09 73 68 |nce numb|er \..sh|
|000020d0| 6f 72 74 09 63 73 43 6f | 64 65 3b 09 2f 2f 20 6e |ort.csCo|de;.// n|
|000020e0| 6f 72 6d 61 6c 6c 79 20 | 73 65 74 20 74 6f 20 52 |ormally |set to R|
|000020f0| 41 4d 5f 45 58 54 45 4e | 44 45 44 5f 43 41 4c 4c |AM_EXTEN|DED_CALL|
|00002100| 0d 09 09 09 09 09 09 2f | 2f 20 66 6f 72 20 41 70 |......./|/ for Ap|
|00002110| 70 6c 65 20 52 65 6d 6f | 74 65 20 41 63 63 65 73 |ple Remo|te Acces|
|00002120| 73 20 41 50 49 20 20 63 | 61 6c 6c 73 0d 23 64 65 |s API c|alls.#de|
|00002130| 66 69 6e 65 20 44 45 78 | 74 65 6e 64 65 64 50 61 |fine DEx|tendedPa|
|00002140| 72 61 6d 20 5c 0d 09 44 | 43 6f 6e 74 72 6f 6c 50 |ram \..D|ControlP|
|00002150| 61 72 61 6d 48 65 61 64 | 65 72 20 5c 0d 09 50 74 |aramHead|er \..Pt|
|00002160| 72 09 68 52 65 73 65 72 | 76 65 64 31 3b 20 5c 0d |r.hReser|ved1; \.|
|00002170| 09 50 74 72 09 68 52 65 | 73 65 72 76 65 64 32 3b |.Ptr.hRe|served2;|
|00002180| 20 5c 0d 09 50 74 72 09 | 72 65 73 75 6c 74 53 74 | \..Ptr.|resultSt|
|00002190| 72 50 74 72 3b 20 5c 09 | 2f 2f 20 73 65 74 20 74 |rPtr; \.|// set t|
|000021a0| 6f 20 7a 65 72 6f 20 69 | 66 20 72 65 73 75 6c 74 |o zero i|f result|
|000021b0| 20 73 74 72 69 6e 67 20 | 69 73 20 75 6e 77 61 6e | string |is unwan|
|000021c0| 74 65 64 0d 09 50 74 72 | 09 65 78 74 65 6e 64 65 |ted..Ptr|.extende|
|000021d0| 64 54 79 70 65 3b 09 09 | 2f 2f 20 70 6f 69 6e 74 |dType;..|// point|
|000021e0| 65 72 20 74 6f 20 69 64 | 65 6e 74 69 66 69 65 72 |er to id|entifier|
|000021f0| 20 73 74 72 69 6e 67 2c | 20 6e 6f 72 6d 61 6c 6c | string,| normall|
|00002200| 79 20 73 65 74 20 74 6f | 20 09 09 09 09 09 09 2f |y set to| ....../|
|00002210| 2f 20 52 45 4d 4f 54 45 | 41 43 43 45 53 53 4e 41 |/ REMOTE|ACCESSNA|
|00002220| 4d 45 20 66 6f 72 20 41 | 70 70 6c 65 20 52 65 6d |ME for A|pple Rem|
|00002230| 6f 74 65 20 41 63 63 65 | 73 73 20 41 50 49 20 20 |ote Acce|ss API |
|00002240| 63 61 6c 6c 73 0d 23 64 | 65 66 69 6e 65 20 44 52 |calls.#d|efine DR|
|00002250| 65 6d 6f 74 65 41 63 63 | 65 73 73 50 61 72 6d 48 |emoteAcc|essParmH|
|00002260| 65 61 64 65 72 20 5c 0d | 09 44 45 78 74 65 6e 64 |eader \.|.DExtend|
|00002270| 65 64 50 61 72 61 6d 20 | 5c 0d 09 73 68 6f 72 74 |edParam |\..short|
|00002280| 09 65 78 74 65 6e 64 65 | 64 43 6f 64 65 3b 09 09 |.extende|dCode;..|
|00002290| 2f 2f 20 66 6f 72 20 75 | 73 65 20 62 79 20 65 78 |// for u|se by ex|
|000022a0| 74 65 6e 64 65 64 20 63 | 61 6c 6c 20 70 72 6f 63 |tended c|all proc|
|000022b0| 20 5c 0d 09 50 74 72 09 | 70 6f 72 74 47 6c 6f 62 | \..Ptr.|portGlob|
|000022c0| 61 6c 73 50 74 72 3b 09 | 2f 2f 20 70 6f 69 6e 74 |alsPtr;.|// point|
|000022d0| 65 72 20 74 6f 20 67 6c | 6f 62 61 6c 73 20 66 6f |er to gl|obals fo|
|000022e0| 72 20 74 68 69 73 20 70 | 6f 72 74 20 28 30 3d 75 |r this p|ort (0=u|
|000022f0| 73 65 72 70 6f 72 74 29 | 20 5c 0d 73 74 72 75 63 |serport)| \.struc|
|00002300| 74 20 54 52 65 6d 6f 74 | 65 41 63 63 65 73 73 50 |t TRemot|eAccessP|
|00002310| 61 72 6d 48 65 61 64 65 | 72 0d 7b 0d 09 44 52 65 |armHeade|r.{..DRe|
|00002320| 6d 6f 74 65 41 63 63 65 | 73 73 50 61 72 6d 48 65 |moteAcce|ssParmHe|
|00002330| 61 64 65 72 0d 7d 3b 0d | 74 79 70 65 64 65 66 20 |ader.};.|typedef |
|00002340| 73 74 72 75 63 74 20 54 | 52 65 6d 6f 74 65 41 63 |struct T|RemoteAc|
|00002350| 63 65 73 73 50 61 72 6d | 48 65 61 64 65 72 20 54 |cessParm|Header T|
|00002360| 52 65 6d 6f 74 65 41 63 | 63 65 73 73 50 61 72 6d |RemoteAc|cessParm|
|00002370| 48 65 61 64 65 72 3b 0d | 75 6e 69 6f 6e 20 54 52 |Header;.|union TR|
|00002380| 65 6d 6f 74 65 41 63 63 | 65 73 73 50 61 72 61 6d |emoteAcc|essParam|
|00002390| 42 6c 6f 63 6b 0d 7b 0d | 09 54 52 65 6d 6f 74 65 |Block.{.|.TRemote|
|000023a0| 41 63 63 65 73 73 50 61 | 72 6d 48 65 61 64 65 72 |AccessPa|rmHeader|
|000023b0| 09 48 44 52 3b 09 09 2f | 2f 20 68 65 61 64 65 72 |.HDR;../|/ header|
|000023c0| 20 70 62 0d 09 54 52 65 | 6d 6f 74 65 41 63 63 65 | pb..TRe|moteAcce|
|000023d0| 73 73 50 61 72 6d 48 65 | 61 64 65 72 09 4c 4f 41 |ssParmHe|ader.LOA|
|000023e0| 44 3b 09 09 2f 2f 20 6c | 6f 61 64 20 70 62 0d 09 |D;..// l|oad pb..|
|000023f0| 54 52 65 6d 6f 74 65 41 | 63 63 65 73 73 50 61 72 |TRemoteA|ccessPar|
|00002400| 6d 48 65 61 64 65 72 09 | 55 4e 4c 4f 41 44 3b 09 |mHeader.|UNLOAD;.|
|00002410| 2f 2f 20 75 6e 6c 6f 61 | 64 20 70 62 0d 09 54 52 |// unloa|d pb..TR|
|00002420| 65 6d 6f 74 65 41 63 63 | 65 73 73 43 6f 6e 6e 65 |emoteAcc|essConne|
|00002430| 63 74 50 61 72 61 6d 09 | 43 4f 4e 4e 45 43 54 3b |ctParam.|CONNECT;|
|00002440| 09 2f 2f 20 63 6f 6e 6e | 65 63 74 20 70 62 0d 09 |.// conn|ect pb..|
|00002450| 54 52 65 6d 6f 74 65 41 | 63 63 65 73 73 44 69 73 |TRemoteA|ccessDis|
|00002460| 63 6f 6e 6e 65 63 74 50 | 61 72 61 6d 20 09 44 49 |connectP|aram .DI|
|00002470| 53 43 4f 4e 4e 45 43 54 | 3b 09 2f 2f 20 64 69 73 |SCONNECT|;.// dis|
|00002480| 63 6f 6e 6e 65 63 74 20 | 70 62 0d 09 54 52 65 6d |connect |pb..TRem|
|00002490| 6f 74 65 41 63 63 65 73 | 73 53 74 61 74 75 73 50 |oteAcces|sStatusP|
|000024a0| 61 72 61 6d 09 53 54 41 | 54 55 53 3b 09 2f 2f 20 |aram.STA|TUS;.// |
|000024b0| 67 65 74 20 63 75 72 72 | 65 6e 74 20 73 74 61 74 |get curr|ent stat|
|000024c0| 75 73 0d 09 54 52 65 6d | 6f 74 65 41 63 63 65 73 |us..TRem|oteAcces|
|000024d0| 73 49 73 52 65 6d 6f 74 | 65 50 61 72 6d 73 09 49 |sIsRemot|eParms.I|
|000024e0| 53 52 45 4d 4f 54 45 3b | 09 2f 2f 20 63 68 65 63 |SREMOTE;|.// chec|
|000024f0| 6b 20 6e 65 74 77 6f 72 | 6b 20 61 64 64 72 65 73 |k networ|k addres|
|00002500| 73 20 6c 6f 63 61 74 69 | 6f 6e 0d 09 54 52 65 6d |s locati|on..TRem|
|00002510| 6f 74 65 41 63 63 65 73 | 73 50 61 73 73 77 6f 72 |oteAcces|sPasswor|
|00002520| 64 4d 75 6e 67 65 72 09 | 4d 55 4e 47 45 50 57 3b |dMunger.|MUNGEPW;|
|00002530| 09 2f 2f 20 72 75 6e 20 | 70 61 73 73 77 6f 72 64 |.// run |password|
|00002540| 20 74 68 72 6f 75 67 68 | 20 6d 75 6e 67 65 72 0d | through| munger.|
|00002550| 09 54 52 65 6d 6f 74 65 | 41 63 63 65 73 73 47 65 |.TRemote|AccessGe|
|00002560| 74 43 6f 64 65 48 6f 6f | 6b 73 09 43 4f 44 45 48 |tCodeHoo|ks.CODEH|
|00002570| 4f 4f 4b 53 3b 09 2f 2f | 20 67 65 74 20 69 6e 74 |OOKS;.//| get int|
|00002580| 65 72 6e 61 6c 20 63 6f | 64 65 20 68 6f 6f 6b 73 |ernal co|de hooks|
|00002590| 0d 09 2f 2a 20 32 2e 30 | 20 61 6e 64 20 61 62 6f |../* 2.0| and abo|
|000025a0| 76 65 20 6f 6e 6c 79 c9 | 20 2a 2f 0d 09 54 39 37 |ve only.| */..T97|
|000025b0| 36 53 65 74 4f 6e 6c 69 | 6e 65 4e 6f 74 69 66 79 |6SetOnli|neNotify|
|000025c0| 09 4f 4e 4c 49 4e 45 5f | 4e 4f 54 49 46 59 09 2f |.ONLINE_|NOTIFY./|
|000025d0| 2f 20 75 73 65 64 20 74 | 6f 20 74 6f 67 67 6c 65 |/ used t|o toggle|
|000025e0| 20 74 68 65 20 73 74 61 | 74 65 0d 09 09 09 09 09 | the sta|te......|
|000025f0| 2f 2f 20 6f 66 20 6e 6f | 74 69 66 69 63 61 74 69 |// of no|tificati|
|00002600| 6f 6e 0d 09 75 6e 73 69 | 67 6e 65 64 20 63 68 61 |on..unsi|gned cha|
|00002610| 72 09 09 66 69 6c 6c 65 | 72 5b 32 35 36 5d 3b 09 |r..fille|r[256];.|
|00002620| 09 2f 2f 20 73 65 74 20 | 74 68 65 20 6d 69 6e 69 |.// set |the mini|
|00002630| 6d 75 6d 20 73 69 7a 65 | 20 6f 66 20 74 68 69 73 |mum size| of this|
|00002640| 20 09 09 09 09 09 09 09 | 09 2f 2f 20 70 61 72 61 | .......|.// para|
|00002650| 6d 65 74 65 72 20 62 6c | 6f 63 6b 0d 7d 3b 0d 74 |meter bl|ock.};.t|
|00002660| 79 70 65 64 65 66 20 75 | 6e 69 6f 6e 20 54 52 65 |ypedef u|nion TRe|
|00002670| 6d 6f 74 65 41 63 63 65 | 73 73 50 61 72 61 6d 42 |moteAcce|ssParamB|
|00002680| 6c 6f 63 6b 20 54 52 65 | 6d 6f 74 65 41 63 63 65 |lock TRe|moteAcce|
|00002690| 73 73 50 61 72 61 6d 42 | 6c 6f 63 6b 3b 0d 74 79 |ssParamB|lock;.ty|
|000026a0| 70 65 64 65 66 20 54 52 | 65 6d 6f 74 65 41 63 63 |pedef TR|emoteAcc|
|000026b0| 65 73 73 50 61 72 61 6d | 42 6c 6f 63 6b 20 2a 54 |essParam|Block *T|
|000026c0| 50 52 65 6d 6f 74 65 41 | 63 63 65 73 73 50 61 72 |PRemoteA|ccessPar|
|000026d0| 61 6d 42 6c 6f 63 6b 3b | 0d 4c 6f 61 64 0d 54 68 |amBlock;|.Load.Th|
|000026e0| 65 20 6c 6f 61 64 20 63 | 6f 6d 6d 61 6e 64 20 69 |e load c|ommand i|
|000026f0| 73 20 75 73 65 64 20 74 | 6f 20 65 6e 73 75 72 65 |s used t|o ensure|
|00002700| 20 74 68 61 74 20 74 68 | 65 20 52 65 6d 6f 74 65 | that th|e Remote|
|00002710| 20 41 63 63 65 73 73 20 | 4d 61 6e 61 67 65 72 20 | Access |Manager |
|00002720| 69 73 20 6c 6f 61 64 65 | 64 20 69 6e 74 6f 20 6d |is loade|d into m|
|00002730| 65 6d 6f 72 79 20 61 6e | 64 20 6d 75 73 74 20 62 |emory an|d must b|
|00002740| 65 20 75 73 65 64 20 62 | 65 66 6f 72 65 20 6d 61 |e used b|efore ma|
|00002750| 6b 69 6e 67 20 61 20 43 | 6f 6e 6e 65 63 74 20 63 |king a C|onnect c|
|00002760| 61 6c 6c 20 2e 20 20 49 | 74 20 75 73 65 73 20 74 |all . I|t uses t|
|00002770| 68 65 20 73 74 61 6e 64 | 61 72 64 20 54 52 65 6d |he stand|ard TRem|
|00002780| 6f 74 65 41 63 63 65 73 | 73 50 61 72 6d 42 6c 6f |oteAcces|sParmBlo|
|00002790| 63 6b 20 61 73 20 74 68 | 65 20 70 61 72 61 6d 65 |ck as th|e parame|
|000027a0| 74 65 72 20 62 6c 6f 63 | 6b 2e 20 20 54 68 65 20 |ter bloc|k. The |
|000027b0| 65 78 61 6d 70 6c 65 20 | 63 6f 64 65 20 62 65 6c |example |code bel|
|000027c0| 6f 77 20 73 68 6f 77 73 | 20 68 6f 77 20 69 74 20 |ow shows| how it |
|000027d0| 77 6f 72 6b 73 2e 20 20 | 54 6f 20 75 73 65 20 74 |works. |To use t|
|000027e0| 68 65 20 4d 75 6e 67 65 | 50 57 20 63 6f 6d 6d 61 |he Munge|PW comma|
|000027f0| 6e 64 2c 20 69 74 20 69 | 73 20 6e 6f 74 20 6e 65 |nd, it i|s not ne|
|00002800| 63 65 73 73 61 72 79 20 | 74 6f 20 75 73 65 20 74 |cessary |to use t|
|00002810| 68 65 20 6c 6f 61 64 20 | 63 6f 6d 6d 61 6e 64 20 |he load |command |
|00002820| 66 69 72 73 74 2e 0d 23 | 69 6e 63 6c 75 64 65 20 |first..#|include |
|00002830| d2 52 65 6d 6f 74 65 41 | 63 63 65 73 73 49 6e 74 |.RemoteA|ccessInt|
|00002840| 65 72 66 61 63 65 2e 68 | d3 0d 76 6f 69 64 20 4c |erface.h|..void L|
|00002850| 6f 61 64 52 65 6d 6f 74 | 65 41 63 63 65 73 73 28 |oadRemot|eAccess(|
|00002860| 29 0d 7b 0d 09 54 52 65 | 6d 6f 74 65 41 63 63 65 |).{..TRe|moteAcce|
|00002870| 73 73 50 61 72 61 6d 42 | 6c 6f 63 6b 20 6c 6f 61 |ssParamB|lock loa|
|00002880| 64 50 42 3b 0d 09 0d 09 | 6c 6f 61 64 50 42 2e 4c |dPB;....|loadPB.L|
|00002890| 4f 41 44 2e 63 73 43 6f | 64 65 20 3d 20 52 41 4d |OAD.csCo|de = RAM|
|000028a0| 5f 45 58 54 45 4e 44 45 | 44 5f 43 41 4c 4c 3b 09 |_EXTENDE|D_CALL;.|
|000028b0| 2f 2f 20 65 78 74 65 6e | 64 65 64 20 63 61 6c 6c |// exten|ded call|
|000028c0| 0d 09 6c 6f 61 64 50 42 | 2e 4c 4f 41 44 2e 72 65 |..loadPB|.LOAD.re|
|000028d0| 73 75 6c 74 53 74 72 50 | 74 72 20 3d 20 6e 69 6c |sultStrP|tr = nil|
|000028e0| 3b 09 2f 2f 20 72 65 73 | 75 6c 74 20 73 74 72 69 |;.// res|ult stri|
|000028f0| 6e 67 0d 09 6c 6f 61 64 | 50 42 2e 4c 4f 41 44 2e |ng..load|PB.LOAD.|
|00002900| 65 78 74 65 6e 64 65 64 | 54 79 70 65 20 3d 20 52 |extended|Type = R|
|00002910| 45 4d 4f 54 45 41 43 43 | 45 53 53 4e 41 4d 45 3b |EMOTEACC|ESSNAME;|
|00002920| 09 2f 2f 20 74 6f 20 72 | 65 6d 6f 74 65 20 61 63 |.// to r|emote ac|
|00002930| 63 65 73 73 0d 09 6c 6f | 61 64 50 42 2e 4c 4f 41 |cess..lo|adPB.LOA|
|00002940| 44 2e 65 78 74 65 6e 64 | 65 64 43 6f 64 65 20 3d |D.extend|edCode =|
|00002950| 20 43 6d 64 52 65 6d 6f | 74 65 41 63 63 65 73 73 | CmdRemo|teAccess|
|00002960| 5f 4c 6f 61 64 3b 09 2f | 2f 20 74 72 79 20 74 6f |_Load;./|/ try to|
|00002970| 20 6c 6f 61 64 0d 09 50 | 42 52 65 6d 6f 74 65 41 | load..P|BRemoteA|
|00002980| 63 63 65 73 73 28 26 6c | 6f 61 64 50 42 2c 20 66 |ccess(&l|oadPB, f|
|00002990| 61 6c 73 65 29 3b 09 2f | 2f 20 69 73 73 75 65 20 |alse);./|/ issue |
|000029a0| 73 79 6e 63 20 63 61 6c | 6c 0d 09 69 66 20 28 6c |sync cal|l..if (l|
|000029b0| 6f 61 64 50 42 2e 4c 4f | 41 44 2e 69 6f 52 65 73 |oadPB.LO|AD.ioRes|
|000029c0| 75 6c 74 29 0d 09 09 53 | 68 6f 77 45 72 72 6f 72 |ult)...S|howError|
|000029d0| 28 6c 6f 61 64 50 42 2e | 4c 4f 41 44 2e 69 6f 52 |(loadPB.|LOAD.ioR|
|000029e0| 65 73 75 6c 74 29 3b 0d | 7d 0d 55 6e 6c 6f 61 64 |esult);.|}.Unload|
|000029f0| 0d 54 68 65 20 75 6e 6c | 6f 61 64 20 63 6f 6d 6d |.The unl|oad comm|
|00002a00| 61 6e 64 20 69 73 20 75 | 73 65 64 20 74 6f 20 72 |and is u|sed to r|
|00002a10| 65 6c 65 61 73 65 20 74 | 68 65 20 52 65 6d 6f 74 |elease t|he Remot|
|00002a20| 65 20 41 63 63 65 73 73 | 20 4d 61 6e 61 67 65 72 |e Access| Manager|
|00002a30| 20 61 6e 64 20 66 72 65 | 65 20 69 74 73 20 6d 65 | and fre|e its me|
|00002a40| 6d 6f 72 79 2e 20 20 20 | 49 74 20 75 73 65 73 20 |mory. |It uses |
|00002a50| 74 68 65 20 73 74 61 6e | 64 61 72 64 20 54 52 65 |the stan|dard TRe|
|00002a60| 6d 6f 74 65 41 63 63 65 | 73 73 50 61 72 6d 42 6c |moteAcce|ssParmBl|
|00002a70| 6f 63 6b 20 61 73 20 74 | 68 65 20 70 61 72 61 6d |ock as t|he param|
|00002a80| 65 74 65 72 20 62 6c 6f | 63 6b 20 61 6e 64 20 63 |eter blo|ck and c|
|00002a90| 61 6e 20 62 65 20 69 73 | 73 75 65 64 20 69 6d 6d |an be is|sued imm|
|00002aa0| 65 64 69 61 74 65 6c 79 | 20 61 66 74 65 72 20 6d |ediately| after m|
|00002ab0| 61 6b 69 6e 67 20 61 20 | 43 6f 6e 6e 65 63 74 20 |aking a |Connect |
|00002ac0| 63 61 6c 6c 2e 20 20 54 | 68 69 73 20 61 6c 6c 6f |call. T|his allo|
|00002ad0| 77 73 20 74 68 65 20 52 | 65 6d 6f 74 65 20 41 63 |ws the R|emote Ac|
|00002ae0| 63 65 73 73 20 4d 61 6e | 61 67 65 72 20 74 6f 20 |cess Man|ager to |
|00002af0| 62 65 20 75 6e 6c 6f 61 | 64 65 64 20 61 73 20 73 |be unloa|ded as s|
|00002b00| 6f 6f 6e 20 61 73 20 61 | 6e 20 61 63 74 69 76 65 |oon as a|n active|
|00002b10| 20 63 6f 6e 6e 65 63 74 | 69 6f 6e 20 69 73 20 74 | connect|ion is t|
|00002b20| 65 72 6d 69 6e 61 74 65 | 64 20 77 69 74 68 20 61 |erminate|d with a|
|00002b30| 20 64 69 73 63 6f 6e 6e | 65 63 74 2c 20 69 66 20 | disconn|ect, if |
|00002b40| 6e 6f 20 6f 74 68 65 72 | 20 63 6c 69 65 6e 74 73 |no other| clients|
|00002b50| 20 68 61 76 65 20 6c 6f | 61 64 65 64 20 52 65 6d | have lo|aded Rem|
|00002b60| 6f 74 65 20 41 63 63 65 | 73 73 2e 20 20 42 65 6c |ote Acce|ss. Bel|
|00002b70| 6f 77 20 69 73 20 61 6e | 20 65 78 61 6d 70 6c 65 |ow is an| example|
|00002b80| 20 75 6e 6c 6f 61 64 20 | 63 61 6c 6c 2e 0d 23 69 | unload |call..#i|
|00002b90| 6e 63 6c 75 64 65 20 d2 | 52 65 6d 6f 74 65 41 63 |nclude .|RemoteAc|
|00002ba0| 63 65 73 73 49 6e 74 65 | 72 66 61 63 65 2e 68 d3 |cessInte|rface.h.|
|00002bb0| 0d 76 6f 69 64 20 55 6e | 6c 6f 61 64 52 65 6d 6f |.void Un|loadRemo|
|00002bc0| 74 65 41 63 63 65 73 73 | 28 29 0d 7b 0d 09 54 52 |teAccess|().{..TR|
|00002bd0| 65 6d 6f 74 65 41 63 63 | 65 73 73 50 61 72 6d 42 |emoteAcc|essParmB|
|00002be0| 6c 6f 63 6b 20 75 6e 6c | 6f 61 64 50 42 3b 0d 09 |lock unl|oadPB;..|
|00002bf0| 0d 09 2f 2f 20 75 6e 6c | 6f 61 64 20 74 68 65 20 |..// unl|oad the |
|00002c00| 63 6f 64 65 20 28 77 69 | 6c 6c 20 6e 6f 74 20 61 |code (wi|ll not a|
|00002c10| 63 74 75 61 6c 6c 79 20 | 67 6f 20 61 77 61 79 20 |ctually |go away |
|00002c20| 74 69 6c 6c 20 74 68 69 | 73 20 63 6f 6e 6e 65 63 |till thi|s connec|
|00002c30| 74 69 6f 6e 20 69 73 20 | 64 6f 6e 65 29 0d 09 75 |tion is |done)..u|
|00002c40| 6e 6c 6f 61 64 50 42 2e | 55 4e 4c 4f 41 44 2e 63 |nloadPB.|UNLOAD.c|
|00002c50| 73 43 6f 64 65 20 3d 20 | 52 41 4d 5f 45 58 54 45 |sCode = |RAM_EXTE|
|00002c60| 4e 44 45 44 5f 43 41 4c | 4c 3b 09 2f 2f 20 65 78 |NDED_CAL|L;.// ex|
|00002c70| 74 65 6e 64 65 64 20 63 | 61 6c 6c 0d 09 75 6e 6c |tended c|all..unl|
|00002c80| 6f 61 64 50 42 2e 55 4e | 4c 4f 41 44 2e 72 65 73 |oadPB.UN|LOAD.res|
|00002c90| 75 6c 74 53 74 72 50 74 | 72 20 3d 20 6e 69 6c 3b |ultStrPt|r = nil;|
|00002ca0| 09 2f 2f 20 72 65 73 75 | 6c 74 20 73 74 72 69 6e |.// resu|lt strin|
|00002cb0| 67 0d 09 75 6e 6c 6f 61 | 64 50 42 2e 55 4e 4c 4f |g..unloa|dPB.UNLO|
|00002cc0| 41 44 2e 65 78 74 65 6e | 64 65 64 54 79 70 65 20 |AD.exten|dedType |
|00002cd0| 3d 20 52 45 4d 4f 54 45 | 41 43 43 45 53 53 4e 41 |= REMOTE|ACCESSNA|
|00002ce0| 4d 45 3b 09 2f 2f 20 74 | 6f 20 72 65 6d 6f 74 65 |ME;.// t|o remote|
|00002cf0| 20 61 63 63 65 73 73 0d | 09 75 6e 6c 6f 61 64 50 | access.|.unloadP|
|00002d00| 42 2e 55 4e 4c 4f 41 44 | 2e 65 78 74 65 6e 64 65 |B.UNLOAD|.extende|
|00002d10| 64 43 6f 64 65 20 3d 20 | 43 6d 64 52 65 6d 6f 74 |dCode = |CmdRemot|
|00002d20| 65 41 63 63 65 73 73 5f | 55 6e 6c 6f 61 64 3b 09 |eAccess_|Unload;.|
|00002d30| 2f 2f 20 74 72 79 20 74 | 6f 20 75 6e 6c 6f 61 64 |// try t|o unload|
|00002d40| 0d 09 50 42 52 65 6d 6f | 74 65 41 63 63 65 73 73 |..PBRemo|teAccess|
|00002d50| 28 26 75 6e 6c 6f 61 64 | 50 42 2c 20 66 61 6c 73 |(&unload|PB, fals|
|00002d60| 65 29 3b 09 2f 2f 20 69 | 73 73 75 65 20 73 79 6e |e);.// i|ssue syn|
|00002d70| 63 20 63 61 6c 6c 0d 09 | 69 66 20 28 75 6e 6c 6f |c call..|if (unlo|
|00002d80| 61 64 50 42 2e 55 4e 4c | 4f 41 44 2e 69 6f 52 65 |adPB.UNL|OAD.ioRe|
|00002d90| 73 75 6c 74 29 0d 09 09 | 53 68 6f 77 45 72 72 6f |sult)...|ShowErro|
|00002da0| 72 28 75 6e 6c 6f 61 64 | 50 42 2e 55 4e 4c 4f 41 |r(unload|PB.UNLOA|
|00002db0| 44 2e 69 6f 52 65 73 75 | 6c 74 29 3b 0d 7d 0d 43 |D.ioResu|lt);.}.C|
|00002dc0| 6f 6e 6e 65 63 74 0d 54 | 68 69 73 20 63 61 6c 6c |onnect.T|his call|
|00002dd0| 20 69 73 20 75 73 65 64 | 20 74 6f 20 69 6e 69 74 | is used| to init|
|00002de0| 69 61 74 65 20 61 6e 20 | 6f 75 74 67 6f 69 6e 67 |iate an |outgoing|
|00002df0| 20 63 6f 6e 6e 65 63 74 | 69 6f 6e 2e 20 20 57 68 | connect|ion. Wh|
|00002e00| 65 6e 20 79 6f 75 20 61 | 72 65 20 63 6f 6e 6e 65 |en you a|re conne|
|00002e10| 63 74 65 64 20 69 6e 20 | 74 68 69 73 20 6d 6f 64 |cted in |this mod|
|00002e20| 65 20 79 6f 75 20 77 69 | 6c 6c 20 73 74 69 6c 6c |e you wi|ll still|
|00002e30| 20 72 65 74 61 69 6e 20 | 61 63 63 65 73 73 20 74 | retain |access t|
|00002e40| 6f 20 79 6f 75 72 20 63 | 75 72 72 65 6e 74 20 6e |o your c|urrent n|
|00002e50| 65 74 77 6f 72 6b 2e 20 | 20 4e 65 74 77 6f 72 6b |etwork. | Network|
|00002e60| 20 6e 75 6d 62 65 72 73 | 20 61 72 65 20 72 65 2d | numbers| are re-|
|00002e70| 6d 61 70 70 65 64 20 69 | 6e 20 61 20 6c 69 6d 69 |mapped i|n a limi|
|00002e80| 74 65 64 20 77 61 79 20 | 69 6e 20 6f 72 64 65 72 |ted way |in order|
|00002e90| 20 74 6f 20 73 6f 6c 76 | 65 20 70 72 6f 62 6c 65 | to solv|e proble|
|00002ea0| 6d 73 20 6f 66 20 6e 65 | 74 77 6f 72 6b 20 6e 75 |ms of ne|twork nu|
|00002eb0| 6d 62 65 72 20 63 6f 6e | 66 6c 69 63 74 73 20 62 |mber con|flicts b|
|00002ec0| 65 74 77 65 65 6e 20 74 | 68 65 20 74 77 6f 20 6d |etween t|he two m|
|00002ed0| 61 63 68 69 6e 65 73 20 | 62 65 69 6e 67 20 64 69 |achines |being di|
|00002ee0| 72 65 63 74 6c 79 20 63 | 6f 6e 6e 65 63 74 65 64 |rectly c|onnected|
|00002ef0| 2c 20 74 68 75 73 20 65 | 6e 73 75 72 69 6e 67 20 |, thus e|nsuring |
|00002f00| 74 68 65 79 20 77 69 6c | 6c 20 61 6c 77 61 79 73 |they wil|l always|
|00002f10| 20 62 65 20 61 63 63 65 | 73 73 69 62 6c 65 20 74 | be acce|ssible t|
|00002f20| 6f 20 65 61 63 68 20 6f | 74 68 65 72 2e 20 20 55 |o each o|ther. U|
|00002f30| 6e 66 6f 72 74 75 6e 61 | 74 65 6c 79 2c 20 69 74 |nfortuna|tely, it|
|00002f40| 20 69 73 20 6e 6f 74 20 | 70 6f 73 73 69 62 6c 65 | is not |possible|
|00002f50| 20 74 6f 20 73 6f 6c 76 | 65 20 61 6c 6c 20 6f 66 | to solv|e all of|
|00002f60| 20 74 68 65 20 6f 74 68 | 65 72 20 70 6f 73 73 69 | the oth|er possi|
|00002f70| 62 6c 65 20 63 6f 6e 66 | 6c 69 63 74 73 20 64 75 |ble conf|licts du|
|00002f80| 65 20 74 6f 20 74 68 65 | 20 6c 69 6d 69 74 65 64 |e to the| limited|
|00002f90| 20 6e 75 6d 62 65 72 20 | 6f 66 20 6e 65 74 77 6f | number |of netwo|
|00002fa0| 72 6b 20 6e 75 6d 62 65 | 72 73 20 61 76 61 69 6c |rk numbe|rs avail|
|00002fb0| 61 62 6c 65 2e 20 20 49 | 6e 20 6f 72 64 65 72 20 |able. I|n order |
|00002fc0| 74 6f 20 70 72 6f 76 69 | 64 65 20 61 20 6d 65 74 |to provi|de a met|
|00002fd0| 68 6f 64 20 6f 66 20 65 | 6e 73 75 72 69 6e 67 20 |hod of e|nsuring |
|00002fe0| 61 63 63 65 73 73 20 74 | 6f 20 61 6c 6c 20 6e 65 |access t|o all ne|
|00002ff0| 74 77 6f 72 6b 73 20 6f | 6e 20 74 68 65 20 64 65 |tworks o|n the de|
|00003000| 73 74 69 6e 61 74 69 6f | 6e 20 6e 65 74 77 6f 72 |stinatio|n networ|
|00003010| 6b 20 61 20 67 75 61 72 | 61 6e 74 65 65 64 20 61 |k a guar|anteed a|
|00003020| 63 63 65 73 73 20 6d 65 | 74 68 6f 64 20 69 73 20 |ccess me|thod is |
|00003030| 61 76 61 69 6c 61 62 6c | 65 2e 20 20 57 68 65 6e |availabl|e. When|
|00003040| 20 63 6f 6e 6e 65 63 74 | 65 64 20 69 6e 20 74 68 | connect|ed in th|
|00003050| 69 73 20 6d 6f 64 65 2c | 20 79 6f 75 20 77 69 6c |is mode,| you wil|
|00003060| 6c 20 6c 6f 73 65 20 61 | 63 63 65 73 73 20 74 6f |l lose a|ccess to|
|00003070| 20 61 6c 6c 20 73 65 72 | 76 69 63 65 73 20 62 65 | all ser|vices be|
|00003080| 79 6f 6e 64 20 74 68 6f | 73 65 20 6f 6e 20 74 68 |yond tho|se on th|
|00003090| 65 20 73 61 6d 65 20 73 | 69 6e 67 6c 65 20 6e 65 |e same s|ingle ne|
|000030a0| 74 77 6f 72 6b 20 6e 75 | 6d 62 65 72 20 74 68 61 |twork nu|mber tha|
|000030b0| 74 20 74 68 65 20 63 61 | 6c 6c 69 6e 67 20 6d 61 |t the ca|lling ma|
|000030c0| 63 68 69 6e 65 20 62 65 | 6c 6f 6e 67 73 20 74 6f |chine be|longs to|
|000030d0| 2e 20 20 49 6e 20 6f 72 | 64 65 72 20 74 6f 20 6e |. In or|der to n|
|000030e0| 6f 74 69 66 79 20 63 6c | 69 65 6e 74 73 20 6f 66 |otify cl|ients of|
|000030f0| 20 74 68 65 20 41 70 70 | 6c 65 54 61 6c 6b 20 73 | the App|leTalk s|
|00003100| 74 61 63 6b 20 74 68 61 | 74 20 61 20 6e 65 74 77 |tack tha|t a netw|
|00003110| 6f 72 6b 20 77 69 6c 6c | 20 6e 6f 20 6c 6f 6e 67 |ork will| no long|
|00003120| 65 72 20 62 65 20 72 65 | 61 63 68 61 62 6c 65 20 |er be re|achable |
|00003130| 77 65 20 68 61 76 65 20 | 63 72 65 61 74 65 64 20 |we have |created |
|00003140| 61 20 6e 65 77 20 41 70 | 70 6c 65 54 61 6c 6b 20 |a new Ap|pleTalk |
|00003150| 54 72 61 6e 73 69 74 69 | 6f 6e 20 51 75 65 75 65 |Transiti|on Queue|
|00003160| 20 65 76 65 6e 74 2e 20 | 20 28 53 65 65 20 4e 65 | event. | (See Ne|
|00003170| 74 77 6f 72 6b 20 54 72 | 61 6e 73 69 74 69 6f 6e |twork Tr|ansition|
|00003180| 20 45 76 65 6e 74 73 20 | 6c 61 74 65 72 20 69 6e | Events |later in|
|00003190| 20 74 68 69 73 20 64 6f | 63 75 6d 65 6e 74 2e 29 | this do|cument.)|
|000031a0| 20 20 57 68 65 6e 20 63 | 6f 6e 6e 65 63 74 69 6e | When c|onnectin|
|000031b0| 67 20 74 68 65 20 63 6c | 69 65 6e 74 20 70 61 73 |g the cl|ient pas|
|000031c0| 73 65 73 20 69 6e 20 61 | 20 54 52 41 43 6f 6e 6e |ses in a| TRAConn|
|000031d0| 65 63 74 49 6e 66 6f 54 | 65 6d 70 6c 61 74 65 2c |ectInfoT|emplate,|
|000031e0| 20 6f 72 20 74 68 65 20 | 46 53 53 70 65 63 20 6f | or the |FSSpec o|
|000031f0| 66 20 61 20 64 6f 63 75 | 6d 65 6e 74 20 77 68 69 |f a docu|ment whi|
|00003200| 63 68 20 63 6f 6e 74 61 | 69 6e 73 20 74 68 65 20 |ch conta|ins the |
|00003210| 63 6f 6e 6e 65 63 74 20 | 70 61 72 61 6d 65 74 65 |connect |paramete|
|00003220| 72 73 2e 20 20 54 68 65 | 20 63 6f 6e 6e 65 63 74 |rs. The| connect|
|00003230| 20 70 61 72 61 6d 65 74 | 65 72 20 62 6c 6f 63 6b | paramet|er block|
|00003240| 20 63 6f 6e 74 61 69 6e | 73 20 74 68 65 20 6f 70 | contain|s the op|
|00003250| 74 69 6f 6e 46 6c 61 67 | 73 20 66 69 65 6c 64 20 |tionFlag|s field |
|00003260| 77 68 69 63 68 20 73 70 | 65 63 69 66 69 65 73 20 |which sp|ecifies |
|00003270| 74 68 65 20 63 6f 6e 6e | 65 63 74 20 6f 70 74 69 |the conn|ect opti|
|00003280| 6f 6e 73 2e 20 20 54 68 | 65 20 66 6c 61 67 73 20 |ons. Th|e flags |
|00003290| 61 72 65 20 73 68 6f 77 | 6e 20 62 65 6c 6f 77 3a |are show|n below:|
|000032a0| 0d 2f 2f 20 63 6f 6e 6e | 65 63 74 20 6f 70 74 69 |.// conn|ect opti|
|000032b0| 6f 6e 20 66 6c 61 67 73 | 0d 23 64 65 66 69 6e 65 |on flags|.#define|
|000032c0| 20 6b 4e 53 43 61 6e 49 | 6e 74 65 72 61 63 74 09 | kNSCanI|nteract.|
|000032d0| 30 78 30 30 30 30 30 30 | 30 31 09 2f 2f 20 55 73 |0x000000|01.// Us|
|000032e0| 65 72 20 69 6e 74 65 72 | 61 63 74 69 6f 6e 20 28 |er inter|action (|
|000032f0| 70 61 73 73 77 6f 72 64 | 20 70 72 6f 6d 70 74 29 |password| prompt)|
|00003300| 20 69 73 20 4f 4b 0d 23 | 64 65 66 69 6e 65 20 6b | is OK.#|define k|
|00003310| 4e 53 53 68 6f 77 53 74 | 61 74 75 73 09 30 78 30 |NSShowSt|atus.0x0|
|00003320| 30 30 30 30 30 30 32 09 | 2f 2f 20 73 68 6f 77 20 |0000002.|// show |
|00003330| 74 68 65 20 73 74 61 74 | 75 73 20 6f 66 20 74 68 |the stat|us of th|
|00003340| 65 20 63 6f 6e 6e 65 63 | 74 20 6f 72 20 64 69 73 |e connec|t or dis|
|00003350| 63 6f 6e 6e 65 63 74 20 | 63 61 6c 6c 0d 23 64 65 |connect |call.#de|
|00003360| 66 69 6e 65 20 6b 4e 53 | 43 6f 6e 6e 65 63 74 44 |fine kNS|ConnectD|
|00003370| 6f 63 75 6d 65 6e 74 09 | 30 78 30 30 30 30 30 30 |ocument.|0x000000|
|00003380| 30 34 09 2f 2f 20 63 6f | 6e 6e 65 63 74 20 75 73 |04.// co|nnect us|
|00003390| 69 6e 67 20 74 68 65 20 | 73 70 65 63 69 66 69 65 |ing the |specifie|
|000033a0| 64 20 64 6f 63 75 6d 65 | 6e 74 20 75 73 69 6e 67 |d docume|nt using|
|000033b0| 20 46 53 53 70 65 63 0d | 23 64 65 66 69 6e 65 20 | FSSpec.|#define |
|000033c0| 6b 4e 53 50 61 73 73 57 | 6f 72 64 53 65 74 09 30 |kNSPassW|ordSet.0|
|000033d0| 78 30 30 30 30 30 30 31 | 30 09 2f 2f 20 75 73 65 |x0000001|0.// use|
|000033e0| 20 74 68 65 20 73 70 65 | 63 69 66 69 65 64 20 70 | the spe|cified p|
|000033f0| 61 73 73 77 6f 72 64 20 | 66 69 65 6c 64 20 77 68 |assword |field wh|
|00003400| 65 6e 20 63 6f 6e 6e 65 | 63 74 69 6e 67 20 09 09 |en conne|cting ..|
|00003410| 09 09 09 09 09 09 2f 2f | 20 62 79 20 64 6f 63 75 |......//| by docu|
|00003420| 6d 65 6e 74 0d 2f 2f 20 | 32 2e 30 20 61 6e 64 20 |ment.// |2.0 and |
|00003430| 61 62 6f 76 65 c9 0d 23 | 64 65 66 69 6e 65 20 6b |above..#|define k|
|00003440| 4e 53 32 53 61 76 76 79 | 46 6c 61 67 73 09 30 78 |NS2Savvy|Flags.0x|
|00003450| 34 30 30 30 30 30 30 30 | 09 2f 2f 20 53 65 74 20 |40000000|.// Set |
|00003460| 74 6f 20 75 73 65 20 74 | 68 65 20 6e 65 78 74 20 |to use t|he next |
|00003470| 32 20 66 6c 61 67 73 20 | 62 65 6c 6f 77 20 66 6f |2 flags |below fo|
|00003480| 72 20 6f 6e 6c 79 20 41 | 52 41 20 09 09 09 09 09 |r only A|RA .....|
|00003490| 09 2f 2f 20 32 2e 30 20 | 61 77 61 72 65 20 61 70 |.// 2.0 |aware ap|
|000034a0| 70 6c 69 63 61 74 69 6f | 6e 73 2e 0d 23 64 65 66 |plicatio|ns..#def|
|000034b0| 69 6e 65 20 6b 4e 53 41 | 52 32 43 6f 6e 6e 65 63 |ine kNSA|R2Connec|
|000034c0| 74 69 6f 6e 09 30 78 30 | 30 30 30 30 30 32 30 09 |tion.0x0|0000020.|
|000034d0| 2f 2f 20 63 6f 6e 6e 65 | 63 74 69 6e 67 20 74 6f |// conne|cting to|
|000034e0| 20 61 20 32 2e 30 20 73 | 65 72 76 65 72 2e 20 0d | a 2.0 s|erver. .|
|000034f0| 23 64 65 66 69 6e 65 20 | 6b 4e 53 4e 6f 74 69 66 |#define |kNSNotif|
|00003500| 79 57 68 69 6c 65 43 6f | 6e 6e 65 63 74 65 64 20 |yWhileCo|nnected |
|00003510| 30 78 30 30 30 30 30 30 | 34 30 09 2f 2f 20 64 69 |0x000000|40.// di|
|00003520| 73 70 6c 61 79 20 63 75 | 74 65 20 6e 6f 74 69 66 |splay cu|te notif|
|00003530| 69 63 61 74 69 6f 6e 20 | 69 63 6f 6e 20 77 68 69 |ication |icon whi|
|00003540| 6c 65 20 63 6f 6e 6e 65 | 63 74 65 64 2e 0d 54 68 |le conne|cted..Th|
|00003550| 65 20 6b 4e 53 43 61 6e | 49 6e 74 65 72 61 63 74 |e kNSCan|Interact|
|00003560| 20 66 6c 61 67 20 61 6c | 6c 6f 77 73 20 69 6e 74 | flag al|lows int|
|00003570| 65 72 61 63 74 69 6f 6e | 20 77 69 74 68 20 74 68 |eraction| with th|
|00003580| 65 20 75 73 65 72 20 74 | 6f 20 67 65 74 20 74 68 |e user t|o get th|
|00003590| 65 20 70 61 73 73 77 6f | 72 64 20 69 66 20 6e 65 |e passwo|rd if ne|
|000035a0| 63 65 73 73 61 72 79 20 | 6f 72 20 70 72 6f 6d 70 |cessary |or promp|
|000035b0| 74 20 74 68 65 20 75 73 | 65 72 20 74 6f 20 63 68 |t the us|er to ch|
|000035c0| 61 6e 67 65 20 74 68 65 | 69 72 20 70 61 73 73 77 |ange the|ir passw|
|000035d0| 6f 72 64 20 69 66 20 74 | 68 65 20 73 65 72 76 65 |ord if t|he serve|
|000035e0| 72 20 72 65 71 75 69 72 | 65 73 20 69 74 2e 20 20 |r requir|es it. |
|000035f0| 54 68 65 20 6b 4e 53 53 | 68 6f 77 53 74 61 74 75 |The kNSS|howStatu|
|00003600| 73 20 66 6c 61 67 20 65 | 6e 61 62 6c 65 73 20 74 |s flag e|nables t|
|00003610| 68 65 20 63 6f 6e 6e 65 | 63 74 69 6f 6e 20 73 74 |he conne|ction st|
|00003620| 61 74 75 73 20 64 69 73 | 70 6c 61 79 2e 20 20 54 |atus dis|play. T|
|00003630| 68 65 20 64 69 73 70 6c | 61 79 20 69 73 20 6d 6f |he displ|ay is mo|
|00003640| 64 61 6c 20 64 69 61 6c | 6f 67 20 77 68 69 63 68 |dal dial|og which|
|00003650| 20 75 70 64 61 74 65 73 | 20 77 69 74 68 20 6e 65 | updates| with ne|
|00003660| 77 20 6d 65 73 73 61 67 | 65 73 20 61 73 20 74 68 |w messag|es as th|
|00003670| 65 20 63 6f 6e 6e 65 63 | 74 69 6f 6e 20 70 72 6f |e connec|tion pro|
|00003680| 67 72 65 73 73 65 73 2e | 20 20 57 68 65 6e 20 74 |gresses.| When t|
|00003690| 68 65 20 6b 4e 53 43 6f | 6e 6e 65 63 74 44 6f 63 |he kNSCo|nnectDoc|
|000036a0| 75 6d 65 6e 74 20 66 6c | 61 67 20 69 73 20 73 65 |ument fl|ag is se|
|000036b0| 74 2c 20 74 68 65 20 41 | 70 70 6c 65 20 52 65 6d |t, the A|pple Rem|
|000036c0| 6f 74 65 20 41 63 63 65 | 73 73 20 41 50 49 20 20 |ote Acce|ss API |
|000036d0| 77 69 6c 6c 20 75 73 65 | 20 74 68 65 20 73 70 65 |will use| the spe|
|000036e0| 63 69 66 69 65 64 20 41 | 52 41 20 32 2e 30 20 64 |cified A|RA 2.0 d|
|000036f0| 6f 63 75 6d 65 6e 74 20 | 66 6f 72 20 74 68 65 20 |ocument |for the |
|00003700| 63 6f 6e 6e 65 63 74 20 | 70 61 72 61 6d 65 74 65 |connect |paramete|
|00003710| 72 73 20 28 69 2e 65 2e | 20 75 73 65 72 20 6e 61 |rs (i.e.| user na|
|00003720| 6d 65 2c 20 70 61 73 73 | 77 6f 72 64 29 20 6f 66 |me, pass|word) of|
|00003730| 20 74 68 65 20 54 52 41 | 43 6f 6e 6e 65 63 74 49 | the TRA|ConnectI|
|00003740| 6e 66 6f 54 65 6d 70 6c | 61 74 65 2e 20 20 54 68 |nfoTempl|ate. Th|
|00003750| 65 20 64 6f 63 75 6d 65 | 6e 74 20 69 73 20 73 70 |e docume|nt is sp|
|00003760| 65 63 69 66 69 65 64 20 | 62 79 20 74 68 65 20 46 |ecified |by the F|
|00003770| 53 53 70 65 63 20 72 65 | 63 6f 72 64 20 77 68 69 |SSpec re|cord whi|
|00003780| 63 68 20 63 6f 6e 74 61 | 69 6e 73 20 76 52 65 66 |ch conta|ins vRef|
|00003790| 4e 75 6d 20 28 76 6f 6c | 75 6d 65 20 72 65 66 65 |Num (vol|ume refe|
|000037a0| 72 65 6e 63 65 20 6e 75 | 6d 62 65 72 29 2c 20 70 |rence nu|mber), p|
|000037b0| 61 72 49 44 20 28 64 69 | 72 65 63 74 6f 72 79 20 |arID (di|rectory |
|000037c0| 49 44 29 2c 20 61 6e 64 | 20 6e 61 6d 65 20 28 70 |ID), and| name (p|
|000037d0| 6f 69 6e 74 65 72 20 74 | 6f 20 50 61 73 63 61 6c |ointer t|o Pascal|
|000037e0| 20 73 74 79 6c 65 20 73 | 74 72 69 6e 67 20 63 6f | style s|tring co|
|000037f0| 6e 74 61 69 6e 69 6e 67 | 20 74 68 65 20 64 6f 63 |ntaining| the doc|
|00003800| 75 6d 65 6e 74 20 6e 61 | 6d 65 29 2e 20 20 4e 6f |ument na|me). No|
|00003810| 20 6f 74 68 65 72 20 70 | 61 72 61 6d 65 74 65 72 | other p|arameter|
|00003820| 73 20 6e 65 65 64 20 74 | 6f 20 62 65 20 73 75 70 |s need t|o be sup|
|00003830| 70 6c 69 65 64 2e 20 20 | 54 68 65 20 6b 4e 53 50 |plied. |The kNSP|
|00003840| 61 73 73 57 6f 72 64 53 | 65 74 20 66 6c 61 67 20 |assWordS|et flag |
|00003850| 6f 76 65 72 72 69 64 65 | 73 20 74 68 65 20 73 61 |override|s the sa|
|00003860| 76 65 64 20 70 61 73 73 | 77 6f 72 64 20 77 68 65 |ved pass|word whe|
|00003870| 6e 20 63 6f 6e 6e 65 63 | 74 69 6e 67 20 62 79 20 |n connec|ting by |
|00003880| 64 6f 63 75 6d 65 6e 74 | 20 6f 72 20 62 79 20 50 |document| or by P|
|00003890| 42 20 61 6e 64 20 66 6f | 72 63 65 73 20 41 70 70 |B and fo|rces App|
|000038a0| 6c 65 20 52 65 6d 6f 74 | 65 20 41 63 63 65 73 73 |le Remot|e Access|
|000038b0| 20 41 50 49 20 20 74 6f | 20 75 73 65 20 74 68 65 | API to| use the|
|000038c0| 20 70 61 73 73 57 6f 72 | 64 20 66 69 65 6c 64 20 | passWor|d field |
|000038d0| 69 6e 20 63 6c 65 61 72 | 74 65 78 74 2e 20 20 49 |in clear|text. I|
|000038e0| 66 20 74 68 65 20 6b 4e | 53 50 61 73 73 57 6f 72 |f the kN|SPassWor|
|000038f0| 64 53 65 74 20 66 6c 61 | 67 20 69 73 20 63 6c 65 |dSet fla|g is cle|
|00003900| 61 72 20 61 6e 64 20 74 | 68 65 20 70 61 73 73 77 |ar and t|he passw|
|00003910| 6f 72 64 53 61 76 65 64 | 20 66 6c 61 67 20 69 73 |ordSaved| flag is|
|00003920| 20 73 65 74 2c 20 74 68 | 65 6e 20 74 68 65 20 63 | set, th|en the c|
|00003930| 6c 69 65 6e 74 20 6d 75 | 73 74 20 73 75 70 70 6c |lient mu|st suppl|
|00003940| 79 20 61 20 6d 75 6e 67 | 65 64 20 70 61 73 73 77 |y a mung|ed passw|
|00003950| 6f 72 64 2e 20 20 54 68 | 65 20 6b 4e 53 32 53 61 |ord. Th|e kNS2Sa|
|00003960| 76 76 79 46 6c 61 67 73 | 20 69 73 20 73 65 74 20 |vvyFlags| is set |
|00003970| 69 66 20 75 73 69 6e 67 | 20 41 52 41 20 32 2e 30 |if using| ARA 2.0|
|00003980| 20 66 65 61 74 75 72 65 | 73 2e 20 20 54 68 65 20 | feature|s. The |
|00003990| 6b 4e 53 41 52 32 43 6f | 6e 6e 65 63 74 69 6f 6e |kNSAR2Co|nnection|
|000039a0| 20 66 6c 61 67 20 69 6e | 64 69 63 61 74 65 73 20 | flag in|dicates |
|000039b0| 74 68 65 20 63 6f 6e 6e | 65 63 74 69 6f 6e 20 69 |the conn|ection i|
|000039c0| 73 20 74 6f 20 61 20 32 | 2e 30 20 73 65 72 76 65 |s to a 2|.0 serve|
|000039d0| 72 2e 20 20 49 66 20 74 | 68 69 73 20 62 69 74 20 |r. If t|his bit |
|000039e0| 69 73 20 6e 6f 74 20 73 | 65 74 2c 20 69 74 20 69 |is not s|et, it i|
|000039f0| 73 20 61 73 73 75 6d 65 | 64 20 74 68 61 74 20 69 |s assume|d that i|
|00003a00| 74 20 69 73 20 61 20 31 | 2e 30 20 63 6f 6e 6e 65 |t is a 1|.0 conne|
|00003a10| 63 74 69 6f 6e 2e 20 20 | 54 68 65 20 6b 4e 53 4e |ction. |The kNSN|
|00003a20| 6f 74 69 66 79 57 68 69 | 6c 65 43 6f 6e 6e 65 63 |otifyWhi|leConnec|
|00003a30| 74 65 64 20 66 6c 61 67 | 20 77 69 6c 6c 20 64 69 |ted flag| will di|
|00003a40| 73 70 6c 61 79 20 61 20 | 6e 6f 74 69 66 69 63 61 |splay a |notifica|
|00003a50| 74 69 6f 6e 20 69 63 6f | 6e 20 6f 6e 20 74 68 65 |tion ico|n on the|
|00003a60| 20 41 70 70 6c 65 20 4d | 65 6e 75 20 77 68 69 6c | Apple M|enu whil|
|00003a70| 65 20 74 68 65 20 75 73 | 65 72 20 69 73 20 63 6f |e the us|er is co|
|00003a80| 6e 6e 65 63 74 65 64 2e | 0d 49 6e 20 74 68 69 73 |nnected.|.In this|
|00003a90| 20 72 65 6c 65 61 73 65 | 2c 20 74 68 65 20 63 6c | release|, the cl|
|00003aa0| 69 65 6e 74 20 6d 61 79 | 20 6e 6f 74 20 63 6f 6e |ient may| not con|
|00003ab0| 6e 65 63 74 20 62 79 20 | 70 61 72 61 6d 65 74 65 |nect by |paramete|
|00003ac0| 72 20 62 6c 6f 63 6b 20 | 28 50 42 29 2e 20 55 73 |r block |(PB). Us|
|00003ad0| 65 20 74 68 65 20 6b 4e | 53 43 6f 6e 6e 65 63 74 |e the kN|SConnect|
|00003ae0| 44 6f 63 75 6d 65 6e 74 | 20 66 6c 61 67 20 74 6f |Document| flag to|
|00003af0| 20 63 6f 6e 6e 65 63 74 | 20 77 69 74 68 20 61 20 | connect| with a |
|00003b00| 73 70 65 63 69 66 69 65 | 64 20 41 52 41 20 32 2e |specifie|d ARA 2.|
|00003b10| 30 20 64 6f 63 75 6d 65 | 6e 74 2e 20 54 68 65 20 |0 docume|nt. The |
|00003b20| 66 69 65 6c 64 73 20 69 | 6e 20 74 68 65 20 63 6f |fields i|n the co|
|00003b30| 6e 6e 65 63 74 49 6e 66 | 6f 20 72 65 63 6f 72 64 |nnectInf|o record|
|00003b40| 20 61 72 65 20 64 69 73 | 63 75 73 73 65 64 20 62 | are dis|cussed b|
|00003b50| 65 6c 6f 77 2e 20 20 54 | 68 65 79 20 61 72 65 20 |elow. T|hey are |
|00003b60| 66 69 6c 6c 65 64 20 62 | 79 20 74 68 65 20 73 70 |filled b|y the sp|
|00003b70| 65 63 69 66 69 65 64 20 | 41 52 41 20 32 2e 30 20 |ecified |ARA 2.0 |
|00003b80| 64 6f 63 75 6d 65 6e 74 | 2e 20 20 57 69 74 68 69 |document|. Withi|
|00003b90| 6e 20 74 68 69 73 20 72 | 65 63 6f 72 64 20 69 73 |n this r|ecord is|
|00003ba0| 20 61 20 76 65 72 73 69 | 6f 6e 20 77 68 69 63 68 | a versi|on which|
|00003bb0| 20 69 73 20 75 73 65 64 | 20 62 79 20 74 68 65 20 | is used| by the |
|00003bc0| 63 6f 6e 6e 65 63 74 20 | 74 65 6d 70 6c 61 74 65 |connect |template|
|00003bd0| 20 28 63 75 72 72 65 6e | 74 6c 79 20 73 65 74 20 | (curren|tly set |
|00003be0| 74 6f 20 31 29 2e 20 20 | 54 68 65 20 6c 74 54 79 |to 1). |The ltTy|
|00003bf0| 70 65 20 70 61 72 61 6d | 65 74 65 72 20 73 70 65 |pe param|eter spe|
|00003c00| 63 69 66 69 65 73 20 74 | 68 65 20 74 79 70 65 20 |cifies t|he type |
|00003c10| 6f 66 20 74 68 65 20 6c | 69 6e 6b 20 74 6f 6f 6c |of the l|ink tool|
|00003c20| 20 74 68 61 74 20 77 69 | 6c 6c 20 62 65 20 75 73 | that wi|ll be us|
|00003c30| 65 64 20 69 6e 20 74 68 | 69 73 20 63 6f 6e 6e 65 |ed in th|is conne|
|00003c40| 63 74 69 6f 6e 2e 20 54 | 68 65 20 41 52 41 20 32 |ction. T|he ARA 2|
|00003c50| 2e 30 20 63 6f 6e 6e 65 | 63 74 20 64 6f 63 75 6d |.0 conne|ct docum|
|00003c60| 65 6e 74 20 73 70 65 63 | 69 66 69 65 73 20 74 68 |ent spec|ifies th|
|00003c70| 65 20 6c 65 6e 67 74 68 | 20 61 6e 64 20 70 6f 69 |e length| and poi|
|00003c80| 6e 74 73 20 74 6f 20 74 | 68 65 20 61 64 64 72 65 |nts to t|he addre|
|00003c90| 73 73 20 75 73 65 64 20 | 69 6e 20 63 6f 6e 6e 65 |ss used |in conne|
|00003ca0| 63 74 69 6e 67 20 62 79 | 20 73 65 74 74 69 6e 67 |cting by| setting|
|00003cb0| 20 75 70 20 20 61 64 64 | 72 65 73 73 49 6e 66 6f | up add|ressInfo|
|00003cc0| 4c 65 6e 67 74 68 20 61 | 6e 64 20 61 64 64 72 65 |Length a|nd addre|
|00003cd0| 73 73 49 6e 66 6f 50 74 | 72 2e 20 20 54 68 65 20 |ssInfoPt|r. The |
|00003ce0| 6c 74 53 70 65 63 69 66 | 69 63 54 65 6d 70 6c 61 |ltSpecif|icTempla|
|00003cf0| 74 65 50 74 72 20 69 73 | 20 65 78 70 65 63 74 65 |tePtr is| expecte|
|00003d00| 64 20 74 6f 20 70 6f 69 | 6e 74 20 74 6f 20 74 68 |d to poi|nt to th|
|00003d10| 65 20 74 65 6d 70 6c 61 | 74 65 20 6f 66 20 74 68 |e templa|te of th|
|00003d20| 65 20 6c 69 6e 6b 20 74 | 6f 6f 6c 20 73 70 65 63 |e link t|ool spec|
|00003d30| 69 66 69 63 20 70 61 72 | 6d 73 2e 20 20 41 6e 20 |ific par|ms. An |
|00003d40| 65 78 61 6d 70 6c 65 20 | 6f 66 20 6c 69 6e 6b 20 |example |of link |
|00003d50| 74 6f 6f 6c 20 73 70 65 | 63 69 66 69 63 20 70 61 |tool spe|cific pa|
|00003d60| 72 6d 73 20 6d 69 67 68 | 74 20 62 65 20 69 74 65 |rms migh|t be ite|
|00003d70| 6d 73 20 73 75 63 68 20 | 61 73 20 74 68 65 20 73 |ms such |as the s|
|00003d80| 65 72 69 61 6c 20 70 6f | 72 74 20 72 65 66 65 72 |erial po|rt refer|
|00003d90| 65 6e 63 65 20 28 2e 41 | 49 6e 2c 20 2e 41 4f 75 |ence (.A|In, .AOu|
|00003da0| 74 29 20 74 68 61 74 20 | 69 73 20 75 73 65 64 20 |t) that |is used |
|00003db0| 69 6e 20 74 68 65 20 4d | 6f 64 65 6d 20 4c 69 6e |in the M|odem Lin|
|00003dc0| 6b 20 54 6f 6f 6c 2e 20 | 20 41 20 75 73 65 72 4e |k Tool. | A userN|
|00003dd0| 61 6d 65 20 69 73 20 70 | 61 73 73 65 64 20 69 6e |ame is p|assed in|
|00003de0| 20 74 68 61 74 20 69 6e | 64 69 63 61 74 65 73 20 | that in|dicates |
|00003df0| 74 68 65 20 6e 61 6d 65 | 20 6f 66 20 74 68 65 20 |the name| of the |
|00003e00| 75 73 65 72 20 6c 6f 67 | 67 69 6e 67 20 69 6e 2e |user log|ging in.|
|00003e10| 20 20 20 41 20 70 61 73 | 73 57 6f 72 64 20 69 73 | A pas|sWord is|
|00003e20| 20 73 70 65 63 69 66 69 | 65 64 20 69 66 20 74 68 | specifi|ed if th|
|00003e30| 65 20 75 73 65 72 20 69 | 73 20 6e 6f 74 20 6c 6f |e user i|s not lo|
|00003e40| 67 67 69 6e 67 20 69 6e | 20 61 73 20 61 20 67 75 |gging in| as a gu|
|00003e50| 65 73 74 2e 20 20 49 66 | 20 74 68 65 20 75 73 65 |est. If| the use|
|00003e60| 72 20 77 61 6e 74 73 20 | 74 6f 20 62 65 20 61 20 |r wants |to be a |
|00003e70| 67 75 65 73 74 2c 20 74 | 68 65 20 67 75 65 73 74 |guest, t|he guest|
|00003e80| 4c 6f 67 69 6e 20 66 6c | 61 67 20 69 73 20 73 65 |Login fl|ag is se|
|00003e90| 74 2e 20 20 20 54 68 65 | 20 63 6f 6e 6e 65 63 74 |t. The| connect|
|00003ea0| 52 65 6d 69 6e 64 65 72 | 54 69 6d 65 72 20 69 73 |Reminder|Timer is|
|00003eb0| 20 75 73 65 64 20 69 66 | 20 74 68 65 20 63 61 6c | used if| the cal|
|00003ec0| 6c 65 72 20 77 61 6e 74 | 73 20 74 6f 20 62 65 20 |ler want|s to be |
|00003ed0| 72 65 6d 69 6e 64 65 64 | 20 74 68 61 74 20 61 20 |reminded| that a |
|00003ee0| 63 6f 6e 6e 65 63 74 69 | 6f 6e 20 69 73 20 69 6e |connecti|on is in|
|00003ef0| 20 70 72 6f 67 72 65 73 | 73 2e 20 20 54 68 69 73 | progres|s. This|
|00003f00| 20 66 69 65 6c 64 20 69 | 73 20 73 65 74 20 74 6f | field i|s set to|
|00003f10| 20 74 68 65 20 6e 75 6d | 62 65 72 20 6f 66 20 73 | the num|ber of s|
|00003f20| 65 63 6f 6e 64 73 20 62 | 65 74 77 65 65 6e 20 72 |econds b|etween r|
|00003f30| 65 6d 69 6e 64 65 72 73 | 2c 20 61 6e 64 20 63 61 |eminders|, and ca|
|00003f40| 6e 20 62 65 20 73 65 74 | 20 74 6f 20 7a 65 72 6f |n be set| to zero|
|00003f50| 20 69 66 20 6e 6f 20 72 | 65 6d 69 6e 64 65 72 73 | if no r|eminders|
|00003f60| 20 61 72 65 20 77 61 6e | 74 65 64 2e 20 20 49 66 | are wan|ted. If|
|00003f70| 20 61 20 63 6f 6e 6e 65 | 63 74 52 65 6d 69 6e 64 | a conne|ctRemind|
|00003f80| 65 72 54 69 6d 65 72 20 | 69 73 20 73 65 74 20 79 |erTimer |is set y|
|00003f90| 6f 75 20 6d 75 73 74 20 | 73 65 74 20 74 68 65 20 |ou must |set the |
|00003fa0| 63 6f 6e 6e 65 63 74 4f | 4b 57 61 69 74 54 69 6d |connectO|KWaitTim|
|00003fb0| 65 72 20 74 68 61 74 20 | 69 6e 64 69 63 61 74 65 |er that |indicate|
|00003fc0| 73 20 68 6f 77 20 6c 6f | 6e 67 20 74 68 65 20 72 |s how lo|ng the r|
|00003fd0| 65 6d 69 6e 64 65 72 20 | 64 69 61 6c 6f 67 20 77 |eminder |dialog w|
|00003fe0| 69 6c 6c 20 77 61 69 74 | 20 66 6f 72 20 4f 4b 20 |ill wait| for OK |
|00003ff0| 74 6f 20 62 65 20 68 69 | 74 20 62 65 66 6f 72 65 |to be hi|t before|
|00004000| 20 64 69 73 63 6f 6e 6e | 65 63 74 69 6e 67 2e 0d | disconn|ecting..|
|00004010| 73 74 72 75 63 74 20 54 | 52 41 43 6f 6e 6e 65 63 |struct T|RAConnec|
|00004020| 74 49 6e 66 6f 54 65 6d | 70 6c 61 74 65 0d 7b 0d |tInfoTem|plate.{.|
|00004030| 09 75 6e 73 69 67 6e 65 | 64 20 6c 6f 6e 67 20 76 |.unsigne|d long v|
|00004040| 65 72 73 69 6f 6e 3b 09 | 2f 2f 20 76 65 72 73 69 |ersion;.|// versi|
|00004050| 6f 6e 20 6f 66 20 74 68 | 69 73 20 66 6f 72 6d 61 |on of th|is forma|
|00004060| 74 0d 09 75 6e 73 69 67 | 6e 65 64 20 6c 6f 6e 67 |t..unsig|ned long|
|00004070| 20 6c 74 54 79 70 65 3b | 09 2f 2f 20 4c 69 6e 6b | ltType;|.// Link|
|00004080| 20 54 6f 6f 6c 20 74 79 | 70 65 0d 09 6c 6f 6e 67 | Tool ty|pe..long|
|00004090| 20 61 64 64 72 65 73 73 | 49 6e 66 6f 4c 65 6e 67 | address|InfoLeng|
|000040a0| 74 68 3b 09 2f 2f 20 6c | 65 6e 67 74 68 20 6f 66 |th;.// l|ength of|
|000040b0| 20 74 68 65 20 61 64 64 | 72 65 73 73 20 69 6e 66 | the add|ress inf|
|000040c0| 6f 72 6d 61 74 69 6f 6e | 0d 09 50 74 72 20 61 64 |ormation|..Ptr ad|
|000040d0| 64 72 65 73 73 49 6e 66 | 6f 50 74 72 3b 09 2f 2f |dressInf|oPtr;.//|
|000040e0| 20 70 6f 69 6e 74 65 72 | 20 74 6f 20 63 6f 6e 6e | pointer| to conn|
|000040f0| 65 63 74 20 61 64 64 72 | 65 73 73 20 69 6e 66 6f |ect addr|ess info|
|00004100| 0d 09 6c 6f 6e 67 20 6c | 74 53 70 65 63 69 66 69 |..long l|tSpecifi|
|00004110| 63 54 65 6d 70 6c 61 74 | 65 4c 65 6e 67 74 68 3b |cTemplat|eLength;|
|00004120| 20 09 2f 2f 20 6c 65 6e | 67 74 68 20 6f 66 20 74 | .// len|gth of t|
|00004130| 68 65 20 6c 74 73 70 65 | 63 69 66 69 63 20 69 6e |he ltspe|cific in|
|00004140| 66 6f 72 6d 61 74 69 6f | 6e 0d 09 50 74 72 20 6c |formatio|n..Ptr l|
|00004150| 74 53 70 65 63 69 66 69 | 63 54 65 6d 70 6c 61 74 |tSpecifi|cTemplat|
|00004160| 65 50 74 72 3b 09 2f 2f | 20 70 6f 69 6e 74 65 72 |ePtr;.//| pointer|
|00004170| 20 74 6f 20 6c 69 6e 6b | 20 74 6f 6f 6c 20 73 70 | to link| tool sp|
|00004180| 65 63 69 66 69 63 20 70 | 61 72 61 6d 73 0d 09 75 |ecific p|arams..u|
|00004190| 6e 73 69 67 6e 65 64 20 | 63 68 61 72 20 70 61 73 |nsigned |char pas|
|000041a0| 73 57 6f 72 64 5b 50 41 | 53 53 57 4f 52 44 42 55 |sWord[PA|SSWORDBU|
|000041b0| 46 53 49 5a 45 5d 3b 09 | 2f 2f 20 75 73 65 72 20 |FSIZE];.|// user |
|000041c0| 70 61 73 73 77 6f 72 64 | 0d 09 75 6e 73 69 67 6e |password|..unsign|
|000041d0| 65 64 20 63 68 61 72 20 | 75 73 65 72 4e 61 6d 65 |ed char |userName|
|000041e0| 5b 55 53 45 52 4e 41 4d | 45 53 49 5a 45 5d 3b 09 |[USERNAM|ESIZE];.|
|000041f0| 2f 2f 20 75 73 65 72 20 | 6e 61 6d 65 09 0d 09 75 |// user |name...u|
|00004200| 6e 73 69 67 6e 65 64 20 | 6c 6f 6e 67 20 63 6f 6e |nsigned |long con|
|00004210| 6e 65 63 74 52 65 6d 69 | 6e 64 65 72 54 69 6d 65 |nectRemi|nderTime|
|00004220| 72 3b 09 2f 2f 20 76 61 | 6c 75 65 20 66 6f 72 20 |r;.// va|lue for |
|00004230| 63 6f 6e 6e 65 63 74 69 | 6f 6e 20 72 65 6d 69 6e |connecti|on remin|
|00004240| 64 65 72 20 69 6e 20 73 | 65 63 6f 6e 64 73 0d 09 |der in s|econds..|
|00004250| 75 6e 73 69 67 6e 65 64 | 20 6c 6f 6e 67 20 63 6f |unsigned| long co|
|00004260| 6e 6e 65 63 74 4f 4b 57 | 61 69 74 54 69 6d 65 72 |nnectOKW|aitTimer|
|00004270| 3b 09 2f 2f 20 68 6f 77 | 20 6c 6f 6e 67 20 74 6f |;.// how| long to|
|00004280| 20 77 61 69 74 20 66 6f | 72 20 4f 4b 20 6f 6e 20 | wait fo|r OK on |
|00004290| 72 65 6d 69 6e 64 65 72 | 20 74 69 6d 65 72 0d 09 |reminder| timer..|
|000042a0| 42 6f 6f 6c 65 61 6e 20 | 67 75 65 73 74 4c 6f 67 |Boolean |guestLog|
|000042b0| 69 6e 3b 09 2f 2f 20 74 | 72 79 20 74 6f 20 6c 6f |in;.// t|ry to lo|
|000042c0| 67 20 69 6e 20 61 73 20 | 61 20 67 75 65 73 74 09 |g in as |a guest.|
|000042d0| 0d 09 42 6f 6f 6c 65 61 | 6e 20 70 61 73 73 77 6f |..Boolea|n passwo|
|000042e0| 72 64 53 61 76 65 64 3b | 09 2f 2f 20 73 65 74 20 |rdSaved;|.// set |
|000042f0| 69 66 20 70 61 73 73 77 | 6f 72 64 20 69 73 20 73 |if passw|ord is s|
|00004300| 61 76 65 64 09 0d 09 42 | 6f 6f 6c 65 61 6e 20 67 |aved...B|oolean g|
|00004310| 75 61 72 61 6e 74 65 65 | 64 41 63 63 65 73 73 3b |uarantee|dAccess;|
|00004320| 09 2f 2f 20 66 6c 61 67 | 20 74 6f 20 67 75 61 72 |.// flag| to guar|
|00004330| 61 6e 74 65 65 20 61 63 | 63 65 73 73 20 74 6f 20 |antee ac|cess to |
|00004340| 73 65 72 76 65 72 73 20 | 69 6e 74 65 72 6e 65 74 |servers |internet|
|00004350| 0d 7d 3b 0d 74 79 70 65 | 64 65 66 20 73 74 72 75 |.};.type|def stru|
|00004360| 63 74 20 54 52 41 43 6f | 6e 6e 65 63 74 49 6e 66 |ct TRACo|nnectInf|
|00004370| 6f 54 65 6d 70 6c 61 74 | 65 20 54 52 41 43 6f 6e |oTemplat|e TRACon|
|00004380| 6e 65 63 74 49 6e 66 6f | 54 65 6d 70 6c 61 74 65 |nectInfo|Template|
|00004390| 3b 0d 74 79 70 65 64 65 | 66 20 54 52 41 43 6f 6e |;.typede|f TRACon|
|000043a0| 6e 65 63 74 49 6e 66 6f | 54 65 6d 70 6c 61 74 65 |nectInfo|Template|
|000043b0| 20 2a 54 50 52 41 43 6f | 6e 6e 65 63 74 49 6e 66 | *TPRACo|nnectInf|
|000043c0| 6f 54 65 6d 70 6c 61 74 | 65 3b 0d 73 74 72 75 63 |oTemplat|e;.struc|
|000043d0| 74 20 54 52 65 6d 6f 74 | 65 41 63 63 65 73 73 43 |t TRemot|eAccessC|
|000043e0| 6f 6e 6e 65 63 74 42 6c | 6f 63 6b 0d 7b 0d 09 44 |onnectBl|ock.{..D|
|000043f0| 52 65 6d 6f 74 65 41 63 | 63 65 73 73 50 61 72 6d |RemoteAc|cessParm|
|00004400| 48 65 61 64 65 72 0d 09 | 54 52 41 43 6f 6e 6e 65 |Header..|TRAConne|
|00004410| 63 74 49 6e 66 6f 54 65 | 6d 70 6c 61 74 65 20 63 |ctInfoTe|mplate c|
|00004420| 6f 6e 6e 65 63 74 49 6e | 66 6f 3b 09 2f 2f 20 54 |onnectIn|fo;.// T|
|00004430| 68 65 20 63 6f 6e 6e 65 | 63 74 69 6f 6e 20 69 6e |he conne|ction in|
|00004440| 66 6f 72 6d 61 74 69 6f | 6e 20 74 65 6d 70 6c 61 |formatio|n templa|
|00004450| 74 65 0d 09 75 6e 73 69 | 67 6e 65 64 20 6c 6f 6e |te..unsi|gned lon|
|00004460| 67 20 6f 70 74 69 6f 6e | 46 6c 61 67 73 3b 09 2f |g option|Flags;./|
|00004470| 2f 20 62 69 74 20 6d 61 | 70 70 65 64 20 63 6f 6e |/ bit ma|pped con|
|00004480| 6e 65 63 74 20 6f 70 74 | 69 6f 6e 20 66 6c 61 67 |nect opt|ion flag|
|00004490| 73 20 0d 09 46 53 53 70 | 65 63 20 66 69 6c 65 49 |s ..FSSp|ec fileI|
|000044a0| 6e 66 6f 3b 09 2f 2f 20 | 66 69 6c 65 20 69 6e 66 |nfo;.// |file inf|
|000044b0| 6f 20 66 6f 72 20 63 6f | 6e 6e 65 63 74 20 64 6f |o for co|nnect do|
|000044c0| 63 75 6d 65 6e 74 0d 7d | 3b 0d 74 79 70 65 64 65 |cument.}|;.typede|
|000044d0| 66 20 73 74 72 75 63 74 | 20 54 52 65 6d 6f 74 65 |f struct| TRemote|
|000044e0| 41 63 63 65 73 73 43 6f | 6e 6e 65 63 74 42 6c 6f |AccessCo|nnectBlo|
|000044f0| 63 6b 20 54 52 65 6d 6f | 74 65 41 63 63 65 73 73 |ck TRemo|teAccess|
|00004500| 43 6f 6e 6e 65 63 74 42 | 6c 6f 63 6b 3b 0d 54 68 |ConnectB|lock;.Th|
|00004510| 65 20 66 6f 6c 6c 6f 77 | 69 6e 67 20 69 73 20 61 |e follow|ing is a|
|00004520| 6e 20 65 78 61 6d 70 6c | 65 20 63 6f 6e 6e 65 63 |n exampl|e connec|
|00004530| 74 69 6f 6e 20 70 72 6f | 63 65 64 75 72 65 3a 0d |tion pro|cedure:.|
|00004540| 23 69 6e 63 6c 75 64 65 | 20 d2 52 65 6d 6f 74 65 |#include| .Remote|
|00004550| 41 63 63 65 73 73 49 6e | 74 65 72 66 61 63 65 2e |AccessIn|terface.|
|00004560| 68 d3 0d 76 6f 69 64 20 | 44 6f 43 6f 6e 6e 65 63 |h..void |DoConnec|
|00004570| 74 28 29 0d 7b 0d 09 54 | 52 65 6d 6f 74 65 41 63 |t().{..T|RemoteAc|
|00004580| 63 65 73 73 50 61 72 61 | 6d 42 6c 6f 63 6b 20 63 |cessPara|mBlock c|
|00004590| 6f 6e 6e 65 63 74 50 42 | 3b 0d 09 53 74 72 32 35 |onnectPB|;..Str25|
|000045a0| 35 20 50 61 74 68 4e 61 | 6d 65 20 3d 20 d2 4d 79 |5 PathNa|me = .My|
|000045b0| 48 61 72 64 44 69 73 6b | 3a 52 65 6d 6f 74 65 20 |HardDisk|:Remote |
|000045c0| 41 63 63 65 73 73 3a 43 | 6f 6e 6e 65 63 74 20 44 |Access:C|onnect D|
|000045d0| 6f 63 75 6d 65 6e 74 d3 | 3b 0d 09 4c 6f 61 64 52 |ocument.|;..LoadR|
|000045e0| 65 6d 6f 74 65 41 63 63 | 65 73 73 28 29 3b 09 2f |emoteAcc|ess();./|
|000045f0| 2f 20 47 65 74 20 74 68 | 65 20 52 65 6d 6f 74 65 |/ Get th|e Remote|
|00004600| 20 41 63 63 65 73 73 20 | 4d 61 6e 61 67 65 72 0d | Access |Manager.|
|00004610| 09 09 2f 2f 20 6c 6f 61 | 64 65 64 0d 09 63 6f 6e |..// loa|ded..con|
|00004620| 6e 65 63 74 50 42 2e 43 | 4f 4e 4e 45 43 54 2e 63 |nectPB.C|ONNECT.c|
|00004630| 73 43 6f 64 65 20 3d 20 | 52 41 4d 5f 45 58 54 45 |sCode = |RAM_EXTE|
|00004640| 4e 44 45 44 5f 43 41 4c | 4c 3b 09 2f 2f 20 65 78 |NDED_CAL|L;.// ex|
|00004650| 74 65 6e 64 65 64 20 63 | 61 6c 6c 0d 09 63 6f 6e |tended c|all..con|
|00004660| 6e 65 63 74 50 42 2e 43 | 4f 4e 4e 45 43 54 2e 72 |nectPB.C|ONNECT.r|
|00004670| 65 73 75 6c 74 53 74 72 | 50 74 72 20 3d 20 6e 69 |esultStr|Ptr = ni|
|00004680| 6c 3b 09 2f 2f 20 64 6f | 6e d5 74 20 77 61 6e 74 |l;.// do|n.t want|
|00004690| 20 72 65 73 75 6c 74 20 | 73 74 72 69 6e 67 73 0d | result |strings.|
|000046a0| 09 63 6f 6e 6e 65 63 74 | 50 42 2e 43 4f 4e 4e 45 |.connect|PB.CONNE|
|000046b0| 43 54 2e 65 78 74 65 6e | 64 65 64 54 79 70 65 20 |CT.exten|dedType |
|000046c0| 3d 20 52 45 4d 4f 54 45 | 41 43 43 45 53 53 4e 41 |= REMOTE|ACCESSNA|
|000046d0| 4d 45 3b 20 20 09 2f 2f | 20 74 6f 20 52 65 6d 6f |ME; .//| to Remo|
|000046e0| 74 65 20 41 63 63 65 73 | 73 0d 09 63 6f 6e 6e 65 |te Acces|s..conne|
|000046f0| 63 74 50 42 2e 43 4f 4e | 4e 45 43 54 2e 65 78 74 |ctPB.CON|NECT.ext|
|00004700| 65 6e 64 65 64 43 6f 64 | 65 20 3d 20 43 6d 64 52 |endedCod|e = CmdR|
|00004710| 65 6d 6f 74 65 41 63 63 | 65 73 73 5f 44 6f 43 6f |emoteAcc|ess_DoCo|
|00004720| 6e 6e 65 63 74 3b 09 20 | 2f 2f 20 63 6f 6e 6e 65 |nnect;. |// conne|
|00004730| 63 74 20 63 6f 6d 6d 61 | 6e 64 0d 09 63 6f 6e 6e |ct comma|nd..conn|
|00004740| 65 63 74 50 42 2e 43 4f | 4e 4e 45 43 54 2e 70 6f |ectPB.CO|NNECT.po|
|00004750| 72 74 47 6c 6f 62 61 6c | 73 50 74 72 20 3d 20 6e |rtGlobal|sPtr = n|
|00004760| 69 6c 3b 09 2f 2f 20 75 | 73 65 20 74 68 65 20 75 |il;.// u|se the u|
|00004770| 73 65 72 20 70 6f 72 74 | 0d 09 63 6f 6e 6e 65 63 |ser port|..connec|
|00004780| 74 50 42 2e 43 4f 4e 4e | 45 43 54 2e 66 69 6c 65 |tPB.CONN|ECT.file|
|00004790| 49 6e 66 6f 2e 76 52 65 | 66 4e 75 6d 20 3d 20 30 |Info.vRe|fNum = 0|
|000047a0| 3b 09 2f 2f 20 55 73 65 | 20 74 68 65 20 66 75 6c |;.// Use| the ful|
|000047b0| 6c 20 70 61 74 68 6e 61 | 6d 65 0d 09 63 6f 6e 6e |l pathna|me..conn|
|000047c0| 65 63 74 50 42 2e 43 4f | 4e 4e 45 43 54 2e 66 69 |ectPB.CO|NNECT.fi|
|000047d0| 6c 65 49 6e 66 6f 2e 70 | 61 72 49 44 20 3d 20 30 |leInfo.p|arID = 0|
|000047e0| 3b 0d 09 73 74 72 63 70 | 79 28 26 50 61 74 68 4e |;..strcp|y(&PathN|
|000047f0| 61 6d 65 2c 26 63 6f 6e | 6e 65 63 74 50 42 2e 43 |ame,&con|nectPB.C|
|00004800| 4f 4e 4e 45 43 54 2e 66 | 69 6c 65 49 6e 66 6f 2e |ONNECT.f|ileInfo.|
|00004810| 6e 61 6d 65 29 3b 09 2f | 2f 20 63 6f 70 79 20 74 |name);./|/ copy t|
|00004820| 68 65 20 73 74 72 69 6e | 67 20 74 6f 20 66 69 6c |he strin|g to fil|
|00004830| 65 49 6e 66 6f 2e 6e 61 | 6d 65 0d 09 2f 2f 20 41 |eInfo.na|me..// A|
|00004840| 73 6b 20 66 6f 72 20 70 | 61 73 73 77 6f 72 64 20 |sk for p|assword |
|00004850| 69 66 20 6e 65 65 64 65 | 64 2c 20 75 73 65 20 63 |if neede|d, use c|
|00004860| 6f 6e 6e 65 63 74 69 6f | 6e 20 64 6f 63 75 6d 65 |onnectio|n docume|
|00004870| 6e 74 2c 20 26 20 73 68 | 6f 77 20 63 6f 6e 6e 65 |nt, & sh|ow conne|
|00004880| 63 74 69 6f 6e 20 73 74 | 61 74 75 73 0d 09 63 6f |ction st|atus..co|
|00004890| 6e 6e 65 63 74 50 42 2e | 43 4f 4e 4e 45 43 54 2e |nnectPB.|CONNECT.|
|000048a0| 6f 70 74 69 6f 6e 46 6c | 61 67 73 20 3d 20 6b 4e |optionFl|ags = kN|
|000048b0| 53 43 61 6e 49 6e 74 65 | 72 61 63 74 20 7c 20 6b |SCanInte|ract | k|
|000048c0| 4e 53 43 6f 6e 6e 65 63 | 74 44 6f 63 75 6d 65 6e |NSConnec|tDocumen|
|000048d0| 74 20 7c 20 6b 4e 53 53 | 68 6f 77 53 74 61 74 75 |t | kNSS|howStatu|
|000048e0| 73 0d 09 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |s.. | |
|000048f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 7c 20 6b 4e | | | kN|
|00004900| 53 32 53 61 76 76 79 46 | 6c 61 67 73 09 2f 2f 20 |S2SavvyF|lags.// |
|00004910| 55 73 65 20 74 68 65 20 | 32 2e 30 20 66 6c 61 67 |Use the |2.0 flag|
|00004920| 73 20 62 65 6c 6f 77 0d | 09 20 20 20 20 20 20 20 |s below.|. |
|00004930| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004940| 20 20 7c 20 6b 4e 53 41 | 52 32 43 6f 6e 6e 65 63 | | kNSA|R2Connec|
|00004950| 74 69 6f 6e 20 09 2f 2f | 20 63 6f 6e 6e 65 63 74 |tion .//| connect|
|00004960| 69 6f 6e 20 74 6f 20 61 | 20 32 2e 30 20 73 65 72 |ion to a| 2.0 ser|
|00004970| 76 65 72 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |ver. | |
|00004980| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 7c | | ||
|00004990| 20 6b 4e 53 4e 6f 74 69 | 66 79 57 68 69 6c 65 43 | kNSNoti|fyWhileC|
|000049a0| 6f 6e 6e 65 63 74 65 64 | 3b 09 2f 2f 20 64 69 73 |onnected|;.// dis|
|000049b0| 70 6c 61 79 69 6e 67 20 | 6e 6f 74 69 66 69 63 61 |playing |notifica|
|000049c0| 74 69 6f 6e 20 69 63 6f | 6e 0d 09 50 42 52 65 6d |tion ico|n..PBRem|
|000049d0| 6f 74 65 41 63 63 65 73 | 73 28 26 63 6f 6e 6e 65 |oteAcces|s(&conne|
|000049e0| 63 74 50 42 2c 20 66 61 | 6c 73 65 29 3b 20 20 09 |ctPB, fa|lse); .|
|000049f0| 2f 2f 20 69 73 73 75 65 | 20 73 79 6e 63 20 63 61 |// issue| sync ca|
|00004a00| 6c 6c 0d 09 69 66 20 28 | 63 6f 6e 6e 65 63 74 50 |ll..if (|connectP|
|00004a10| 42 2e 43 4f 4e 4e 45 43 | 54 2e 69 6f 52 65 73 75 |B.CONNEC|T.ioResu|
|00004a20| 6c 74 29 0d 09 20 20 53 | 68 6f 77 45 72 72 6f 72 |lt).. S|howError|
|00004a30| 28 63 6f 6e 6e 65 63 74 | 50 42 2e 43 4f 4e 4e 45 |(connect|PB.CONNE|
|00004a40| 43 54 2e 69 6f 52 65 73 | 75 6c 74 29 3b 20 09 2f |CT.ioRes|ult); ./|
|00004a50| 2f 20 44 6f 20 45 72 72 | 6f 72 20 72 65 70 6f 72 |/ Do Err|or repor|
|00004a60| 74 69 6e 67 20 61 6e 64 | 20 72 65 63 6f 76 65 72 |ting and| recover|
|00004a70| 79 0d 09 55 6e 6c 6f 61 | 64 52 65 6d 6f 74 65 41 |y..Unloa|dRemoteA|
|00004a80| 63 63 65 73 73 28 29 3b | 09 2f 2f 20 55 6e 6c 6f |ccess();|.// Unlo|
|00004a90| 61 64 20 77 68 65 6e 20 | 64 69 73 63 6f 6e 6e 65 |ad when |disconne|
|00004aa0| 63 74 65 64 2e 0d 7d 20 | 2f 2f 20 44 6f 43 6f 6e |cted..} |// DoCon|
|00004ab0| 6e 65 63 74 0d 44 69 73 | 63 6f 6e 6e 65 63 74 0d |nect.Dis|connect.|
|00004ac0| 54 68 65 20 64 69 73 63 | 6f 6e 6e 65 63 74 20 63 |The disc|onnect c|
|00004ad0| 6f 6d 6d 61 6e 64 20 69 | 73 20 75 73 65 64 20 74 |ommand i|s used t|
|00004ae0| 6f 20 74 65 72 6d 69 6e | 61 74 65 20 61 6e 20 65 |o termin|ate an e|
|00004af0| 78 69 73 74 69 6e 67 20 | 73 65 73 73 69 6f 6e 20 |xisting |session |
|00004b00| 6f 72 20 63 61 6e 63 65 | 6c 20 6f 6e 65 20 74 68 |or cance|l one th|
|00004b10| 61 74 20 69 73 20 62 65 | 69 6e 67 20 63 72 65 61 |at is be|ing crea|
|00004b20| 74 65 64 2e 20 20 49 66 | 20 79 6f 75 20 6f 6e 6c |ted. If| you onl|
|00004b30| 79 20 77 61 6e 74 20 74 | 6f 20 64 69 73 63 6f 6e |y want t|o discon|
|00004b40| 6e 65 63 74 20 61 20 73 | 65 73 73 69 6f 6e 20 74 |nect a s|ession t|
|00004b50| 68 61 74 20 77 61 73 20 | 63 6f 6e 6e 65 63 74 65 |hat was |connecte|
|00004b60| 64 20 77 69 74 68 20 61 | 20 73 70 65 63 69 66 69 |d with a| specifi|
|00004b70| 63 20 70 61 72 61 6d 65 | 74 65 72 20 62 6c 6f 63 |c parame|ter bloc|
|00004b80| 6b 20 79 6f 75 20 63 61 | 6e 20 64 6f 20 73 6f 20 |k you ca|n do so |
|00004b90| 62 79 20 73 65 74 74 69 | 6e 67 20 61 20 70 6f 69 |by setti|ng a poi|
|00004ba0| 6e 74 65 72 20 74 6f 20 | 74 68 65 20 70 61 72 61 |nter to |the para|
|00004bb0| 6d 65 74 65 72 20 62 6c | 6f 63 6b 20 75 73 65 64 |meter bl|ock used|
|00004bc0| 20 74 6f 20 69 73 73 75 | 65 20 74 68 65 20 63 6f | to issu|e the co|
|00004bd0| 6e 6e 65 63 74 20 69 6e | 20 61 62 6f 72 74 4f 6e |nnect in| abortOn|
|00004be0| 6c 79 54 68 69 73 50 42 | 2e 20 20 49 66 20 79 6f |lyThisPB|. If yo|
|00004bf0| 75 20 77 61 6e 74 20 74 | 6f 20 64 69 73 63 6f 6e |u want t|o discon|
|00004c00| 6e 65 63 74 20 61 20 63 | 6f 6e 6e 65 63 74 69 6f |nect a c|onnectio|
|00004c10| 6e 20 63 72 65 61 74 65 | 64 20 62 79 20 61 6e 79 |n create|d by any|
|00004c20| 6f 6e 65 2c 20 79 6f 75 | 20 73 65 74 20 74 68 65 |one, you| set the|
|00004c30| 20 61 62 6f 72 74 4f 6e | 6c 79 54 68 69 73 50 42 | abortOn|lyThisPB|
|00004c40| 20 66 69 65 6c 64 20 74 | 6f 20 7a 65 72 6f 2e 20 | field t|o zero. |
|00004c50| 20 49 66 20 79 6f 75 20 | 61 72 65 20 64 69 73 63 | If you |are disc|
|00004c60| 6f 6e 6e 65 63 74 69 6e | 67 20 61 6e 20 6f 75 74 |onnectin|g an out|
|00004c70| 67 6f 69 6e 67 20 63 61 | 6c 6c 2c 20 79 6f 75 20 |going ca|ll, you |
|00004c80| 70 61 73 73 20 7a 65 72 | 6f 20 69 6e 20 70 6f 72 |pass zer|o in por|
|00004c90| 74 47 6c 6f 62 61 6c 73 | 50 74 72 2e 20 20 44 69 |tGlobals|Ptr. Di|
|00004ca0| 73 63 6f 6e 6e 65 63 74 | 69 6e 67 20 70 6f 72 74 |sconnect|ing port|
|00004cb0| 73 20 6f 74 68 65 72 20 | 74 68 61 6e 20 74 68 65 |s other |than the|
|00004cc0| 20 75 73 65 72 70 6f 72 | 74 2c 20 69 73 20 6e 6f | userpor|t, is no|
|00004cd0| 74 20 73 75 70 70 6f 72 | 74 65 64 20 69 6e 20 74 |t suppor|ted in t|
|00004ce0| 68 69 73 20 76 65 72 73 | 69 6f 6e 2e 20 20 59 6f |his vers|ion. Yo|
|00004cf0| 75 20 73 68 6f 75 6c 64 | 20 61 6c 77 61 79 73 20 |u should| always |
|00004d00| 73 65 74 20 64 69 73 63 | 6f 6e 6e 65 63 74 69 6e |set disc|onnectin|
|00004d10| 20 74 6f 20 7a 65 72 6f | 2e 20 20 54 68 65 20 6f | to zero|. The o|
|00004d20| 70 74 69 6f 6e 20 6b 4e | 53 53 68 6f 77 53 74 61 |ption kN|SShowSta|
|00004d30| 74 75 73 20 77 69 6c 6c | 20 63 61 75 73 65 20 74 |tus will| cause t|
|00004d40| 68 65 20 41 70 70 6c 65 | 20 52 65 6d 6f 74 65 20 |he Apple| Remote |
|00004d50| 41 63 63 65 73 73 20 41 | 50 49 20 20 74 6f 20 64 |Access A|PI to d|
|00004d60| 69 73 70 6c 61 79 20 74 | 68 65 20 73 74 61 74 75 |isplay t|he statu|
|00004d70| 73 20 64 69 61 6c 6f 67 | 20 64 75 72 69 6e 67 20 |s dialog| during |
|00004d80| 74 68 65 20 64 69 73 63 | 6f 6e 6e 65 63 74 2e 0d |the disc|onnect..|
|00004d90| 23 64 65 66 69 6e 65 20 | 6b 4e 75 6d 57 61 72 6e |#define |kNumWarn|
|00004da0| 45 6e 74 72 69 65 73 4d | 61 78 20 20 35 09 2f 2f |EntriesM|ax 5.//|
|00004db0| 20 6e 75 6d 62 65 72 20 | 6f 66 20 65 6e 74 72 69 | number |of entri|
|00004dc0| 65 73 20 69 6e 20 77 61 | 72 6e 20 61 72 72 61 79 |es in wa|rn array|
|00004dd0| 0d 73 74 72 75 63 74 20 | 54 52 65 6d 6f 74 65 41 |.struct |TRemoteA|
|00004de0| 63 63 65 73 73 44 69 73 | 63 6f 6e 6e 65 63 74 50 |ccessDis|connectP|
|00004df0| 61 72 61 6d 0d 7b 0d 09 | 44 52 65 6d 6f 74 65 41 |aram.{..|DRemoteA|
|00004e00| 63 63 65 73 73 50 61 72 | 6d 48 65 61 64 65 72 0d |ccessPar|mHeader.|
|00004e10| 09 75 6e 73 69 67 6e 65 | 64 20 6c 6f 6e 67 20 64 |.unsigne|d long d|
|00004e20| 69 73 63 6f 6e 6e 65 63 | 74 69 6e 3b 09 2f 2f 20 |isconnec|tin;.// |
|00004e30| 4e 6f 74 65 3a 20 53 65 | 74 20 74 68 69 73 20 70 |Note: Se|t this p|
|00004e40| 61 72 61 6d 65 74 65 72 | 20 74 6f 20 30 0d 09 54 |arameter| to 0..T|
|00004e50| 50 52 65 6d 6f 74 65 41 | 63 63 65 73 73 50 61 72 |PRemoteA|ccessPar|
|00004e60| 61 6d 42 6c 6f 63 6b 20 | 61 62 6f 72 74 4f 6e 6c |amBlock |abortOnl|
|00004e70| 79 54 68 69 73 50 42 3b | 09 2f 2f 20 6f 6e 6c 79 |yThisPB;|.// only|
|00004e80| 20 61 62 6f 72 74 20 61 | 20 63 6f 6e 6e 65 63 74 | abort a| connect|
|00004e90| 69 6f 6e 20 6f 70 65 6e | 65 64 20 62 79 20 74 68 |ion open|ed by th|
|00004ea0| 69 73 20 70 62 0d 09 75 | 6e 73 69 67 6e 65 64 20 |is pb..u|nsigned |
|00004eb0| 6c 6f 6e 67 20 77 61 72 | 6e 41 72 72 5b 6b 4e 75 |long war|nArr[kNu|
|00004ec0| 6d 57 61 72 6e 45 6e 74 | 72 69 65 73 4d 61 78 5d |mWarnEnt|riesMax]|
|00004ed0| 3b 20 09 2f 2f 20 73 65 | 74 20 77 61 72 6e 20 74 |; .// se|t warn t|
|00004ee0| 69 6d 65 73 20 68 65 72 | 65 20 69 6e 20 73 65 63 |imes her|e in sec|
|00004ef0| 6f 6e 64 73 20 28 7a 65 | 72 6f 20 61 6c 6c 20 69 |onds (ze|ro all i|
|00004f00| 66 0d 09 09 2f 2f 20 6e | 6f 20 77 61 72 6e 69 6e |f...// n|o warnin|
|00004f10| 67 73 29 09 09 09 09 0d | 09 75 6e 73 69 67 6e 65 |gs).....|.unsigne|
|00004f20| 64 20 6c 6f 6e 67 20 6f | 70 74 69 6f 6e 46 6c 61 |d long o|ptionFla|
|00004f30| 67 73 3b 09 2f 2f 20 62 | 69 74 20 6d 61 70 70 65 |gs;.// b|it mappe|
|00004f40| 64 20 63 6f 6e 6e 65 63 | 74 20 6f 70 74 69 6f 6e |d connec|t option|
|00004f50| 20 66 6c 61 67 73 0d 7d | 3b 0d 74 79 70 65 64 65 | flags.}|;.typede|
|00004f60| 66 20 73 74 72 75 63 74 | 20 54 52 65 6d 6f 74 65 |f struct| TRemote|
|00004f70| 41 63 63 65 73 73 44 69 | 73 63 6f 6e 6e 65 63 74 |AccessDi|sconnect|
|00004f80| 50 61 72 61 6d 20 54 52 | 65 6d 6f 74 65 41 63 63 |Param TR|emoteAcc|
|00004f90| 65 73 73 44 69 73 63 6f | 6e 6e 65 63 74 50 61 72 |essDisco|nnectPar|
|00004fa0| 61 6d 3b 0d 54 68 65 20 | 66 6f 6c 6c 6f 77 69 6e |am;.The |followin|
|00004fb0| 67 20 69 73 20 61 6e 20 | 65 78 61 6d 70 6c 65 20 |g is an |example |
|00004fc0| 6f 66 20 20 61 20 73 69 | 6d 70 6c 65 20 64 69 73 |of a si|mple dis|
|00004fd0| 63 6f 6e 6e 65 63 74 20 | 70 72 6f 63 65 64 75 72 |connect |procedur|
|00004fe0| 65 2e 20 20 49 74 20 77 | 69 6c 6c 20 64 69 73 63 |e. It w|ill disc|
|00004ff0| 6f 6e 6e 65 63 74 20 61 | 6e 79 20 65 78 69 73 74 |onnect a|ny exist|
|00005000| 69 6e 67 20 61 63 74 69 | 76 65 20 63 6f 6e 6e 65 |ing acti|ve conne|
|00005010| 63 74 69 6f 6e 2e 0d 23 | 69 6e 63 6c 75 64 65 20 |ction..#|include |
|00005020| d2 52 65 6d 6f 74 65 41 | 63 63 65 73 73 49 6e 74 |.RemoteA|ccessInt|
|00005030| 65 72 66 61 63 65 2e 68 | d3 0d 76 6f 69 64 20 44 |erface.h|..void D|
|00005040| 6f 44 69 73 63 6f 6e 6e | 65 63 74 28 29 0d 7b 0d |oDisconn|ect().{.|
|00005050| 09 54 52 65 6d 6f 74 65 | 41 63 63 65 73 73 50 61 |.TRemote|AccessPa|
|00005060| 72 61 6d 42 6c 6f 63 6b | 20 64 69 73 63 6f 6e 6e |ramBlock| disconn|
|00005070| 65 63 74 50 42 3b 0d 09 | 2f 2f 20 73 65 74 20 75 |ectPB;..|// set u|
|00005080| 70 20 74 68 65 20 52 65 | 6d 6f 74 65 20 41 63 63 |p the Re|mote Acc|
|00005090| 65 73 73 20 50 42 0d 09 | 64 69 73 63 6f 6e 6e 65 |ess PB..|disconne|
|000050a0| 63 74 50 42 2e 44 49 53 | 43 4f 4e 4e 45 43 54 2e |ctPB.DIS|CONNECT.|
|000050b0| 63 73 43 6f 64 65 20 3d | 20 52 41 4d 5f 45 58 54 |csCode =| RAM_EXT|
|000050c0| 45 4e 44 45 44 5f 43 41 | 4c 4c 3b 09 09 2f 2f 20 |ENDED_CA|LL;..// |
|000050d0| 65 78 74 65 6e 64 65 64 | 20 63 61 6c 6c 0d 09 64 |extended| call..d|
|000050e0| 69 73 63 6f 6e 6e 65 63 | 74 50 42 2e 44 49 53 43 |isconnec|tPB.DISC|
|000050f0| 4f 4e 4e 45 43 54 2e 72 | 65 73 75 6c 74 53 74 72 |ONNECT.r|esultStr|
|00005100| 50 74 72 20 3d 20 6e 69 | 6c 3b 09 09 2f 2f 20 64 |Ptr = ni|l;..// d|
|00005110| 6f 6e d5 74 20 77 61 6e | 74 20 72 65 73 75 6c 74 |on.t wan|t result|
|00005120| 20 73 74 72 69 6e 67 73 | 0d 09 64 69 73 63 6f 6e | strings|..discon|
|00005130| 6e 65 63 74 50 42 2e 44 | 49 53 43 4f 4e 4e 45 43 |nectPB.D|ISCONNEC|
|00005140| 54 2e 65 78 74 65 6e 64 | 65 64 54 79 70 65 20 3d |T.extend|edType =|
|00005150| 20 52 45 4d 4f 54 45 41 | 43 43 45 53 53 4e 41 4d | REMOTEA|CCESSNAM|
|00005160| 45 3b 09 09 20 2f 2f 20 | 74 6f 20 52 65 6d 6f 74 |E;.. // |to Remot|
|00005170| 65 20 41 63 63 65 73 73 | 0d 09 64 69 73 63 6f 6e |e Access|..discon|
|00005180| 6e 65 63 74 50 42 2e 44 | 49 53 43 4f 4e 4e 45 43 |nectPB.D|ISCONNEC|
|00005190| 54 2e 65 78 74 65 6e 64 | 65 64 43 6f 64 65 20 3d |T.extend|edCode =|
|000051a0| 20 43 6d 64 52 65 6d 6f | 74 65 41 63 63 65 73 73 | CmdRemo|teAccess|
|000051b0| 5f 44 69 73 63 6f 6e 6e | 65 63 74 3b 20 20 2f 2f |_Disconn|ect; //|
|000051c0| 20 64 69 73 63 6f 6e 6e | 65 63 74 20 63 6f 6d 6d | disconn|ect comm|
|000051d0| 61 6e 64 0d 09 64 69 73 | 63 6f 6e 6e 65 63 74 50 |and..dis|connectP|
|000051e0| 42 2e 44 49 53 43 4f 4e | 4e 45 43 54 2e 70 6f 72 |B.DISCON|NECT.por|
|000051f0| 74 47 6c 6f 62 61 6c 73 | 50 74 72 20 3d 20 6e 69 |tGlobals|Ptr = ni|
|00005200| 6c 3b 09 09 2f 2f 20 75 | 73 65 72 20 70 6f 72 74 |l;..// u|ser port|
|00005210| 0d 09 64 69 73 63 6f 6e | 6e 65 63 74 50 42 2e 44 |..discon|nectPB.D|
|00005220| 49 53 43 4f 4e 4e 45 43 | 54 2e 61 62 6f 72 74 4f |ISCONNEC|T.abortO|
|00005230| 6e 6c 79 54 68 69 73 50 | 42 20 3d 20 6e 69 6c 3b |nlyThisP|B = nil;|
|00005240| 09 09 2f 2f 20 64 6f 6e | 27 74 20 67 65 74 20 74 |..// don|'t get t|
|00005250| 69 65 64 20 74 6f 20 61 | 6e 79 20 73 70 65 63 69 |ied to a|ny speci|
|00005260| 66 69 63 20 70 62 0d 09 | 64 69 73 63 6f 6e 6e 65 |fic pb..|disconne|
|00005270| 63 74 50 42 2e 44 49 53 | 43 4f 4e 4e 45 43 54 2e |ctPB.DIS|CONNECT.|
|00005280| 6f 70 74 69 6f 6e 46 6c | 61 67 73 20 3d 20 30 7c |optionFl|ags = 0||
|00005290| 20 6b 4e 53 53 68 6f 77 | 53 74 61 74 75 73 3b 09 | kNSShow|Status;.|
|000052a0| 2f 2f 20 73 68 6f 77 20 | 73 74 61 74 75 73 20 77 |// show |status w|
|000052b0| 68 69 6c 65 20 64 69 73 | 63 6f 6e 6e 65 63 74 69 |hile dis|connecti|
|000052c0| 6e 67 0d 09 50 42 52 65 | 6d 6f 74 65 41 63 63 65 |ng..PBRe|moteAcce|
|000052d0| 73 73 28 26 64 69 73 63 | 6f 6e 6e 65 63 74 50 42 |ss(&disc|onnectPB|
|000052e0| 2c 20 66 61 6c 73 65 29 | 3b 09 09 2f 2f 20 69 73 |, false)|;..// is|
|000052f0| 73 75 65 20 73 79 6e 63 | 20 63 61 6c 6c 0d 09 69 |sue sync| call..i|
|00005300| 66 20 28 64 69 73 63 6f | 6e 6e 65 63 74 50 42 2e |f (disco|nnectPB.|
|00005310| 44 49 53 43 4f 4e 4e 45 | 43 54 2e 69 6f 52 65 73 |DISCONNE|CT.ioRes|
|00005320| 75 6c 74 29 0d 09 20 20 | 53 68 6f 77 45 72 72 6f |ult).. |ShowErro|
|00005330| 72 28 64 69 73 63 6f 6e | 6e 65 63 74 50 42 2e 44 |r(discon|nectPB.D|
|00005340| 49 53 43 4f 4e 4e 45 43 | 54 2e 69 6f 52 65 73 75 |ISCONNEC|T.ioResu|
|00005350| 6c 74 29 3b 20 09 09 2f | 2f 20 44 6f 20 45 72 72 |lt); ../|/ Do Err|
|00005360| 6f 72 20 72 65 70 6f 72 | 74 69 6e 67 20 61 6e 64 |or repor|ting and|
|00005370| 20 72 65 63 6f 76 65 72 | 79 0d 7d 0d 49 73 52 65 | recover|y.}.IsRe|
|00005380| 6d 6f 74 65 0d 54 68 65 | 20 22 49 73 52 65 6d 6f |mote.The| "IsRemo|
|00005390| 74 65 22 20 63 6f 6d 6d | 61 6e 64 20 69 73 20 75 |te" comm|and is u|
|000053a0| 73 65 64 20 74 6f 20 64 | 65 74 65 72 6d 69 6e 65 |sed to d|etermine|
|000053b0| 20 69 66 20 61 20 6e 65 | 74 77 6f 72 6b 20 61 64 | if a ne|twork ad|
|000053c0| 64 72 65 73 73 20 69 73 | 20 72 65 6d 6f 74 65 20 |dress is| remote |
|000053d0| 6f 72 20 6c 6f 63 61 6c | 2e 20 20 49 66 20 74 68 |or local|. If th|
|000053e0| 65 20 6e 65 74 77 6f 72 | 6b 20 69 73 20 72 65 6d |e networ|k is rem|
|000053f0| 6f 74 65 2c 20 74 68 65 | 20 63 61 6c 6c 20 77 69 |ote, the| call wi|
|00005400| 6c 6c 20 6f 70 74 69 6f | 6e 61 6c 6c 79 20 72 65 |ll optio|nally re|
|00005410| 74 75 72 6e 20 74 68 65 | 20 69 6e 66 6f 72 6d 61 |turn the| informa|
|00005420| 74 69 6f 6e 20 6e 65 63 | 65 73 73 61 72 79 20 74 |tion nec|essary t|
|00005430| 6f 20 6d 61 6b 65 20 74 | 68 65 20 63 6f 6e 6e 65 |o make t|he conne|
|00005440| 63 74 69 6f 6e 20 74 6f | 20 74 68 65 20 72 65 6d |ction to| the rem|
|00005450| 6f 74 65 20 6e 65 74 77 | 6f 72 6b 2e 20 54 68 65 |ote netw|ork. The|
|00005460| 20 70 61 72 61 6d 65 74 | 65 72 20 74 68 65 41 64 | paramet|er theAd|
|00005470| 64 72 65 73 73 20 63 6f | 6e 74 61 69 6e 73 20 74 |dress co|ntains t|
|00005480| 68 65 20 6e 65 74 77 6f | 72 6b 20 61 64 64 72 65 |he netwo|rk addre|
|00005490| 73 73 20 74 6f 20 62 65 | 20 63 68 65 63 6b 65 64 |ss to be| checked|
|000054a0| 2e 20 20 20 54 68 65 20 | 66 6f 72 6d 61 74 20 6f |. The |format o|
|000054b0| 66 20 74 68 65 41 64 64 | 72 65 73 73 20 69 73 20 |f theAdd|ress is |
|000054c0| 74 68 65 20 73 61 6d 65 | 20 61 73 20 66 6f 72 20 |the same| as for |
|000054d0| 74 68 65 20 73 74 72 75 | 63 74 20 41 64 64 72 42 |the stru|ct AddrB|
|000054e0| 6c 6f 63 6b 20 61 73 20 | 64 65 66 69 6e 65 64 20 |lock as |defined |
|000054f0| 69 6e 20 41 70 70 6c 65 | 54 61 6c 6b 2e 68 3a 0d |in Apple|Talk.h:.|
|00005500| 09 42 79 74 65 73 20 33 | 20 26 20 32 20 28 48 69 |.Bytes 3| & 2 (Hi|
|00005510| 67 68 20 57 6f 72 64 29 | 3a 20 4e 65 74 77 6f 72 |gh Word)|: Networ|
|00005520| 6b 20 4e 75 6d 62 65 72 | 0d 09 42 79 74 65 20 31 |k Number|..Byte 1|
|00005530| 3a 20 4e 6f 64 65 20 4e | 75 6d 62 65 72 0d 09 42 |: Node N|umber..B|
|00005540| 79 74 65 20 30 20 28 4c | 6f 77 20 42 79 74 65 29 |yte 0 (L|ow Byte)|
|00005550| 3a 20 53 6f 63 6b 65 74 | 20 4e 75 6d 62 65 72 0d |: Socket| Number.|
|00005560| 54 68 65 20 6f 70 74 69 | 6f 6e 46 6c 61 67 73 20 |The opti|onFlags |
|00005570| 70 61 72 61 6d 65 74 65 | 72 20 69 73 20 75 73 65 |paramete|r is use|
|00005580| 64 20 66 6f 72 20 67 65 | 74 74 69 6e 67 2c 20 6f |d for ge|tting, o|
|00005590| 72 20 64 69 73 70 6f 73 | 69 6e 67 2c 20 63 6f 6e |r dispos|ing, con|
|000055a0| 6e 65 63 74 69 6f 6e 20 | 69 6e 66 6f 72 6d 61 74 |nection |informat|
|000055b0| 69 6f 6e 2e 20 20 54 68 | 65 20 66 6f 6c 6c 6f 77 |ion. Th|e follow|
|000055c0| 69 6e 67 20 66 6c 61 67 | 73 20 61 72 65 20 64 65 |ing flag|s are de|
|000055d0| 66 69 6e 65 64 3a 20 20 | 0d 23 64 65 66 69 6e 65 |fined: |.#define|
|000055e0| 20 63 74 6c 69 72 5f 67 | 65 74 43 6f 6e 6e 65 63 | ctlir_g|etConnec|
|000055f0| 74 49 6e 66 6f 09 30 78 | 30 31 09 2f 2f 20 77 69 |tInfo.0x|01.// wi|
|00005600| 6c 6c 20 67 65 74 20 63 | 6f 6e 6e 65 63 74 20 69 |ll get c|onnect i|
|00005610| 6e 66 6f 20 69 66 20 61 | 64 64 72 65 73 73 20 72 |nfo if a|ddress r|
|00005620| 65 6d 6f 74 65 0d 23 64 | 65 66 69 6e 65 20 63 74 |emote.#d|efine ct|
|00005630| 6c 69 72 5f 64 69 73 70 | 6f 73 65 43 6f 6e 6e 65 |lir_disp|oseConne|
|00005640| 63 74 49 6e 66 6f 20 09 | 30 78 30 32 09 2f 2f 20 |ctInfo .|0x02.// |
|00005650| 77 69 6c 6c 20 64 69 73 | 70 6f 73 65 20 69 6e 66 |will dis|pose inf|
|00005660| 6f 20 69 6e 20 63 6f 6e | 6e 65 63 74 49 6e 66 6f |o in con|nectInfo|
|00005670| 50 74 72 20 70 72 6f 70 | 65 72 6c 79 0d 49 66 20 |Ptr prop|erly.If |
|00005680| 74 68 65 20 63 74 6c 69 | 72 5f 67 65 74 43 6f 6e |the ctli|r_getCon|
|00005690| 6e 65 63 74 49 6e 66 6f | 20 66 6c 61 67 20 69 73 |nectInfo| flag is|
|000056a0| 20 73 65 74 2c 20 61 6e | 64 20 74 68 65 20 6e 65 | set, an|d the ne|
|000056b0| 74 77 6f 72 6b 20 61 64 | 64 72 65 73 73 20 69 73 |twork ad|dress is|
|000056c0| 20 72 65 6d 6f 74 65 2c | 20 74 68 65 20 69 6e 66 | remote,| the inf|
|000056d0| 6f 72 6d 61 74 69 6f 6e | 20 6e 65 63 65 73 73 61 |ormation| necessa|
|000056e0| 72 79 20 74 6f 20 63 72 | 65 61 74 65 20 74 68 65 |ry to cr|eate the|
|000056f0| 20 72 65 6d 6f 74 65 20 | 63 6f 6e 6e 65 63 74 69 | remote |connecti|
|00005700| 6f 6e 20 69 73 20 72 65 | 74 75 72 6e 65 64 2e 20 |on is re|turned. |
|00005710| 20 49 66 20 74 68 65 20 | 63 74 6c 69 72 5f 64 69 | If the |ctlir_di|
|00005720| 73 70 6f 73 65 43 6f 6e | 6e 65 63 74 49 6e 66 6f |sposeCon|nectInfo|
|00005730| 20 66 6c 61 67 20 69 73 | 20 73 65 74 2c 20 74 68 | flag is| set, th|
|00005740| 65 20 63 6f 6e 6e 65 63 | 74 20 69 6e 66 6f 72 6d |e connec|t inform|
|00005750| 61 74 69 6f 6e 20 73 74 | 72 75 63 74 75 72 65 20 |ation st|ructure |
|00005760| 70 6f 69 6e 74 65 64 20 | 74 6f 20 62 79 20 63 6f |pointed |to by co|
|00005770| 6e 6e 65 63 74 49 6e 66 | 6f 50 74 72 2c 20 69 73 |nnectInf|oPtr, is|
|00005780| 20 64 69 73 70 6f 73 65 | 64 20 6f 66 20 70 72 6f | dispose|d of pro|
|00005790| 70 65 72 6c 79 2e 0d 54 | 68 65 20 6c 6f 63 61 74 |perly..T|he locat|
|000057a0| 69 6f 6e 49 73 52 65 6d | 6f 74 65 46 6c 61 67 20 |ionIsRem|oteFlag |
|000057b0| 70 61 72 61 6d 65 74 65 | 72 20 69 73 20 61 20 66 |paramete|r is a f|
|000057c0| 6c 61 67 20 74 68 61 74 | 20 69 73 20 72 65 74 75 |lag that| is retu|
|000057d0| 72 6e 65 64 20 74 72 75 | 65 20 69 66 20 74 68 65 |rned tru|e if the|
|000057e0| 20 6e 65 74 77 6f 72 6b | 20 61 64 64 72 65 73 73 | network| address|
|000057f0| 20 69 73 20 72 65 6d 6f | 74 65 2e 20 20 54 68 65 | is remo|te. The|
|00005800| 20 63 6f 6e 6e 65 63 74 | 49 6e 66 6f 4c 65 6e 67 | connect|InfoLeng|
|00005810| 74 68 20 70 61 72 61 6d | 65 74 65 72 20 69 6e 64 |th param|eter ind|
|00005820| 69 63 61 74 65 73 20 74 | 68 65 20 6c 65 6e 67 74 |icates t|he lengt|
|00005830| 68 20 6f 66 20 74 68 65 | 20 63 6f 6e 6e 65 63 74 |h of the| connect|
|00005840| 20 69 6e 66 6f 72 6d 61 | 74 69 6f 6e 2e 20 20 54 | informa|tion. T|
|00005850| 68 65 20 63 6f 6e 6e 65 | 63 74 49 6e 66 6f 50 74 |he conne|ctInfoPt|
|00005860| 72 20 69 73 20 61 20 70 | 6f 69 6e 74 65 72 20 74 |r is a p|ointer t|
|00005870| 6f 20 74 68 65 20 63 6f | 6e 6e 65 63 74 69 6f 6e |o the co|nnection|
|00005880| 20 69 6e 66 6f 72 6d 61 | 74 69 6f 6e 20 66 6f 72 | informa|tion for|
|00005890| 20 63 6f 6e 6e 65 63 74 | 69 6e 67 20 77 69 74 68 | connect|ing with|
|000058a0| 20 74 68 65 20 72 65 6d | 6f 74 65 20 61 64 64 72 | the rem|ote addr|
|000058b0| 65 73 73 2e 20 20 54 68 | 65 73 65 20 76 61 6c 75 |ess. Th|ese valu|
|000058c0| 65 73 20 61 72 65 20 72 | 65 74 75 72 6e 65 64 20 |es are r|eturned |
|000058d0| 77 68 65 6e 20 74 68 65 | 20 6e 65 74 77 6f 72 6b |when the| network|
|000058e0| 20 61 64 64 72 65 73 73 | 20 69 73 20 72 65 6d 6f | address| is remo|
|000058f0| 74 65 2c 20 61 6e 64 20 | 74 68 65 20 63 74 6c 69 |te, and |the ctli|
|00005900| 72 5f 67 65 74 43 6f 6e | 6e 65 63 74 49 6e 66 6f |r_getCon|nectInfo|
|00005910| 20 66 6c 61 67 20 69 73 | 20 73 65 74 2e 20 20 0d | flag is| set. .|
|00005920| 73 74 72 75 63 74 20 54 | 52 65 6d 6f 74 65 41 63 |struct T|RemoteAc|
|00005930| 63 65 73 73 49 73 52 65 | 6d 6f 74 65 50 61 72 6d |cessIsRe|moteParm|
|00005940| 73 0d 7b 0d 09 44 52 65 | 6d 6f 74 65 41 63 63 65 |s.{..DRe|moteAcce|
|00005950| 73 73 50 61 72 6d 48 65 | 61 64 65 72 0d 09 6c 6f |ssParmHe|ader..lo|
|00005960| 6e 67 20 74 68 65 41 64 | 64 72 65 73 73 3b 20 09 |ng theAd|dress; .|
|00005970| 09 09 2f 2f 20 61 64 64 | 72 65 73 73 20 74 68 61 |..// add|ress tha|
|00005980| 74 20 69 73 20 74 6f 20 | 62 65 20 63 68 65 63 6b |t is to |be check|
|00005990| 65 64 0d 09 75 6e 73 69 | 67 6e 65 64 20 6c 6f 6e |ed..unsi|gned lon|
|000059a0| 67 20 6f 70 74 69 6f 6e | 46 6c 61 67 73 3b 09 2f |g option|Flags;./|
|000059b0| 2f 20 53 65 74 20 74 6f | 20 63 74 6c 69 72 5f 67 |/ Set to| ctlir_g|
|000059c0| 65 74 43 6f 6e 6e 65 63 | 74 49 6e 66 6f 20 6f 72 |etConnec|tInfo or|
|000059d0| 0d 09 09 2f 2f 20 63 74 | 6c 69 72 5f 64 69 73 70 |...// ct|lir_disp|
|000059e0| 6f 73 65 43 6f 6e 6e 65 | 63 74 49 6e 66 6f 2c 20 |oseConne|ctInfo, |
|000059f0| 69 66 20 7a 65 72 6f 20 | 6f 6e 6c 79 20 63 68 65 |if zero |only che|
|00005a00| 63 6b 73 0d 09 09 2f 2f | 20 74 68 65 41 64 64 72 |cks...//| theAddr|
|00005a10| 65 73 73 0d 09 42 6f 6f | 6c 65 61 6e 20 6c 6f 63 |ess..Boo|lean loc|
|00005a20| 61 74 69 6f 6e 49 73 52 | 65 6d 6f 74 65 46 6c 61 |ationIsR|emoteFla|
|00005a30| 67 3b 09 2f 2f 20 72 65 | 74 75 72 6e 73 20 74 72 |g;.// re|turns tr|
|00005a40| 75 65 20 69 66 20 61 64 | 64 72 65 73 73 20 69 73 |ue if ad|dress is|
|00005a50| 20 72 65 6d 6f 74 65 0d | 09 6c 6f 6e 67 20 63 6f | remote.|.long co|
|00005a60| 6e 6e 65 63 74 49 6e 66 | 6f 4c 65 6e 67 74 68 3b |nnectInf|oLength;|
|00005a70| 09 09 2f 2f 20 6c 65 6e | 67 74 68 20 6f 66 20 74 |..// len|gth of t|
|00005a80| 68 65 20 66 6f 6c 6c 6f | 77 69 6e 67 20 64 61 74 |he follo|wing dat|
|00005a90| 61 09 0d 09 54 50 52 41 | 43 6f 6e 6e 65 63 74 49 |a...TPRA|ConnectI|
|00005aa0| 6e 66 6f 54 65 6d 70 6c | 61 74 65 20 63 6f 6e 6e |nfoTempl|ate conn|
|00005ab0| 65 63 74 49 6e 66 6f 50 | 74 72 3b 09 2f 2f 20 54 |ectInfoP|tr;.// T|
|00005ac0| 68 65 20 63 6f 6e 6e 65 | 63 74 69 6f 6e 20 69 6e |he conne|ction in|
|00005ad0| 66 6f 72 6d 61 74 69 6f | 6e 20 74 65 6d 70 6c 61 |formatio|n templa|
|00005ae0| 74 65 20 70 6f 69 6e 74 | 65 72 09 0d 7d 3b 0d 74 |te point|er..};.t|
|00005af0| 79 70 65 64 65 66 20 73 | 74 72 75 63 74 20 54 52 |ypedef s|truct TR|
|00005b00| 65 6d 6f 74 65 41 63 63 | 65 73 73 49 73 52 65 6d |emoteAcc|essIsRem|
|00005b10| 6f 74 65 50 61 72 6d 73 | 20 54 52 65 6d 6f 74 65 |oteParms| TRemote|
|00005b20| 41 63 63 65 73 73 49 73 | 52 65 6d 6f 74 65 50 61 |AccessIs|RemotePa|
|00005b30| 72 6d 73 3b 0d 53 74 61 | 74 75 73 0d 54 68 65 20 |rms;.Sta|tus.The |
|00005b40| 73 74 61 74 75 73 20 63 | 6f 6d 6d 61 6e 64 20 69 |status c|ommand i|
|00005b50| 73 20 75 73 65 64 20 74 | 6f 20 6f 62 74 61 69 6e |s used t|o obtain|
|00005b60| 20 69 6e 66 6f 72 6d 61 | 74 69 6f 6e 20 61 62 6f | informa|tion abo|
|00005b70| 75 74 20 52 65 6d 6f 74 | 65 20 41 63 63 65 73 73 |ut Remot|e Access|
|00005b80| 2e 20 20 54 68 65 20 69 | 6e 66 6f 72 6d 61 74 69 |. The i|nformati|
|00005b90| 6f 6e 20 79 6f 75 20 63 | 61 6e 20 6f 62 74 61 69 |on you c|an obtai|
|00005ba0| 6e 20 69 73 20 68 6f 77 | 20 6c 6f 6e 67 20 61 20 |n is how| long a |
|00005bb0| 63 6f 6e 6e 65 63 74 69 | 6f 6e 20 68 61 73 20 62 |connecti|on has b|
|00005bc0| 65 65 6e 20 61 63 74 69 | 76 65 2c 20 68 6f 77 20 |een acti|ve, how |
|00005bd0| 6d 75 63 68 20 74 69 6d | 65 20 72 65 6d 61 69 6e |much tim|e remain|
|00005be0| 73 20 69 6e 20 74 68 65 | 20 63 6f 6e 6e 65 63 74 |s in the| connect|
|00005bf0| 69 6f 6e 2c 20 74 68 65 | 20 6e 61 6d 65 20 6f 66 |ion, the| name of|
|00005c00| 20 74 68 65 20 75 73 65 | 72 20 74 68 61 74 20 6d | the use|r that m|
|00005c10| 61 64 65 20 61 6e 20 61 | 6e 73 77 65 72 69 6e 67 |ade an a|nswering|
|00005c20| 20 63 6f 6e 6e 65 63 74 | 69 6f 6e 2c 20 74 68 65 | connect|ion, the|
|00005c30| 20 6e 61 6d 65 20 6f 66 | 20 74 68 65 20 63 6f 6d | name of| the com|
|00005c40| 70 75 74 65 72 20 79 6f | 75 20 61 72 65 20 63 6f |puter yo|u are co|
|00005c50| 6e 6e 65 63 74 65 64 20 | 74 6f 20 6f 6e 20 61 20 |nnected |to on a |
|00005c60| 63 61 6c 6c 69 6e 67 20 | 63 6f 6e 6e 65 63 74 69 |calling |connecti|
|00005c70| 6f 6e 2c 20 61 6e 64 20 | 74 68 65 20 6c 61 73 74 |on, and |the last|
|00005c80| 20 6d 65 73 73 61 67 65 | 20 74 68 61 74 20 77 61 | message| that wa|
|00005c90| 73 20 70 6f 73 74 65 64 | 2e 20 20 54 68 65 20 73 |s posted|. The s|
|00005ca0| 74 61 74 75 73 42 69 74 | 73 20 70 61 72 61 6d 65 |tatusBit|s parame|
|00005cb0| 74 65 72 20 69 73 20 75 | 73 65 64 20 74 6f 20 64 |ter is u|sed to d|
|00005cc0| 65 74 65 72 6d 69 6e 65 | 20 69 66 20 61 20 63 6f |etermine| if a co|
|00005cd0| 6e 6e 65 63 74 69 6f 6e | 20 69 73 20 61 63 74 69 |nnection| is acti|
|00005ce0| 76 65 2c 20 73 74 61 72 | 74 69 6e 67 20 75 70 2c |ve, star|ting up,|
|00005cf0| 20 69 6e 20 74 68 65 20 | 70 72 6f 63 65 73 73 20 | in the |process |
|00005d00| 6f 66 20 74 65 61 72 69 | 6e 67 20 64 6f 77 6e 2c |of teari|ng down,|
|00005d10| 20 69 66 20 74 68 65 20 | 63 6f 6e 6e 65 63 74 69 | if the |connecti|
|00005d20| 6f 6e 20 69 73 20 61 6e | 20 61 6e 73 77 65 72 69 |on is an| answeri|
|00005d30| 6e 67 20 6f 72 20 63 61 | 6c 6c 69 6e 67 20 63 6f |ng or ca|lling co|
|00005d40| 6e 6e 65 63 74 69 6f 6e | 2c 20 69 66 20 74 68 65 |nnection|, if the|
|00005d50| 20 63 6f 6d 70 75 74 65 | 72 20 69 73 20 65 6e 61 | compute|r is ena|
|00005d60| 62 6c 65 64 20 74 6f 20 | 72 65 63 65 69 76 65 20 |bled to |receive |
|00005d70| 61 6e 73 77 65 72 20 63 | 61 6c 6c 73 20 6f 72 20 |answer c|alls or |
|00005d80| 69 66 20 61 20 64 69 73 | 63 6f 6e 6e 65 63 74 20 |if a dis|connect |
|00005d90| 69 73 20 69 6e 20 70 72 | 6f 67 72 65 73 73 2e 20 |is in pr|ogress. |
|00005da0| 54 68 65 20 66 6f 6c 6c | 6f 77 69 6e 67 20 66 6c |The foll|owing fl|
|00005db0| 61 67 73 20 61 72 65 20 | 64 65 66 69 6e 65 64 3a |ags are |defined:|
|00005dc0| 20 0d 2f 2f 20 62 69 74 | 73 20 70 61 73 73 65 64 | .// bit|s passed|
|00005dd0| 20 62 61 63 6b 20 69 6e | 20 73 74 61 74 75 73 42 | back in| statusB|
|00005de0| 69 74 73 0d 23 64 65 66 | 69 6e 65 20 43 63 74 6c |its.#def|ine Cctl|
|00005df0| 43 6f 6e 6e 65 63 74 65 | 64 20 20 20 20 20 20 20 |Connecte|d |
|00005e00| 20 20 20 20 30 78 30 30 | 30 30 30 30 30 31 09 2f | 0x00|000001./|
|00005e10| 2f 20 73 65 74 20 77 68 | 65 6e 20 63 6f 6e 6e 65 |/ set wh|en conne|
|00005e20| 63 74 65 64 0d 23 64 65 | 66 69 6e 65 20 43 63 74 |cted.#de|fine Cct|
|00005e30| 6c 41 6e 73 77 65 72 45 | 6e 61 62 6c 65 20 20 20 |lAnswerE|nable |
|00005e40| 20 20 20 20 20 30 78 30 | 30 30 30 30 30 30 34 09 | 0x0|0000004.|
|00005e50| 2f 2f 20 73 65 74 20 77 | 68 65 6e 20 77 65 20 61 |// set w|hen we a|
|00005e60| 72 65 20 73 65 74 20 74 | 6f 20 61 6e 73 77 65 72 |re set t|o answer|
|00005e70| 20 63 61 6c 6c 73 0d 23 | 64 65 66 69 6e 65 20 43 | calls.#|define C|
|00005e80| 63 74 6c 53 65 72 76 65 | 72 4d 6f 64 65 20 20 20 |ctlServe|rMode |
|00005e90| 20 20 20 20 20 20 20 30 | 78 30 30 30 30 30 30 30 | 0|x0000000|
|00005ea0| 38 09 2f 2f 20 73 65 74 | 20 66 6f 72 20 61 6e 73 |8.// set| for ans|
|00005eb0| 77 65 72 20 6d 6f 64 65 | 2c 20 63 6c 65 61 72 20 |wer mode|, clear |
|00005ec0| 66 6f 72 20 63 61 6c 6c | 20 6d 6f 64 65 0d 23 64 |for call| mode.#d|
|00005ed0| 65 66 69 6e 65 20 43 63 | 74 6c 43 6f 6e 6e 65 63 |efine Cc|tlConnec|
|00005ee0| 74 69 6f 6e 41 62 6f 72 | 74 69 6e 67 20 20 30 78 |tionAbor|ting 0x|
|00005ef0| 30 30 30 30 30 30 31 30 | 09 2f 2f 20 63 6f 6e 6e |00000010|.// conn|
|00005f00| 65 63 74 69 6f 6e 20 69 | 73 20 62 65 69 6e 67 20 |ection i|s being |
|00005f10| 74 6f 72 6e 20 64 6f 77 | 6e 0d 23 64 65 66 69 6e |torn dow|n.#defin|
|00005f20| 65 20 43 63 74 6c 43 6f | 6e 6e 65 63 74 49 6e 50 |e CctlCo|nnectInP|
|00005f30| 72 6f 67 20 20 20 20 20 | 20 20 30 78 30 30 30 30 |rog | 0x0000|
|00005f40| 30 30 32 30 09 2f 2f 20 | 73 65 74 20 77 68 65 6e |0020.// |set when|
|00005f50| 20 63 6f 6e 6e 65 63 74 | 69 6f 6e 20 69 6e 20 70 | connect|ion in p|
|00005f60| 72 6f 67 72 65 73 73 20 | 6f 72 20 66 75 6c 6c 79 |rogress |or fully|
|00005f70| 0d 09 09 09 09 09 09 09 | 09 2f 2f 20 63 6f 6e 6e |........|.// conn|
|00005f80| 65 63 74 65 64 0d 23 64 | 65 66 69 6e 65 20 43 63 |ected.#d|efine Cc|
|00005f90| 74 6c 44 69 73 63 6f 6e | 6e 65 63 74 49 6e 53 74 |tlDiscon|nectInSt|
|00005fa0| 61 72 74 65 64 20 30 78 | 30 30 30 30 38 30 30 30 |arted 0x|00008000|
|00005fb0| 09 2f 2f 20 73 6f 6d 65 | 62 6f 64 79 20 68 61 73 |.// some|body has|
|00005fc0| 20 73 74 61 72 74 65 64 | 20 61 20 64 69 73 63 6f | started| a disco|
|00005fd0| 6e 6e 65 63 74 49 6e 0d | 23 64 65 66 69 6e 65 20 |nnectIn.|#define |
|00005fe0| 63 74 6c 41 52 32 43 6f | 6e 6e 65 63 74 69 6f 6e |ctlAR2Co|nnection|
|00005ff0| 20 20 20 20 20 20 20 20 | 30 78 30 32 30 30 30 30 | |0x020000|
|00006000| 30 30 09 2f 2f 20 73 65 | 74 20 77 68 65 6e 20 74 |00.// se|t when t|
|00006010| 68 69 73 20 63 6f 6e 6e | 65 63 74 69 6f 6e 20 69 |his conn|ection i|
|00006020| 73 20 74 6f 20 61 20 32 | 2e 30 20 73 65 72 76 65 |s to a 2|.0 serve|
|00006030| 72 0d 23 64 65 66 69 6e | 65 20 63 74 6c 4e 6f 74 |r.#defin|e ctlNot|
|00006040| 69 66 79 57 68 69 6c 65 | 43 6f 6e 6e 65 63 74 65 |ifyWhile|Connecte|
|00006050| 64 20 30 78 30 34 30 30 | 30 30 30 30 09 2f 2f 20 |d 0x0400|0000.// |
|00006060| 73 65 74 20 77 68 65 6e | 20 74 68 65 20 75 73 65 |set when| the use|
|00006070| 72 20 77 61 6e 74 73 20 | 74 6f 20 62 65 20 72 65 |r wants |to be re|
|00006080| 6d 69 6e 64 65 64 20 77 | 68 69 6c 65 20 09 09 09 |minded w|hile ...|
|00006090| 2f 2f 20 63 6f 6e 6e 65 | 63 74 65 64 2e 0d 23 64 |// conne|cted..#d|
|000060a0| 65 66 69 6e 65 20 63 74 | 6c 43 6f 6e 6e 65 63 74 |efine ct|lConnect|
|000060b0| 65 64 54 6f 4d 50 53 20 | 20 20 20 20 20 20 30 78 |edToMPS | 0x|
|000060c0| 30 38 30 30 30 30 30 30 | 09 2f 2f 20 73 65 74 20 |08000000|.// set |
|000060d0| 77 68 65 6e 20 63 6c 69 | 65 6e 74 20 69 73 20 63 |when cli|ent is c|
|000060e0| 6f 6e 6e 65 63 74 65 64 | 20 74 6f 20 61 20 6d 75 |onnected| to a mu|
|000060f0| 6c 74 69 2d 70 6f 72 74 | 20 09 09 09 2f 2f 20 73 |lti-port| ...// s|
|00006100| 65 72 76 65 72 0d 23 64 | 65 66 69 6e 65 20 43 63 |erver.#d|efine Cc|
|00006110| 74 6c 4d 75 6c 74 69 4e | 6f 64 65 52 65 61 64 79 |tlMultiN|odeReady|
|00006120| 20 20 20 20 20 20 30 78 | 38 30 30 30 30 30 30 30 | 0x|80000000|
|00006130| 09 2f 2f 20 73 68 6f 77 | 73 20 69 66 20 77 65 20 |.// show|s if we |
|00006140| 63 75 72 72 65 6e 74 6c | 79 20 68 61 76 65 20 61 |currentl|y have a|
|00006150| 20 6d 75 6c 74 69 6e 6f | 64 65 20 09 09 09 09 09 | multino|de .....|
|00006160| 2f 2f 20 61 64 64 72 65 | 73 73 20 74 6f 20 65 6e |// addre|ss to en|
|00006170| 61 62 6c 65 20 61 6e 73 | 77 65 72 20 6d 6f 64 65 |able ans|wer mode|
|00006180| 2e 0d 54 68 65 20 66 6f | 6c 6c 6f 77 69 6e 67 20 |..The fo|llowing |
|00006190| 73 74 72 75 63 74 20 69 | 73 20 75 73 65 64 20 77 |struct i|s used w|
|000061a0| 68 65 6e 20 6d 61 6b 69 | 6e 67 20 61 20 73 74 61 |hen maki|ng a sta|
|000061b0| 74 75 73 20 63 61 6c 6c | 3a 0d 73 74 72 75 63 74 |tus call|:.struct|
|000061c0| 20 54 52 65 6d 6f 74 65 | 41 63 63 65 73 73 53 74 | TRemote|AccessSt|
|000061d0| 61 74 75 73 50 61 72 61 | 6d 0d 7b 0d 09 44 52 65 |atusPara|m.{..DRe|
|000061e0| 6d 6f 74 65 41 63 63 65 | 73 73 50 61 72 6d 48 65 |moteAcce|ssParmHe|
|000061f0| 61 64 65 72 0d 09 75 6e | 73 69 67 6e 65 64 20 6c |ader..un|signed l|
|00006200| 6f 6e 67 20 73 74 61 74 | 75 73 42 69 74 73 3b 09 |ong stat|usBits;.|
|00006210| 2f 2f 20 62 69 74 73 20 | 66 6f 72 20 63 75 72 72 |// bits |for curr|
|00006220| 65 6e 74 20 73 74 61 74 | 75 73 0d 09 75 6e 73 69 |ent stat|us..unsi|
|00006230| 67 6e 65 64 20 6c 6f 6e | 67 20 74 69 6d 65 43 6f |gned lon|g timeCo|
|00006240| 6e 6e 65 63 74 65 64 3b | 09 2f 2f 20 6e 75 6d 62 |nnected;|.// numb|
|00006250| 65 72 20 6f 66 20 73 65 | 63 6f 6e 64 73 20 77 65 |er of se|conds we|
|00006260| 20 68 61 76 65 20 62 65 | 65 6e 20 63 6f 6e 6e 65 | have be|en conne|
|00006270| 63 74 65 64 0d 09 75 6e | 73 69 67 6e 65 64 20 6c |cted..un|signed l|
|00006280| 6f 6e 67 20 20 74 69 6d | 65 4c 65 66 74 3b 09 2f |ong tim|eLeft;./|
|00006290| 2f 20 6e 75 6d 62 65 72 | 20 6f 66 20 73 65 63 6f |/ number| of seco|
|000062a0| 6e 64 73 20 72 65 6d 61 | 69 6e 69 6e 67 20 69 6e |nds rema|ining in|
|000062b0| 20 63 6f 6e 6e 65 63 74 | 69 6f 6e 0d 09 09 2f 2f | connect|ion...//|
|000062c0| 20 28 30 78 66 66 66 66 | 66 66 66 66 20 69 6e 66 | (0xffff|ffff inf|
|000062d0| 69 6e 69 74 65 29 0d 09 | 75 6e 73 69 67 6e 65 64 |inite)..|unsigned|
|000062e0| 20 63 68 61 72 20 2a 75 | 73 65 72 4e 61 6d 65 50 | char *u|serNameP|
|000062f0| 74 72 3b 09 2f 2f 20 72 | 65 74 75 72 6e 73 20 75 |tr;.// r|eturns u|
|00006300| 73 65 72 20 6e 61 6d 65 | 2c 20 65 78 70 65 63 74 |ser name|, expect|
|00006310| 73 20 70 6f 69 6e 74 65 | 72 20 74 6f 20 62 75 66 |s pointe|r to buf|
|00006320| 66 65 72 20 09 09 09 09 | 2f 2f 20 6f 66 20 55 53 |fer ....|// of US|
|00006330| 45 52 4e 41 4d 45 53 49 | 5a 45 20 69 66 20 6e 6f |ERNAMESI|ZE if no|
|00006340| 6e 20 6e 69 6c 0d 09 75 | 6e 73 69 67 6e 65 64 20 |n nil..u|nsigned |
|00006350| 63 68 61 72 20 20 2a 63 | 6f 6e 6e 65 63 74 65 64 |char *c|onnected|
|00006360| 54 6f 4e 61 6d 65 50 74 | 72 3b 09 2f 2f 20 72 65 |ToNamePt|r;.// re|
|00006370| 74 75 72 6e 73 20 6e 61 | 6d 65 20 6f 66 20 77 68 |turns na|me of wh|
|00006380| 65 72 65 20 77 65 20 63 | 6f 6e 6e 65 63 74 65 64 |ere we c|onnected|
|00006390| 20 74 6f 2c 20 09 09 09 | 09 09 2f 2f 20 65 78 70 | to, ...|..// exp|
|000063a0| 65 63 74 73 20 70 6f 69 | 6e 74 65 72 20 74 6f 20 |ects poi|nter to |
|000063b0| 62 75 66 66 65 72 20 6f | 66 20 55 53 45 52 4e 41 |buffer o|f USERNA|
|000063c0| 4d 45 53 49 5a 45 20 69 | 66 20 09 09 09 09 2f 2f |MESIZE i|f ....//|
|000063d0| 20 6e 6f 6e 20 6e 69 6c | 0d 09 54 50 52 65 6d 6f | non nil|..TPRemo|
|000063e0| 74 65 41 63 63 65 73 73 | 50 61 72 61 6d 42 6c 6f |teAccess|ParamBlo|
|000063f0| 63 6b 20 63 6f 6e 6e 65 | 63 74 65 64 42 79 50 61 |ck conne|ctedByPa|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.