home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1993-01-19 | 9.9 KB | [TEXT/MPS ] |
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
Confidence | Program | Detection | Match Type | Support
|
---|
10%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| MS-DOS Code Page Info (other/dosCodePage)
| ext
| Unsupported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary II, Tue Jan 19 17:49:11 1993, modified Tue Jan 19 17:49:11 1993, creator 'MPS ', type ASCII, 9310 bytes "GUSINetDB.cp" , at 0x24de 607 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
74%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
25%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| siegfried
| fmt/1762 MacBinary (II)
| default
| |
100%
| lsar
| MacBinary
| default
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [MPS ] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0c 47 55 53 49 4e 65 | 74 44 42 2e 63 70 00 00 |..GUSINe|tDB.cp..|
|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 54 45 58 54 4d 50 53 | 20 00 00 00 00 00 00 00 |.TEXTMPS| .......|
|00000050| 00 00 00 00 00 24 5e 00 | 00 02 5f a7 82 35 e7 a7 |.....$^.|.._..5..|
|00000060| 82 35 e7 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.5......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 f5 1f 00 00 |........|........|
|00000080| 2f 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |/*******|********|
|00000090| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000000a0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000000b0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000000c0| 2a 2a 2a 2a 2a 2a 0d 50 | 72 6f 6a 65 63 74 09 3a |******.P|roject.:|
|000000d0| 09 47 55 53 49 09 09 09 | 09 2d 09 47 72 61 6e 64 |.GUSI...|.-.Grand|
|000000e0| 20 55 6e 69 66 69 65 64 | 20 53 6f 63 6b 65 74 20 | Unified| Socket |
|000000f0| 49 6e 74 65 72 66 61 63 | 65 0d 46 69 6c 65 09 09 |Interfac|e.File..|
|00000100| 3a 09 47 55 53 49 4e 65 | 74 44 42 2e 63 70 09 2d |:.GUSINe|tDB.cp.-|
|00000110| 09 43 6f 6e 76 65 72 74 | 20 69 6e 74 65 72 6e 65 |.Convert| interne|
|00000120| 74 20 6e 61 6d 65 73 20 | 74 6f 20 61 64 72 65 73 |t names |to adres|
|00000130| 73 65 73 0d 41 75 74 68 | 6f 72 09 3a 09 4d 61 74 |ses.Auth|or.:.Mat|
|00000140| 74 68 69 61 73 20 4e 65 | 65 72 61 63 68 65 72 0d |thias Ne|eracher.|
|00000150| 0d 09 54 68 69 73 20 66 | 69 6c 65 20 77 61 73 20 |..This f|ile was |
|00000160| 64 65 72 69 76 65 64 20 | 66 72 6f 6d 20 74 68 65 |derived |from the|
|00000170| 20 73 6f 63 6b 65 74 20 | 6c 69 62 72 61 72 79 20 | socket |library |
|00000180| 62 79 0d 0d 09 09 43 68 | 61 72 6c 69 65 20 52 65 |by....Ch|arlie Re|
|00000190| 69 6d 61 6e 09 3c 63 72 | 65 69 6d 61 6e 40 6e 63 |iman.<cr|eiman@nc|
|000001a0| 73 61 2e 75 69 75 63 2e | 65 64 75 3e 20 61 6e 64 |sa.uiuc.|edu> and|
|000001b0| 0d 09 09 54 6f 6d 20 4d | 69 6c 6c 69 67 61 6e 09 |...Tom M|illigan.|
|000001c0| 3c 6d 69 6c 6c 69 67 61 | 6e 40 6d 61 64 68 61 75 |<milliga|n@madhau|
|000001d0| 73 2e 75 74 63 73 2e 75 | 74 6f 72 6f 6e 74 6f 2e |s.utcs.u|toronto.|
|000001e0| 63 61 3e 0d 0d 53 74 61 | 72 74 65 64 09 3a 09 31 |ca>..Sta|rted.:.1|
|000001f0| 32 53 65 70 39 32 09 09 | 09 09 09 09 09 09 4c 61 |2Sep92..|......La|
|00000200| 6e 67 75 61 67 65 09 3a | 09 4d 50 57 20 43 2b 2b |nguage.:|.MPW C++|
|00000210| 0d 09 09 09 09 31 34 53 | 65 70 39 32 09 4d 4e 09 |.....14S|ep92.MN.|
|00000220| 4d 61 79 62 65 20 69 74 | 20 77 6f 72 6b 73 2c 20 |Maybe it| works, |
|00000230| 6d 61 79 62 65 20 69 74 | 20 64 6f 65 73 6e 27 74 |maybe it| doesn't|
|00000240| 0d 09 09 09 09 32 31 4e | 6f 76 39 32 09 4d 4e 09 |.....21N|ov92.MN.|
|00000250| 52 65 6d 6f 76 65 20 66 | 6f 72 63 65 5f 61 63 74 |Remove f|orce_act|
|00000260| 69 76 65 0d 09 09 09 09 | 31 39 4a 61 6e 39 33 09 |ive.....|19Jan93.|
|00000270| 4d 4e 09 43 61 6e 27 74 | 20 73 65 74 20 61 6c 69 |MN.Can't| set ali|
|00000280| 61 73 65 73 20 74 6f 20 | 4e 55 4c 4c 2e 0d 4c 61 |ases to |NULL..La|
|00000290| 73 74 09 09 3a 09 31 39 | 4a 61 6e 39 33 0d 2a 2a |st..:.19|Jan93.**|
|000002a0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000002b0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000002c0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000002d0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000002e0| 2a 2a 2a 2f 0d 0d 23 69 | 6e 63 6c 75 64 65 20 22 |***/..#i|nclude "|
|000002f0| 47 55 53 49 49 4e 45 54 | 5f 50 2e 68 22 0d 0d 23 |GUSIINET|_P.h"..#|
|00000300| 70 72 61 67 6d 61 20 73 | 65 67 6d 65 6e 74 20 47 |pragma s|egment G|
|00000310| 55 53 49 52 65 73 69 64 | 65 6e 74 0d 70 61 73 63 |USIResid|ent.pasc|
|00000320| 61 6c 20 76 6f 69 64 20 | 44 4e 52 44 6f 6e 65 28 |al void |DNRDone(|
|00000330| 73 74 72 75 63 74 20 68 | 6f 73 74 49 6e 66 6f 20 |struct h|ostInfo |
|00000340| 2a 2c 20 42 6f 6f 6c 65 | 61 6e 20 2a 20 64 6f 6e |*, Boole|an * don|
|00000350| 65 29 0d 7b 0d 09 2a 64 | 6f 6e 65 20 3d 20 74 72 |e).{..*d|one = tr|
|00000360| 75 65 3b 0d 7d 0d 0d 23 | 70 72 61 67 6d 61 20 73 |ue;.}..#|pragma s|
|00000370| 65 67 6d 65 6e 74 20 47 | 55 53 49 49 4e 45 54 0d |egment G|USIINET.|
|00000380| 0d 69 6e 74 20 68 5f 65 | 72 72 6e 6f 3b 0d 0d 2f |.int h_e|rrno;../|
|00000390| 2a 0d 20 2a 20 20 20 47 | 65 74 68 6f 73 74 62 79 |*. * G|ethostby|
|000003a0| 6e 61 6d 65 20 61 6e 64 | 20 67 65 74 68 6f 73 74 |name and| gethost|
|000003b0| 62 79 61 64 64 72 20 65 | 61 63 68 20 72 65 74 75 |byaddr e|ach retu|
|000003c0| 72 6e 20 61 20 70 6f 69 | 6e 74 65 72 20 74 6f 20 |rn a poi|nter to |
|000003d0| 61 6e 0d 20 2a 20 20 20 | 6f 62 6a 65 63 74 20 77 |an. * |object w|
|000003e0| 69 74 68 20 74 68 65 20 | 66 6f 6c 6c 6f 77 69 6e |ith the |followin|
|000003f0| 67 20 73 74 72 75 63 74 | 75 72 65 20 64 65 73 63 |g struct|ure desc|
|00000400| 72 69 62 69 6e 67 20 61 | 6e 20 49 6e 74 65 72 6e |ribing a|n Intern|
|00000410| 65 74 0d 20 2a 20 20 20 | 68 6f 73 74 20 72 65 66 |et. * |host ref|
|00000420| 65 72 65 6e 63 65 64 20 | 62 79 20 6e 61 6d 65 20 |erenced |by name |
|00000430| 6f 72 20 62 79 20 61 64 | 64 72 65 73 73 2c 20 72 |or by ad|dress, r|
|00000440| 65 73 70 65 63 74 69 76 | 65 6c 79 2e 20 54 68 69 |espectiv|ely. Thi|
|00000450| 73 0d 20 2a 20 20 20 73 | 74 72 75 63 74 75 72 65 |s. * s|tructure|
|00000460| 20 63 6f 6e 74 61 69 6e | 73 20 74 68 65 20 69 6e | contain|s the in|
|00000470| 66 6f 72 6d 61 74 69 6f | 6e 20 6f 62 74 61 69 6e |formatio|n obtain|
|00000480| 65 64 20 66 72 6f 6d 20 | 74 68 65 20 4d 61 63 54 |ed from |the MacT|
|00000490| 43 50 0d 20 2a 20 20 20 | 6e 61 6d 65 20 73 65 72 |CP. * |name ser|
|000004a0| 76 65 72 2e 0d 20 2a 0d | 20 2a 20 20 20 73 74 72 |ver.. *.| * str|
|000004b0| 75 63 74 20 20 20 20 68 | 6f 73 74 65 6e 74 0d 20 |uct h|ostent. |
|000004c0| 2a 20 20 20 7b 0d 20 2a | 20 20 20 20 20 20 20 20 |* {. *| |
|000004d0| 63 68 61 72 20 2a 68 5f | 6e 61 6d 65 3b 0d 20 2a |char *h_|name;. *|
|000004e0| 20 20 20 20 20 20 20 20 | 63 68 61 72 20 2a 2a 68 | |char **h|
|000004f0| 5f 61 6c 69 61 73 65 73 | 3b 0d 20 2a 20 20 20 20 |_aliases|;. * |
|00000500| 20 20 20 20 69 6e 74 20 | 20 68 5f 61 64 64 72 74 | int | h_addrt|
|00000510| 79 70 65 3b 0d 20 2a 20 | 20 20 20 20 20 20 20 69 |ype;. * | i|
|00000520| 6e 74 20 20 68 5f 6c 65 | 6e 67 74 68 3b 0d 20 2a |nt h_le|ngth;. *|
|00000530| 20 20 20 20 20 20 20 20 | 63 68 61 72 20 2a 2a 68 | |char **h|
|00000540| 5f 61 64 64 72 5f 6c 69 | 73 74 3b 0d 20 2a 20 20 |_addr_li|st;. * |
|00000550| 20 7d 3b 0d 20 2a 20 20 | 20 23 64 65 66 69 6e 65 | };. * | #define|
|00000560| 20 20 20 68 5f 61 64 64 | 72 20 20 68 5f 61 64 64 | h_add|r h_add|
|00000570| 72 5f 6c 69 73 74 5b 30 | 5d 0d 20 2a 0d 20 2a 20 |r_list[0|]. *. * |
|00000580| 20 20 54 68 65 20 6d 65 | 6d 62 65 72 73 20 6f 66 | The me|mbers of|
|00000590| 20 74 68 69 73 20 73 74 | 72 75 63 74 75 72 65 20 | this st|ructure |
|000005a0| 61 72 65 3a 0d 20 2a 0d | 20 2a 20 20 20 68 5f 6e |are:. *.| * h_n|
|000005b0| 61 6d 65 20 20 20 20 20 | 20 20 4f 66 66 69 63 69 |ame | Offici|
|000005c0| 61 6c 20 6e 61 6d 65 20 | 6f 66 20 74 68 65 20 68 |al name |of the h|
|000005d0| 6f 73 74 2e 0d 20 2a 0d | 20 2a 20 20 20 68 5f 61 |ost.. *.| * h_a|
|000005e0| 6c 69 61 73 65 73 20 20 | 20 20 41 20 7a 65 72 6f |liases | A zero|
|000005f0| 20 74 65 72 6d 69 6e 61 | 74 65 64 20 61 72 72 61 | termina|ted arra|
|00000600| 79 20 6f 66 20 61 6c 74 | 65 72 6e 61 74 65 20 6e |y of alt|ernate n|
|00000610| 61 6d 65 73 20 66 6f 72 | 20 74 68 65 20 68 6f 73 |ames for| the hos|
|00000620| 74 2e 0d 20 2a 0d 20 2a | 20 20 20 68 5f 61 64 64 |t.. *. *| h_add|
|00000630| 72 74 79 70 65 20 20 20 | 54 68 65 20 74 79 70 65 |rtype |The type|
|00000640| 20 6f 66 20 61 64 64 72 | 65 73 73 20 62 65 69 6e | of addr|ess bein|
|00000650| 67 20 20 72 65 74 75 72 | 6e 65 64 3b 20 61 6c 77 |g retur|ned; alw|
|00000660| 61 79 73 20 41 46 5f 49 | 4e 45 54 2e 0d 20 2a 0d |ays AF_I|NET.. *.|
|00000670| 20 2a 20 20 20 68 5f 6c | 65 6e 67 74 68 20 20 20 | * h_l|ength |
|00000680| 20 20 54 68 65 20 6c 65 | 6e 67 74 68 2c 20 69 6e | The le|ngth, in|
|00000690| 20 62 79 74 65 73 2c 20 | 6f 66 20 74 68 65 20 61 | bytes, |of the a|
|000006a0| 64 64 72 65 73 73 2e 0d | 20 2a 0d 20 2a 20 20 20 |ddress..| *. * |
|000006b0| 68 5f 61 64 64 72 5f 6c | 69 73 74 20 20 41 20 7a |h_addr_l|ist A z|
|000006c0| 65 72 6f 20 74 65 72 6d | 69 6e 61 74 65 64 20 61 |ero term|inated a|
|000006d0| 72 72 61 79 20 6f 66 20 | 6e 65 74 77 6f 72 6b 20 |rray of |network |
|000006e0| 61 64 64 72 65 73 73 65 | 73 20 66 6f 72 20 74 68 |addresse|s for th|
|000006f0| 65 20 68 6f 73 74 2e 0d | 20 2a 0d 20 2a 20 20 20 |e host..| *. * |
|00000700| 45 72 72 6f 72 20 72 65 | 74 75 72 6e 20 73 74 61 |Error re|turn sta|
|00000710| 74 75 73 20 66 72 6f 6d | 20 67 65 74 68 6f 73 74 |tus from| gethost|
|00000720| 62 79 6e 61 6d 65 20 61 | 6e 64 20 67 65 74 68 6f |byname a|nd getho|
|00000730| 73 74 62 79 61 64 64 72 | 20 20 69 73 0d 20 2a 20 |stbyaddr| is. * |
|00000740| 20 20 69 6e 64 69 63 61 | 74 65 64 20 62 79 20 72 | indica|ted by r|
|00000750| 65 74 75 72 6e 20 6f 66 | 20 61 20 6e 75 6c 6c 20 |eturn of| a null |
|00000760| 70 6f 69 6e 74 65 72 2e | 20 20 54 68 65 20 65 78 |pointer.| The ex|
|00000770| 74 65 72 6e 61 6c 20 69 | 6e 74 65 67 65 72 0d 20 |ternal i|nteger. |
|00000780| 2a 20 20 20 68 5f 65 72 | 72 6e 6f 20 6d 61 79 20 |* h_er|rno may |
|00000790| 74 68 65 6e 20 20 62 65 | 20 63 68 65 63 6b 65 64 |then be| checked|
|000007a0| 20 20 74 6f 20 20 73 65 | 65 20 20 77 68 65 74 68 | to se|e wheth|
|000007b0| 65 72 20 20 74 68 69 73 | 20 20 69 73 20 20 61 0d |er this| is a.|
|000007c0| 20 2a 20 20 20 74 65 6d | 70 6f 72 61 72 79 20 20 | * tem|porary |
|000007d0| 66 61 69 6c 75 72 65 20 | 20 6f 72 20 20 61 6e 20 |failure | or an |
|000007e0| 20 69 6e 76 61 6c 69 64 | 20 20 6f 72 20 20 75 6e | invalid| or un|
|000007f0| 6b 6e 6f 77 6e 20 20 68 | 6f 73 74 2e 20 20 54 68 |known h|ost. Th|
|00000800| 65 0d 20 2a 20 20 20 72 | 6f 75 74 69 6e 65 20 68 |e. * r|outine h|
|00000810| 65 72 72 6f 72 20 20 63 | 61 6e 20 20 62 65 20 20 |error c|an be |
|00000820| 75 73 65 64 20 20 74 6f | 20 20 70 72 69 6e 74 20 |used to| print |
|00000830| 20 61 6e 20 65 72 72 6f | 72 20 20 6d 65 73 73 61 | an erro|r messa|
|00000840| 67 65 0d 20 2a 20 20 20 | 64 65 73 63 72 69 62 69 |ge. * |describi|
|00000850| 6e 67 20 74 68 65 20 66 | 61 69 6c 75 72 65 2e 20 |ng the f|ailure. |
|00000860| 20 49 66 20 69 74 73 20 | 61 72 67 75 6d 65 6e 74 | If its |argument|
|00000870| 20 73 74 72 69 6e 67 20 | 69 73 20 6e 6f 6e 2d 4e | string |is non-N|
|00000880| 55 4c 4c 2c 0d 20 2a 20 | 20 20 69 74 20 69 73 20 |ULL,. * | it is |
|00000890| 70 72 69 6e 74 65 64 2c | 20 66 6f 6c 6c 6f 77 65 |printed,| followe|
|000008a0| 64 20 62 79 20 61 20 63 | 6f 6c 6f 6e 20 61 6e 64 |d by a c|olon and|
|000008b0| 20 61 20 73 70 61 63 65 | 2e 20 20 20 54 68 65 20 | a space|. The |
|000008c0| 20 65 72 72 6f 72 0d 20 | 2a 20 20 20 6d 65 73 73 | error. |* mess|
|000008d0| 61 67 65 20 69 73 20 70 | 72 69 6e 74 65 64 20 77 |age is p|rinted w|
|000008e0| 69 74 68 20 61 20 74 72 | 61 69 6c 69 6e 67 20 6e |ith a tr|ailing n|
|000008f0| 65 77 6c 69 6e 65 2e 0d | 20 2a 0d 20 2a 20 20 20 |ewline..| *. * |
|00000900| 68 5f 65 72 72 6e 6f 20 | 63 61 6e 20 68 61 76 65 |h_errno |can have|
|00000910| 20 74 68 65 20 66 6f 6c | 6c 6f 77 69 6e 67 20 76 | the fol|lowing v|
|00000920| 61 6c 75 65 73 3a 0d 20 | 2a 0d 20 2a 20 20 20 20 |alues:. |*. * |
|00000930| 20 48 4f 53 54 5f 4e 4f | 54 5f 46 4f 55 4e 44 20 | HOST_NO|T_FOUND |
|00000940| 20 4e 6f 20 73 75 63 68 | 20 68 6f 73 74 20 69 73 | No such| host is|
|00000950| 20 6b 6e 6f 77 6e 2e 0d | 20 2a 0d 20 2a 20 20 20 | known..| *. * |
|00000960| 20 20 54 52 59 5f 41 47 | 41 49 4e 09 54 68 69 73 | TRY_AG|AIN.This|
|00000970| 20 69 73 20 75 73 75 61 | 6c 6c 79 20 61 20 74 65 | is usua|lly a te|
|00000980| 6d 70 6f 72 61 72 79 20 | 65 72 72 6f 72 20 61 6e |mporary |error an|
|00000990| 64 0d 20 2a 09 09 09 09 | 09 6d 65 61 6e 73 20 20 |d. *....|.means |
|000009a0| 20 74 68 61 74 20 20 74 | 68 65 20 20 6c 6f 63 61 | that t|he loca|
|000009b0| 6c 20 20 73 65 72 76 65 | 72 20 20 64 69 64 20 20 |l serve|r did |
|000009c0| 6e 6f 74 0d 20 2a 09 09 | 09 09 09 72 65 63 65 69 |not. *..|...recei|
|000009d0| 76 65 20 61 20 72 65 73 | 70 6f 6e 73 65 20 66 72 |ve a res|ponse fr|
|000009e0| 6f 6d 20 20 61 6e 20 20 | 61 75 74 68 6f 72 69 74 |om an |authorit|
|000009f0| 61 74 69 76 65 0d 20 2a | 09 09 09 09 09 73 65 72 |ative. *|.....ser|
|00000a00| 76 65 72 2e 20 20 20 41 | 20 20 72 65 74 72 79 20 |ver. A| retry |
|00000a10| 61 74 20 73 6f 6d 65 20 | 6c 61 74 65 72 20 74 69 |at some |later ti|
|00000a20| 6d 65 20 6d 61 79 0d 20 | 2a 09 09 09 09 09 73 75 |me may. |*.....su|
|00000a30| 63 63 65 65 64 2e 0d 20 | 2a 0d 20 2a 20 20 20 20 |cceed.. |*. * |
|00000a40| 20 4e 4f 5f 52 45 43 4f | 56 45 52 59 09 53 6f 6d | NO_RECO|VERY.Som|
|00000a50| 65 20 75 6e 65 78 70 65 | 63 74 65 64 20 73 65 72 |e unexpe|cted ser|
|00000a60| 76 65 72 20 66 61 69 6c | 75 72 65 20 77 61 73 20 |ver fail|ure was |
|00000a70| 65 6e 63 6f 75 6e 74 65 | 72 65 64 2e 0d 20 2a 09 |encounte|red.. *.|
|00000a80| 20 09 09 09 09 54 68 69 | 73 20 69 73 20 61 20 6e | ....Thi|s is a n|
|00000a90| 6f 6e 2d 72 65 63 6f 76 | 65 72 61 62 6c 65 20 65 |on-recov|erable e|
|00000aa0| 72 72 6f 72 2e 0d 20 2a | 0d 20 2a 20 20 20 20 20 |rror.. *|. * |
|00000ab0| 4e 4f 5f 44 41 54 41 09 | 09 54 68 65 20 72 65 71 |NO_DATA.|.The req|
|00000ac0| 75 65 73 74 65 64 20 6e | 61 6d 65 20 69 73 20 76 |uested n|ame is v|
|00000ad0| 61 6c 69 64 20 62 75 74 | 20 20 64 6f 65 73 20 20 |alid but| does |
|00000ae0| 6e 6f 74 0d 20 2a 09 09 | 09 09 09 68 61 76 65 20 |not. *..|...have |
|00000af0| 20 20 61 6e 20 49 50 20 | 20 61 64 64 72 65 73 73 | an IP | address|
|00000b00| 3b 20 20 74 68 69 73 20 | 20 69 73 20 6e 6f 74 20 |; this | is not |
|00000b10| 20 61 0d 20 2a 09 09 09 | 09 09 74 65 6d 70 6f 72 | a. *...|..tempor|
|00000b20| 61 72 79 20 65 72 72 6f | 72 2e 20 54 68 69 73 20 |ary erro|r. This |
|00000b30| 6d 65 61 6e 73 20 74 68 | 61 74 20 74 68 65 20 20 |means th|at the |
|00000b40| 6e 61 6d 65 0d 20 2a 09 | 09 09 09 09 69 73 20 6b |name. *.|....is k|
|00000b50| 6e 6f 77 6e 20 20 74 6f | 20 74 68 65 20 6e 61 6d |nown to| the nam|
|00000b60| 65 20 73 65 72 76 65 72 | 20 62 75 74 20 74 68 65 |e server| but the|
|00000b70| 72 65 20 69 73 0d 20 2a | 09 09 09 09 09 6e 6f 20 |re is. *|.....no |
|00000b80| 61 64 64 72 65 73 73 20 | 20 61 73 73 6f 63 69 61 |address | associa|
|00000b90| 74 65 64 20 20 77 69 74 | 68 20 20 74 68 69 73 20 |ted wit|h this |
|00000ba0| 20 6e 61 6d 65 2e 0d 20 | 2a 09 09 09 09 09 41 6e | name.. |*.....An|
|00000bb0| 6f 74 68 65 72 20 74 79 | 70 65 20 6f 66 20 72 65 |other ty|pe of re|
|00000bc0| 71 75 65 73 74 20 74 6f | 20 74 68 65 20 6e 61 6d |quest to| the nam|
|00000bd0| 65 20 73 65 72 76 65 72 | 0d 20 2a 09 09 09 09 09 |e server|. *.....|
|00000be0| 75 73 69 6e 67 20 74 68 | 69 73 20 64 6f 6d 61 69 |using th|is domai|
|00000bf0| 6e 20 6e 61 6d 65 20 77 | 69 6c 6c 20 72 65 73 75 |n name w|ill resu|
|00000c00| 6c 74 20 69 6e 20 20 61 | 6e 0d 20 2a 09 09 09 09 |lt in a|n. *....|
|00000c10| 09 61 6e 73 77 65 72 3b | 20 20 66 6f 72 20 65 78 |.answer;| for ex|
|00000c20| 61 6d 70 6c 65 2c 20 61 | 20 6d 61 69 6c 2d 66 6f |ample, a| mail-fo|
|00000c30| 72 77 61 72 64 65 72 20 | 6d 61 79 0d 20 2a 09 09 |rwarder |may. *..|
|00000c40| 09 09 09 62 65 20 72 65 | 67 69 73 74 65 72 65 64 |...be re|gistered|
|00000c50| 20 66 6f 72 20 74 68 69 | 73 20 64 6f 6d 61 69 6e | for thi|s domain|
|00000c60| 2e 0d 20 2a 09 09 09 09 | 09 28 4e 4f 54 20 47 45 |.. *....|.(NOT GE|
|00000c70| 4e 45 52 41 54 45 44 20 | 42 59 20 54 48 49 53 20 |NERATED |BY THIS |
|00000c80| 49 4d 50 4c 45 4d 45 4e | 54 41 54 49 4f 4e 29 0d |IMPLEMEN|TATION).|
|00000c90| 20 2a 2f 0d 0d 73 74 61 | 74 69 63 20 73 74 72 75 | */..sta|tic stru|
|00000ca0| 63 74 20 68 6f 73 74 49 | 6e 66 6f 20 6d 61 63 48 |ct hostI|nfo macH|
|00000cb0| 6f 73 74 3b 0d 0d 23 64 | 65 66 69 6e 65 20 4d 41 |ost;..#d|efine MA|
|00000cc0| 58 41 4c 49 41 53 45 53 | 20 30 0d 73 74 61 74 69 |XALIASES| 0.stati|
|00000cd0| 63 20 63 68 61 72 20 2a | 61 6c 69 61 73 50 74 72 |c char *|aliasPtr|
|00000ce0| 73 5b 4d 41 58 41 4c 49 | 41 53 45 53 2b 31 5d 20 |s[MAXALI|ASES+1] |
|00000cf0| 3d 20 7b 4e 55 4c 4c 7d | 3b 0d 73 74 61 74 69 63 |= {NULL}|;.static|
|00000d00| 20 69 70 5f 61 64 64 72 | 20 2a 61 64 64 72 50 74 | ip_addr| *addrPt|
|00000d10| 72 73 5b 4e 55 4d 5f 41 | 4c 54 5f 41 44 44 52 53 |rs[NUM_A|LT_ADDRS|
|00000d20| 2b 31 5d 3b 0d 0d 73 74 | 61 74 69 63 20 73 74 72 |+1];..st|atic str|
|00000d30| 75 63 74 20 68 6f 73 74 | 65 6e 74 20 20 75 6e 69 |uct host|ent uni|
|00000d40| 78 48 6f 73 74 20 3d 0d | 7b 0d 09 6d 61 63 48 6f |xHost =.|{..macHo|
|00000d50| 73 74 2e 63 6e 61 6d 65 | 2c 0d 09 61 6c 69 61 73 |st.cname|,..alias|
|00000d60| 50 74 72 73 2c 0d 09 41 | 46 5f 49 4e 45 54 2c 0d |Ptrs,..A|F_INET,.|
|00000d70| 09 73 69 7a 65 6f 66 28 | 69 70 5f 61 64 64 72 29 |.sizeof(|ip_addr)|
|00000d80| 2c 0d 09 28 63 68 61 72 | 20 2a 2a 29 20 61 64 64 |,..(char| **) add|
|00000d90| 72 50 74 72 73 0d 7d 3b | 0d 0d 69 6e 6c 69 6e 65 |rPtrs.};|..inline|
|00000da0| 20 73 74 72 75 63 74 20 | 69 6e 5f 61 64 64 72 20 | struct |in_addr |
|00000db0| 6d 61 6b 65 5f 69 6e 5f | 61 64 64 72 28 69 70 5f |make_in_|addr(ip_|
|00000dc0| 61 64 64 72 20 61 64 64 | 72 29 0d 7b 0d 09 73 74 |addr add|r).{..st|
|00000dd0| 72 75 63 74 20 69 6e 5f | 61 64 64 72 09 72 65 73 |ruct in_|addr.res|
|00000de0| 3b 0d 0d 09 72 65 73 2e | 73 5f 61 64 64 72 09 3d |;...res.|s_addr.=|
|00000df0| 09 61 64 64 72 3b 0d 0d | 09 72 65 74 75 72 6e 20 |.addr;..|.return |
|00000e00| 72 65 73 3b 0d 7d 0d 0d | 73 74 72 75 63 74 20 68 |res;.}..|struct h|
|00000e10| 6f 73 74 65 6e 74 20 2a | 20 67 65 74 68 6f 73 74 |ostent *| gethost|
|00000e20| 62 79 6e 61 6d 65 28 63 | 68 61 72 20 2a 6e 61 6d |byname(c|har *nam|
|00000e30| 65 29 0d 7b 0d 09 42 6f | 6f 6c 65 61 6e 20 64 6f |e).{..Bo|olean do|
|00000e40| 6e 65 3b 0d 09 69 6e 74 | 20 69 3b 0d 0d 09 66 6f |ne;..int| i;...fo|
|00000e50| 72 20 28 69 3d 30 3b 20 | 69 3c 4e 55 4d 5f 41 4c |r (i=0; |i<NUM_AL|
|00000e60| 54 5f 41 44 44 52 53 3b | 20 69 2b 2b 29 0d 09 09 |T_ADDRS;| i++)...|
|00000e70| 6d 61 63 48 6f 73 74 2e | 61 64 64 72 5b 69 5d 20 |macHost.|addr[i] |
|00000e80| 3d 20 30 3b 0d 0d 09 64 | 6f 6e 65 20 3d 20 66 61 |= 0;...d|one = fa|
|00000e90| 6c 73 65 3b 0d 0d 09 69 | 66 20 28 53 74 72 54 6f |lse;...i|f (StrTo|
|00000ea0| 41 64 64 72 28 6e 61 6d | 65 2c 20 26 6d 61 63 48 |Addr(nam|e, &macH|
|00000eb0| 6f 73 74 2c 20 52 65 73 | 75 6c 74 50 72 6f 63 50 |ost, Res|ultProcP|
|00000ec0| 74 72 28 44 4e 52 44 6f | 6e 65 29 2c 20 28 63 68 |tr(DNRDo|ne), (ch|
|00000ed0| 61 72 20 2a 29 20 26 64 | 6f 6e 65 29 20 3d 3d 20 |ar *) &d|one) == |
|00000ee0| 63 61 63 68 65 46 61 75 | 6c 74 29 0d 09 09 53 50 |cacheFau|lt)...SP|
|00000ef0| 49 4e 50 28 21 64 6f 6e | 65 2c 53 50 5f 4e 41 4d |INP(!don|e,SP_NAM|
|00000f00| 45 2c 30 4c 29 3b 0d 0d | 09 73 77 69 74 63 68 20 |E,0L);..|.switch |
|00000f10| 28 6d 61 63 48 6f 73 74 | 2e 72 74 6e 43 6f 64 65 |(macHost|.rtnCode|
|00000f20| 29 20 7b 0d 09 63 61 73 | 65 20 6e 6f 45 72 72 3a |) {..cas|e noErr:|
|00000f30| 20 62 72 65 61 6b 3b 0d | 0d 09 63 61 73 65 20 6e | break;.|..case n|
|00000f40| 61 6d 65 53 79 6e 74 61 | 78 45 72 72 3a 09 68 5f |ameSynta|xErr:.h_|
|00000f50| 65 72 72 6e 6f 20 3d 20 | 48 4f 53 54 5f 4e 4f 54 |errno = |HOST_NOT|
|00000f60| 5f 46 4f 55 4e 44 3b 09 | 72 65 74 75 72 6e 28 4e |_FOUND;.|return(N|
|00000f70| 55 4c 4c 29 3b 0d 09 63 | 61 73 65 20 63 61 63 68 |ULL);..c|ase cach|
|00000f80| 65 46 61 75 6c 74 3a 09 | 09 68 5f 65 72 72 6e 6f |eFault:.|.h_errno|
|00000f90| 20 3d 20 4e 4f 5f 52 45 | 43 4f 56 45 52 59 3b 09 | = NO_RE|COVERY;.|
|00000fa0| 09 72 65 74 75 72 6e 28 | 4e 55 4c 4c 29 3b 0d 09 |.return(|NULL);..|
|00000fb0| 63 61 73 65 20 6e 6f 52 | 65 73 75 6c 74 50 72 6f |case noR|esultPro|
|00000fc0| 63 3a 09 68 5f 65 72 72 | 6e 6f 20 3d 20 4e 4f 5f |c:.h_err|no = NO_|
|00000fd0| 52 45 43 4f 56 45 52 59 | 3b 09 09 72 65 74 75 72 |RECOVERY|;..retur|
|00000fe0| 6e 28 4e 55 4c 4c 29 3b | 0d 09 63 61 73 65 20 6e |n(NULL);|..case n|
|00000ff0| 6f 4e 61 6d 65 53 65 72 | 76 65 72 3a 09 68 5f 65 |oNameSer|ver:.h_e|
|00001000| 72 72 6e 6f 20 3d 20 48 | 4f 53 54 5f 4e 4f 54 5f |rrno = H|OST_NOT_|
|00001010| 46 4f 55 4e 44 3b 09 72 | 65 74 75 72 6e 28 4e 55 |FOUND;.r|eturn(NU|
|00001020| 4c 4c 29 3b 0d 09 63 61 | 73 65 20 61 75 74 68 4e |LL);..ca|se authN|
|00001030| 61 6d 65 45 72 72 3a 09 | 09 68 5f 65 72 72 6e 6f |ameErr:.|.h_errno|
|00001040| 20 3d 20 48 4f 53 54 5f | 4e 4f 54 5f 46 4f 55 4e | = HOST_|NOT_FOUN|
|00001050| 44 3b 09 72 65 74 75 72 | 6e 28 4e 55 4c 4c 29 3b |D;.retur|n(NULL);|
|00001060| 0d 09 63 61 73 65 20 6e | 6f 41 6e 73 45 72 72 3a |..case n|oAnsErr:|
|00001070| 09 09 09 68 5f 65 72 72 | 6e 6f 20 3d 20 54 52 59 |...h_err|no = TRY|
|00001080| 5f 41 47 41 49 4e 3b 09 | 09 09 72 65 74 75 72 6e |_AGAIN;.|..return|
|00001090| 28 4e 55 4c 4c 29 3b 0d | 09 63 61 73 65 20 64 6e |(NULL);.|.case dn|
|000010a0| 72 45 72 72 3a 09 09 09 | 68 5f 65 72 72 6e 6f 20 |rErr:...|h_errno |
|000010b0| 3d 20 4e 4f 5f 52 45 43 | 4f 56 45 52 59 3b 09 09 |= NO_REC|OVERY;..|
|000010c0| 72 65 74 75 72 6e 28 4e | 55 4c 4c 29 3b 0d 09 63 |return(N|ULL);..c|
|000010d0| 61 73 65 20 6f 75 74 4f | 66 4d 65 6d 6f 72 79 3a |ase outO|fMemory:|
|000010e0| 09 09 68 5f 65 72 72 6e | 6f 20 3d 20 54 52 59 5f |..h_errn|o = TRY_|
|000010f0| 41 47 41 49 4e 3b 09 09 | 09 72 65 74 75 72 6e 28 |AGAIN;..|.return(|
|00001100| 4e 55 4c 4c 29 3b 0d 09 | 64 65 66 61 75 6c 74 3a |NULL);..|default:|
|00001110| 09 09 09 09 09 68 5f 65 | 72 72 6e 6f 20 3d 20 4e |.....h_e|rrno = N|
|00001120| 4f 5f 52 45 43 4f 56 45 | 52 59 3b 09 09 72 65 74 |O_RECOVE|RY;..ret|
|00001130| 75 72 6e 28 4e 55 4c 4c | 29 3b 0d 09 7d 0d 0d 09 |urn(NULL|);..}...|
|00001140| 2f 2a 20 77 61 73 20 74 | 68 65 20 27 6e 61 6d 65 |/* was t|he 'name|
|00001150| 27 20 61 6e 20 49 50 20 | 61 64 64 72 65 73 73 3f |' an IP |address?|
|00001160| 20 2a 2f 0d 09 69 66 20 | 28 6d 61 63 48 6f 73 74 | */..if |(macHost|
|00001170| 2e 63 6e 61 6d 65 5b 30 | 5d 20 3d 3d 20 30 29 20 |.cname[0|] == 0) |
|00001180| 7b 0d 09 09 68 5f 65 72 | 72 6e 6f 20 3d 20 48 4f |{...h_er|rno = HO|
|00001190| 53 54 5f 4e 4f 54 5f 46 | 4f 55 4e 44 3b 0d 09 09 |ST_NOT_F|OUND;...|
|000011a0| 72 65 74 75 72 6e 28 4e | 55 4c 4c 29 3b 0d 09 7d |return(N|ULL);..}|
|000011b0| 0d 0d 09 2f 2a 20 66 6f | 72 20 73 6f 6d 65 20 72 |.../* fo|r some r|
|000011c0| 65 61 73 6f 6e 20 74 68 | 65 72 65 20 69 73 20 61 |eason th|ere is a|
|000011d0| 20 64 6f 74 20 61 74 20 | 74 68 65 20 65 6e 64 20 | dot at |the end |
|000011e0| 6f 66 20 74 68 65 20 6e | 61 6d 65 20 2a 2f 0d 09 |of the n|ame */..|
|000011f0| 69 20 3d 20 73 74 72 6c | 65 6e 28 6d 61 63 48 6f |i = strl|en(macHo|
|00001200| 73 74 2e 63 6e 61 6d 65 | 29 20 2d 20 31 3b 0d 09 |st.cname|) - 1;..|
|00001210| 69 66 20 28 6d 61 63 48 | 6f 73 74 2e 63 6e 61 6d |if (macH|ost.cnam|
|00001220| 65 5b 69 5d 20 3d 3d 20 | 27 2e 27 29 0d 09 09 6d |e[i] == |'.')...m|
|00001230| 61 63 48 6f 73 74 2e 63 | 6e 61 6d 65 5b 69 5d 20 |acHost.c|name[i] |
|00001240| 3d 20 30 3b 0d 0d 09 66 | 6f 72 20 28 69 3d 30 3b |= 0;...f|or (i=0;|
|00001250| 20 69 3c 4e 55 4d 5f 41 | 4c 54 5f 41 44 44 52 53 | i<NUM_A|LT_ADDRS|
|00001260| 20 26 26 20 6d 61 63 48 | 6f 73 74 2e 61 64 64 72 | && macH|ost.addr|
|00001270| 5b 69 5d 21 3d 30 3b 20 | 69 2b 2b 29 0d 09 09 61 |[i]!=0; |i++)...a|
|00001280| 64 64 72 50 74 72 73 5b | 69 5d 20 3d 09 28 69 70 |ddrPtrs[|i] =.(ip|
|00001290| 5f 61 64 64 72 20 2a 29 | 20 26 6d 61 63 48 6f 73 |_addr *)| &macHos|
|000012a0| 74 2e 61 64 64 72 5b 69 | 5d 3b 0d 0d 09 61 64 64 |t.addr[i|];...add|
|000012b0| 72 50 74 72 73 5b 69 5d | 20 3d 20 4e 55 4c 4c 3b |rPtrs[i]| = NULL;|
|000012c0| 0d 0d 09 72 65 74 75 72 | 6e 20 26 75 6e 69 78 48 |...retur|n &unixH|
|000012d0| 6f 73 74 3b 0d 7d 0d 0d | 73 74 72 75 63 74 20 68 |ost;.}..|struct h|
|000012e0| 6f 73 74 65 6e 74 20 2a | 20 67 65 74 68 6f 73 74 |ostent *| gethost|
|000012f0| 62 79 61 64 64 72 28 73 | 74 72 75 63 74 20 69 6e |byaddr(s|truct in|
|00001300| 5f 61 64 64 72 20 2a 61 | 64 64 72 50 2c 20 69 6e |_addr *a|ddrP, in|
|00001310| 74 2c 20 69 6e 74 29 0d | 7b 0d 09 42 6f 6f 6c 65 |t, int).|{..Boole|
|00001320| 61 6e 09 64 6f 6e 65 3b | 0d 09 69 6e 74 20 09 09 |an.done;|..int ..|
|00001330| 69 3b 0d 0d 09 66 6f 72 | 20 28 69 3d 30 3b 20 69 |i;...for| (i=0; i|
|00001340| 3c 4e 55 4d 5f 41 4c 54 | 5f 41 44 44 52 53 3b 20 |<NUM_ALT|_ADDRS; |
|00001350| 69 2b 2b 29 0d 09 09 6d | 61 63 48 6f 73 74 2e 61 |i++)...m|acHost.a|
|00001360| 64 64 72 5b 69 5d 20 3d | 20 30 3b 0d 0d 09 64 6f |ddr[i] =| 0;...do|
|00001370| 6e 65 20 3d 20 66 61 6c | 73 65 3b 0d 0d 09 69 66 |ne = fal|se;...if|
|00001380| 20 28 41 64 64 72 54 6f | 4e 61 6d 65 28 2a 28 69 | (AddrTo|Name(*(i|
|00001390| 70 5f 61 64 64 72 20 2a | 29 61 64 64 72 50 2c 20 |p_addr *|)addrP, |
|000013a0| 26 6d 61 63 48 6f 73 74 | 2c 20 52 65 73 75 6c 74 |&macHost|, Result|
|000013b0| 50 72 6f 63 50 74 72 28 | 44 4e 52 44 6f 6e 65 29 |ProcPtr(|DNRDone)|
|000013c0| 2c 20 28 63 68 61 72 20 | 2a 29 20 26 64 6f 6e 65 |, (char |*) &done|
|000013d0| 29 20 3d 3d 20 63 61 63 | 68 65 46 61 75 6c 74 29 |) == cac|heFault)|
|000013e0| 0d 09 09 53 50 49 4e 50 | 28 21 64 6f 6e 65 2c 53 |...SPINP|(!done,S|
|000013f0| 50 5f 41 44 44 52 2c 30 | 4c 29 3b 0d 0d 09 73 77 |P_ADDR,0|L);...sw|
|00001400| 69 74 63 68 20 28 6d 61 | 63 48 6f 73 74 2e 72 74 |itch (ma|cHost.rt|
|00001410| 6e 43 6f 64 65 29 20 7b | 0d 09 63 61 73 65 20 6e |nCode) {|..case n|
|00001420| 6f 45 72 72 3a 20 09 09 | 09 62 72 65 61 6b 3b 0d |oErr: ..|.break;.|
|00001430| 0d 09 63 61 73 65 20 63 | 61 63 68 65 46 61 75 6c |..case c|acheFaul|
|00001440| 74 3a 09 09 68 5f 65 72 | 72 6e 6f 20 3d 20 4e 4f |t:..h_er|rno = NO|
|00001450| 5f 52 45 43 4f 56 45 52 | 59 3b 09 09 72 65 74 75 |_RECOVER|Y;..retu|
|00001460| 72 6e 28 4e 55 4c 4c 29 | 3b 0d 09 63 61 73 65 20 |rn(NULL)|;..case |
|00001470| 6e 6f 4e 61 6d 65 53 65 | 72 76 65 72 3a 09 68 5f |noNameSe|rver:.h_|
|00001480| 65 72 72 6e 6f 20 3d 20 | 48 4f 53 54 5f 4e 4f 54 |errno = |HOST_NOT|
|00001490| 5f 46 4f 55 4e 44 3b 09 | 72 65 74 75 72 6e 28 4e |_FOUND;.|return(N|
|000014a0| 55 4c 4c 29 3b 0d 09 63 | 61 73 65 20 61 75 74 68 |ULL);..c|ase auth|
|000014b0| 4e 61 6d 65 45 72 72 3a | 09 09 68 5f 65 72 72 6e |NameErr:|..h_errn|
|000014c0| 6f 20 3d 20 48 4f 53 54 | 5f 4e 4f 54 5f 46 4f 55 |o = HOST|_NOT_FOU|
|000014d0| 4e 44 3b 09 72 65 74 75 | 72 6e 28 4e 55 4c 4c 29 |ND;.retu|rn(NULL)|
|000014e0| 3b 0d 09 63 61 73 65 20 | 6e 6f 41 6e 73 45 72 72 |;..case |noAnsErr|
|000014f0| 3a 09 09 09 68 5f 65 72 | 72 6e 6f 20 3d 20 54 52 |:...h_er|rno = TR|
|00001500| 59 5f 41 47 41 49 4e 3b | 09 09 09 72 65 74 75 72 |Y_AGAIN;|...retur|
|00001510| 6e 28 4e 55 4c 4c 29 3b | 0d 09 63 61 73 65 20 64 |n(NULL);|..case d|
|00001520| 6e 72 45 72 72 3a 09 09 | 09 68 5f 65 72 72 6e 6f |nrErr:..|.h_errno|
|00001530| 20 3d 20 4e 4f 5f 52 45 | 43 4f 56 45 52 59 3b 09 | = NO_RE|COVERY;.|
|00001540| 09 72 65 74 75 72 6e 28 | 4e 55 4c 4c 29 3b 0d 09 |.return(|NULL);..|
|00001550| 63 61 73 65 20 6f 75 74 | 4f 66 4d 65 6d 6f 72 79 |case out|OfMemory|
|00001560| 3a 09 09 68 5f 65 72 72 | 6e 6f 20 3d 20 54 52 59 |:..h_err|no = TRY|
|00001570| 5f 41 47 41 49 4e 3b 09 | 09 09 72 65 74 75 72 6e |_AGAIN;.|..return|
|00001580| 28 4e 55 4c 4c 29 3b 0d | 09 64 65 66 61 75 6c 74 |(NULL);.|.default|
|00001590| 3a 09 09 09 09 09 68 5f | 65 72 72 6e 6f 20 3d 20 |:.....h_|errno = |
|000015a0| 4e 4f 5f 52 45 43 4f 56 | 45 52 59 3b 09 09 72 65 |NO_RECOV|ERY;..re|
|000015b0| 74 75 72 6e 28 4e 55 4c | 4c 29 3b 0d 09 7d 0d 0d |turn(NUL|L);..}..|
|000015c0| 09 2f 2a 20 66 6f 72 20 | 73 6f 6d 65 20 72 65 61 |./* for |some rea|
|000015d0| 73 6f 6e 20 74 68 65 72 | 65 20 69 73 20 61 20 64 |son ther|e is a d|
|000015e0| 6f 74 20 61 74 20 74 68 | 65 20 65 6e 64 20 6f 66 |ot at th|e end of|
|000015f0| 20 74 68 65 20 6e 61 6d | 65 20 2a 2f 0d 09 69 20 | the nam|e */..i |
|00001600| 3d 20 73 74 72 6c 65 6e | 28 6d 61 63 48 6f 73 74 |= strlen|(macHost|
|00001610| 2e 63 6e 61 6d 65 29 20 | 2d 20 31 3b 0d 09 69 66 |.cname) |- 1;..if|
|00001620| 20 28 6d 61 63 48 6f 73 | 74 2e 63 6e 61 6d 65 5b | (macHos|t.cname[|
|00001630| 69 5d 20 3d 3d 20 27 2e | 27 29 0d 09 09 6d 61 63 |i] == '.|')...mac|
|00001640| 48 6f 73 74 2e 63 6e 61 | 6d 65 5b 69 5d 20 3d 20 |Host.cna|me[i] = |
|00001650| 30 3b 0d 0d 09 66 6f 72 | 20 28 69 3d 30 3b 20 69 |0;...for| (i=0; i|
|00001660| 3c 4e 55 4d 5f 41 4c 54 | 5f 41 44 44 52 53 3b 20 |<NUM_ALT|_ADDRS; |
|00001670| 69 2b 2b 29 0d 09 09 61 | 64 64 72 50 74 72 73 5b |i++)...a|ddrPtrs[|
|00001680| 69 5d 20 3d 20 28 69 70 | 5f 61 64 64 72 20 2a 29 |i] = (ip|_addr *)|
|00001690| 20 26 6d 61 63 48 6f 73 | 74 2e 61 64 64 72 5b 69 | &macHos|t.addr[i|
|000016a0| 5d 3b 0d 0d 09 61 64 64 | 72 50 74 72 73 5b 4e 55 |];...add|rPtrs[NU|
|000016b0| 4d 5f 41 4c 54 5f 41 44 | 44 52 53 5d 20 3d 20 4e |M_ALT_AD|DRS] = N|
|000016c0| 55 4c 4c 3b 0d 0d 09 72 | 65 74 75 72 6e 20 26 75 |ULL;...r|eturn &u|
|000016d0| 6e 69 78 48 6f 73 74 3b | 0d 7d 0d 0d 63 68 61 72 |nixHost;|.}..char|
|000016e0| 20 2a 20 69 6e 65 74 5f | 6e 74 6f 61 28 73 74 72 | * inet_|ntoa(str|
|000016f0| 75 63 74 20 69 6e 5f 61 | 64 64 72 20 69 6e 61 64 |uct in_a|ddr inad|
|00001700| 64 72 29 0d 7b 0d 09 28 | 76 6f 69 64 29 20 41 64 |dr).{..(|void) Ad|
|00001710| 64 72 54 6f 53 74 72 28 | 69 6e 61 64 64 72 2e 73 |drToStr(|inaddr.s|
|00001720| 5f 61 64 64 72 2c 20 6d | 61 63 48 6f 73 74 2e 63 |_addr, m|acHost.c|
|00001730| 6e 61 6d 65 29 3b 0d 0d | 09 72 65 74 75 72 6e 20 |name);..|.return |
|00001740| 6d 61 63 48 6f 73 74 2e | 63 6e 61 6d 65 3b 0d 7d |macHost.|cname;.}|
|00001750| 0d 0d 73 74 72 75 63 74 | 20 69 6e 5f 61 64 64 72 |..struct| in_addr|
|00001760| 20 69 6e 65 74 5f 61 64 | 64 72 28 63 68 61 72 20 | inet_ad|dr(char |
|00001770| 2a 61 64 64 72 65 73 73 | 29 0d 7b 0d 09 69 66 20 |*address|).{..if |
|00001780| 28 53 74 72 54 6f 41 64 | 64 72 28 61 64 64 72 65 |(StrToAd|dr(addre|
|00001790| 73 73 2c 26 6d 61 63 48 | 6f 73 74 2c 4e 55 4c 4c |ss,&macH|ost,NULL|
|000017a0| 2c 4e 55 4c 4c 29 20 21 | 3d 20 6e 6f 45 72 72 29 |,NULL) !|= noErr)|
|000017b0| 0d 09 09 72 65 74 75 72 | 6e 20 6d 61 6b 65 5f 69 |...retur|n make_i|
|000017c0| 6e 5f 61 64 64 72 28 30 | 78 46 46 46 46 46 46 46 |n_addr(0|xFFFFFFF|
|000017d0| 46 29 3b 0d 0d 09 2f 2a | 20 77 61 73 20 74 68 65 |F);.../*| was the|
|000017e0| 20 27 61 64 64 72 65 73 | 73 27 20 72 65 61 6c 6c | 'addres|s' reall|
|000017f0| 79 20 61 20 6e 61 6d 65 | 3f 20 2a 2f 0d 09 69 66 |y a name|? */..if|
|00001800| 20 28 6d 61 63 48 6f 73 | 74 2e 63 6e 61 6d 65 5b | (macHos|t.cname[|
|00001810| 30 5d 20 21 3d 20 30 29 | 0d 09 09 72 65 74 75 72 |0] != 0)|...retur|
|00001820| 6e 20 6d 61 6b 65 5f 69 | 6e 5f 61 64 64 72 28 30 |n make_i|n_addr(0|
|00001830| 78 46 46 46 46 46 46 46 | 46 29 3b 0d 0d 09 72 65 |xFFFFFFF|F);...re|
|00001840| 74 75 72 6e 20 6d 61 6b | 65 5f 69 6e 5f 61 64 64 |turn mak|e_in_add|
|00001850| 72 28 6d 61 63 48 6f 73 | 74 2e 61 64 64 72 5b 30 |r(macHos|t.addr[0|
|00001860| 5d 29 3b 0d 7d 0d 0d 2f | 2a 0d 20 2a 20 67 65 74 |]);.}../|*. * get|
|00001870| 68 6f 73 74 6e 61 6d 65 | 28 29 0d 20 2a 0d 20 2a |hostname|(). *. *|
|00001880| 20 54 72 79 20 74 6f 20 | 67 65 74 20 6d 79 20 68 | Try to |get my h|
|00001890| 6f 73 74 20 6e 61 6d 65 | 20 66 72 6f 6d 20 44 4e |ost name| from DN|
|000018a0| 52 2e 20 49 66 20 69 74 | 20 66 61 69 6c 73 2c 20 |R. If it| fails, |
|000018b0| 6a 75 73 74 20 72 65 74 | 75 72 6e 20 6d 79 0d 20 |just ret|urn my. |
|000018c0| 2a 20 49 50 20 61 64 64 | 72 65 73 73 20 61 73 20 |* IP add|ress as |
|000018d0| 41 53 43 49 49 2e 20 54 | 68 69 73 20 69 73 20 6e |ASCII. T|his is n|
|000018e0| 6f 6e 2d 73 74 61 6e 64 | 61 72 64 2c 20 62 75 74 |on-stand|ard, but|
|000018f0| 20 69 74 27 73 20 61 20 | 6d 61 63 2c 0d 20 2a 20 | it's a |mac,. * |
|00001900| 77 68 61 74 20 64 6f 20 | 79 6f 75 20 77 61 6e 74 |what do |you want|
|00001910| 20 6d 65 20 74 6f 20 64 | 6f 3f 0d 20 2a 2f 0d 0d | me to d|o?. */..|
|00001920| 69 6e 74 20 67 65 74 68 | 6f 73 74 6e 61 6d 65 28 |int geth|ostname(|
|00001930| 63 68 61 72 20 2a 6d 61 | 63 68 6e 61 6d 65 2c 20 |char *ma|chname, |
|00001940| 6c 6f 6e 67 20 62 75 66 | 6c 65 6e 29 0d 7b 0d 09 |long buf|len).{..|
|00001950| 69 6e 5f 61 64 64 72 20 | 69 70 61 64 64 72 3b 0d |in_addr |ipaddr;.|
|00001960| 09 73 74 72 75 63 74 09 | 68 6f 73 74 65 6e 74 20 |.struct.|hostent |
|00001970| 2a 68 70 3b 0d 09 73 74 | 72 75 63 74 20 47 65 74 |*hp;..st|ruct Get|
|00001980| 41 64 64 72 50 61 72 61 | 6d 42 6c 6f 63 6b 20 70 |AddrPara|mBlock p|
|00001990| 62 72 3b 0d 0d 09 70 62 | 72 2e 69 6f 43 52 65 66 |br;...pb|r.ioCRef|
|000019a0| 4e 75 6d 20 09 3d 20 49 | 4e 45 54 53 6f 63 6b 65 |Num .= I|NETSocke|
|000019b0| 74 73 2e 44 72 69 76 65 | 72 28 29 3b 0d 09 70 62 |ts.Drive|r();..pb|
|000019c0| 72 2e 63 73 43 6f 64 65 | 20 09 09 3d 20 69 70 63 |r.csCode| ..= ipc|
|000019d0| 74 6c 47 65 74 41 64 64 | 72 3b 0d 0d 09 69 66 20 |tlGetAdd|r;...if |
|000019e0| 28 50 42 43 6f 6e 74 72 | 6f 6c 53 79 6e 63 28 50 |(PBContr|olSync(P|
|000019f0| 61 72 6d 42 6c 6b 50 74 | 72 28 26 70 62 72 29 29 |armBlkPt|r(&pbr))|
|00001a00| 29 0d 09 09 67 6f 74 6f | 20 72 65 73 69 67 6e 3b |)...goto| resign;|
|00001a10| 0d 0d 09 69 70 61 64 64 | 72 09 3d 09 6d 61 6b 65 |...ipadd|r.=.make|
|00001a20| 5f 69 6e 5f 61 64 64 72 | 28 70 62 72 2e 6f 75 72 |_in_addr|(pbr.our|
|00001a30| 41 64 64 72 65 73 73 29 | 3b 0d 0d 09 68 70 20 3d |Address)|;...hp =|
|00001a40| 20 67 65 74 68 6f 73 74 | 62 79 61 64 64 72 28 26 | gethost|byaddr(&|
|00001a50| 69 70 61 64 64 72 2c 20 | 73 69 7a 65 6f 66 28 69 |ipaddr, |sizeof(i|
|00001a60| 6e 5f 61 64 64 72 29 2c | 20 41 46 5f 49 4e 45 54 |n_addr),| AF_INET|
|00001a70| 29 3b 0d 0d 09 69 66 20 | 28 21 68 70 29 0d 09 09 |);...if |(!hp)...|
|00001a80| 67 6f 74 6f 20 72 65 73 | 69 67 6e 3b 0d 09 65 6c |goto res|ign;..el|
|00001a90| 73 65 0d 09 09 73 74 72 | 6e 63 70 79 28 6d 61 63 |se...str|ncpy(mac|
|00001aa0| 68 6e 61 6d 65 2c 20 68 | 70 2d 3e 68 5f 6e 61 6d |hname, h|p->h_nam|
|00001ab0| 65 2c 20 75 6e 73 69 67 | 6e 65 64 28 62 75 66 6c |e, unsig|ned(bufl|
|00001ac0| 65 6e 29 29 3b 0d 0d 09 | 6d 61 63 68 6e 61 6d 65 |en));...|machname|
|00001ad0| 5b 62 75 66 6c 65 6e 2d | 31 5d 20 3d 20 30 3b 20 |[buflen-|1] = 0; |
|00001ae0| 20 2f 2a 20 65 78 74 72 | 61 20 73 61 66 65 67 75 | /* extr|a safegu|
|00001af0| 61 72 64 20 2a 2f 0d 0d | 09 72 65 74 75 72 6e 20 |ard */..|.return |
|00001b00| 30 3b 0d 0d 72 65 73 69 | 67 6e 3a 0d 09 73 70 72 |0;..resi|gn:..spr|
|00001b10| 69 6e 74 66 28 6d 61 63 | 68 6e 61 6d 65 2c 20 22 |intf(mac|hname, "|
|00001b20| 25 64 2e 25 64 2e 25 64 | 2e 25 64 22 2c 0d 09 09 |%d.%d.%d|.%d",...|
|00001b30| 09 09 09 09 09 69 70 61 | 64 64 72 2e 73 5f 61 64 |.....ipa|ddr.s_ad|
|00001b40| 64 72 3e 3e 32 34 2c 0d | 09 09 09 09 09 09 09 69 |dr>>24,.|.......i|
|00001b50| 70 61 64 64 72 2e 73 5f | 61 64 64 72 3e 3e 31 36 |paddr.s_|addr>>16|
|00001b60| 20 26 20 30 78 66 66 2c | 0d 09 09 09 09 09 09 09 | & 0xff,|........|
|00001b70| 69 70 61 64 64 72 2e 73 | 5f 61 64 64 72 3e 3e 38 |ipaddr.s|_addr>>8|
|00001b80| 20 26 20 30 78 66 66 2c | 0d 09 09 09 09 09 09 09 | & 0xff,|........|
|00001b90| 69 70 61 64 64 72 2e 73 | 5f 61 64 64 72 20 26 20 |ipaddr.s|_addr & |
|00001ba0| 30 78 66 66 29 3b 0d 09 | 72 65 74 75 72 6e 20 30 |0xff);..|return 0|
|00001bb0| 3b 0d 7d 0d 0d 0d 2f 2a | 0d 20 2a 09 67 65 74 73 |;.}.../*|. *.gets|
|00001bc0| 65 72 76 62 79 62 6e 61 | 6d 65 28 29 0d 20 2a 0d |ervbybna|me(). *.|
|00001bd0| 20 2a 09 52 65 61 6c 20 | 6b 6c 75 64 67 79 2e 20 | *.Real |kludgy. |
|00001be0| 20 53 68 6f 75 6c 64 20 | 61 74 20 6c 65 61 73 74 | Should |at least|
|00001bf0| 20 63 6f 6e 73 75 6c 74 | 20 61 20 72 65 73 6f 75 | consult| a resou|
|00001c00| 72 63 65 20 66 69 6c 65 | 20 61 73 20 74 68 65 20 |rce file| as the |
|00001c10| 73 65 72 76 69 63 65 0d | 20 2a 09 64 61 74 61 62 |service.| *.datab|
|00001c20| 61 73 65 2e 0d 20 2a 2f | 0d 74 79 70 65 64 65 66 |ase.. */|.typedef|
|00001c30| 20 73 74 72 75 63 74 20 | 73 65 72 76 69 63 65 73 | struct |services|
|00001c40| 20 7b 0d 09 63 68 61 72 | 09 09 73 76 5f 6e 61 6d | {..char|..sv_nam|
|00001c50| 65 5b 31 32 5d 3b 0d 09 | 73 68 6f 72 74 09 09 73 |e[12];..|short..s|
|00001c60| 76 5f 6e 75 6d 62 65 72 | 3b 0d 09 63 68 61 72 09 |v_number|;..char.|
|00001c70| 09 73 76 5f 70 72 6f 74 | 6f 63 6f 6c 5b 35 5d 3b |.sv_prot|ocol[5];|
|00001c80| 0d 7d 20 73 65 72 76 69 | 63 65 73 5f 74 2c 20 2a |.} servi|ces_t, *|
|00001c90| 73 65 72 76 69 63 65 73 | 5f 70 3b 0d 0d 73 74 61 |services|_p;..sta|
|00001ca0| 74 69 63 09 73 74 72 75 | 63 74 20 73 65 72 76 69 |tic.stru|ct servi|
|00001cb0| 63 65 73 09 73 6c 69 73 | 74 5b 5d 20 3d 0d 7b 0d |ces.slis|t[] =.{.|
|00001cc0| 09 7b 22 65 63 68 6f 22 | 2c 20 37 2c 20 22 75 64 |.{"echo"|, 7, "ud|
|00001cd0| 70 22 7d 2c 0d 09 7b 22 | 64 69 73 63 61 72 64 22 |p"},..{"|discard"|
|00001ce0| 2c 20 39 2c 20 22 75 64 | 70 22 7d 2c 0d 09 7b 22 |, 9, "ud|p"},..{"|
|00001cf0| 74 69 6d 65 22 2c 20 33 | 37 2c 20 22 75 64 70 22 |time", 3|7, "udp"|
|00001d00| 7d 2c 0d 09 7b 22 64 6f | 6d 61 69 6e 22 2c 20 35 |},..{"do|main", 5|
|00001d10| 33 2c 20 22 75 64 70 22 | 7d 2c 0d 09 7b 22 73 75 |3, "udp"|},..{"su|
|00001d20| 6e 72 70 63 22 2c 20 31 | 31 31 2c 20 22 75 64 70 |nrpc", 1|11, "udp|
|00001d30| 22 7d 2c 0d 09 7b 22 74 | 66 74 70 22 2c 20 36 39 |"},..{"t|ftp", 69|
|00001d40| 2c 20 22 75 64 70 22 7d | 2c 0d 09 7b 22 62 69 66 |, "udp"}|,..{"bif|
|00001d50| 66 22 2c 20 35 31 32 2c | 20 22 75 64 70 22 7d 2c |f", 512,| "udp"},|
|00001d60| 0d 09 7b 22 77 68 6f 22 | 2c 20 35 31 33 2c 20 22 |..{"who"|, 513, "|
|00001d70| 75 64 70 22 7d 2c 0d 09 | 7b 22 74 61 6c 6b 22 2c |udp"},..|{"talk",|
|00001d80| 20 35 31 37 2c 20 22 75 | 64 70 22 7d 2c 0d 09 7b | 517, "u|dp"},..{|
|00001d90| 22 72 6f 75 74 65 22 2c | 20 35 32 30 2c 20 22 75 |"route",| 520, "u|
|00001da0| 64 70 22 7d 2c 0d 09 7b | 22 6e 65 77 2d 72 77 68 |dp"},..{|"new-rwh|
|00001db0| 6f 22 2c 20 35 35 30 2c | 20 22 75 64 70 22 7d 2c |o", 550,| "udp"},|
|00001dc0| 0d 09 7b 22 6e 65 74 73 | 74 61 74 22 2c 20 31 35 |..{"nets|tat", 15|
|00001dd0| 2c 20 22 74 63 70 22 7d | 2c 0d 09 7b 22 66 74 70 |, "tcp"}|,..{"ftp|
|00001de0| 2d 64 61 74 61 22 2c 20 | 32 30 2c 20 22 74 63 70 |-data", |20, "tcp|
|00001df0| 22 7d 2c 0d 09 7b 22 66 | 74 70 22 2c 20 32 31 2c |"},..{"f|tp", 21,|
|00001e00| 20 22 74 63 70 22 7d 2c | 0d 09 7b 22 74 65 6c 6e | "tcp"},|..{"teln|
|00001e10| 65 74 22 2c 20 32 33 2c | 20 22 74 63 70 22 7d 2c |et", 23,| "tcp"},|
|00001e20| 0d 09 7b 22 73 6d 74 70 | 22 2c 20 32 35 2c 20 22 |..{"smtp|", 25, "|
|00001e30| 74 63 70 22 7d 2c 0d 09 | 7b 22 74 69 6d 65 22 2c |tcp"},..|{"time",|
|00001e40| 20 33 37 2c 20 22 74 63 | 70 22 7d 2c 0d 09 7b 22 | 37, "tc|p"},..{"|
|00001e50| 77 68 6f 69 73 22 2c 20 | 34 33 2c 20 22 74 63 70 |whois", |43, "tcp|
|00001e60| 22 7d 2c 0d 09 7b 22 64 | 6f 6d 61 69 6e 22 2c 20 |"},..{"d|omain", |
|00001e70| 35 33 2c 20 22 74 63 70 | 22 7d 2c 0d 09 7b 22 68 |53, "tcp|"},..{"h|
|00001e80| 6f 73 74 6e 61 6d 65 73 | 22 2c 20 31 30 31 2c 20 |ostnames|", 101, |
|00001e90| 22 74 63 70 22 7d 2c 0d | 09 7b 22 6e 6e 74 70 22 |"tcp"},.|.{"nntp"|
|00001ea0| 2c 20 31 31 39 2c 20 22 | 74 63 70 22 7d 2c 0d 09 |, 119, "|tcp"},..|
|00001eb0| 7b 22 66 69 6e 67 65 72 | 22 2c 20 37 39 2c 20 22 |{"finger|", 79, "|
|00001ec0| 74 63 70 22 7d 2c 0d 09 | 7b 22 75 75 63 70 2d 70 |tcp"},..|{"uucp-p|
|00001ed0| 61 74 68 22 2c 20 31 31 | 37 2c 20 22 74 63 70 22 |ath", 11|7, "tcp"|
|00001ee0| 7d 2c 0d 09 7b 22 75 6e | 74 70 22 2c 20 31 31 39 |},..{"un|tp", 119|
|00001ef0| 2c 20 22 74 63 70 22 7d | 2c 0d 09 7b 22 6e 74 70 |, "tcp"}|,..{"ntp|
|00001f00| 22 2c 20 31 32 33 2c 20 | 22 74 63 70 22 7d 2c 0d |", 123, |"tcp"},.|
|00001f10| 09 7b 22 65 78 65 63 22 | 2c 20 35 31 32 2c 20 22 |.{"exec"|, 512, "|
|00001f20| 74 63 70 22 7d 2c 0d 09 | 7b 22 6c 6f 67 69 6e 22 |tcp"},..|{"login"|
|00001f30| 2c 20 35 31 33 2c 20 22 | 74 63 70 22 7d 2c 0d 09 |, 513, "|tcp"},..|
|00001f40| 7b 22 73 68 65 6c 6c 22 | 2c 20 35 31 34 2c 20 22 |{"shell"|, 514, "|
|00001f50| 74 63 70 22 7d 2c 0d 09 | 7b 22 70 72 69 6e 74 65 |tcp"},..|{"printe|
|00001f60| 72 22 2c 20 35 31 35 2c | 20 22 74 63 70 22 7d 2c |r", 515,| "tcp"},|
|00001f70| 0d 09 7b 22 63 6f 75 72 | 69 65 72 22 2c 20 35 33 |..{"cour|ier", 53|
|00001f80| 30 2c 20 22 74 63 70 22 | 7d 2c 0d 09 7b 22 75 75 |0, "tcp"|},..{"uu|
|00001f90| 63 70 22 2c 20 35 34 30 | 2c 20 22 74 63 70 22 7d |cp", 540|, "tcp"}|
|00001fa0| 2c 0d 09 7b 22 22 2c 20 | 30 2c 20 22 22 20 7d 0d |,..{"", |0, "" }.|
|00001fb0| 7d 3b 0d 0d 23 64 65 66 | 69 6e 65 09 4d 41 58 5f |};..#def|ine.MAX_|
|00001fc0| 53 45 52 56 45 4e 54 09 | 09 09 31 30 0d 73 74 61 |SERVENT.|..10.sta|
|00001fd0| 74 69 63 20 09 73 74 72 | 75 63 74 20 73 65 72 76 |tic .str|uct serv|
|00001fe0| 65 6e 74 09 09 73 65 72 | 76 65 6e 74 73 5b 4d 41 |ent..ser|vents[MA|
|00001ff0| 58 5f 53 45 52 56 45 4e | 54 5d 3b 0d 73 74 61 74 |X_SERVEN|T];.stat|
|00002000| 69 63 20 09 69 6e 74 09 | 09 09 09 09 73 65 72 76 |ic .int.|....serv|
|00002010| 65 6e 74 5f 63 6f 75 6e | 74 3d 30 3b 0d 0d 73 74 |ent_coun|t=0;..st|
|00002020| 72 75 63 74 20 73 65 72 | 76 65 6e 74 20 2a 20 67 |ruct ser|vent * g|
|00002030| 65 74 73 65 72 76 62 79 | 6e 61 6d 65 20 28 63 68 |etservby|name (ch|
|00002040| 61 72 20 2a 20 6e 61 6d | 65 2c 20 63 68 61 72 20 |ar * nam|e, char |
|00002050| 2a 20 70 72 6f 74 6f 29 | 0d 7b 0d 09 69 6e 74 09 |* proto)|.{..int.|
|00002060| 09 69 3b 0d 09 73 74 72 | 75 63 74 09 73 65 72 76 |.i;..str|uct.serv|
|00002070| 65 6e 74 09 2a 73 65 3b | 0d 0d 09 69 66 20 28 21 |ent.*se;|...if (!|
|00002080| 73 74 72 63 6d 70 28 70 | 72 6f 74 6f 2c 20 22 75 |strcmp(p|roto, "u|
|00002090| 64 70 22 29 20 7c 7c 20 | 21 73 74 72 63 6d 70 28 |dp") || |!strcmp(|
|000020a0| 70 72 6f 74 6f 2c 20 22 | 74 63 70 22 29 29 20 7b |proto, "|tcp")) {|
|000020b0| 0d 09 09 66 6f 72 20 28 | 69 3d 30 3b 20 73 6c 69 |...for (|i=0; sli|
|000020c0| 73 74 5b 69 5d 2e 73 76 | 5f 6e 75 6d 62 65 72 20 |st[i].sv|_number |
|000020d0| 21 3d 20 30 3b 20 69 2b | 2b 29 0d 09 09 09 69 66 |!= 0; i+|+)....if|
|000020e0| 20 28 73 74 72 63 6d 70 | 20 28 73 6c 69 73 74 5b | (strcmp| (slist[|
|000020f0| 69 5d 2e 73 76 5f 6e 61 | 6d 65 2c 20 6e 61 6d 65 |i].sv_na|me, name|
|00002100| 29 20 3d 3d 20 30 29 0d | 09 09 09 09 69 66 20 28 |) == 0).|....if (|
|00002110| 73 74 72 63 6d 70 20 28 | 73 6c 69 73 74 5b 69 5d |strcmp (|slist[i]|
|00002120| 2e 73 76 5f 70 72 6f 74 | 6f 63 6f 6c 2c 20 70 72 |.sv_prot|ocol, pr|
|00002130| 6f 74 6f 29 20 3d 3d 20 | 30 29 20 20 7b 0d 09 09 |oto) == |0) {...|
|00002140| 09 09 09 73 65 20 3d 20 | 26 73 65 72 76 65 6e 74 |...se = |&servent|
|00002150| 73 5b 73 65 72 76 65 6e | 74 5f 63 6f 75 6e 74 5d |s[serven|t_count]|
|00002160| 3b 0d 09 09 09 09 09 73 | 65 2d 3e 73 5f 6e 61 6d |;......s|e->s_nam|
|00002170| 65 20 3d 20 73 6c 69 73 | 74 5b 69 5d 2e 73 76 5f |e = slis|t[i].sv_|
|00002180| 6e 61 6d 65 3b 0d 09 09 | 09 09 09 73 65 2d 3e 73 |name;...|...se->s|
|00002190| 5f 61 6c 69 61 73 65 73 | 20 3d 20 61 6c 69 61 73 |_aliases| = alias|
|000021a0| 50 74 72 73 3b 0d 09 09 | 09 09 09 73 65 2d 3e 73 |Ptrs;...|...se->s|
|000021b0| 5f 70 6f 72 74 20 3d 20 | 73 6c 69 73 74 5b 69 5d |_port = |slist[i]|
|000021c0| 2e 73 76 5f 6e 75 6d 62 | 65 72 3b 0d 09 09 09 09 |.sv_numb|er;.....|
|000021d0| 09 73 65 2d 3e 73 5f 70 | 72 6f 74 6f 20 3d 20 73 |.se->s_p|roto = s|
|000021e0| 6c 69 73 74 5b 69 5d 2e | 73 76 5f 70 72 6f 74 6f |list[i].|sv_proto|
|000021f0| 63 6f 6c 3b 0d 09 09 09 | 09 09 73 65 72 76 65 6e |col;....|..serven|
|00002200| 74 5f 63 6f 75 6e 74 20 | 3d 20 28 73 65 72 76 65 |t_count |= (serve|
|00002210| 6e 74 5f 63 6f 75 6e 74 | 20 2b 31 29 20 25 20 4d |nt_count| +1) % M|
|00002220| 41 58 5f 53 45 52 56 45 | 4e 54 3b 0d 09 09 09 09 |AX_SERVE|NT;.....|
|00002230| 09 72 65 74 75 72 6e 20 | 73 65 3b 0d 09 09 09 09 |.return |se;.....|
|00002240| 7d 0d 09 09 72 65 74 75 | 72 6e 20 4e 55 4c 4c 3b |}...retu|rn NULL;|
|00002250| 0d 09 7d 20 65 6c 73 65 | 20 7b 0d 09 09 65 72 72 |..} else| {...err|
|00002260| 6e 6f 20 3d 20 45 50 52 | 4f 54 4f 4e 4f 53 55 50 |no = EPR|OTONOSUP|
|00002270| 50 4f 52 54 3b 0d 0d 09 | 09 72 65 74 75 72 6e 20 |PORT;...|.return |
|00002280| 4e 55 4c 4c 3b 0d 09 7d | 0d 7d 0d 0d 73 74 61 74 |NULL;..}|.}..stat|
|00002290| 69 63 09 63 68 61 72 09 | 74 63 70 5b 5d 20 3d 20 |ic.char.|tcp[] = |
|000022a0| 22 74 63 70 22 3b 0d 73 | 74 61 74 69 63 09 63 68 |"tcp";.s|tatic.ch|
|000022b0| 61 72 09 75 64 70 5b 5d | 20 3d 20 22 75 64 70 22 |ar.udp[]| = "udp"|
|000022c0| 3b 0d 23 64 65 66 69 6e | 65 09 4d 41 58 5f 50 52 |;.#defin|e.MAX_PR|
|000022d0| 4f 54 4f 45 4e 54 09 09 | 09 31 30 0d 73 74 61 74 |OTOENT..|.10.stat|
|000022e0| 69 63 20 09 73 74 72 75 | 63 74 20 70 72 6f 74 6f |ic .stru|ct proto|
|000022f0| 65 6e 74 09 09 70 72 6f | 74 6f 65 6e 74 73 5b 4d |ent..pro|toents[M|
|00002300| 41 58 5f 50 52 4f 54 4f | 45 4e 54 5d 3b 0d 73 74 |AX_PROTO|ENT];.st|
|00002310| 61 74 69 63 20 09 69 6e | 74 09 09 09 09 09 70 72 |atic .in|t.....pr|
|00002320| 6f 74 6f 65 6e 74 5f 63 | 6f 75 6e 74 3d 30 3b 0d |otoent_c|ount=0;.|
|00002330| 0d 73 74 72 75 63 74 20 | 70 72 6f 74 6f 65 6e 74 |.struct |protoent|
|00002340| 20 2a 20 67 65 74 70 72 | 6f 74 6f 62 79 6e 61 6d | * getpr|otobynam|
|00002350| 65 28 63 68 61 72 20 2a | 20 6e 61 6d 65 29 0d 7b |e(char *| name).{|
|00002360| 0d 09 73 74 72 75 63 74 | 20 70 72 6f 74 6f 65 6e |..struct| protoen|
|00002370| 74 20 2a 70 65 3b 0d 0d | 09 70 65 20 3d 20 26 70 |t *pe;..|.pe = &p|
|00002380| 72 6f 74 6f 65 6e 74 73 | 5b 70 72 6f 74 6f 65 6e |rotoents|[protoen|
|00002390| 74 5f 63 6f 75 6e 74 5d | 3b 0d 09 69 66 20 28 73 |t_count]|;..if (s|
|000023a0| 74 72 63 6d 70 28 6e 61 | 6d 65 2c 20 22 75 64 70 |trcmp(na|me, "udp|
|000023b0| 22 29 20 3d 3d 20 30 29 | 20 7b 0d 09 09 70 65 2d |") == 0)| {...pe-|
|000023c0| 3e 70 5f 6e 61 6d 65 20 | 3d 20 75 64 70 3b 0d 09 |>p_name |= udp;..|
|000023d0| 09 70 65 2d 3e 70 5f 70 | 72 6f 74 6f 20 3d 20 49 |.pe->p_p|roto = I|
|000023e0| 50 50 52 4f 54 4f 5f 55 | 44 50 3b 0d 09 7d 20 65 |PPROTO_U|DP;..} e|
|000023f0| 6c 73 65 20 69 66 20 28 | 73 74 72 63 6d 70 20 28 |lse if (|strcmp (|
|00002400| 6e 61 6d 65 2c 20 22 74 | 63 70 22 29 20 3d 3d 20 |name, "t|cp") == |
|00002410| 30 29 20 20 7b 0d 09 09 | 70 65 2d 3e 70 5f 6e 61 |0) {...|pe->p_na|
|00002420| 6d 65 20 3d 20 74 63 70 | 3b 0d 09 09 70 65 2d 3e |me = tcp|;...pe->|
|00002430| 70 5f 70 72 6f 74 6f 20 | 3d 20 49 50 50 52 4f 54 |p_proto |= IPPROT|
|00002440| 4f 5f 54 43 50 3b 0d 09 | 7d 20 65 6c 73 65 20 7b |O_TCP;..|} else {|
|00002450| 0d 09 09 65 72 72 6e 6f | 20 3d 20 45 50 52 4f 54 |...errno| = EPROT|
|00002460| 4f 4e 4f 53 55 50 50 4f | 52 54 3b 0d 09 09 72 65 |ONOSUPPO|RT;...re|
|00002470| 74 75 72 6e 20 4e 55 4c | 4c 3b 0d 09 7d 0d 09 70 |turn NUL|L;..}..p|
|00002480| 65 2d 3e 70 5f 61 6c 69 | 61 73 65 73 20 3d 20 61 |e->p_ali|ases = a|
|00002490| 6c 69 61 73 50 74 72 73 | 3b 0d 09 70 72 6f 74 6f |liasPtrs|;..proto|
|000024a0| 65 6e 74 5f 63 6f 75 6e | 74 20 3d 20 28 70 72 6f |ent_coun|t = (pro|
|000024b0| 74 6f 65 6e 74 5f 63 6f | 75 6e 74 20 2b 31 29 20 |toent_co|unt +1) |
|000024c0| 25 20 4d 41 58 5f 50 52 | 4f 54 4f 45 4e 54 3b 0d |% MAX_PR|OTOENT;.|
|000024d0| 09 72 65 74 75 72 6e 20 | 70 65 3b 0d 7d 0d 00 00 |.return |pe;.}...|
|000024e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000024f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002500| 00 00 01 00 00 00 01 f7 | 00 00 00 f7 00 00 00 68 |........|.......h|
|00002510| 00 00 00 f0 35 ff ff 20 | 00 0b 56 00 00 00 00 f0 |....5.. |..V.....|
|00002520| 3c ff ff 00 00 0b 6f 00 | 00 00 00 f0 37 ff ff 00 |<.....o.|....7...|
|00002530| 0c 47 55 53 49 4e 65 74 | 44 42 2e 63 70 e3 02 00 |.GUSINet|DB.cp...|
|00002540| 00 00 54 45 58 54 4d 50 | 53 20 00 00 ff ff ff ff |..TEXTMP|S ......|
|00002550| 00 00 54 45 58 54 4d 50 | 53 20 00 00 ff ff ff ff |..TEXTMP|S ......|
|00002560| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002570| 00 00 a6 d8 10 4e 00 00 | 24 5e 00 00 02 5f 00 f0 |.....N..|$^..._..|
|00002580| 23 ff ff 00 03 04 74 00 | 66 30 38 f0 20 ff ff 00 |#.....t.|f08. ...|
|00002590| 00 1a 57 00 00 00 00 f0 | 30 ff ff 00 00 1b 5b 00 |..W.....|0.....[.|
|000025a0| 00 00 00 f0 23 ff ff 20 | 00 9c 51 00 00 00 00 f0 |....#.. |..Q.....|
|000025b0| 21 ff ff 00 03 01 68 00 | 66 30 2c f0 22 ff ff 00 |!.....h.|f0,."...|
|000025c0| 03 02 6c 00 66 30 24 f0 | 31 ff ff 00 03 03 70 00 |..l.f0$.|1.....p.|
|000025d0| 66 30 28 f0 38 ff ff 00 | 00 05 fb 00 00 00 00 f0 |f0(.8...|........|
|000025e0| 3e 02 bf 20 02 ff 20 00 | 66 2f f0 f0 20 ff ff 00 |>.. .. .|f/.. ...|
|000025f0| 00 01 5a 00 00 00 00 f0 | 30 00 32 00 00 1f 9f 00 |..Z.....|0.2.....|
|00002600| 00 00 00 6b 17 a5 d8 dd | 3f e5 32 30 00 04 00 04 |...k....|?.20....|
|00002610| 00 00 00 00 00 00 a7 81 | fd 82 a7 81 fd 82 a6 71 |........|.......q|
|00002620| 49 ef 00 00 bf be 00 04 | 00 24 00 03 05 47 55 53 |I.......|.$...GUS|
|00002630| 49 ba 00 0a 62 6c 6f 63 | 6b 73 62 65 72 67 00 01 |I...bloc|ksberg..|
|00002640| 32 00 0c 47 55 53 49 4e | 65 74 44 42 2e 63 70 00 |2..GUSIN|etDB.cp.|
|00002650| 00 00 00 1a 43 61 6e 27 | 74 20 73 65 74 20 61 6c |....Can'|t set al|
|00002660| 69 61 73 65 73 20 74 6f | 20 4e 55 4c 4c 2e 00 00 |iases to| NULL...|
|00002670| 00 00 48 00 09 4d 6f 6e | 61 63 6f 00 2a 2a 2a 2a |..H..Mon|aco.****|
|00002680| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 0d 50 72 |********|*****.Pr|
|00002690| 6f 6a 65 63 74 00 06 00 | 03 00 37 00 34 02 8f 02 |oject...|..7.4...|
|000026a0| 9b 00 37 00 34 02 8f 02 | 9b a7 81 fd a7 00 00 24 |..7.4...|.......$|
|000026b0| 18 00 00 24 18 00 00 0c | 10 01 00 00 00 00 16 00 |...$....|........|
|000026c0| 01 00 00 01 e4 00 00 02 | 0e 0b 4c 61 73 74 43 68 |........|..LastCh|
|000026d0| 61 6e 67 65 00 00 00 00 | 1e 00 37 00 34 02 8f 02 |ange....|..7.4...|
|000026e0| 9b 00 37 00 34 02 8f 02 | 9b 00 00 0c 10 00 00 00 |..7.4...|........|
|000026f0| 00 00 00 00 00 00 00 00 | 00 01 00 00 00 01 f7 00 |........|........|
|00002700| 00 00 f7 00 00 00 68 01 | 83 6d 2c 05 84 00 00 00 |......h.|.m,.....|
|00002710| 1c 00 5e 00 01 4d 50 53 | 52 00 02 00 12 63 6b 69 |..^..MPS|R....cki|
|00002720| 64 00 00 00 36 03 ed ff | ff 00 00 00 6f 00 00 00 |d...6...|....o...|
|00002730| 00 03 ef ff ff 00 00 00 | bb 00 00 00 00 03 f0 ff |........|........|
|00002740| ff 00 00 00 d5 01 89 a1 | c0 00 80 00 00 00 00 00 |........|........|
|00002750| 00 00 00 00 00 09 50 72 | 6f 6a 65 63 74 6f 72 00 |......Pr|ojector.|
|00002760| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002770| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+