home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume13 / rpc3.9 / part11 < prev    next >
SHell self-extracting ARchive  |  1988-02-27  |  62.8 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: SHell self-extracting ARchive (archive/shar).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Newsgroup Content (archive/news) magic Supported
100% dexvert SHell self-extracting ARchive (archive/shar) magic Supported
100% dexvert Internet Message Format (text/imf) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file news or mail text default
99% file C source text default
98% file C source, ASCII text default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/329 Shell Archive Format default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime message/rfc822 default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 53 75 62 6a 65 63 74 3a | 20 20 76 31 33 69 30 38 |Subject:| v13i08|
|00000010| 38 3a 20 20 53 75 6e 20 | 52 50 43 2c 20 72 65 6c |8: Sun |RPC, rel|
|00000020| 65 61 73 65 20 33 2e 39 | 2c 20 50 61 72 74 31 31 |ease 3.9|, Part11|
|00000030| 2f 31 35 0a 4e 65 77 73 | 67 72 6f 75 70 73 3a 20 |/15.News|groups: |
|00000040| 63 6f 6d 70 2e 73 6f 75 | 72 63 65 73 2e 75 6e 69 |comp.sou|rces.uni|
|00000050| 78 0a 53 65 6e 64 65 72 | 3a 20 73 6f 75 72 63 65 |x.Sender|: source|
|00000060| 73 0a 41 70 70 72 6f 76 | 65 64 3a 20 72 73 61 6c |s.Approv|ed: rsal|
|00000070| 7a 40 75 75 6e 65 74 2e | 55 55 2e 4e 45 54 0a 0a |z@uunet.|UU.NET..|
|00000080| 53 75 62 6d 69 74 74 65 | 64 2d 62 79 3a 20 53 74 |Submitte|d-by: St|
|00000090| 65 70 68 65 6e 20 58 2e | 20 4e 61 68 6d 20 3c 73 |ephen X.| Nahm <s|
|000000a0| 78 6e 40 53 75 6e 2e 43 | 4f 4d 3e 0a 50 6f 73 74 |xn@Sun.C|OM>.Post|
|000000b0| 69 6e 67 2d 6e 75 6d 62 | 65 72 3a 20 56 6f 6c 75 |ing-numb|er: Volu|
|000000c0| 6d 65 20 31 33 2c 20 49 | 73 73 75 65 20 38 38 0a |me 13, I|ssue 88.|
|000000d0| 41 72 63 68 69 76 65 2d | 6e 61 6d 65 3a 20 72 70 |Archive-|name: rp|
|000000e0| 63 33 2e 39 2f 70 61 72 | 74 31 31 0a 0a 23 21 20 |c3.9/par|t11..#! |
|000000f0| 2f 62 69 6e 2f 73 68 0a | 23 20 54 68 69 73 20 69 |/bin/sh.|# This i|
|00000100| 73 20 61 20 73 68 65 6c | 6c 20 61 72 63 68 69 76 |s a shel|l archiv|
|00000110| 65 2e 20 54 6f 20 65 78 | 74 72 61 63 74 2c 20 72 |e. To ex|tract, r|
|00000120| 65 6d 6f 76 65 20 74 68 | 65 20 68 65 61 64 65 72 |emove th|e header|
|00000130| 20 61 6e 64 20 74 79 70 | 65 20 22 73 68 20 66 69 | and typ|e "sh fi|
|00000140| 6c 65 6e 61 6d 65 22 0a | 23 0a 65 63 68 6f 20 78 |lename".|#.echo x|
|00000150| 20 2d 20 64 6f 63 0a 65 | 63 68 6f 20 63 72 65 61 | - doc.e|cho crea|
|00000160| 74 69 6e 67 20 64 69 72 | 65 63 74 6f 72 79 20 64 |ting dir|ectory d|
|00000170| 6f 63 0a 6d 6b 64 69 72 | 20 64 6f 63 0a 63 64 20 |oc.mkdir| doc.cd |
|00000180| 64 6f 63 0a 65 63 68 6f | 20 78 20 2d 20 72 70 63 |doc.echo| x - rpc|
|00000190| 2e 70 72 6f 67 2e 6d 73 | 0a 73 65 64 20 2d 65 20 |.prog.ms|.sed -e |
|000001a0| 27 73 2f 5e 58 2f 2f 27 | 20 3e 20 72 70 63 2e 70 |'s/^X//'| > rpc.p|
|000001b0| 72 6f 67 2e 6d 73 20 3c | 3c 27 46 75 6e 6b 79 5f |rog.ms <|<'Funky_|
|000001c0| 53 74 75 66 66 27 0a 58 | 2e 5c 22 20 40 28 23 29 |Stuff'.X|.\" @(#)|
|000001d0| 72 70 63 2e 70 72 6f 67 | 2e 6d 73 09 31 2e 32 20 |rpc.prog|.ms.1.2 |
|000001e0| 38 37 2f 31 31 2f 30 39 | 20 33 2e 39 20 52 50 43 |87/11/09| 3.9 RPC|
|000001f0| 53 52 43 0a 58 2e 64 65 | 20 42 54 0a 58 2e 69 66 |SRC.X.de| BT.X.if|
|00000200| 20 5c 5c 6e 25 3d 31 20 | 2e 74 6c 20 27 27 2d 20 | \\n%=1 |.tl ''- |
|00000210| 25 20 2d 27 27 0a 58 2e | 2e 0a 58 2e 49 58 20 22 |% -''.X.|..X.IX "|
|00000220| 4e 65 74 77 6f 72 6b 20 | 50 72 6f 67 72 61 6d 6d |Network |Programm|
|00000230| 69 6e 67 22 20 22 22 20 | 22 22 20 22 22 20 50 41 |ing" "" |"" "" PA|
|00000240| 47 45 20 4d 41 4a 4f 52 | 0a 58 2e 6e 72 20 4f 46 |GE MAJOR|.X.nr OF|
|00000250| 20 30 0a 58 2e 4e 44 0a | 58 2e 5c 22 20 70 72 65 | 0.X.ND.|X.\" pre|
|00000260| 76 65 6e 74 20 65 78 63 | 65 73 73 20 75 6e 64 65 |vent exc|ess unde|
|00000270| 72 6c 69 6e 69 6e 67 20 | 69 6e 20 6e 72 6f 66 66 |rlining |in nroff|
|00000280| 0a 58 2e 69 66 20 6e 20 | 2e 66 70 20 32 20 52 0a |.X.if n |.fp 2 R.|
|00000290| 58 2e 4f 48 20 27 52 65 | 6d 6f 74 65 20 50 72 6f |X.OH 'Re|mote Pro|
|000002a0| 63 65 64 75 72 65 20 43 | 61 6c 6c 20 50 72 6f 67 |cedure C|all Prog|
|000002b0| 72 61 6d 6d 69 6e 67 20 | 47 75 69 64 65 27 27 50 |ramming |Guide''P|
|000002c0| 61 67 65 20 25 27 0a 58 | 2e 45 48 20 27 50 61 67 |age %'.X|.EH 'Pag|
|000002d0| 65 20 25 27 27 52 65 6d | 6f 74 65 20 50 72 6f 63 |e %''Rem|ote Proc|
|000002e0| 65 64 75 72 65 20 43 61 | 6c 6c 20 50 72 6f 67 72 |edure Ca|ll Progr|
|000002f0| 61 6d 6d 69 6e 67 20 47 | 75 69 64 65 27 0a 58 2e |amming G|uide'.X.|
|00000300| 53 48 0a 5c 26 52 65 6d | 6f 74 65 20 50 72 6f 63 |SH.\&Rem|ote Proc|
|00000310| 65 64 75 72 65 20 43 61 | 6c 6c 20 50 72 6f 67 72 |edure Ca|ll Progr|
|00000320| 61 6d 6d 69 6e 67 20 47 | 75 69 64 65 0a 58 2e 6e |amming G|uide.X.n|
|00000330| 72 20 4f 46 20 31 0a 58 | 2e 49 58 20 22 52 50 43 |r OF 1.X|.IX "RPC|
|00000340| 20 50 72 6f 67 72 61 6d | 6d 69 6e 67 20 47 75 69 | Program|ming Gui|
|00000350| 64 65 22 0a 58 2e 4c 50 | 0a 54 68 69 73 20 64 6f |de".X.LP|.This do|
|00000360| 63 75 6d 65 6e 74 20 69 | 73 20 69 6e 74 65 6e 64 |cument i|s intend|
|00000370| 65 64 20 66 6f 72 20 70 | 72 6f 67 72 61 6d 6d 65 |ed for p|rogramme|
|00000380| 72 73 20 77 68 6f 20 77 | 69 73 68 20 74 6f 20 77 |rs who w|ish to w|
|00000390| 72 69 74 65 20 6e 65 74 | 77 6f 72 6b 20 0a 61 70 |rite net|work .ap|
|000003a0| 70 6c 69 63 61 74 69 6f | 6e 73 20 75 73 69 6e 67 |plicatio|ns using|
|000003b0| 20 72 65 6d 6f 74 65 20 | 70 72 6f 63 65 64 75 72 | remote |procedur|
|000003c0| 65 20 63 61 6c 6c 73 20 | 28 65 78 70 6c 61 69 6e |e calls |(explain|
|000003d0| 65 64 20 62 65 6c 6f 77 | 29 2c 20 74 68 75 73 0a |ed below|), thus.|
|000003e0| 61 76 6f 69 64 69 6e 67 | 20 6c 6f 77 2d 6c 65 76 |avoiding| low-lev|
|000003f0| 65 6c 20 73 79 73 74 65 | 6d 20 70 72 69 6d 69 74 |el syste|m primit|
|00000400| 69 76 65 73 20 62 61 73 | 65 64 20 6f 6e 20 73 6f |ives bas|ed on so|
|00000410| 63 6b 65 74 73 2e 20 20 | 54 68 65 20 72 65 61 64 |ckets. |The read|
|00000420| 65 72 0a 6d 75 73 74 20 | 62 65 20 66 61 6d 69 6c |er.must |be famil|
|00000430| 69 61 72 20 77 69 74 68 | 20 74 68 65 20 43 20 70 |iar with| the C p|
|00000440| 72 6f 67 72 61 6d 6d 69 | 6e 67 20 6c 61 6e 67 75 |rogrammi|ng langu|
|00000450| 61 67 65 2c 20 61 6e 64 | 20 73 68 6f 75 6c 64 20 |age, and| should |
|00000460| 68 61 76 65 20 61 20 0a | 77 6f 72 6b 69 6e 67 20 |have a .|working |
|00000470| 6b 6e 6f 77 6c 65 64 67 | 65 20 6f 66 20 6e 65 74 |knowledg|e of net|
|00000480| 77 6f 72 6b 20 74 68 65 | 6f 72 79 2e 0a 58 2e 53 |work the|ory..X.S|
|00000490| 48 0a 58 2e 49 58 20 72 | 70 63 67 65 6e 20 22 22 |H.X.IX r|pcgen ""|
|000004a0| 20 5c 66 49 72 70 63 67 | 65 6e 5c 66 50 0a 58 2e | \fIrpcg|en\fP.X.|
|000004b0| 49 0a 4e 4f 54 45 3a 20 | 42 65 66 6f 72 65 20 61 |I.NOTE: |Before a|
|000004c0| 74 74 65 6d 70 74 69 6e | 67 20 74 6f 20 77 72 69 |ttemptin|g to wri|
|000004d0| 74 65 20 61 20 6e 65 74 | 77 6f 72 6b 20 61 70 70 |te a net|work app|
|000004e0| 6c 69 63 61 74 69 6f 6e | 2c 20 6f 72 20 74 6f 20 |lication|, or to |
|000004f0| 63 6f 6e 76 65 72 74 20 | 61 6e 0a 65 78 69 73 74 |convert |an.exist|
|00000500| 69 6e 67 20 6e 6f 6e 2d | 6e 65 74 77 6f 72 6b 20 |ing non-|network |
|00000510| 61 70 70 6c 69 63 61 74 | 69 6f 6e 20 74 6f 20 72 |applicat|ion to r|
|00000520| 75 6e 20 6f 76 65 72 20 | 74 68 65 20 6e 65 74 77 |un over |the netw|
|00000530| 6f 72 6b 2c 20 79 6f 75 | 20 73 68 6f 75 6c 64 0a |ork, you| should.|
|00000540| 62 65 20 66 61 6d 69 6c | 69 61 72 20 77 69 74 68 |be famil|iar with|
|00000550| 20 74 68 65 20 6d 61 74 | 65 72 69 61 6c 20 69 6e | the mat|erial in|
|00000560| 20 74 68 69 73 20 63 68 | 61 70 74 65 72 2e 20 20 | this ch|apter. |
|00000570| 48 6f 77 65 76 65 72 2c | 20 66 6f 72 20 6d 6f 73 |However,| for mos|
|00000580| 74 0a 61 70 70 6c 69 63 | 61 74 69 6f 6e 73 2c 20 |t.applic|ations, |
|00000590| 79 6f 75 20 63 61 6e 20 | 63 69 72 63 75 6d 76 65 |you can |circumve|
|000005a0| 6e 74 20 74 68 65 20 6e | 65 65 64 20 74 6f 20 63 |nt the n|eed to c|
|000005b0| 6f 70 65 20 77 69 74 68 | 20 74 68 65 20 6b 69 6e |ope with| the kin|
|000005c0| 64 73 20 6f 66 0a 64 65 | 74 61 69 6c 73 20 70 72 |ds of.de|tails pr|
|000005d0| 65 73 65 6e 74 65 64 20 | 68 65 72 65 20 62 79 20 |esented |here by |
|000005e0| 75 73 69 6e 67 20 74 68 | 65 0a 58 2e 49 20 72 70 |using th|e.X.I rp|
|000005f0| 63 67 65 6e 0a 70 72 6f | 74 6f 63 6f 6c 20 63 6f |cgen.pro|tocol co|
|00000600| 6d 70 69 6c 65 72 2c 20 | 77 68 69 63 68 20 69 73 |mpiler, |which is|
|00000610| 20 64 65 73 63 72 69 62 | 65 64 20 69 6e 20 64 65 | describ|ed in de|
|00000620| 74 61 69 6c 20 69 6e 20 | 74 68 65 20 6e 65 78 74 |tail in |the next|
|00000630| 20 63 68 61 70 74 65 72 | 2c 0a 74 68 65 0a 5c 66 | chapter|,.the.\f|
|00000640| 49 5c 66 28 4c 42 72 70 | 63 67 65 6e 5c 66 52 20 |I\f(LBrp|cgen\fR |
|00000650| 50 72 6f 67 72 61 6d 6d | 69 6e 67 20 47 75 69 64 |Programm|ing Guid|
|00000660| 65 5c 66 49 5c 2e 0a 54 | 68 65 0a 5c 66 52 47 65 |e\fI\..T|he.\fRGe|
|00000670| 6e 65 72 61 74 69 6e 67 | 20 58 44 52 20 52 6f 75 |nerating| XDR Rou|
|00000680| 74 69 6e 65 73 5c 66 49 | 0a 73 65 63 74 69 6f 6e |tines\fI|.section|
|00000690| 20 6f 66 20 74 68 61 74 | 20 63 68 61 70 74 65 72 | of that| chapter|
|000006a0| 20 63 6f 6e 74 61 69 6e | 73 20 74 68 65 20 63 6f | contain|s the co|
|000006b0| 6d 70 6c 65 74 65 20 73 | 6f 75 72 63 65 20 66 6f |mplete s|ource fo|
|000006c0| 72 20 61 20 77 6f 72 6b | 69 6e 67 20 52 50 43 0a |r a work|ing RPC.|
|000006d0| 73 65 72 76 69 63 65 5c | 28 65 6d 61 20 72 65 6d |service\|(ema rem|
|000006e0| 6f 74 65 20 64 69 72 65 | 63 74 6f 72 79 20 6c 69 |ote dire|ctory li|
|000006f0| 73 74 69 6e 67 20 73 65 | 72 76 69 63 65 20 77 68 |sting se|rvice wh|
|00000700| 69 63 68 20 75 73 65 73 | 0a 58 2e 42 20 72 70 63 |ich uses|.X.B rpc|
|00000710| 67 65 6e 20 0a 74 6f 20 | 67 65 6e 65 72 61 74 65 |gen .to |generate|
|00000720| 20 58 44 52 20 72 6f 75 | 74 69 6e 65 73 20 61 73 | XDR rou|tines as|
|00000730| 20 77 65 6c 6c 20 61 73 | 20 63 6c 69 65 6e 74 20 | well as| client |
|00000740| 61 6e 64 20 73 65 72 76 | 65 72 20 73 74 75 62 73 |and serv|er stubs|
|00000750| 2e 0a 58 2e 4c 50 0a 58 | 2e 4c 50 0a 57 68 61 74 |..X.LP.X|.LP.What|
|00000760| 20 61 72 65 20 72 65 6d | 6f 74 65 20 70 72 6f 63 | are rem|ote proc|
|00000770| 65 64 75 72 65 20 63 61 | 6c 6c 73 3f 20 20 53 69 |edure ca|lls? Si|
|00000780| 6d 70 6c 79 20 70 75 74 | 2c 20 74 68 65 79 20 61 |mply put|, they a|
|00000790| 72 65 20 74 68 65 20 68 | 69 67 68 2d 6c 65 76 65 |re the h|igh-leve|
|000007a0| 6c 0a 63 6f 6d 6d 75 6e | 69 63 61 74 69 6f 6e 73 |l.commun|ications|
|000007b0| 20 70 61 72 61 64 69 67 | 6d 20 75 73 65 64 20 69 | paradig|m used i|
|000007c0| 6e 20 74 68 65 20 6f 70 | 65 72 61 74 69 6e 67 20 |n the op|erating |
|000007d0| 73 79 73 74 65 6d 2e 0a | 52 50 43 20 70 72 65 73 |system..|RPC pres|
|000007e0| 75 6d 65 73 20 74 68 65 | 20 65 78 69 73 74 65 6e |umes the| existen|
|000007f0| 63 65 20 6f 66 0a 6c 6f | 77 2d 6c 65 76 65 6c 20 |ce of.lo|w-level |
|00000800| 6e 65 74 77 6f 72 6b 69 | 6e 67 20 6d 65 63 68 61 |networki|ng mecha|
|00000810| 6e 69 73 6d 73 20 28 73 | 75 63 68 20 61 73 20 54 |nisms (s|uch as T|
|00000820| 43 50 2f 49 50 20 61 6e | 64 20 55 44 50 2f 49 50 |CP/IP an|d UDP/IP|
|00000830| 29 2c 20 61 6e 64 20 75 | 70 6f 6e 20 74 68 65 6d |), and u|pon them|
|00000840| 0a 69 74 20 69 6d 70 6c | 65 6d 65 6e 74 73 20 61 |.it impl|ements a|
|00000850| 20 6c 6f 67 69 63 61 6c | 20 63 6c 69 65 6e 74 20 | logical| client |
|00000860| 74 6f 20 73 65 72 76 65 | 72 20 63 6f 6d 6d 75 6e |to serve|r commun|
|00000870| 69 63 61 74 69 6f 6e 73 | 20 73 79 73 74 65 6d 20 |ications| system |
|00000880| 64 65 73 69 67 6e 65 64 | 0a 73 70 65 63 69 66 69 |designed|.specifi|
|00000890| 63 61 6c 6c 79 20 66 6f | 72 20 74 68 65 20 73 75 |cally fo|r the su|
|000008a0| 70 70 6f 72 74 20 6f 66 | 20 6e 65 74 77 6f 72 6b |pport of| network|
|000008b0| 20 61 70 70 6c 69 63 61 | 74 69 6f 6e 73 2e 20 20 | applica|tions. |
|000008c0| 57 69 74 68 20 52 50 43 | 2c 20 74 68 65 20 63 6c |With RPC|, the cl|
|000008d0| 69 65 6e 74 0a 6d 61 6b | 65 73 20 61 20 70 72 6f |ient.mak|es a pro|
|000008e0| 63 65 64 75 72 65 20 63 | 61 6c 6c 20 74 6f 20 73 |cedure c|all to s|
|000008f0| 65 6e 64 20 61 20 64 61 | 74 61 20 70 61 63 6b 65 |end a da|ta packe|
|00000900| 74 20 74 6f 20 74 68 65 | 20 73 65 72 76 65 72 2e |t to the| server.|
|00000910| 20 20 57 68 65 6e 20 74 | 68 65 0a 70 61 63 6b 65 | When t|he.packe|
|00000920| 74 20 61 72 72 69 76 65 | 73 2c 20 74 68 65 20 73 |t arrive|s, the s|
|00000930| 65 72 76 65 72 20 63 61 | 6c 6c 73 20 61 20 64 69 |erver ca|lls a di|
|00000940| 73 70 61 74 63 68 20 72 | 6f 75 74 69 6e 65 2c 20 |spatch r|outine, |
|00000950| 70 65 72 66 6f 72 6d 73 | 20 77 68 61 74 65 76 65 |performs| whateve|
|00000960| 72 0a 73 65 72 76 69 63 | 65 20 69 73 20 72 65 71 |r.servic|e is req|
|00000970| 75 65 73 74 65 64 2c 20 | 73 65 6e 64 73 20 62 61 |uested, |sends ba|
|00000980| 63 6b 20 74 68 65 20 72 | 65 70 6c 79 2c 20 61 6e |ck the r|eply, an|
|00000990| 64 20 74 68 65 20 70 72 | 6f 63 65 64 75 72 65 20 |d the pr|ocedure |
|000009a0| 63 61 6c 6c 20 72 65 74 | 75 72 6e 73 0a 74 6f 20 |call ret|urns.to |
|000009b0| 74 68 65 20 63 6c 69 65 | 6e 74 2e 0a 58 2e 4e 48 |the clie|nt..X.NH|
|000009c0| 20 30 0a 5c 26 4c 61 79 | 65 72 73 20 6f 66 20 52 | 0.\&Lay|ers of R|
|000009d0| 50 43 0a 58 2e 49 58 20 | 22 6c 61 79 65 72 73 20 |PC.X.IX |"layers |
|000009e0| 6f 66 20 52 50 43 22 0a | 58 2e 49 58 20 22 52 50 |of RPC".|X.IX "RP|
|000009f0| 43 22 20 22 6c 61 79 65 | 72 73 22 0a 58 2e 4c 50 |C" "laye|rs".X.LP|
|00000a00| 0a 54 68 65 20 52 50 43 | 20 69 6e 74 65 72 66 61 |.The RPC| interfa|
|00000a10| 63 65 20 63 61 6e 20 62 | 65 20 73 65 65 6e 20 61 |ce can b|e seen a|
|00000a20| 73 20 62 65 69 6e 67 20 | 64 69 76 69 64 65 64 20 |s being |divided |
|00000a30| 69 6e 74 6f 20 74 68 72 | 65 65 20 6c 61 79 65 72 |into thr|ee layer|
|00000a40| 73 2e 5c 2a 2a 0a 58 2e | 46 53 0a 46 6f 72 20 61 |s.\**.X.|FS.For a|
|00000a50| 20 63 6f 6d 70 6c 65 74 | 65 20 73 70 65 63 69 66 | complet|e specif|
|00000a60| 69 63 61 74 69 6f 6e 20 | 6f 66 20 74 68 65 20 72 |ication |of the r|
|00000a70| 6f 75 74 69 6e 65 73 20 | 69 6e 20 74 68 65 20 72 |outines |in the r|
|00000a80| 65 6d 6f 74 65 20 70 72 | 6f 63 65 64 75 72 65 0a |emote pr|ocedure.|
|00000a90| 63 61 6c 6c 20 4c 69 62 | 72 61 72 79 2c 20 73 65 |call Lib|rary, se|
|00000aa0| 65 20 74 68 65 0a 58 2e | 49 20 72 70 63 20 28 33 |e the.X.|I rpc (3|
|00000ab0| 4e 29 0a 6d 61 6e 75 61 | 6c 20 70 61 67 65 2e 0a |N).manua|l page..|
|00000ac0| 58 2e 46 45 0a 58 2e 4c | 50 0a 58 2e 49 20 22 54 |X.FE.X.L|P.X.I "T|
|00000ad0| 68 65 20 48 69 67 68 65 | 73 74 20 4c 61 79 65 72 |he Highe|st Layer|
|00000ae0| 3a 22 0a 58 2e 49 58 20 | 52 50 43 20 22 54 68 65 |:".X.IX |RPC "The|
|00000af0| 20 48 69 67 68 65 73 74 | 20 4c 61 79 65 72 22 0a | Highest| Layer".|
|00000b00| 54 68 65 20 68 69 67 68 | 65 73 74 20 6c 61 79 65 |The high|est laye|
|00000b10| 72 20 69 73 20 74 6f 74 | 61 6c 6c 79 20 74 72 61 |r is tot|ally tra|
|00000b20| 6e 73 70 61 72 65 6e 74 | 20 74 6f 20 74 68 65 20 |nsparent| to the |
|00000b30| 6f 70 65 72 61 74 69 6e | 67 20 73 79 73 74 65 6d |operatin|g system|
|00000b40| 2c 20 0a 6d 61 63 68 69 | 6e 65 20 61 6e 64 20 6e |, .machi|ne and n|
|00000b50| 65 74 77 6f 72 6b 20 75 | 70 6f 6e 20 77 68 69 63 |etwork u|pon whic|
|00000b60| 68 20 69 73 20 69 73 20 | 72 75 6e 2e 20 20 49 74 |h is is |run. It|
|00000b70| 27 73 20 70 72 6f 62 61 | 62 6c 79 20 62 65 73 74 |'s proba|bly best|
|00000b80| 20 74 6f 20 0a 74 68 69 | 6e 6b 20 6f 66 20 74 68 | to .thi|nk of th|
|00000b90| 69 73 20 6c 65 76 65 6c | 20 61 73 20 61 20 77 61 |is level| as a wa|
|00000ba0| 79 20 6f 66 20 5c 66 49 | 75 73 69 6e 67 5c 66 50 |y of \fI|using\fP|
|00000bb0| 20 52 50 43 2c 20 72 61 | 74 68 65 72 20 74 68 61 | RPC, ra|ther tha|
|00000bc0| 6e 20 61 73 20 0a 61 20 | 5c 66 49 70 61 72 74 20 |n as .a |\fIpart |
|00000bd0| 6f 66 5c 66 50 20 52 50 | 43 20 70 72 6f 70 65 72 |of\fP RP|C proper|
|00000be0| 2e 20 20 50 72 6f 67 72 | 61 6d 6d 65 72 73 20 77 |. Progr|ammers w|
|00000bf0| 68 6f 20 77 72 69 74 65 | 20 52 50 43 20 72 6f 75 |ho write| RPC rou|
|00000c00| 74 69 6e 65 73 20 0a 73 | 68 6f 75 6c 64 20 28 61 |tines .s|hould (a|
|00000c10| 6c 6d 6f 73 74 29 20 61 | 6c 77 61 79 73 20 6d 61 |lmost) a|lways ma|
|00000c20| 6b 65 20 74 68 69 73 20 | 6c 61 79 65 72 20 61 76 |ke this |layer av|
|00000c30| 61 69 6c 61 62 6c 65 20 | 74 6f 20 6f 74 68 65 72 |ailable |to other|
|00000c40| 73 20 62 79 20 77 61 79 | 20 0a 6f 66 20 61 20 73 |s by way| .of a s|
|00000c50| 69 6d 70 6c 65 20 43 20 | 66 72 6f 6e 74 20 65 6e |imple C |front en|
|00000c60| 64 20 74 6f 20 74 68 61 | 74 20 65 6e 74 69 72 65 |d to tha|t entire|
|00000c70| 6c 79 20 68 69 64 65 73 | 20 74 68 65 20 6e 65 74 |ly hides| the net|
|00000c80| 77 6f 72 6b 69 6e 67 2e | 20 20 20 0a 58 2e 4c 50 |working.| .X.LP|
|00000c90| 20 0a 54 6f 20 69 6c 6c | 75 73 74 72 61 74 65 2c | .To ill|ustrate,|
|00000ca0| 20 61 74 20 74 68 69 73 | 20 6c 65 76 65 6c 20 61 | at this| level a|
|00000cb0| 20 70 72 6f 67 72 61 6d | 20 63 61 6e 20 73 69 6d | program| can sim|
|00000cc0| 70 6c 79 20 6d 61 6b 65 | 20 61 20 63 61 6c 6c 20 |ply make| a call |
|00000cd0| 74 6f 0a 58 2e 49 20 72 | 6e 75 73 65 72 73 20 2c |to.X.I r|nusers ,|
|00000ce0| 0a 61 20 43 20 72 6f 75 | 74 69 6e 65 20 77 68 69 |.a C rou|tine whi|
|00000cf0| 63 68 20 72 65 74 75 72 | 6e 73 20 74 68 65 20 6e |ch retur|ns the n|
|00000d00| 75 6d 62 65 72 20 6f 66 | 20 75 73 65 72 73 20 6f |umber of| users o|
|00000d10| 6e 20 61 20 72 65 6d 6f | 74 65 20 6d 61 63 68 69 |n a remo|te machi|
|00000d20| 6e 65 2e 0a 54 68 65 20 | 75 73 65 72 20 69 73 20 |ne..The |user is |
|00000d30| 6e 6f 74 20 65 78 70 6c | 69 63 69 74 6c 79 20 61 |not expl|icitly a|
|00000d40| 77 61 72 65 20 6f 66 20 | 75 73 69 6e 67 20 52 50 |ware of |using RP|
|00000d50| 43 20 5c 28 65 6d 20 74 | 68 65 79 20 73 69 6d 70 |C \(em t|hey simp|
|00000d60| 6c 79 20 0a 63 61 6c 6c | 20 61 20 70 72 6f 63 65 |ly .call| a proce|
|00000d70| 64 75 72 65 2c 20 6a 75 | 73 74 20 61 73 20 74 68 |dure, ju|st as th|
|00000d80| 65 79 20 77 6f 75 6c 64 | 20 63 61 6c 6c 0a 58 2e |ey would| call.X.|
|00000d90| 49 20 6d 61 6c 6c 6f 63 | 0a 58 2e 4c 50 0a 58 2e |I malloc|.X.LP.X.|
|00000da0| 49 20 22 54 68 65 20 4d | 69 64 64 6c 65 20 4c 61 |I "The M|iddle La|
|00000db0| 79 65 72 3a 22 0a 58 2e | 49 58 20 52 50 43 20 22 |yer:".X.|IX RPC "|
|00000dc0| 54 68 65 20 4d 69 64 64 | 6c 65 20 4c 61 79 65 72 |The Midd|le Layer|
|00000dd0| 22 0a 54 68 65 20 6d 69 | 64 64 6c 65 20 6c 61 79 |".The mi|ddle lay|
|00000de0| 65 72 20 69 73 20 72 65 | 61 6c 6c 79 20 22 52 50 |er is re|ally "RP|
|00000df0| 43 20 70 72 6f 70 65 72 | 2e 22 20 20 48 65 72 65 |C proper|." Here|
|00000e00| 2c 20 74 68 65 20 75 73 | 65 72 20 64 6f 65 73 6e |, the us|er doesn|
|00000e10| 27 74 20 0a 6e 65 65 64 | 20 74 6f 20 63 6f 6e 73 |'t .need| to cons|
|00000e20| 69 64 65 72 20 64 65 74 | 61 69 6c 73 20 61 62 6f |ider det|ails abo|
|00000e30| 75 74 20 73 6f 63 6b 65 | 74 73 2c 20 74 68 65 20 |ut socke|ts, the |
|00000e40| 55 4e 49 58 20 73 79 73 | 74 65 6d 2c 20 6f 72 20 |UNIX sys|tem, or |
|00000e50| 6f 74 68 65 72 20 6c 6f | 77 2d 6c 65 76 65 6c 20 |other lo|w-level |
|00000e60| 0a 69 6d 70 6c 65 6d 65 | 6e 74 61 74 69 6f 6e 20 |.impleme|ntation |
|00000e70| 6d 65 63 68 61 6e 69 73 | 6d 73 2e 20 20 54 68 65 |mechanis|ms. The|
|00000e80| 79 20 73 69 6d 70 6c 65 | 20 6d 61 6b 65 20 72 65 |y simple| make re|
|00000e90| 6d 6f 74 65 20 70 72 6f | 63 65 64 75 72 65 20 63 |mote pro|cedure c|
|00000ea0| 61 6c 6c 73 20 0a 74 6f | 20 72 6f 75 74 69 6e 65 |alls .to| routine|
|00000eb0| 73 20 6f 6e 20 6f 74 68 | 65 72 20 6d 61 63 68 69 |s on oth|er machi|
|00000ec0| 6e 65 73 2e 20 20 54 68 | 65 20 73 65 6c 6c 69 6e |nes. Th|e sellin|
|00000ed0| 67 20 70 6f 69 6e 74 20 | 68 65 72 65 20 69 73 20 |g point |here is |
|00000ee0| 73 69 6d 70 6c 69 63 69 | 74 79 2e 20 20 0a 49 74 |simplici|ty. .It|
|00000ef0| 27 73 20 74 68 69 73 20 | 6c 61 79 65 72 20 74 68 |'s this |layer th|
|00000f00| 61 74 20 61 6c 6c 6f 77 | 73 20 52 50 43 20 74 6f |at allow|s RPC to|
|00000f10| 20 70 61 73 73 20 74 68 | 65 20 22 68 65 6c 6c 6f | pass th|e "hello|
|00000f20| 20 77 6f 72 6c 64 22 20 | 74 65 73 74 20 5c 28 65 | world" |test \(e|
|00000f30| 6d 20 0a 73 69 6d 70 6c | 65 20 74 68 69 6e 67 73 |m .simpl|e things|
|00000f40| 20 73 68 6f 75 6c 64 20 | 62 65 20 73 69 6d 70 6c | should |be simpl|
|00000f50| 65 2e 20 20 54 68 65 20 | 6d 69 64 64 6c 65 2d 6c |e. The |middle-l|
|00000f60| 61 79 65 72 20 72 6f 75 | 74 69 6e 65 73 20 61 72 |ayer rou|tines ar|
|00000f70| 65 20 75 73 65 64 20 0a | 66 6f 72 20 6d 6f 73 74 |e used .|for most|
|00000f80| 20 61 70 70 6c 69 63 61 | 74 69 6f 6e 73 2e 0a 58 | applica|tions..X|
|00000f90| 2e 4c 50 0a 52 50 43 20 | 63 61 6c 6c 73 20 61 72 |.LP.RPC |calls ar|
|00000fa0| 65 20 6d 61 64 65 20 77 | 69 74 68 20 74 68 65 20 |e made w|ith the |
|00000fb0| 73 79 73 74 65 6d 20 72 | 6f 75 74 69 6e 65 73 0a |system r|outines.|
|00000fc0| 58 2e 49 20 72 65 67 69 | 73 74 65 72 72 70 63 0a |X.I regi|sterrpc.|
|00000fd0| 58 2e 49 20 63 61 6c 6c | 72 70 63 0a 61 6e 64 0a |X.I call|rpc.and.|
|00000fe0| 58 2e 49 20 73 76 63 5f | 72 75 6e 20 2e 0a 54 68 |X.I svc_|run ..Th|
|00000ff0| 65 20 66 69 72 73 74 20 | 74 77 6f 20 6f 66 20 74 |e first |two of t|
|00001000| 68 65 73 65 20 61 72 65 | 20 74 68 65 20 6d 6f 73 |hese are| the mos|
|00001010| 74 20 66 75 6e 64 61 6d | 65 6e 74 61 6c 3a 0a 58 |t fundam|ental:.X|
|00001020| 2e 49 20 72 65 67 69 73 | 74 65 72 72 70 63 20 0a |.I regis|terrpc .|
|00001030| 6f 62 74 61 69 6e 73 20 | 61 20 75 6e 69 71 75 65 |obtains |a unique|
|00001040| 20 73 79 73 74 65 6d 2d | 77 69 64 65 20 70 72 6f | system-|wide pro|
|00001050| 63 65 64 75 72 65 2d 69 | 64 65 6e 74 69 66 69 63 |cedure-i|dentific|
|00001060| 61 74 69 6f 6e 20 6e 75 | 6d 62 65 72 2c 20 61 6e |ation nu|mber, an|
|00001070| 64 0a 58 2e 49 20 63 61 | 6c 6c 72 70 63 20 0a 61 |d.X.I ca|llrpc .a|
|00001080| 63 74 75 61 6c 6c 79 20 | 65 78 65 63 75 74 65 73 |ctually |executes|
|00001090| 20 61 20 72 65 6d 6f 74 | 65 20 70 72 6f 63 65 64 | a remot|e proced|
|000010a0| 75 72 65 20 63 61 6c 6c | 2e 20 20 41 74 20 74 68 |ure call|. At th|
|000010b0| 65 20 6d 69 64 64 6c 65 | 20 6c 65 76 65 6c 2c 20 |e middle| level, |
|000010c0| 61 20 0a 63 61 6c 6c 20 | 74 6f 20 0a 58 2e 49 20 |a .call |to .X.I |
|000010d0| 72 6e 75 73 65 72 73 0a | 69 73 20 69 6d 70 6c 65 |rnusers.|is imple|
|000010e0| 6d 65 6e 74 65 64 20 62 | 79 20 77 61 79 20 6f 66 |mented b|y way of|
|000010f0| 20 74 68 65 73 65 20 74 | 77 6f 20 72 6f 75 74 69 | these t|wo routi|
|00001100| 6e 65 73 2e 0a 58 2e 4c | 50 0a 54 68 65 20 6d 69 |nes..X.L|P.The mi|
|00001110| 64 64 6c 65 20 6c 61 79 | 65 72 20 69 73 20 75 6e |ddle lay|er is un|
|00001120| 66 6f 72 74 75 6e 61 74 | 65 6c 79 20 72 61 72 65 |fortunat|ely rare|
|00001130| 6c 79 20 75 73 65 64 20 | 69 6e 20 73 65 72 69 6f |ly used |in serio|
|00001140| 75 73 20 70 72 6f 67 72 | 61 6d 6d 69 6e 67 20 0a |us progr|amming .|
|00001150| 64 75 65 20 74 6f 20 69 | 74 73 20 69 6e 66 6c 65 |due to i|ts infle|
|00001160| 78 69 62 69 6c 69 74 79 | 20 28 73 69 6d 70 6c 69 |xibility| (simpli|
|00001170| 63 69 74 79 29 2e 20 20 | 49 74 20 64 6f 65 73 20 |city). |It does |
|00001180| 6e 6f 74 20 61 6c 6c 6f | 77 20 74 69 6d 65 6f 75 |not allo|w timeou|
|00001190| 74 20 0a 73 70 65 63 69 | 66 69 63 61 74 69 6f 6e |t .speci|fication|
|000011a0| 73 20 6f 72 20 74 68 65 | 20 63 68 6f 69 63 65 20 |s or the| choice |
|000011b0| 6f 66 20 74 72 61 6e 73 | 70 6f 72 74 2e 20 20 49 |of trans|port. I|
|000011c0| 74 20 61 6c 6c 6f 77 73 | 20 6e 6f 20 55 4e 49 58 |t allows| no UNIX|
|000011d0| 0a 70 72 6f 63 65 73 73 | 20 63 6f 6e 74 72 6f 6c |.process| control|
|000011e0| 20 6f 72 20 66 6c 65 78 | 69 62 69 6c 69 74 79 20 | or flex|ibility |
|000011f0| 69 6e 20 63 61 73 65 20 | 6f 66 20 65 72 72 6f 72 |in case |of error|
|00001200| 73 2e 20 20 49 74 20 64 | 6f 65 73 6e 27 74 20 73 |s. It d|oesn't s|
|00001210| 75 70 70 6f 72 74 0a 6d | 75 6c 74 69 70 6c 65 20 |upport.m|ultiple |
|00001220| 6b 69 6e 64 73 20 6f 66 | 20 63 61 6c 6c 20 61 75 |kinds of| call au|
|00001230| 74 68 65 6e 74 69 63 61 | 74 69 6f 6e 2e 20 20 54 |thentica|tion. T|
|00001240| 68 65 20 70 72 6f 67 72 | 61 6d 6d 65 72 20 72 61 |he progr|ammer ra|
|00001250| 72 65 6c 79 20 6e 65 65 | 64 73 20 0a 61 6c 6c 20 |rely nee|ds .all |
|00001260| 74 68 65 73 65 20 6b 69 | 6e 64 73 20 6f 66 20 63 |these ki|nds of c|
|00001270| 6f 6e 74 72 6f 6c 2c 20 | 62 75 74 20 6f 6e 65 20 |ontrol, |but one |
|00001280| 6f 72 20 74 77 6f 20 6f | 66 20 74 68 65 6d 20 69 |or two o|f them i|
|00001290| 73 20 6f 66 74 65 6e 20 | 6e 65 63 65 73 73 61 72 |s often |necessar|
|000012a0| 79 2e 0a 58 2e 4c 50 0a | 58 2e 49 20 22 54 68 65 |y..X.LP.|X.I "The|
|000012b0| 20 4c 6f 77 65 73 74 20 | 4c 61 79 65 72 3a 22 0a | Lowest |Layer:".|
|000012c0| 58 2e 49 58 20 52 50 43 | 20 22 54 68 65 20 4c 6f |X.IX RPC| "The Lo|
|000012d0| 77 65 73 74 20 4c 61 79 | 65 72 22 0a 54 68 65 20 |west Lay|er".The |
|000012e0| 6c 6f 77 65 73 74 20 6c | 61 79 65 72 20 64 6f 65 |lowest l|ayer doe|
|000012f0| 73 20 61 6c 6c 6f 77 20 | 74 68 65 73 65 20 64 65 |s allow |these de|
|00001300| 74 61 69 6c 73 20 74 6f | 20 62 65 20 63 6f 6e 74 |tails to| be cont|
|00001310| 72 6f 6c 6c 65 64 20 62 | 79 20 74 68 65 20 0a 70 |rolled b|y the .p|
|00001320| 72 6f 67 72 61 6d 6d 65 | 72 2c 20 61 6e 64 20 66 |rogramme|r, and f|
|00001330| 6f 72 20 74 68 61 74 20 | 72 65 61 73 6f 6e 20 69 |or that |reason i|
|00001340| 74 20 69 73 20 6f 66 74 | 65 6e 20 6e 65 63 65 73 |t is oft|en neces|
|00001350| 73 61 72 79 2e 20 20 50 | 72 6f 67 72 61 6d 73 20 |sary. P|rograms |
|00001360| 0a 77 72 69 74 74 65 6e | 20 61 74 20 74 68 69 73 |.written| at this|
|00001370| 20 6c 65 76 65 6c 20 61 | 72 65 20 61 6c 73 6f 20 | level a|re also |
|00001380| 6d 6f 73 74 20 65 66 66 | 69 63 69 65 6e 74 2c 20 |most eff|icient, |
|00001390| 62 75 74 20 74 68 69 73 | 20 69 73 20 72 61 72 65 |but this| is rare|
|000013a0| 6c 79 20 61 0a 72 65 61 | 6c 20 69 73 73 75 65 20 |ly a.rea|l issue |
|000013b0| 5c 28 65 6d 20 73 69 6e | 63 65 20 52 50 43 20 63 |\(em sin|ce RPC c|
|000013c0| 6c 69 65 6e 74 73 20 61 | 6e 64 20 73 65 72 76 65 |lients a|nd serve|
|000013d0| 72 73 20 72 61 72 65 6c | 79 20 67 65 6e 65 72 61 |rs rarel|y genera|
|000013e0| 74 65 20 0a 68 65 61 76 | 79 20 6e 65 74 77 6f 72 |te .heav|y networ|
|000013f0| 6b 20 6c 6f 61 64 73 2e | 0a 58 2e 4c 50 0a 41 6c |k loads.|.X.LP.Al|
|00001400| 74 68 6f 75 67 68 20 74 | 68 69 73 20 64 6f 63 75 |though t|his docu|
|00001410| 6d 65 6e 74 20 6f 6e 6c | 79 20 64 69 73 63 75 73 |ment onl|y discus|
|00001420| 73 65 73 20 74 68 65 20 | 69 6e 74 65 72 66 61 63 |ses the |interfac|
|00001430| 65 20 74 6f 20 43 2c 0a | 72 65 6d 6f 74 65 20 70 |e to C,.|remote p|
|00001440| 72 6f 63 65 64 75 72 65 | 20 63 61 6c 6c 73 20 63 |rocedure| calls c|
|00001450| 61 6e 20 62 65 20 6d 61 | 64 65 20 66 72 6f 6d 20 |an be ma|de from |
|00001460| 61 6e 79 20 6c 61 6e 67 | 75 61 67 65 2e 0a 45 76 |any lang|uage..Ev|
|00001470| 65 6e 20 74 68 6f 75 67 | 68 20 74 68 69 73 20 64 |en thoug|h this d|
|00001480| 6f 63 75 6d 65 6e 74 20 | 64 69 73 63 75 73 73 65 |ocument |discusse|
|00001490| 73 20 52 50 43 0a 77 68 | 65 6e 20 69 74 20 69 73 |s RPC.wh|en it is|
|000014a0| 20 75 73 65 64 20 74 6f | 20 63 6f 6d 6d 75 6e 69 | used to| communi|
|000014b0| 63 61 74 65 0a 62 65 74 | 77 65 65 6e 20 70 72 6f |cate.bet|ween pro|
|000014c0| 63 65 73 73 65 73 20 6f | 6e 20 64 69 66 66 65 72 |cesses o|n differ|
|000014d0| 65 6e 74 20 6d 61 63 68 | 69 6e 65 73 2c 0a 69 74 |ent mach|ines,.it|
|000014e0| 20 77 6f 72 6b 73 20 6a | 75 73 74 20 61 73 20 77 | works j|ust as w|
|000014f0| 65 6c 6c 20 66 6f 72 20 | 63 6f 6d 6d 75 6e 69 63 |ell for |communic|
|00001500| 61 74 69 6f 6e 0a 62 65 | 74 77 65 65 6e 20 64 69 |ation.be|tween di|
|00001510| 66 66 65 72 65 6e 74 20 | 70 72 6f 63 65 73 73 65 |fferent |processe|
|00001520| 73 20 6f 6e 20 74 68 65 | 20 73 61 6d 65 20 6d 61 |s on the| same ma|
|00001530| 63 68 69 6e 65 2e 0a 58 | 2e 0a 58 2e 4e 48 20 32 |chine..X|..X.NH 2|
|00001540| 0a 5c 26 54 68 65 20 52 | 50 43 20 50 61 72 61 64 |.\&The R|PC Parad|
|00001550| 69 67 6d 0a 58 2e 49 58 | 20 22 70 61 72 61 64 69 |igm.X.IX| "paradi|
|00001560| 67 6d 20 6f 66 20 52 50 | 43 22 0a 58 2e 49 58 20 |gm of RP|C".X.IX |
|00001570| 22 52 50 43 22 20 22 70 | 61 72 61 64 69 67 6d 22 |"RPC" "p|aradigm"|
|00001580| 0a 58 2e 4c 50 0a 48 65 | 72 65 20 69 73 20 61 20 |.X.LP.He|re is a |
|00001590| 64 69 61 67 72 61 6d 20 | 6f 66 20 74 68 65 20 52 |diagram |of the R|
|000015a0| 50 43 20 70 61 72 61 64 | 69 67 6d 3a 0a 58 2e 4c |PC parad|igm:.X.L|
|000015b0| 50 0a 58 2e 5c 22 20 54 | 68 69 73 20 69 73 20 61 |P.X.\" T|his is a|
|000015c0| 20 50 49 43 20 64 69 61 | 67 72 61 6d 0a 58 2e 50 | PIC dia|gram.X.P|
|000015d0| 53 0a 4c 31 3a 20 61 72 | 72 6f 77 20 64 6f 77 6e |S.L1: ar|row down|
|000015e0| 20 31 69 20 22 63 6c 69 | 65 6e 74 20 22 20 72 6a | 1i "cli|ent " rj|
|000015f0| 75 73 74 20 22 70 72 6f | 67 72 61 6d 20 22 20 72 |ust "pro|gram " r|
|00001600| 6a 75 73 74 0a 4c 32 3a | 20 6c 69 6e 65 20 72 69 |just.L2:| line ri|
|00001610| 67 68 74 20 31 69 20 22 | 5c 66 49 63 61 6c 6c 72 |ght 1i "|\fIcallr|
|00001620| 70 63 28 29 5c 66 50 22 | 20 22 66 75 6e 63 74 69 |pc()\fP"| "functi|
|00001630| 6f 6e 22 0a 6d 6f 76 65 | 20 75 70 20 31 2e 35 69 |on".move| up 1.5i|
|00001640| 3b 20 6c 69 6e 65 20 64 | 6f 74 74 65 64 20 64 6f |; line d|otted do|
|00001650| 77 6e 20 36 69 3b 20 6d | 6f 76 65 20 75 70 20 34 |wn 6i; m|ove up 4|
|00001660| 2e 35 69 0a 61 72 72 6f | 77 20 72 69 67 68 74 20 |.5i.arro|w right |
|00001670| 31 69 0a 4c 33 3a 20 61 | 72 72 6f 77 20 64 6f 77 |1i.L3: a|rrow dow|
|00001680| 6e 20 31 69 20 22 65 78 | 65 63 75 74 65 20 22 20 |n 1i "ex|ecute " |
|00001690| 72 6a 75 73 74 20 22 72 | 65 71 75 65 73 74 20 22 |rjust "r|equest "|
|000016a0| 20 72 6a 75 73 74 0a 4c | 34 3a 20 61 72 72 6f 77 | rjust.L|4: arrow|
|000016b0| 20 72 69 67 68 74 20 31 | 2e 35 69 20 22 63 61 6c | right 1|.5i "cal|
|000016c0| 6c 22 20 22 73 65 72 76 | 69 63 65 22 0a 4c 35 3a |l" "serv|ice".L5:|
|000016d0| 20 61 72 72 6f 77 20 64 | 6f 77 6e 20 31 69 20 22 | arrow d|own 1i "|
|000016e0| 20 73 65 72 76 69 63 65 | 22 20 6c 6a 75 73 74 20 | service|" ljust |
|000016f0| 22 20 65 78 65 63 75 74 | 65 73 22 20 6c 6a 75 73 |" execut|es" ljus|
|00001700| 74 0a 4c 36 3a 20 61 72 | 72 6f 77 20 6c 65 66 74 |t.L6: ar|row left|
|00001710| 20 31 2e 35 69 20 22 5c | 66 49 72 65 74 75 72 6e | 1.5i "\|fIreturn|
|00001720| 5c 66 50 22 20 22 61 6e | 73 77 65 72 22 0a 4c 37 |\fP" "an|swer".L7|
|00001730| 3a 20 61 72 72 6f 77 20 | 64 6f 77 6e 20 31 69 20 |: arrow |down 1i |
|00001740| 22 72 65 71 75 65 73 74 | 20 22 20 72 6a 75 73 74 |"request| " rjust|
|00001750| 20 22 63 6f 6d 70 6c 65 | 74 65 64 20 22 20 72 6a | "comple|ted " rj|
|00001760| 75 73 74 0a 4c 38 3a 20 | 6c 69 6e 65 20 6c 65 66 |ust.L8: |line lef|
|00001770| 74 20 31 69 0a 61 72 72 | 6f 77 20 6c 65 66 74 20 |t 1i.arr|ow left |
|00001780| 31 69 20 22 5c 66 49 72 | 65 74 75 72 6e 5c 66 50 |1i "\fIr|eturn\fP|
|00001790| 22 20 22 72 65 70 6c 79 | 22 0a 4c 39 3a 20 61 72 |" "reply|".L9: ar|
|000017a0| 72 6f 77 20 64 6f 77 6e | 20 31 69 20 22 70 72 6f |row down| 1i "pro|
|000017b0| 67 72 61 6d 20 22 20 72 | 6a 75 73 74 20 22 63 6f |gram " r|just "co|
|000017c0| 6e 74 69 6e 75 65 73 20 | 22 20 72 6a 75 73 74 0a |ntinues |" rjust.|
|000017d0| 6c 69 6e 65 20 64 61 73 | 68 65 64 20 64 6f 77 6e |line das|hed down|
|000017e0| 20 66 72 6f 6d 20 4c 32 | 20 74 6f 20 4c 39 0a 6c | from L2| to L9.l|
|000017f0| 69 6e 65 20 64 61 73 68 | 65 64 20 64 6f 77 6e 20 |ine dash|ed down |
|00001800| 66 72 6f 6d 20 4c 34 20 | 74 6f 20 4c 37 0a 6c 69 |from L4 |to L7.li|
|00001810| 6e 65 20 64 61 73 68 65 | 64 20 75 70 20 31 69 20 |ne dashe|d up 1i |
|00001820| 66 72 6f 6d 20 4c 33 20 | 22 73 65 72 76 69 63 65 |from L3 |"service|
|00001830| 20 22 20 72 6a 75 73 74 | 20 22 64 61 65 6d 6f 6e | " rjust| "daemon|
|00001840| 20 22 20 72 6a 75 73 74 | 0a 61 72 72 6f 77 20 64 | " rjust|.arrow d|
|00001850| 61 73 68 65 64 20 64 6f | 77 6e 20 31 69 20 66 72 |ashed do|wn 1i fr|
|00001860| 6f 6d 20 4c 38 0a 6d 6f | 76 65 20 72 69 67 68 74 |om L8.mo|ve right|
|00001870| 20 31 69 20 66 72 6f 6d | 20 4c 33 0a 62 6f 78 20 | 1i from| L3.box |
|00001880| 69 6e 76 69 73 20 22 4d | 61 63 68 69 6e 65 20 42 |invis "M|achine B|
|00001890| 22 0a 6d 6f 76 65 20 6c | 65 66 74 20 30 2e 37 69 |".move l|eft 0.7i|
|000018a0| 20 66 72 6f 6d 20 4c 32 | 3b 20 6d 6f 76 65 20 64 | from L2|; move d|
|000018b0| 6f 77 6e 0a 62 6f 78 20 | 69 6e 76 69 73 20 22 4d |own.box |invis "M|
|000018c0| 61 63 68 69 6e 65 20 41 | 22 0a 58 2e 50 45 0a 58 |achine A|".X.PE.X|
|000018d0| 2e 0a 58 2e 4b 53 0a 58 | 2e 4e 48 20 31 0a 5c 26 |..X.KS.X|.NH 1.\&|
|000018e0| 48 69 67 68 65 72 20 4c | 61 79 65 72 73 20 6f 66 |Higher L|ayers of|
|000018f0| 20 52 50 43 0a 58 2e 4e | 48 20 32 0a 5c 26 48 69 | RPC.X.N|H 2.\&Hi|
|00001900| 67 68 65 73 74 20 4c 61 | 79 65 72 0a 58 2e 49 58 |ghest La|yer.X.IX|
|00001910| 20 22 68 69 67 68 65 73 | 74 20 6c 61 79 65 72 20 | "highes|t layer |
|00001920| 6f 66 20 52 50 43 22 0a | 58 2e 49 58 20 52 50 43 |of RPC".|X.IX RPC|
|00001930| 20 22 68 69 67 68 65 73 | 74 20 6c 61 79 65 72 22 | "highes|t layer"|
|00001940| 0a 58 2e 4c 50 0a 49 6d | 61 67 69 6e 65 20 79 6f |.X.LP.Im|agine yo|
|00001950| 75 27 72 65 20 77 72 69 | 74 69 6e 67 20 61 20 70 |u're wri|ting a p|
|00001960| 72 6f 67 72 61 6d 20 74 | 68 61 74 20 6e 65 65 64 |rogram t|hat need|
|00001970| 73 20 74 6f 20 6b 6e 6f | 77 0a 68 6f 77 20 6d 61 |s to kno|w.how ma|
|00001980| 6e 79 20 75 73 65 72 73 | 20 61 72 65 20 6c 6f 67 |ny users| are log|
|00001990| 67 65 64 20 69 6e 74 6f | 20 61 20 72 65 6d 6f 74 |ged into| a remot|
|000019a0| 65 20 6d 61 63 68 69 6e | 65 2e 0a 59 6f 75 20 63 |e machin|e..You c|
|000019b0| 61 6e 20 64 6f 20 74 68 | 69 73 20 62 79 20 63 61 |an do th|is by ca|
|000019c0| 6c 6c 69 6e 67 20 74 68 | 65 20 52 50 43 20 6c 69 |lling th|e RPC li|
|000019d0| 62 72 61 72 79 20 72 6f | 75 74 69 6e 65 0a 58 2e |brary ro|utine.X.|
|000019e0| 49 58 20 72 75 73 65 72 | 73 20 22 22 20 22 22 20 |IX ruser|s "" "" |
|000019f0| 22 5c 66 49 72 75 73 65 | 72 73 5c 66 50 22 20 50 |"\fIruse|rs\fP" P|
|00001a00| 41 47 45 20 4d 41 4a 4f | 52 0a 58 2e 49 20 72 6e |AGE MAJO|R.X.I rn|
|00001a10| 75 73 65 72 73 20 2c 0a | 61 73 20 69 6c 6c 75 73 |users ,.|as illus|
|00001a20| 74 72 61 74 65 64 20 62 | 65 6c 6f 77 3a 0a 58 2e |trated b|elow:.X.|
|00001a30| 69 65 20 74 20 2e 44 53 | 0a 58 2e 65 6c 20 2e 44 |ie t .DS|.X.el .D|
|00001a40| 53 20 4c 0a 58 2e 66 74 | 20 43 57 0a 23 69 6e 63 |S L.X.ft| CW.#inc|
|00001a50| 6c 75 64 65 20 3c 73 74 | 64 69 6f 2e 68 3e 0a 0a |lude <st|dio.h>..|
|00001a60| 6d 61 69 6e 28 61 72 67 | 63 2c 20 61 72 67 76 29 |main(arg|c, argv)|
|00001a70| 0a 09 69 6e 74 20 61 72 | 67 63 3b 0a 09 63 68 61 |..int ar|gc;..cha|
|00001a80| 72 20 2a 2a 61 72 67 76 | 3b 0a 7b 0a 09 69 6e 74 |r **argv|;.{..int|
|00001a90| 20 6e 75 6d 3b 0a 0a 09 | 69 66 20 28 61 72 67 63 | num;...|if (argc|
|00001aa0| 20 3c 20 32 29 20 7b 0a | 09 09 66 70 72 69 6e 74 | < 2) {.|..fprint|
|00001ab0| 66 28 73 74 64 65 72 72 | 2c 20 22 75 73 61 67 65 |f(stderr|, "usage|
|00001ac0| 3a 20 72 6e 75 73 65 72 | 73 20 68 6f 73 74 6e 61 |: rnuser|s hostna|
|00001ad0| 6d 65 5c 65 6e 22 29 3b | 0a 09 09 65 78 69 74 28 |me\en");|...exit(|
|00001ae0| 31 29 3b 0a 09 7d 0a 09 | 69 66 20 28 28 6e 75 6d |1);..}..|if ((num|
|00001af0| 20 3d 20 72 6e 75 73 65 | 72 73 28 61 72 67 76 5b | = rnuse|rs(argv[|
|00001b00| 31 5d 29 29 20 3c 20 30 | 29 20 7b 0a 09 09 66 70 |1])) < 0|) {...fp|
|00001b10| 72 69 6e 74 66 28 73 74 | 64 65 72 72 2c 20 22 65 |rintf(st|derr, "e|
|00001b20| 72 72 6f 72 3a 20 72 6e | 75 73 65 72 73 5c 65 6e |rror: rn|users\en|
|00001b30| 22 29 3b 0a 09 09 65 78 | 69 74 28 2d 31 29 3b 0a |");...ex|it(-1);.|
|00001b40| 09 7d 0a 09 70 72 69 6e | 74 66 28 22 25 64 20 75 |.}..prin|tf("%d u|
|00001b50| 73 65 72 73 20 6f 6e 20 | 25 73 5c 65 6e 22 2c 20 |sers on |%s\en", |
|00001b60| 6e 75 6d 2c 20 61 72 67 | 76 5b 31 5d 29 3b 0a 09 |num, arg|v[1]);..|
|00001b70| 65 78 69 74 28 30 29 3b | 0a 7d 0a 58 2e 44 45 0a |exit(0);|.}.X.DE.|
|00001b80| 58 2e 4b 45 0a 52 50 43 | 20 6c 69 62 72 61 72 79 |X.KE.RPC| library|
|00001b90| 20 72 6f 75 74 69 6e 65 | 73 20 73 75 63 68 20 61 | routine|s such a|
|00001ba0| 73 0a 58 2e 49 20 72 6e | 75 73 65 72 73 0a 61 72 |s.X.I rn|users.ar|
|00001bb0| 65 20 69 6e 20 74 68 65 | 20 52 50 43 20 73 65 72 |e in the| RPC ser|
|00001bc0| 76 69 63 65 73 20 6c 69 | 62 72 61 72 79 0a 58 2e |vices li|brary.X.|
|00001bd0| 49 20 6c 69 62 72 70 63 | 73 76 63 2e 61 0a 54 68 |I librpc|svc.a.Th|
|00001be0| 75 73 2c 20 74 68 65 20 | 70 72 6f 67 72 61 6d 20 |us, the |program |
|00001bf0| 61 62 6f 76 65 20 73 68 | 6f 75 6c 64 20 62 65 20 |above sh|ould be |
|00001c00| 63 6f 6d 70 69 6c 65 64 | 20 77 69 74 68 0a 58 2e |compiled| with.X.|
|00001c10| 44 53 0a 58 2e 66 74 20 | 43 57 0a 25 20 63 63 20 |DS.X.ft |CW.% cc |
|00001c20| 5c 66 49 70 72 6f 67 72 | 61 6d 5c 66 50 2e 63 20 |\fIprogr|am\fP.c |
|00001c30| 2d 6c 72 70 63 73 76 63 | 0a 58 2e 44 45 0a 58 2e |-lrpcsvc|.X.DE.X.|
|00001c40| 49 20 72 6e 75 73 65 72 | 73 20 2c 0a 6c 69 6b 65 |I rnuser|s ,.like|
|00001c50| 20 74 68 65 20 6f 74 68 | 65 72 20 52 50 43 20 6c | the oth|er RPC l|
|00001c60| 69 62 72 61 72 79 20 72 | 6f 75 74 69 6e 65 73 2c |ibrary r|outines,|
|00001c70| 20 69 73 20 64 6f 63 75 | 6d 65 6e 74 65 64 20 69 | is docu|mented i|
|00001c80| 6e 20 73 65 63 74 69 6f | 6e 20 33 52 20 0a 6f 66 |n sectio|n 3R .of|
|00001c90| 20 74 68 65 0a 58 2e 49 | 20 22 53 79 73 74 65 6d | the.X.I| "System|
|00001ca0| 20 49 6e 74 65 72 66 61 | 63 65 20 4d 61 6e 75 61 | Interfa|ce Manua|
|00001cb0| 6c 20 66 6f 72 20 74 68 | 65 20 53 75 6e 20 57 6f |l for th|e Sun Wo|
|00001cc0| 72 6b 73 74 61 74 69 6f | 6e 22 20 2c 0a 74 68 65 |rkstatio|n" ,.the|
|00001cd0| 20 73 61 6d 65 20 73 65 | 63 74 69 6f 6e 20 77 68 | same se|ction wh|
|00001ce0| 69 63 68 20 64 6f 63 75 | 6d 65 6e 74 73 20 74 68 |ich docu|ments th|
|00001cf0| 65 20 73 74 61 6e 64 61 | 72 64 20 53 75 6e 20 52 |e standa|rd Sun R|
|00001d00| 50 43 20 73 65 72 76 69 | 63 65 73 2e 20 20 0a 58 |PC servi|ces. .X|
|00001d10| 2e 49 58 20 22 52 50 43 | 20 53 65 72 76 69 63 65 |.IX "RPC| Service|
|00001d20| 73 22 0a 53 65 65 20 74 | 68 65 20 0a 58 2e 49 20 |s".See t|he .X.I |
|00001d30| 69 6e 74 72 6f 20 28 33 | 52 29 0a 6d 61 6e 75 61 |intro (3|R).manua|
|00001d40| 6c 20 70 61 67 65 20 66 | 6f 72 20 61 6e 20 65 78 |l page f|or an ex|
|00001d50| 70 6c 61 6e 61 74 69 6f | 6e 20 6f 66 20 74 68 65 |planatio|n of the|
|00001d60| 20 64 6f 63 75 6d 65 6e | 74 61 74 69 6f 6e 20 73 | documen|tation s|
|00001d70| 74 72 61 74 65 67 79 20 | 0a 66 6f 72 20 74 68 65 |trategy |.for the|
|00001d80| 73 65 20 73 65 72 76 69 | 63 65 73 20 61 6e 64 20 |se servi|ces and |
|00001d90| 74 68 65 69 72 20 52 50 | 43 20 70 72 6f 74 6f 63 |their RP|C protoc|
|00001da0| 6f 6c 73 2e 0a 58 2e 4c | 50 0a 48 65 72 65 20 61 |ols..X.L|P.Here a|
|00001db0| 72 65 20 73 6f 6d 65 20 | 6f 66 20 74 68 65 20 52 |re some |of the R|
|00001dc0| 50 43 20 73 65 72 76 69 | 63 65 20 6c 69 62 72 61 |PC servi|ce libra|
|00001dd0| 72 79 20 72 6f 75 74 69 | 6e 65 73 20 61 76 61 69 |ry routi|nes avai|
|00001de0| 6c 61 62 6c 65 20 74 6f | 20 74 68 65 20 0a 43 20 |lable to| the .C |
|00001df0| 70 72 6f 67 72 61 6d 6d | 65 72 3a 0a 58 2e 54 53 |programm|er:.X.TS|
|00001e00| 0a 62 6f 78 20 74 61 62 | 20 28 26 29 20 3b 0a 63 |.box tab| (&) ;.c|
|00001e10| 66 49 20 63 66 49 0a 6c | 66 4c 20 6c 20 2e 0a 52 |fI cfI.l|fL l ..R|
|00001e20| 6f 75 74 69 6e 65 26 44 | 65 73 63 72 69 70 74 69 |outine&D|escripti|
|00001e30| 6f 6e 0a 5f 0a 58 2e 73 | 70 2e 35 0a 72 6e 75 73 |on._.X.s|p.5.rnus|
|00001e40| 65 72 73 26 52 65 74 75 | 72 6e 20 6e 75 6d 62 65 |ers&Retu|rn numbe|
|00001e50| 72 20 6f 66 20 75 73 65 | 72 73 20 6f 6e 20 72 65 |r of use|rs on re|
|00001e60| 6d 6f 74 65 20 6d 61 63 | 68 69 6e 65 0a 72 75 73 |mote mac|hine.rus|
|00001e70| 65 72 73 26 52 65 74 75 | 72 6e 20 69 6e 66 6f 72 |ers&Retu|rn infor|
|00001e80| 6d 61 74 69 6f 6e 20 61 | 62 6f 75 74 20 75 73 65 |mation a|bout use|
|00001e90| 72 73 20 6f 6e 20 72 65 | 6d 6f 74 65 20 6d 61 63 |rs on re|mote mac|
|00001ea0| 68 69 6e 65 0a 68 61 76 | 65 64 69 73 6b 26 44 65 |hine.hav|edisk&De|
|00001eb0| 74 65 72 6d 69 6e 65 20 | 69 66 20 72 65 6d 6f 74 |termine |if remot|
|00001ec0| 65 20 6d 61 63 68 69 6e | 65 20 68 61 73 20 64 69 |e machin|e has di|
|00001ed0| 73 6b 0a 72 73 74 61 74 | 73 26 47 65 74 20 70 65 |sk.rstat|s&Get pe|
|00001ee0| 72 66 6f 72 6d 61 6e 63 | 65 20 64 61 74 61 20 66 |rformanc|e data f|
|00001ef0| 72 6f 6d 20 72 65 6d 6f | 74 65 20 6b 65 72 6e 65 |rom remo|te kerne|
|00001f00| 6c 0a 72 77 61 6c 6c 26 | 57 72 69 74 65 20 74 6f |l.rwall&|Write to|
|00001f10| 20 73 70 65 63 69 66 69 | 65 64 20 72 65 6d 6f 74 | specifi|ed remot|
|00001f20| 65 20 6d 61 63 68 69 6e | 65 73 0a 79 70 70 61 73 |e machin|es.yppas|
|00001f30| 73 77 64 26 55 70 64 61 | 74 65 20 75 73 65 72 20 |swd&Upda|te user |
|00001f40| 70 61 73 73 77 6f 72 64 | 20 69 6e 20 59 65 6c 6c |password| in Yell|
|00001f50| 6f 77 20 50 61 67 65 73 | 0a 58 2e 54 45 0a 58 2e |ow Pages|.X.TE.X.|
|00001f60| 4c 50 0a 4f 74 68 65 72 | 20 52 50 43 20 73 65 72 |LP.Other| RPC ser|
|00001f70| 76 69 63 65 73 20 5c 28 | 65 6d 20 66 6f 72 20 65 |vices \(|em for e|
|00001f80| 78 61 6d 70 6c 65 0a 58 | 2e 49 20 65 74 68 65 72 |xample.X|.I ether|
|00001f90| 0a 58 2e 49 20 6d 6f 75 | 6e 74 0a 58 2e 49 20 72 |.X.I mou|nt.X.I r|
|00001fa0| 71 75 6f 74 61 0a 61 6e | 64 0a 58 2e 49 20 73 70 |quota.an|d.X.I sp|
|00001fb0| 72 61 79 0a 5c 28 65 6d | 20 61 72 65 20 6e 6f 74 |ray.\(em| are not|
|00001fc0| 20 61 76 61 69 6c 61 62 | 6c 65 20 74 6f 20 74 68 | availab|le to th|
|00001fd0| 65 20 43 20 70 72 6f 67 | 72 61 6d 6d 65 72 20 61 |e C prog|rammer a|
|00001fe0| 73 20 6c 69 62 72 61 72 | 79 20 72 6f 75 74 69 6e |s librar|y routin|
|00001ff0| 65 73 2e 0a 54 68 65 79 | 20 64 6f 2c 20 68 6f 77 |es..They| do, how|
|00002000| 65 76 65 72 2c 0a 68 61 | 76 65 20 52 50 43 20 70 |ever,.ha|ve RPC p|
|00002010| 72 6f 67 72 61 6d 20 6e | 75 6d 62 65 72 73 20 73 |rogram n|umbers s|
|00002020| 6f 20 74 68 65 79 20 63 | 61 6e 20 62 65 20 69 6e |o they c|an be in|
|00002030| 76 6f 6b 65 64 20 77 69 | 74 68 0a 58 2e 49 20 63 |voked wi|th.X.I c|
|00002040| 61 6c 6c 72 70 63 0a 77 | 68 69 63 68 20 77 69 6c |allrpc.w|hich wil|
|00002050| 6c 20 62 65 20 64 69 73 | 63 75 73 73 65 64 20 69 |l be dis|cussed i|
|00002060| 6e 20 74 68 65 20 6e 65 | 78 74 20 73 65 63 74 69 |n the ne|xt secti|
|00002070| 6f 6e 2e 20 20 4d 6f 73 | 74 20 6f 66 20 74 68 65 |on. Mos|t of the|
|00002080| 6d 20 61 6c 73 6f 20 0a | 68 61 76 65 20 63 6f 6d |m also .|have com|
|00002090| 70 69 6c 61 62 6c 65 20 | 0a 58 2e 49 20 72 70 63 |pilable |.X.I rpc|
|000020a0| 67 65 6e 20 28 31 29 0a | 70 72 6f 74 6f 63 6f 6c |gen (1).|protocol|
|000020b0| 20 64 65 73 63 72 69 70 | 74 69 6f 6e 20 66 69 6c | descrip|tion fil|
|000020c0| 65 73 2e 20 20 28 54 68 | 65 0a 58 2e 49 20 72 70 |es. (Th|e.X.I rp|
|000020d0| 63 67 65 6e 0a 70 72 6f | 74 6f 63 6f 6c 20 63 6f |cgen.pro|tocol co|
|000020e0| 6d 70 69 6c 65 72 20 72 | 61 64 69 63 61 6c 6c 79 |mpiler r|adically|
|000020f0| 20 73 69 6d 70 6c 69 66 | 69 65 73 20 74 68 65 20 | simplif|ies the |
|00002100| 70 72 6f 63 65 73 73 20 | 6f 66 20 64 65 76 65 6c |process |of devel|
|00002110| 6f 70 69 6e 67 0a 6e 65 | 74 77 6f 72 6b 20 61 70 |oping.ne|twork ap|
|00002120| 70 6c 69 63 61 74 69 6f | 6e 73 2e 20 20 53 65 65 |plicatio|ns. See|
|00002130| 20 74 68 65 0a 5c 66 49 | 5c 66 28 4c 42 72 70 63 | the.\fI|\f(LBrpc|
|00002140| 67 65 6e 5c 66 50 20 50 | 72 6f 67 72 61 6d 6d 69 |gen\fP P|rogrammi|
|00002150| 6e 67 20 47 75 69 64 65 | 5c 66 52 0a 63 68 61 70 |ng Guide|\fR.chap|
|00002160| 74 65 72 20 66 6f 72 20 | 64 65 74 61 69 6c 65 64 |ter for |detailed|
|00002170| 20 69 6e 66 6f 72 6d 61 | 74 69 6f 6e 20 61 62 6f | informa|tion abo|
|00002180| 75 74 20 0a 58 2e 49 20 | 72 70 63 67 65 6e 20 0a |ut .X.I |rpcgen .|
|00002190| 61 6e 64 20 0a 58 2e 49 | 20 72 70 63 67 65 6e 20 |and .X.I| rpcgen |
|000021a0| 0a 70 72 6f 74 6f 63 6f | 6c 20 64 65 73 63 72 69 |.protoco|l descri|
|000021b0| 70 74 69 6f 6e 20 66 69 | 6c 65 73 29 2e 0a 58 2e |ption fi|les)..X.|
|000021c0| 0a 58 2e 4b 53 0a 58 2e | 4e 48 20 32 0a 5c 26 49 |.X.KS.X.|NH 2.\&I|
|000021d0| 6e 74 65 72 6d 65 64 69 | 61 74 65 20 4c 61 79 65 |ntermedi|ate Laye|
|000021e0| 72 0a 58 2e 49 58 20 22 | 69 6e 74 65 72 6d 65 64 |r.X.IX "|intermed|
|000021f0| 69 61 74 65 20 6c 61 79 | 65 72 20 6f 66 20 52 50 |iate lay|er of RP|
|00002200| 43 22 0a 58 2e 49 58 20 | 22 52 50 43 22 20 22 69 |C".X.IX |"RPC" "i|
|00002210| 6e 74 65 72 6d 65 64 69 | 61 74 65 20 6c 61 79 65 |ntermedi|ate laye|
|00002220| 72 22 0a 58 2e 4c 50 0a | 54 68 65 20 73 69 6d 70 |r".X.LP.|The simp|
|00002230| 6c 65 73 74 20 69 6e 74 | 65 72 66 61 63 65 2c 20 |lest int|erface, |
|00002240| 77 68 69 63 68 20 65 78 | 70 6c 69 63 69 74 6c 79 |which ex|plicitly|
|00002250| 20 6d 61 6b 65 73 20 52 | 50 43 20 63 61 6c 6c 73 | makes R|PC calls|
|00002260| 2c 20 75 73 65 73 20 74 | 68 65 20 0a 66 75 6e 63 |, uses t|he .func|
|00002270| 74 69 6f 6e 73 0a 58 2e | 49 20 63 61 6c 6c 72 70 |tions.X.|I callrp|
|00002280| 63 0a 61 6e 64 0a 58 2e | 49 20 72 65 67 69 73 74 |c.and.X.|I regist|
|00002290| 65 72 72 70 63 0a 55 73 | 69 6e 67 20 74 68 69 73 |errpc.Us|ing this|
|000022a0| 20 6d 65 74 68 6f 64 2c | 20 74 68 65 20 6e 75 6d | method,| the num|
|000022b0| 62 65 72 20 6f 66 20 72 | 65 6d 6f 74 65 20 75 73 |ber of r|emote us|
|000022c0| 65 72 73 20 63 61 6e 20 | 62 65 20 67 6f 74 74 65 |ers can |be gotte|
|000022d0| 6e 20 61 73 20 66 6f 6c | 6c 6f 77 73 3a 0a 58 2e |n as fol|lows:.X.|
|000022e0| 69 65 20 74 20 2e 44 53 | 0a 58 2e 65 6c 20 2e 44 |ie t .DS|.X.el .D|
|000022f0| 53 20 4c 0a 23 69 6e 63 | 6c 75 64 65 20 3c 73 74 |S L.#inc|lude <st|
|00002300| 64 69 6f 2e 68 3e 0a 23 | 69 6e 63 6c 75 64 65 20 |dio.h>.#|include |
|00002310| 3c 72 70 63 2f 72 70 63 | 2e 68 3e 0a 23 69 6e 63 |<rpc/rpc|.h>.#inc|
|00002320| 6c 75 64 65 20 3c 75 74 | 6d 70 2e 68 3e 0a 23 69 |lude <ut|mp.h>.#i|
|00002330| 6e 63 6c 75 64 65 20 3c | 72 70 63 73 76 63 2f 72 |nclude <|rpcsvc/r|
|00002340| 75 73 65 72 73 2e 68 3e | 0a 0a 6d 61 69 6e 28 61 |users.h>|..main(a|
|00002350| 72 67 63 2c 20 61 72 67 | 76 29 0a 09 69 6e 74 20 |rgc, arg|v)..int |
|00002360| 61 72 67 63 3b 0a 09 63 | 68 61 72 20 2a 2a 61 72 |argc;..c|har **ar|
|00002370| 67 76 3b 0a 7b 0a 09 75 | 6e 73 69 67 6e 65 64 20 |gv;.{..u|nsigned |
|00002380| 6c 6f 6e 67 20 6e 75 73 | 65 72 73 3b 0a 09 69 6e |long nus|ers;..in|
|00002390| 74 20 73 74 61 74 3b 0a | 0a 09 69 66 20 28 61 72 |t stat;.|..if (ar|
|000023a0| 67 63 20 3c 20 32 29 20 | 7b 0a 09 09 66 70 72 69 |gc < 2) |{...fpri|
|000023b0| 6e 74 66 28 73 74 64 65 | 72 72 2c 20 22 75 73 61 |ntf(stde|rr, "usa|
|000023c0| 67 65 3a 20 6e 75 73 65 | 72 73 20 68 6f 73 74 6e |ge: nuse|rs hostn|
|000023d0| 61 6d 65 5c 65 6e 22 29 | 3b 0a 09 09 65 78 69 74 |ame\en")|;...exit|
|000023e0| 28 2d 31 29 3b 0a 09 7d | 0a 09 69 66 20 28 73 74 |(-1);..}|..if (st|
|000023f0| 61 74 20 3d 20 63 61 6c | 6c 72 70 63 28 61 72 67 |at = cal|lrpc(arg|
|00002400| 76 5b 31 5d 2c 0a 09 20 | 20 52 55 53 45 52 53 50 |v[1],.. | RUSERSP|
|00002410| 52 4f 47 2c 20 52 55 53 | 45 52 53 56 45 52 53 2c |ROG, RUS|ERSVERS,|
|00002420| 20 52 55 53 45 52 53 50 | 52 4f 43 5f 4e 55 4d 2c | RUSERSP|ROC_NUM,|
|00002430| 0a 09 20 20 78 64 72 5f | 76 6f 69 64 2c 20 30 2c |.. xdr_|void, 0,|
|00002440| 20 78 64 72 5f 75 5f 6c | 6f 6e 67 2c 20 26 6e 75 | xdr_u_l|ong, &nu|
|00002450| 73 65 72 73 29 20 21 3d | 20 30 29 20 7b 0a 09 09 |sers) !=| 0) {...|
|00002460| 63 6c 6e 74 5f 70 65 72 | 72 6e 6f 28 73 74 61 74 |clnt_per|rno(stat|
|00002470| 29 3b 0a 09 09 65 78 69 | 74 28 31 29 3b 0a 09 7d |);...exi|t(1);..}|
|00002480| 0a 09 70 72 69 6e 74 66 | 28 22 25 64 20 75 73 65 |..printf|("%d use|
|00002490| 72 73 20 6f 6e 20 25 73 | 5c 65 6e 22 2c 20 6e 75 |rs on %s|\en", nu|
|000024a0| 73 65 72 73 2c 20 61 72 | 67 76 5b 31 5d 29 3b 0a |sers, ar|gv[1]);.|
|000024b0| 09 65 78 69 74 28 30 29 | 3b 0a 7d 0a 58 2e 44 45 |.exit(0)|;.}.X.DE|
|000024c0| 0a 58 2e 4b 45 0a 45 61 | 63 68 20 52 50 43 20 70 |.X.KE.Ea|ch RPC p|
|000024d0| 72 6f 63 65 64 75 72 65 | 20 69 73 20 75 6e 69 71 |rocedure| is uniq|
|000024e0| 75 65 6c 79 20 64 65 66 | 69 6e 65 64 20 62 79 20 |uely def|ined by |
|000024f0| 61 20 70 72 6f 67 72 61 | 6d 20 6e 75 6d 62 65 72 |a progra|m number|
|00002500| 2c 20 0a 76 65 72 73 69 | 6f 6e 20 6e 75 6d 62 65 |, .versi|on numbe|
|00002510| 72 2c 20 61 6e 64 20 70 | 72 6f 63 65 64 75 72 65 |r, and p|rocedure|
|00002520| 20 6e 75 6d 62 65 72 2e | 20 20 54 68 65 20 70 72 | number.| The pr|
|00002530| 6f 67 72 61 6d 20 6e 75 | 6d 62 65 72 20 0a 73 70 |ogram nu|mber .sp|
|00002540| 65 63 69 66 69 65 73 20 | 61 20 67 72 6f 75 70 20 |ecifies |a group |
|00002550| 6f 66 20 72 65 6c 61 74 | 65 64 20 72 65 6d 6f 74 |of relat|ed remot|
|00002560| 65 20 70 72 6f 63 65 64 | 75 72 65 73 2c 20 65 61 |e proced|ures, ea|
|00002570| 63 68 20 6f 66 20 0a 77 | 68 69 63 68 20 68 61 73 |ch of .w|hich has|
|00002580| 20 61 20 64 69 66 66 65 | 72 65 6e 74 20 70 72 6f | a diffe|rent pro|
|00002590| 63 65 64 75 72 65 20 6e | 75 6d 62 65 72 2e 20 20 |cedure n|umber. |
|000025a0| 45 61 63 68 20 70 72 6f | 67 72 61 6d 20 61 6c 73 |Each pro|gram als|
|000025b0| 6f 20 0a 68 61 73 20 61 | 20 76 65 72 73 69 6f 6e |o .has a| version|
|000025c0| 20 6e 75 6d 62 65 72 2c | 20 73 6f 20 77 68 65 6e | number,| so when|
|000025d0| 20 61 20 6d 69 6e 6f 72 | 20 63 68 61 6e 67 65 20 | a minor| change |
|000025e0| 69 73 20 6d 61 64 65 20 | 74 6f 20 61 20 0a 72 65 |is made |to a .re|
|000025f0| 6d 6f 74 65 20 73 65 72 | 76 69 63 65 20 28 61 64 |mote ser|vice (ad|
|00002600| 64 69 6e 67 20 61 20 6e | 65 77 20 70 72 6f 63 65 |ding a n|ew proce|
|00002610| 64 75 72 65 2c 20 66 6f | 72 20 65 78 61 6d 70 6c |dure, fo|r exampl|
|00002620| 65 29 2c 20 61 20 6e 65 | 77 20 0a 70 72 6f 67 72 |e), a ne|w .progr|
|00002630| 61 6d 20 6e 75 6d 62 65 | 72 20 64 6f 65 73 6e 27 |am numbe|r doesn'|
|00002640| 74 20 68 61 76 65 20 74 | 6f 20 62 65 20 61 73 73 |t have t|o be ass|
|00002650| 69 67 6e 65 64 2e 20 20 | 57 68 65 6e 20 79 6f 75 |igned. |When you|
|00002660| 20 77 61 6e 74 20 0a 74 | 6f 20 63 61 6c 6c 20 61 | want .t|o call a|
|00002670| 20 70 72 6f 63 65 64 75 | 72 65 20 74 6f 20 66 69 | procedu|re to fi|
|00002680| 6e 64 20 74 68 65 20 6e | 75 6d 62 65 72 20 6f 66 |nd the n|umber of|
|00002690| 20 72 65 6d 6f 74 65 20 | 75 73 65 72 73 2c 20 79 | remote |users, y|
|000026a0| 6f 75 20 0a 6c 6f 6f 6b | 20 75 70 20 74 68 65 20 |ou .look| up the |
|000026b0| 61 70 70 72 6f 70 72 69 | 61 74 65 20 70 72 6f 67 |appropri|ate prog|
|000026c0| 72 61 6d 2c 20 76 65 72 | 73 69 6f 6e 20 61 6e 64 |ram, ver|sion and|
|000026d0| 20 70 72 6f 63 65 64 75 | 72 65 20 6e 75 6d 62 65 | procedu|re numbe|
|000026e0| 72 73 0a 69 6e 20 61 20 | 6d 61 6e 75 61 6c 2c 20 |rs.in a |manual, |
|000026f0| 6a 75 73 74 20 61 73 20 | 79 6f 75 20 6c 6f 6f 6b |just as |you look|
|00002700| 20 75 70 20 74 68 65 20 | 6e 61 6d 65 20 6f 66 20 | up the |name of |
|00002710| 61 20 6d 65 6d 6f 72 79 | 20 61 6c 6c 6f 63 61 74 |a memory| allocat|
|00002720| 6f 72 20 0a 77 68 65 6e | 20 79 6f 75 20 77 61 6e |or .when| you wan|
|00002730| 74 20 74 6f 20 61 6c 6c | 6f 63 61 74 65 20 6d 65 |t to all|ocate me|
|00002740| 6d 6f 72 79 2e 0a 58 2e | 4c 50 0a 54 68 65 20 73 |mory..X.|LP.The s|
|00002750| 69 6d 70 6c 65 73 74 20 | 77 61 79 20 6f 66 20 6d |implest |way of m|
|00002760| 61 6b 69 6e 67 20 72 65 | 6d 6f 74 65 20 70 72 6f |aking re|mote pro|
|00002770| 63 65 64 75 72 65 20 63 | 61 6c 6c 73 20 69 73 20 |cedure c|alls is |
|00002780| 77 69 74 68 20 74 68 65 | 20 74 68 65 20 52 50 43 |with the| the RPC|
|00002790| 20 0a 6c 69 62 72 61 72 | 79 20 72 6f 75 74 69 6e | .librar|y routin|
|000027a0| 65 0a 58 2e 49 20 63 61 | 6c 6c 72 70 63 0a 49 74 |e.X.I ca|llrpc.It|
|000027b0| 20 68 61 73 20 65 69 67 | 68 74 20 70 61 72 61 6d | has eig|ht param|
|000027c0| 65 74 65 72 73 2e 20 20 | 54 68 65 20 66 69 72 73 |eters. |The firs|
|000027d0| 74 20 69 73 20 74 68 65 | 20 6e 61 6d 65 20 6f 66 |t is the| name of|
|000027e0| 20 74 68 65 20 72 65 6d | 6f 74 65 20 73 65 72 76 | the rem|ote serv|
|000027f0| 65 72 20 0a 6d 61 63 68 | 69 6e 65 2e 20 20 54 68 |er .mach|ine. Th|
|00002800| 65 20 6e 65 78 74 20 74 | 68 72 65 65 20 70 61 72 |e next t|hree par|
|00002810| 61 6d 65 74 65 72 73 20 | 61 72 65 20 74 68 65 20 |ameters |are the |
|00002820| 70 72 6f 67 72 61 6d 2c | 20 76 65 72 73 69 6f 6e |program,| version|
|00002830| 2c 20 61 6e 64 20 70 72 | 6f 63 65 64 75 72 65 20 |, and pr|ocedure |
|00002840| 0a 6e 75 6d 62 65 72 73 | 5c 28 65 6d 74 6f 67 65 |.numbers|\(emtoge|
|00002850| 74 68 65 72 20 74 68 65 | 79 20 69 64 65 6e 74 69 |ther the|y identi|
|00002860| 66 79 20 74 68 65 20 70 | 72 6f 63 65 64 75 72 65 |fy the p|rocedure|
|00002870| 20 74 6f 20 62 65 20 63 | 61 6c 6c 65 64 2e 0a 54 | to be c|alled..T|
|00002880| 68 65 20 66 69 66 74 68 | 20 61 6e 64 20 73 69 78 |he fifth| and six|
|00002890| 74 68 20 70 61 72 61 6d | 65 74 65 72 73 20 61 72 |th param|eters ar|
|000028a0| 65 20 61 6e 20 58 44 52 | 20 66 69 6c 74 65 72 20 |e an XDR| filter |
|000028b0| 61 6e 64 20 61 6e 20 61 | 72 67 75 6d 65 6e 74 20 |and an a|rgument |
|000028c0| 74 6f 0a 62 65 20 65 6e | 63 6f 64 65 64 20 61 6e |to.be en|coded an|
|000028d0| 64 20 70 61 73 73 65 64 | 20 74 6f 20 74 68 65 20 |d passed| to the |
|000028e0| 72 65 6d 6f 74 65 20 70 | 72 6f 63 65 64 75 72 65 |remote p|rocedure|
|000028f0| 2e 20 20 0a 54 68 65 20 | 66 69 6e 61 6c 20 74 77 |. .The |final tw|
|00002900| 6f 20 70 61 72 61 6d 65 | 74 65 72 73 20 61 72 65 |o parame|ters are|
|00002910| 20 61 20 66 69 6c 74 65 | 72 20 66 6f 72 20 64 65 | a filte|r for de|
|00002920| 63 6f 64 69 6e 67 20 74 | 68 65 20 72 65 73 75 6c |coding t|he resul|
|00002930| 74 73 20 0a 72 65 74 75 | 72 6e 65 64 20 62 79 20 |ts .retu|rned by |
|00002940| 74 68 65 20 72 65 6d 6f | 74 65 20 70 72 6f 63 65 |the remo|te proce|
|00002950| 64 75 72 65 20 61 6e 64 | 20 61 20 70 6f 69 6e 74 |dure and| a point|
|00002960| 65 72 20 74 6f 20 74 68 | 65 20 70 6c 61 63 65 20 |er to th|e place |
|00002970| 77 68 65 72 65 20 0a 74 | 68 65 20 70 72 6f 63 65 |where .t|he proce|
|00002980| 64 75 72 65 27 73 20 72 | 65 73 75 6c 74 73 20 61 |dure's r|esults a|
|00002990| 72 65 20 74 6f 20 62 65 | 20 73 74 6f 72 65 64 2e |re to be| stored.|
|000029a0| 20 20 4d 75 6c 74 69 70 | 6c 65 20 61 72 67 75 6d | Multip|le argum|
|000029b0| 65 6e 74 73 20 61 6e 64 | 0a 72 65 73 75 6c 74 73 |ents and|.results|
|000029c0| 20 61 72 65 20 68 61 6e | 64 6c 65 64 20 62 79 20 | are han|dled by |
|000029d0| 65 6d 62 65 64 64 69 6e | 67 20 74 68 65 6d 20 69 |embeddin|g them i|
|000029e0| 6e 20 73 74 72 75 63 74 | 75 72 65 73 2e 20 20 49 |n struct|ures. I|
|000029f0| 66 20 0a 58 2e 49 20 63 | 61 6c 6c 72 70 63 20 0a |f .X.I c|allrpc .|
|00002a00| 63 6f 6d 70 6c 65 74 65 | 73 20 73 75 63 63 65 73 |complete|s succes|
|00002a10| 73 66 75 6c 6c 79 2c 20 | 69 74 20 72 65 74 75 72 |sfully, |it retur|
|00002a20| 6e 73 20 7a 65 72 6f 3b | 20 65 6c 73 65 20 69 74 |ns zero;| else it|
|00002a30| 20 72 65 74 75 72 6e 73 | 20 61 20 6e 6f 6e 7a 65 | returns| a nonze|
|00002a40| 72 6f 20 0a 76 61 6c 75 | 65 2e 20 20 54 68 65 20 |ro .valu|e. The |
|00002a50| 72 65 74 75 72 6e 20 63 | 6f 64 65 73 20 28 6f 66 |return c|odes (of|
|00002a60| 20 74 79 70 65 0a 58 2e | 49 20 22 65 6e 75 6d 0a | type.X.|I "enum.|
|00002a70| 63 61 73 74 20 69 6e 74 | 6f 20 61 6e 20 69 6e 74 |cast int|o an int|
|00002a80| 65 67 65 72 29 20 61 72 | 65 20 66 6f 75 6e 64 20 |eger) ar|e found |
|00002a90| 69 6e 20 0a 58 2e 49 20 | 3c 72 70 63 2f 63 6c 6e |in .X.I |<rpc/cln|
|00002aa0| 74 2e 68 3e 20 2e 0a 58 | 2e 4c 50 0a 53 69 6e 63 |t.h> ..X|.LP.Sinc|
|00002ab0| 65 20 64 61 74 61 20 74 | 79 70 65 73 20 6d 61 79 |e data t|ypes may|
|00002ac0| 20 62 65 20 72 65 70 72 | 65 73 65 6e 74 65 64 20 | be repr|esented |
|00002ad0| 64 69 66 66 65 72 65 6e | 74 6c 79 20 6f 6e 20 64 |differen|tly on d|
|00002ae0| 69 66 66 65 72 65 6e 74 | 20 6d 61 63 68 69 6e 65 |ifferent| machine|
|00002af0| 73 2c 0a 58 2e 49 20 63 | 61 6c 6c 72 70 63 20 0a |s,.X.I c|allrpc .|
|00002b00| 6e 65 65 64 73 20 62 6f | 74 68 20 74 68 65 20 74 |needs bo|th the t|
|00002b10| 79 70 65 20 6f 66 20 74 | 68 65 20 52 50 43 20 61 |ype of t|he RPC a|
|00002b20| 72 67 75 6d 65 6e 74 2c | 20 61 73 20 77 65 6c 6c |rgument,| as well|
|00002b30| 20 61 73 0a 61 20 70 6f | 69 6e 74 65 72 20 74 6f | as.a po|inter to|
|00002b40| 20 74 68 65 20 61 72 67 | 75 6d 65 6e 74 20 69 74 | the arg|ument it|
|00002b50| 73 65 6c 66 20 28 61 6e | 64 20 73 69 6d 69 6c 61 |self (an|d simila|
|00002b60| 72 6c 79 20 66 6f 72 20 | 74 68 65 20 72 65 73 75 |rly for |the resu|
|00002b70| 6c 74 29 2e 20 20 46 6f | 72 0a 58 2e 49 20 52 55 |lt). Fo|r.X.I RU|
|00002b80| 53 45 52 53 50 52 4f 43 | 5f 4e 55 4d 20 2c 0a 74 |SERSPROC|_NUM ,.t|
|00002b90| 68 65 20 72 65 74 75 72 | 6e 20 76 61 6c 75 65 20 |he retur|n value |
|00002ba0| 69 73 20 61 6e 0a 58 2e | 49 20 22 75 6e 73 69 67 |is an.X.|I "unsig|
|00002bb0| 6e 65 64 20 6c 6f 6e 67 | 22 0a 73 6f 0a 58 2e 49 |ned long|".so.X.I|
|00002bc0| 20 63 61 6c 6c 72 70 63 | 20 0a 68 61 73 0a 58 2e | callrpc| .has.X.|
|00002bd0| 49 20 78 64 72 5f 75 5f | 6c 6f 6e 67 20 0a 61 73 |I xdr_u_|long .as|
|00002be0| 20 69 74 73 20 66 69 72 | 73 74 20 72 65 74 75 72 | its fir|st retur|
|00002bf0| 6e 20 70 61 72 61 6d 65 | 74 65 72 2c 20 77 68 69 |n parame|ter, whi|
|00002c00| 63 68 20 73 61 79 73 0a | 74 68 61 74 20 74 68 65 |ch says.|that the|
|00002c10| 20 72 65 73 75 6c 74 20 | 69 73 20 6f 66 20 74 79 | result |is of ty|
|00002c20| 70 65 0a 58 2e 49 20 22 | 75 6e 73 69 67 6e 65 64 |pe.X.I "|unsigned|
|00002c30| 20 6c 6f 6e 67 22 0a 61 | 6e 64 0a 58 2e 49 20 26 | long".a|nd.X.I &|
|00002c40| 6e 75 73 65 72 73 20 0a | 58 2e 49 58 20 22 6e 75 |nusers .|X.IX "nu|
|00002c50| 73 65 72 73 26 22 20 22 | 22 20 5c 66 49 26 6e 75 |sers&" "|" \fI&nu|
|00002c60| 73 65 72 73 5c 66 50 0a | 61 73 20 69 74 73 20 73 |sers\fP.|as its s|
|00002c70| 65 63 6f 6e 64 20 72 65 | 74 75 72 6e 20 70 61 72 |econd re|turn par|
|00002c80| 61 6d 65 74 65 72 2c 0a | 77 68 69 63 68 20 69 73 |ameter,.|which is|
|00002c90| 20 61 20 70 6f 69 6e 74 | 65 72 20 74 6f 20 77 68 | a point|er to wh|
|00002ca0| 65 72 65 20 74 68 65 20 | 6c 6f 6e 67 20 72 65 73 |ere the |long res|
|00002cb0| 75 6c 74 20 77 69 6c 6c | 20 62 65 20 70 6c 61 63 |ult will| be plac|
|00002cc0| 65 64 2e 20 20 53 69 6e | 63 65 0a 58 2e 49 20 52 |ed. Sin|ce.X.I R|
|00002cd0| 55 53 45 52 53 50 52 4f | 43 5f 4e 55 4d 20 0a 74 |USERSPRO|C_NUM .t|
|00002ce0| 61 6b 65 73 20 6e 6f 20 | 61 72 67 75 6d 65 6e 74 |akes no |argument|
|00002cf0| 2c 20 74 68 65 20 61 72 | 67 75 6d 65 6e 74 20 70 |, the ar|gument p|
|00002d00| 61 72 61 6d 65 74 65 72 | 20 6f 66 0a 58 2e 49 20 |arameter| of.X.I |
|00002d10| 63 61 6c 6c 72 70 63 20 | 0a 69 73 0a 58 2e 49 20 |callrpc |.is.X.I |
|00002d20| 78 64 72 5f 76 6f 69 64 | 20 2e 0a 58 2e 4c 50 0a |xdr_void| ..X.LP.|
|00002d30| 41 66 74 65 72 20 74 72 | 79 69 6e 67 20 73 65 76 |After tr|ying sev|
|00002d40| 65 72 61 6c 20 74 69 6d | 65 73 20 74 6f 20 64 65 |eral tim|es to de|
|00002d50| 6c 69 76 65 72 20 61 20 | 6d 65 73 73 61 67 65 2c |liver a |message,|
|00002d60| 20 69 66 0a 58 2e 49 20 | 63 61 6c 6c 72 70 63 20 | if.X.I |callrpc |
|00002d70| 0a 67 65 74 73 20 6e 6f | 20 61 6e 73 77 65 72 2c |.gets no| answer,|
|00002d80| 20 69 74 20 72 65 74 75 | 72 6e 73 20 77 69 74 68 | it retu|rns with|
|00002d90| 20 61 6e 20 65 72 72 6f | 72 20 63 6f 64 65 2e 0a | an erro|r code..|
|00002da0| 54 68 65 20 64 65 6c 69 | 76 65 72 79 20 6d 65 63 |The deli|very mec|
|00002db0| 68 61 6e 69 73 6d 20 69 | 73 20 55 44 50 2c 0a 77 |hanism i|s UDP,.w|
|00002dc0| 68 69 63 68 20 73 74 61 | 6e 64 73 20 66 6f 72 20 |hich sta|nds for |
|00002dd0| 55 73 65 72 20 44 61 74 | 61 67 72 61 6d 20 50 72 |User Dat|agram Pr|
|00002de0| 6f 74 6f 63 6f 6c 2e 0a | 4d 65 74 68 6f 64 73 20 |otocol..|Methods |
|00002df0| 66 6f 72 20 61 64 6a 75 | 73 74 69 6e 67 20 74 68 |for adju|sting th|
|00002e00| 65 20 6e 75 6d 62 65 72 | 20 6f 66 20 72 65 74 72 |e number| of retr|
|00002e10| 69 65 73 0a 6f 72 20 66 | 6f 72 20 75 73 69 6e 67 |ies.or f|or using|
|00002e20| 20 61 20 64 69 66 66 65 | 72 65 6e 74 20 70 72 6f | a diffe|rent pro|
|00002e30| 74 6f 63 6f 6c 20 72 65 | 71 75 69 72 65 20 79 6f |tocol re|quire yo|
|00002e40| 75 20 74 6f 20 75 73 65 | 20 74 68 65 20 6c 6f 77 |u to use| the low|
|00002e50| 65 72 0a 6c 61 79 65 72 | 20 6f 66 20 74 68 65 20 |er.layer| of the |
|00002e60| 52 50 43 20 6c 69 62 72 | 61 72 79 2c 20 64 69 73 |RPC libr|ary, dis|
|00002e70| 63 75 73 73 65 64 20 6c | 61 74 65 72 20 69 6e 20 |cussed l|ater in |
|00002e80| 74 68 69 73 20 64 6f 63 | 75 6d 65 6e 74 2e 0a 54 |this doc|ument..T|
|00002e90| 68 65 20 72 65 6d 6f 74 | 65 20 73 65 72 76 65 72 |he remot|e server|
|00002ea0| 20 70 72 6f 63 65 64 75 | 72 65 0a 63 6f 72 72 65 | procedu|re.corre|
|00002eb0| 73 70 6f 6e 64 69 6e 67 | 20 74 6f 20 74 68 65 20 |sponding| to the |
|00002ec0| 61 62 6f 76 65 20 6d 69 | 67 68 74 20 6c 6f 6f 6b |above mi|ght look|
|00002ed0| 20 6c 69 6b 65 20 74 68 | 69 73 3a 0a 58 2e 69 65 | like th|is:.X.ie|
|00002ee0| 20 74 20 2e 44 53 0a 58 | 2e 65 6c 20 2e 44 53 20 | t .DS.X|.el .DS |
|00002ef0| 4c 0a 58 2e 66 74 20 43 | 57 0a 58 2e 66 74 20 43 |L.X.ft C|W.X.ft C|
|00002f00| 57 0a 63 68 61 72 20 2a | 0a 6e 75 73 65 72 28 69 |W.char *|.nuser(i|
|00002f10| 6e 64 61 74 61 29 0a 09 | 63 68 61 72 20 2a 69 6e |ndata)..|char *in|
|00002f20| 64 61 74 61 3b 0a 7b 0a | 09 73 74 61 74 69 63 20 |data;.{.|.static |
|00002f30| 69 6e 74 20 6e 75 73 65 | 72 73 3b 0a 0a 58 2e 66 |int nuse|rs;..X.f|
|00002f40| 74 20 49 0a 09 2f 2a 0a | 09 20 2a 20 43 6f 64 65 |t I../*.|. * Code|
|00002f50| 20 68 65 72 65 20 74 6f | 20 63 6f 6d 70 75 74 65 | here to| compute|
|00002f60| 20 74 68 65 20 6e 75 6d | 62 65 72 20 6f 66 20 75 | the num|ber of u|
|00002f70| 73 65 72 73 0a 09 20 2a | 20 61 6e 64 20 70 6c 61 |sers.. *| and pla|
|00002f80| 63 65 20 72 65 73 75 6c | 74 20 69 6e 20 76 61 72 |ce resul|t in var|
|00002f90| 69 61 62 6c 65 20 5c 66 | 49 6e 75 73 65 72 73 5c |iable \f|Inusers\|
|00002fa0| 66 50 2e 0a 09 20 2a 2f | 0a 58 2e 66 74 20 43 57 |fP... */|.X.ft CW|
|00002fb0| 0a 09 72 65 74 75 72 6e | 28 28 63 68 61 72 20 2a |..return|((char *|
|00002fc0| 29 26 6e 75 73 65 72 73 | 29 3b 0a 7d 0a 58 2e 44 |)&nusers|);.}.X.D|
|00002fd0| 45 0a 58 2e 4c 50 0a 49 | 74 20 74 61 6b 65 73 20 |E.X.LP.I|t takes |
|00002fe0| 6f 6e 65 20 61 72 67 75 | 6d 65 6e 74 2c 20 77 68 |one argu|ment, wh|
|00002ff0| 69 63 68 20 69 73 20 61 | 20 70 6f 69 6e 74 65 72 |ich is a| pointer|
|00003000| 20 74 6f 20 74 68 65 20 | 69 6e 70 75 74 0a 6f 66 | to the |input.of|
|00003010| 20 74 68 65 20 72 65 6d | 6f 74 65 20 70 72 6f 63 | the rem|ote proc|
|00003020| 65 64 75 72 65 20 63 61 | 6c 6c 20 28 69 67 6e 6f |edure ca|ll (igno|
|00003030| 72 65 64 20 69 6e 20 6f | 75 72 20 65 78 61 6d 70 |red in o|ur examp|
|00003040| 6c 65 29 2c 0a 61 6e 64 | 20 69 74 20 72 65 74 75 |le),.and| it retu|
|00003050| 72 6e 73 20 61 20 70 6f | 69 6e 74 65 72 20 74 6f |rns a po|inter to|
|00003060| 20 74 68 65 20 72 65 73 | 75 6c 74 2e 0a 49 6e 20 | the res|ult..In |
|00003070| 74 68 65 20 63 75 72 72 | 65 6e 74 20 76 65 72 73 |the curr|ent vers|
|00003080| 69 6f 6e 20 6f 66 20 43 | 2c 0a 63 68 61 72 61 63 |ion of C|,.charac|
|00003090| 74 65 72 20 70 6f 69 6e | 74 65 72 73 20 61 72 65 |ter poin|ters are|
|000030a0| 20 74 68 65 20 67 65 6e | 65 72 69 63 20 70 6f 69 | the gen|eric poi|
|000030b0| 6e 74 65 72 73 2c 0a 73 | 6f 20 62 6f 74 68 20 74 |nters,.s|o both t|
|000030c0| 68 65 20 69 6e 70 75 74 | 20 61 72 67 75 6d 65 6e |he input| argumen|
|000030d0| 74 20 61 6e 64 20 74 68 | 65 20 72 65 74 75 72 6e |t and th|e return|
|000030e0| 20 76 61 6c 75 65 20 61 | 72 65 20 63 61 73 74 20 | value a|re cast |
|000030f0| 74 6f 0a 58 2e 49 20 22 | 63 68 61 72 20 2a 22 0a |to.X.I "|char *".|
|00003100| 58 2e 4c 50 0a 4e 6f 72 | 6d 61 6c 6c 79 2c 20 61 |X.LP.Nor|mally, a|
|00003110| 20 73 65 72 76 65 72 20 | 72 65 67 69 73 74 65 72 | server |register|
|00003120| 73 20 61 6c 6c 20 6f 66 | 20 74 68 65 20 52 50 43 |s all of| the RPC|
|00003130| 20 63 61 6c 6c 73 20 69 | 74 20 70 6c 61 6e 73 0a | calls i|t plans.|
|00003140| 74 6f 20 68 61 6e 64 6c | 65 2c 20 61 6e 64 20 74 |to handl|e, and t|
|00003150| 68 65 6e 20 67 6f 65 73 | 20 69 6e 74 6f 20 61 6e |hen goes| into an|
|00003160| 20 69 6e 66 69 6e 69 74 | 65 20 6c 6f 6f 70 20 77 | infinit|e loop w|
|00003170| 61 69 74 69 6e 67 20 74 | 6f 20 73 65 72 76 69 63 |aiting t|o servic|
|00003180| 65 20 72 65 71 75 65 73 | 74 73 2e 0a 49 6e 20 74 |e reques|ts..In t|
|00003190| 68 69 73 20 65 78 61 6d | 70 6c 65 2c 20 74 68 65 |his exam|ple, the|
|000031a0| 72 65 20 69 73 20 6f 6e | 6c 79 20 61 20 73 69 6e |re is on|ly a sin|
|000031b0| 67 6c 65 20 70 72 6f 63 | 65 64 75 72 65 0a 74 6f |gle proc|edure.to|
|000031c0| 20 72 65 67 69 73 74 65 | 72 2c 20 73 6f 20 74 68 | registe|r, so th|
|000031d0| 65 20 6d 61 69 6e 20 62 | 6f 64 79 20 6f 66 20 74 |e main b|ody of t|
|000031e0| 68 65 20 73 65 72 76 65 | 72 20 77 6f 75 6c 64 20 |he serve|r would |
|000031f0| 6c 6f 6f 6b 20 6c 69 6b | 65 20 74 68 69 73 3a 0a |look lik|e this:.|
|00003200| 58 2e 69 65 20 74 20 2e | 44 53 0a 58 2e 65 6c 20 |X.ie t .|DS.X.el |
|00003210| 2e 44 53 20 4c 0a 58 2e | 66 74 20 43 57 0a 23 69 |.DS L.X.|ft CW.#i|
|00003220| 6e 63 6c 75 64 65 20 3c | 73 74 64 69 6f 2e 68 3e |nclude <|stdio.h>|
|00003230| 0a 23 69 6e 63 6c 75 64 | 65 20 3c 72 70 63 2f 72 |.#includ|e <rpc/r|
|00003240| 70 63 2e 68 3e 0a 23 69 | 6e 63 6c 75 64 65 20 3c |pc.h>.#i|nclude <|
|00003250| 75 74 6d 70 2e 68 3e 0a | 23 69 6e 63 6c 75 64 65 |utmp.h>.|#include|
|00003260| 20 3c 72 70 63 73 76 63 | 2f 72 75 73 65 72 73 2e | <rpcsvc|/rusers.|
|00003270| 68 3e 0a 0a 63 68 61 72 | 20 2a 6e 75 73 65 72 28 |h>..char| *nuser(|
|00003280| 29 3b 0a 0a 6d 61 69 6e | 28 29 0a 7b 0a 09 72 65 |);..main|().{..re|
|00003290| 67 69 73 74 65 72 72 70 | 63 28 52 55 53 45 52 53 |gisterrp|c(RUSERS|
|000032a0| 50 52 4f 47 2c 20 52 55 | 53 45 52 53 56 45 52 53 |PROG, RU|SERSVERS|
|000032b0| 2c 20 52 55 53 45 52 53 | 50 52 4f 43 5f 4e 55 4d |, RUSERS|PROC_NUM|
|000032c0| 2c 0a 09 09 6e 75 73 65 | 72 2c 20 78 64 72 5f 76 |,...nuse|r, xdr_v|
|000032d0| 6f 69 64 2c 20 78 64 72 | 5f 75 5f 6c 6f 6e 67 29 |oid, xdr|_u_long)|
|000032e0| 3b 0a 09 73 76 63 5f 72 | 75 6e 28 29 3b 09 09 2f |;..svc_r|un();../|
|000032f0| 2a 20 5c 66 49 4e 65 76 | 65 72 20 72 65 74 75 72 |* \fINev|er retur|
|00003300| 6e 73 5c 66 50 20 2a 2f | 0a 09 66 70 72 69 6e 74 |ns\fP */|..fprint|
|00003310| 66 28 73 74 64 65 72 72 | 2c 20 22 45 72 72 6f 72 |f(stderr|, "Error|
|00003320| 3a 20 73 76 63 5f 72 75 | 6e 20 72 65 74 75 72 6e |: svc_ru|n return|
|00003330| 65 64 21 5c 65 6e 22 29 | 3b 0a 09 65 78 69 74 28 |ed!\en")|;..exit(|
|00003340| 31 29 3b 0a 7d 0a 58 2e | 44 45 0a 58 2e 4c 50 0a |1);.}.X.|DE.X.LP.|
|00003350| 54 68 65 0a 58 2e 49 20 | 72 65 67 69 73 74 65 72 |The.X.I |register|
|00003360| 72 70 63 0a 72 6f 75 74 | 69 6e 65 20 72 65 67 69 |rpc.rout|ine regi|
|00003370| 73 74 65 72 73 20 61 20 | 43 20 70 72 6f 63 65 64 |sters a |C proced|
|00003380| 75 72 65 20 61 73 20 63 | 6f 72 72 65 73 70 6f 6e |ure as c|orrespon|
|00003390| 64 69 6e 67 20 74 6f 20 | 61 0a 67 69 76 65 6e 20 |ding to |a.given |
|000033a0| 52 50 43 20 70 72 6f 63 | 65 64 75 72 65 20 6e 75 |RPC proc|edure nu|
|000033b0| 6d 62 65 72 2e 20 20 54 | 68 65 20 66 69 72 73 74 |mber. T|he first|
|000033c0| 20 74 68 72 65 65 20 70 | 61 72 61 6d 65 74 65 72 | three p|arameter|
|000033d0| 73 2c 0a 58 2e 49 20 52 | 55 53 45 52 50 52 4f 47 |s,.X.I R|USERPROG|
|000033e0| 20 2c 0a 58 2e 49 20 52 | 55 53 45 52 53 56 45 52 | ,.X.I R|USERSVER|
|000033f0| 53 20 2c 0a 61 6e 64 0a | 58 2e 49 20 52 55 53 45 |S ,.and.|X.I RUSE|
|00003400| 52 53 50 52 4f 43 5f 4e | 55 4d 20 0a 61 72 65 20 |RSPROC_N|UM .are |
|00003410| 74 68 65 20 70 72 6f 67 | 72 61 6d 2c 20 76 65 72 |the prog|ram, ver|
|00003420| 73 69 6f 6e 2c 20 61 6e | 64 20 70 72 6f 63 65 64 |sion, an|d proced|
|00003430| 75 72 65 20 6e 75 6d 62 | 65 72 73 0a 6f 66 20 74 |ure numb|ers.of t|
|00003440| 68 65 20 72 65 6d 6f 74 | 65 20 70 72 6f 63 65 64 |he remot|e proced|
|00003450| 75 72 65 20 74 6f 20 62 | 65 20 72 65 67 69 73 74 |ure to b|e regist|
|00003460| 65 72 65 64 3b 0a 58 2e | 49 20 6e 75 73 65 72 20 |ered;.X.|I nuser |
|00003470| 0a 69 73 20 74 68 65 20 | 6e 61 6d 65 20 6f 66 20 |.is the |name of |
|00003480| 74 68 65 20 6c 6f 63 61 | 6c 20 70 72 6f 63 65 64 |the loca|l proced|
|00003490| 75 72 65 20 74 68 61 74 | 20 69 6d 70 6c 65 6d 65 |ure that| impleme|
|000034a0| 6e 74 73 20 74 68 65 20 | 72 65 6d 6f 74 65 0a 70 |nts the |remote.p|
|000034b0| 72 6f 63 65 64 75 72 65 | 3b 20 61 6e 64 0a 58 2e |rocedure|; and.X.|
|000034c0| 49 20 78 64 72 5f 76 6f | 69 64 20 0a 61 6e 64 0a |I xdr_vo|id .and.|
|000034d0| 58 2e 49 20 78 64 72 5f | 75 5f 6c 6f 6e 67 20 0a |X.I xdr_|u_long .|
|000034e0| 61 72 65 20 74 68 65 20 | 58 44 52 20 66 69 6c 74 |are the |XDR filt|
|000034f0| 65 72 73 20 66 6f 72 20 | 74 68 65 20 72 65 6d 6f |ers for |the remo|
|00003500| 74 65 20 70 72 6f 63 65 | 64 75 72 65 27 73 20 61 |te proce|dure's a|
|00003510| 72 67 75 6d 65 6e 74 73 | 20 61 6e 64 0a 72 65 73 |rguments| and.res|
|00003520| 75 6c 74 73 2c 20 72 65 | 73 70 65 63 74 69 76 65 |ults, re|spective|
|00003530| 6c 79 2e 20 20 28 4d 75 | 6c 74 69 70 6c 65 20 61 |ly. (Mu|ltiple a|
|00003540| 72 67 75 6d 65 6e 74 73 | 20 6f 72 20 6d 75 6c 74 |rguments| or mult|
|00003550| 69 70 6c 65 20 72 65 73 | 75 6c 74 73 0a 61 72 65 |iple res|ults.are|
|00003560| 20 70 61 73 73 65 64 20 | 61 73 20 73 74 72 75 63 | passed |as struc|
|00003570| 74 75 72 65 73 29 2e 0a | 58 2e 4c 50 0a 4f 6e 6c |tures)..|X.LP.Onl|
|00003580| 79 20 74 68 65 20 55 44 | 50 20 74 72 61 6e 73 70 |y the UD|P transp|
|00003590| 6f 72 74 20 6d 65 63 68 | 61 6e 69 73 6d 20 63 61 |ort mech|anism ca|
|000035a0| 6e 20 75 73 65 0a 58 2e | 49 20 72 65 67 69 73 74 |n use.X.|I regist|
|000035b0| 65 72 72 70 63 0a 74 68 | 75 73 2c 20 69 74 20 69 |errpc.th|us, it i|
|000035c0| 73 20 61 6c 77 61 79 73 | 20 73 61 66 65 20 69 6e |s always| safe in|
|000035d0| 20 63 6f 6e 6a 75 6e 63 | 74 69 6f 6e 20 77 69 74 | conjunc|tion wit|
|000035e0| 68 20 63 61 6c 6c 73 20 | 67 65 6e 65 72 61 74 65 |h calls |generate|
|000035f0| 64 20 62 79 0a 58 2e 49 | 20 63 61 6c 6c 72 70 63 |d by.X.I| callrpc|
|00003600| 20 2e 0a 58 2e 53 48 0a | 5c 26 57 41 52 4e 49 4e | ..X.SH.|\&WARNIN|
|00003610| 47 3a 0a 58 2e 49 58 20 | 22 55 44 50 20 38 4b 20 |G:.X.IX |"UDP 8K |
|00003620| 77 61 72 6e 69 6e 67 22 | 0a 54 68 65 20 55 44 50 |warning"|.The UDP|
|00003630| 20 74 72 61 6e 73 70 6f | 72 74 20 6d 65 63 68 61 | transpo|rt mecha|
|00003640| 6e 69 73 6d 20 63 61 6e | 20 6f 6e 6c 79 20 64 65 |nism can| only de|
|00003650| 61 6c 20 77 69 74 68 0a | 61 72 67 75 6d 65 6e 74 |al with.|argument|
|00003660| 73 20 61 6e 64 20 72 65 | 73 75 6c 74 73 20 6c 65 |s and re|sults le|
|00003670| 73 73 20 74 68 61 6e 20 | 38 4b 20 62 79 74 65 73 |ss than |8K bytes|
|00003680| 20 69 6e 20 6c 65 6e 67 | 74 68 2e 0a 58 2e 4c 50 | in leng|th..X.LP|
|00003690| 0a 58 2e 4c 50 0a 41 66 | 74 65 72 20 72 65 67 69 |.X.LP.Af|ter regi|
|000036a0| 73 74 65 72 69 6e 67 20 | 74 68 65 20 6c 6f 63 61 |stering |the loca|
|000036b0| 6c 20 70 72 6f 63 65 64 | 75 72 65 2c 20 74 68 65 |l proced|ure, the|
|000036c0| 20 73 65 72 76 65 72 20 | 70 72 6f 67 72 61 6d 27 | server |program'|
|000036d0| 73 0a 6d 61 69 6e 20 70 | 72 6f 63 65 64 75 72 65 |s.main p|rocedure|
|000036e0| 20 63 61 6c 6c 73 0a 58 | 2e 49 20 73 76 63 5f 72 | calls.X|.I svc_r|
|000036f0| 75 6e 20 2c 0a 74 68 65 | 20 52 50 43 20 6c 69 62 |un ,.the| RPC lib|
|00003700| 72 61 72 79 27 73 20 72 | 65 6d 6f 74 65 20 70 72 |rary's r|emote pr|
|00003710| 6f 63 65 64 75 72 65 20 | 64 69 73 70 61 74 63 68 |ocedure |dispatch|
|00003720| 65 72 2e 20 20 49 74 20 | 69 73 20 74 68 69 73 20 |er. It |is this |
|00003730| 0a 66 75 6e 63 74 69 6f | 6e 20 74 68 61 74 20 63 |.functio|n that c|
|00003740| 61 6c 6c 73 20 74 68 65 | 20 72 65 6d 6f 74 65 20 |alls the| remote |
|00003750| 70 72 6f 63 65 64 75 72 | 65 73 20 69 6e 20 72 65 |procedur|es in re|
|00003760| 73 70 6f 6e 73 65 20 74 | 6f 20 52 50 43 0a 63 61 |sponse t|o RPC.ca|
|00003770| 6c 6c 20 6d 65 73 73 61 | 67 65 73 2e 20 20 4e 6f |ll messa|ges. No|
|00003780| 74 65 20 74 68 61 74 20 | 74 68 65 20 64 69 73 70 |te that |the disp|
|00003790| 61 74 63 68 65 72 20 74 | 61 6b 65 73 20 63 61 72 |atcher t|akes car|
|000037a0| 65 20 6f 66 20 64 65 63 | 6f 64 69 6e 67 0a 72 65 |e of dec|oding.re|
|000037b0| 6d 6f 74 65 20 70 72 6f | 63 65 64 75 72 65 20 61 |mote pro|cedure a|
|000037c0| 72 67 75 6d 65 6e 74 73 | 20 61 6e 64 20 65 6e 63 |rguments| and enc|
|000037d0| 6f 64 69 6e 67 20 72 65 | 73 75 6c 74 73 2c 20 75 |oding re|sults, u|
|000037e0| 73 69 6e 67 20 74 68 65 | 20 58 44 52 0a 66 69 6c |sing the| XDR.fil|
|000037f0| 74 65 72 73 20 73 70 65 | 63 69 66 69 65 64 20 77 |ters spe|cified w|
|00003800| 68 65 6e 20 74 68 65 20 | 72 65 6d 6f 74 65 20 70 |hen the |remote p|
|00003810| 72 6f 63 65 64 75 72 65 | 20 77 61 73 20 72 65 67 |rocedure| was reg|
|00003820| 69 73 74 65 72 65 64 2e | 0a 58 2e 0a 58 2e 4e 48 |istered.|.X..X.NH|
|00003830| 20 32 0a 5c 26 41 73 73 | 69 67 6e 69 6e 67 20 50 | 2.\&Ass|igning P|
|00003840| 72 6f 67 72 61 6d 20 4e | 75 6d 62 65 72 73 0a 58 |rogram N|umbers.X|
|00003850| 2e 49 58 20 22 70 72 6f | 67 72 61 6d 20 6e 75 6d |.IX "pro|gram num|
|00003860| 62 65 72 20 61 73 73 69 | 67 6e 6d 65 6e 74 22 0a |ber assi|gnment".|
|00003870| 58 2e 49 58 20 22 61 73 | 73 69 67 6e 69 6e 67 20 |X.IX "as|signing |
|00003880| 70 72 6f 67 72 61 6d 20 | 6e 75 6d 62 65 72 73 22 |program |numbers"|
|00003890| 0a 58 2e 4c 50 0a 50 72 | 6f 67 72 61 6d 20 6e 75 |.X.LP.Pr|ogram nu|
|000038a0| 6d 62 65 72 73 20 61 72 | 65 20 61 73 73 69 67 6e |mbers ar|e assign|
|000038b0| 65 64 20 69 6e 20 67 72 | 6f 75 70 73 20 6f 66 20 |ed in gr|oups of |
|000038c0| 0a 58 2e 49 20 30 78 32 | 30 30 30 30 30 30 30 20 |.X.I 0x2|0000000 |
|000038d0| 0a 61 63 63 6f 72 64 69 | 6e 67 20 74 6f 20 74 68 |.accordi|ng to th|
|000038e0| 65 20 66 6f 6c 6c 6f 77 | 69 6e 67 20 63 68 61 72 |e follow|ing char|
|000038f0| 74 3a 0a 58 2e 44 53 0a | 58 2e 66 74 20 43 57 0a |t:.X.DS.|X.ft CW.|
|00003900| 20 20 20 20 20 20 20 30 | 78 30 20 2d 20 30 78 31 | 0|x0 - 0x1|
|00003910| 66 66 66 66 66 66 66 09 | 5c 66 52 44 65 66 69 6e |fffffff.|\fRDefin|
|00003920| 65 64 20 62 79 20 53 75 | 6e 5c 66 50 0a 30 78 32 |ed by Su|n\fP.0x2|
|00003930| 30 30 30 30 30 30 30 20 | 2d 20 30 78 33 66 66 66 |0000000 |- 0x3fff|
|00003940| 66 66 66 66 09 5c 66 52 | 44 65 66 69 6e 65 64 20 |ffff.\fR|Defined |
|00003950| 62 79 20 75 73 65 72 5c | 66 50 0a 30 78 34 30 30 |by user\|fP.0x400|
|00003960| 30 30 30 30 30 20 2d 20 | 30 78 35 66 66 66 66 66 |00000 - |0x5fffff|
|00003970| 66 66 09 5c 66 52 54 72 | 61 6e 73 69 65 6e 74 5c |ff.\fRTr|ansient\|
|00003980| 66 50 0a 30 78 36 30 30 | 30 30 30 30 30 20 2d 20 |fP.0x600|00000 - |
|00003990| 30 78 37 66 66 66 66 66 | 66 66 09 5c 66 52 52 65 |0x7fffff|ff.\fRRe|
|000039a0| 73 65 72 76 65 64 5c 66 | 50 0a 30 78 38 30 30 30 |served\f|P.0x8000|
|000039b0| 30 30 30 30 20 2d 20 30 | 78 39 66 66 66 66 66 66 |0000 - 0|x9ffffff|
|000039c0| 66 09 5c 66 52 52 65 73 | 65 72 76 65 64 5c 66 50 |f.\fRRes|erved\fP|
|000039d0| 0a 30 78 61 30 30 30 30 | 30 30 30 20 2d 20 30 78 |.0xa0000|000 - 0x|
|000039e0| 62 66 66 66 66 66 66 66 | 09 5c 66 52 52 65 73 65 |bfffffff|.\fRRese|
|000039f0| 72 76 65 64 5c 66 50 0a | 30 78 63 30 30 30 30 30 |rved\fP.|0xc00000|
|00003a00| 30 30 20 2d 20 30 78 64 | 66 66 66 66 66 66 66 09 |00 - 0xd|fffffff.|
|00003a10| 5c 66 52 52 65 73 65 72 | 76 65 64 5c 66 50 0a 30 |\fRReser|ved\fP.0|
|00003a20| 78 65 30 30 30 30 30 30 | 30 20 2d 20 30 78 66 66 |xe000000|0 - 0xff|
|00003a30| 66 66 66 66 66 66 09 5c | 66 52 52 65 73 65 72 76 |ffffff.\|fRReserv|
|00003a40| 65 64 5c 66 50 0a 58 2e | 66 74 20 52 0a 58 2e 44 |ed\fP.X.|ft R.X.D|
|00003a50| 45 0a 53 75 6e 20 4d 69 | 63 72 6f 73 79 73 74 65 |E.Sun Mi|crosyste|
|00003a60| 6d 73 20 61 64 6d 69 6e | 69 73 74 65 72 73 20 74 |ms admin|isters t|
|00003a70| 68 65 20 66 69 72 73 74 | 20 67 72 6f 75 70 20 6f |he first| group o|
|00003a80| 66 20 6e 75 6d 62 65 72 | 73 2c 20 77 68 69 63 68 |f number|s, which|
|00003a90| 0a 73 68 6f 75 6c 64 20 | 62 65 20 69 64 65 6e 74 |.should |be ident|
|00003aa0| 69 63 61 6c 20 66 6f 72 | 20 61 6c 6c 20 53 75 6e |ical for| all Sun|
|00003ab0| 20 63 75 73 74 6f 6d 65 | 72 73 2e 20 20 49 66 20 | custome|rs. If |
|00003ac0| 61 20 63 75 73 74 6f 6d | 65 72 0a 64 65 76 65 6c |a custom|er.devel|
|00003ad0| 6f 70 73 20 61 6e 20 61 | 70 70 6c 69 63 61 74 69 |ops an a|pplicati|
|00003ae0| 6f 6e 20 74 68 61 74 20 | 6d 69 67 68 74 20 62 65 |on that |might be|
|00003af0| 20 6f 66 20 67 65 6e 65 | 72 61 6c 20 69 6e 74 65 | of gene|ral inte|
|00003b00| 72 65 73 74 2c 20 74 68 | 61 74 0a 61 70 70 6c 69 |rest, th|at.appli|
|00003b10| 63 61 74 69 6f 6e 20 73 | 68 6f 75 6c 64 20 62 65 |cation s|hould be|
|00003b20| 20 67 69 76 65 6e 20 61 | 6e 20 61 73 73 69 67 6e | given a|n assign|
|00003b30| 65 64 20 6e 75 6d 62 65 | 72 20 69 6e 20 74 68 65 |ed numbe|r in the|
|00003b40| 20 66 69 72 73 74 0a 72 | 61 6e 67 65 2e 20 20 54 | first.r|ange. T|
|00003b50| 68 65 20 73 65 63 6f 6e | 64 20 67 72 6f 75 70 20 |he secon|d group |
|00003b60| 6f 66 20 6e 75 6d 62 65 | 72 73 20 69 73 20 72 65 |of numbe|rs is re|
|00003b70| 73 65 72 76 65 64 20 66 | 6f 72 20 73 70 65 63 69 |served f|or speci|
|00003b80| 66 69 63 0a 63 75 73 74 | 6f 6d 65 72 20 61 70 70 |fic.cust|omer app|
|00003b90| 6c 69 63 61 74 69 6f 6e | 73 2e 20 20 54 68 69 73 |lication|s. This|
|00003ba0| 20 72 61 6e 67 65 20 69 | 73 20 69 6e 74 65 6e 64 | range i|s intend|
|00003bb0| 65 64 20 70 72 69 6d 61 | 72 69 6c 79 20 66 6f 72 |ed prima|rily for|
|00003bc0| 0a 64 65 62 75 67 67 69 | 6e 67 20 6e 65 77 20 70 |.debuggi|ng new p|
|00003bd0| 72 6f 67 72 61 6d 73 2e | 20 20 54 68 65 20 74 68 |rograms.| The th|
|00003be0| 69 72 64 20 67 72 6f 75 | 70 20 69 73 20 72 65 73 |ird grou|p is res|
|00003bf0| 65 72 76 65 64 20 66 6f | 72 0a 61 70 70 6c 69 63 |erved fo|r.applic|
|00003c00| 61 74 69 6f 6e 73 20 74 | 68 61 74 20 67 65 6e 65 |ations t|hat gene|
|00003c10| 72 61 74 65 20 70 72 6f | 67 72 61 6d 20 6e 75 6d |rate pro|gram num|
|00003c20| 62 65 72 73 20 64 79 6e | 61 6d 69 63 61 6c 6c 79 |bers dyn|amically|
|00003c30| 2e 20 20 54 68 65 0a 66 | 69 6e 61 6c 20 67 72 6f |. The.f|inal gro|
|00003c40| 75 70 73 20 61 72 65 20 | 72 65 73 65 72 76 65 64 |ups are |reserved|
|00003c50| 20 66 6f 72 20 66 75 74 | 75 72 65 20 75 73 65 2c | for fut|ure use,|
|00003c60| 20 61 6e 64 20 73 68 6f | 75 6c 64 20 6e 6f 74 20 | and sho|uld not |
|00003c70| 62 65 0a 75 73 65 64 2e | 0a 58 2e 4c 50 0a 54 6f |be.used.|.X.LP.To|
|00003c80| 20 72 65 67 69 73 74 65 | 72 20 61 20 70 72 6f 74 | registe|r a prot|
|00003c90| 6f 63 6f 6c 20 73 70 65 | 63 69 66 69 63 61 74 69 |ocol spe|cificati|
|00003ca0| 6f 6e 2c 20 73 65 6e 64 | 20 61 20 72 65 71 75 65 |on, send| a reque|
|00003cb0| 73 74 20 62 79 20 6e 65 | 74 77 6f 72 6b 20 0a 6d |st by ne|twork .m|
|00003cc0| 61 69 6c 20 74 6f 0a 58 | 2e 49 20 72 70 63 40 73 |ail to.X|.I rpc@s|
|00003cd0| 75 6e 0a 6f 72 20 77 72 | 69 74 65 20 74 6f 3a 0a |un.or wr|ite to:.|
|00003ce0| 58 2e 44 53 0a 52 50 43 | 20 41 64 6d 69 6e 69 73 |X.DS.RPC| Adminis|
|00003cf0| 74 72 61 74 6f 72 0a 53 | 75 6e 20 4d 69 63 72 6f |trator.S|un Micro|
|00003d00| 73 79 73 74 65 6d 73 0a | 32 35 35 30 20 47 61 72 |systems.|2550 Gar|
|00003d10| 63 69 61 20 41 76 65 2e | 0a 4d 6f 75 6e 74 61 69 |cia Ave.|.Mountai|
|00003d20| 6e 20 56 69 65 77 2c 20 | 43 41 20 39 34 30 34 33 |n View, |CA 94043|
|00003d30| 0a 58 2e 44 45 0a 50 6c | 65 61 73 65 20 69 6e 63 |.X.DE.Pl|ease inc|
|00003d40| 6c 75 64 65 20 61 20 63 | 6f 6d 70 69 6c 61 62 6c |lude a c|ompilabl|
|00003d50| 65 20 0a 58 2e 49 20 72 | 70 63 67 65 6e 20 0a 60 |e .X.I r|pcgen .`|
|00003d60| 60 2e 78 27 27 20 66 69 | 6c 65 20 64 65 73 63 72 |`.x'' fi|le descr|
|00003d70| 69 62 69 6e 67 20 79 6f | 75 72 20 70 72 6f 74 6f |ibing yo|ur proto|
|00003d80| 63 6f 6c 2e 0a 59 6f 75 | 20 77 69 6c 6c 20 62 65 |col..You| will be|
|00003d90| 20 67 69 76 65 6e 20 61 | 20 75 6e 69 71 75 65 20 | given a| unique |
|00003da0| 70 72 6f 67 72 61 6d 20 | 6e 75 6d 62 65 72 20 69 |program |number i|
|00003db0| 6e 20 72 65 74 75 72 6e | 2e 0a 58 2e 49 58 20 22 |n return|..X.IX "|
|00003dc0| 52 50 43 22 20 22 61 64 | 6d 69 6e 69 73 74 72 61 |RPC" "ad|ministra|
|00003dd0| 74 69 6f 6e 22 0a 58 2e | 49 58 20 22 61 64 6d 69 |tion".X.|IX "admi|
|00003de0| 6e 69 73 74 72 61 74 69 | 6f 6e 20 6f 66 20 52 50 |nistrati|on of RP|
|00003df0| 43 22 0a 58 2e 4c 50 0a | 54 68 65 20 52 50 43 20 |C".X.LP.|The RPC |
|00003e00| 70 72 6f 67 72 61 6d 20 | 6e 75 6d 62 65 72 73 20 |program |numbers |
|00003e10| 61 6e 64 20 70 72 6f 74 | 6f 63 6f 6c 20 73 70 65 |and prot|ocol spe|
|00003e20| 63 69 66 69 63 61 74 69 | 6f 6e 73 20 0a 6f 66 20 |cificati|ons .of |
|00003e30| 73 74 61 6e 64 61 72 64 | 20 53 75 6e 20 52 50 43 |standard| Sun RPC|
|00003e40| 20 73 65 72 76 69 63 65 | 73 20 63 61 6e 20 62 65 | service|s can be|
|00003e50| 0a 66 6f 75 6e 64 20 69 | 6e 20 74 68 65 20 69 6e |.found i|n the in|
|00003e60| 63 6c 75 64 65 20 66 69 | 6c 65 73 20 69 6e 20 0a |clude fi|les in .|
|00003e70| 58 2e 49 20 22 2f 75 73 | 72 2f 69 6e 63 6c 75 64 |X.I "/us|r/includ|
|00003e80| 65 2f 72 70 63 73 76 63 | 22 20 2e 0a 54 68 65 73 |e/rpcsvc|" ..Thes|
|00003e90| 65 20 73 65 72 76 69 63 | 65 73 2c 20 68 6f 77 65 |e servic|es, howe|
|00003ea0| 76 65 72 2c 20 63 6f 6e | 73 74 69 74 75 74 65 20 |ver, con|stitute |
|00003eb0| 6f 6e 6c 79 20 61 20 73 | 6d 61 6c 6c 20 73 75 62 |only a s|mall sub|
|00003ec0| 73 65 74 20 0a 6f 66 20 | 74 68 6f 73 65 20 77 68 |set .of |those wh|
|00003ed0| 69 63 68 20 68 61 76 65 | 20 62 65 65 6e 20 72 65 |ich have| been re|
|00003ee0| 67 69 73 74 65 72 65 64 | 2e 20 20 54 68 65 20 63 |gistered|. The c|
|00003ef0| 6f 6d 70 6c 65 74 65 20 | 6c 69 73 74 20 6f 66 20 |omplete |list of |
|00003f00| 0a 72 65 67 69 73 74 65 | 72 65 64 20 70 72 6f 67 |.registe|red prog|
|00003f10| 72 61 6d 73 2c 20 61 73 | 20 6f 66 20 74 68 65 20 |rams, as| of the |
|00003f20| 74 69 6d 65 20 77 68 65 | 6e 20 74 68 69 73 20 6d |time whe|n this m|
|00003f30| 61 6e 75 61 6c 20 77 61 | 73 20 0a 70 72 69 6e 74 |anual wa|s .print|
|00003f40| 65 64 2c 20 69 73 3a 0a | 58 2e 54 53 20 48 0a 62 |ed, is:.|X.TS H.b|
|00003f50| 6f 78 20 74 61 62 20 28 | 26 29 20 3b 0a 6c 66 42 |ox tab (|&) ;.lfB|
|00003f60| 49 20 6c 66 42 49 20 6c | 66 42 49 0a 6c 66 4c 20 |I lfBI l|fBI.lfL |
|00003f70| 6c 66 4c 20 6c 66 49 20 | 2e 0a 52 50 43 20 4e 75 |lfL lfI |..RPC Nu|
|00003f80| 6d 62 65 72 26 50 72 6f | 67 72 61 6d 26 44 65 73 |mber&Pro|gram&Des|
|00003f90| 63 72 69 70 74 69 6f 6e | 0a 5f 0a 58 2e 54 48 0a |cription|._.X.TH.|
|00003fa0| 58 2e 73 70 2e 35 0a 31 | 30 30 30 30 30 26 50 4d |X.sp.5.1|00000&PM|
|00003fb0| 41 50 50 52 4f 47 26 70 | 6f 72 74 6d 61 70 70 65 |APPROG&p|ortmappe|
|00003fc0| 72 0a 31 30 30 30 30 31 | 26 52 53 54 41 54 50 52 |r.100001|&RSTATPR|
|00003fd0| 4f 47 26 72 65 6d 6f 74 | 65 20 73 74 61 74 73 20 |OG&remot|e stats |
|00003fe0| 20 20 20 20 20 20 20 20 | 20 20 20 0a 31 30 30 30 | | .1000|
|00003ff0| 30 32 26 52 55 53 45 52 | 53 50 52 4f 47 26 72 65 |02&RUSER|SPROG&re|
|00004000| 6d 6f 74 65 20 75 73 65 | 72 73 20 20 20 20 20 20 |mote use|rs |
|00004010| 20 20 20 20 20 20 0a 31 | 30 30 30 30 33 26 4e 46 | .1|00003&NF|
|00004020| 53 50 52 4f 47 26 6e 66 | 73 20 20 20 20 20 20 20 |SPROG&nf|s |
|00004030| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 0a 31 | | .1|
|00004040| 30 30 30 30 34 26 59 50 | 50 52 4f 47 26 59 65 6c |00004&YP|PROG&Yel|
|00004050| 6c 6f 77 20 50 61 67 65 | 73 20 20 20 20 20 20 20 |low Page|s |
|00004060| 20 20 20 20 20 0a 31 30 | 30 30 30 35 26 4d 4f 55 | .10|0005&MOU|
|00004070| 4e 54 50 52 4f 47 26 6d | 6f 75 6e 74 20 64 65 6d |NTPROG&m|ount dem|
|00004080| 6f 6e 20 20 20 20 20 20 | 20 20 20 20 20 20 20 0a |on | .|
|00004090| 31 30 30 30 30 36 26 44 | 42 58 50 52 4f 47 26 72 |100006&D|BXPROG&r|
|000040a0| 65 6d 6f 74 65 20 64 62 | 78 20 20 20 20 20 20 20 |emote db|x |
|000040b0| 20 20 20 20 20 20 20 0a | 31 30 30 30 30 37 26 59 | .|100007&Y|
|000040c0| 50 42 49 4e 44 50 52 4f | 47 26 79 70 20 62 69 6e |PBINDPRO|G&yp bin|
|000040d0| 64 65 72 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |der | |
|000040e0| 20 20 0a 31 30 30 30 30 | 38 26 57 41 4c 4c 50 52 | .10000|8&WALLPR|
|000040f0| 4f 47 26 73 68 75 74 64 | 6f 77 6e 20 6d 73 67 20 |OG&shutd|own msg |
|00004100| 20 20 20 20 20 20 20 20 | 20 20 20 0a 31 30 30 30 | | .1000|
|00004110| 30 39 26 59 50 50 41 53 | 53 57 44 50 52 4f 47 26 |09&YPPAS|SWDPROG&|
|00004120| 79 70 70 61 73 73 77 64 | 20 73 65 72 76 65 72 20 |yppasswd| server |
|00004130| 20 20 20 20 20 20 20 20 | 0a 31 30 30 30 31 30 26 | |.100010&|
|00004140| 45 54 48 45 52 53 54 41 | 54 50 52 4f 47 26 65 74 |ETHERSTA|TPROG&et|
|00004150| 68 65 72 20 73 74 61 74 | 73 20 20 20 20 20 20 20 |her stat|s |
|00004160| 20 20 20 20 20 20 0a 31 | 30 30 30 31 31 26 52 51 | .1|00011&RQ|
|00004170| 55 4f 54 41 50 52 4f 47 | 26 64 69 73 6b 20 71 75 |UOTAPROG|&disk qu|
|00004180| 6f 74 61 73 20 20 20 20 | 20 20 20 20 20 20 20 20 |otas | |
|00004190| 20 0a 31 30 30 30 31 32 | 26 53 50 52 41 59 50 52 | .100012|&SPRAYPR|
|000041a0| 4f 47 26 73 70 72 61 79 | 20 70 61 63 6b 65 74 73 |OG&spray| packets|
|000041b0| 20 20 20 20 20 20 20 20 | 20 20 20 0a 31 30 30 30 | | .1000|
|000041c0| 31 33 26 49 42 4d 33 32 | 37 30 50 52 4f 47 26 33 |13&IBM32|70PROG&3|
|000041d0| 32 37 30 20 6d 61 70 70 | 65 72 20 20 20 20 20 20 |270 mapp|er |
|000041e0| 20 20 20 20 20 20 20 0a | 31 30 30 30 31 34 26 49 | .|100014&I|
|000041f0| 42 4d 52 4a 45 50 52 4f | 47 26 52 4a 45 20 6d 61 |BMRJEPRO|G&RJE ma|
|00004200| 70 70 65 72 20 20 20 20 | 20 20 20 20 20 20 20 20 |pper | |
|00004210| 20 20 0a 31 30 30 30 31 | 35 26 53 45 4c 4e 53 56 | .10001|5&SELNSV|
|00004220| 43 50 52 4f 47 26 73 65 | 6c 65 63 74 69 6f 6e 20 |CPROG&se|lection |
|00004230| 73 65 72 76 69 63 65 20 | 20 20 20 20 20 20 0a 31 |service | .1|
|00004240| 30 30 30 31 36 26 52 44 | 41 54 41 42 41 53 45 50 |00016&RD|ATABASEP|
|00004250| 52 4f 47 26 72 65 6d 6f | 74 65 20 64 61 74 61 62 |ROG&remo|te datab|
|00004260| 61 73 65 20 61 63 63 65 | 73 73 20 20 0a 31 30 30 |ase acce|ss .100|
|00004270| 30 31 37 26 52 45 58 45 | 43 50 52 4f 47 26 72 65 |017&REXE|CPROG&re|
|00004280| 6d 6f 74 65 20 65 78 65 | 63 75 74 69 6f 6e 20 20 |mote exe|cution |
|00004290| 20 20 20 20 20 20 0a 31 | 30 30 30 31 38 26 41 4c | .1|00018&AL|
|000042a0| 49 43 45 50 52 4f 47 26 | 41 6c 69 63 65 20 4f 66 |ICEPROG&|Alice Of|
|000042b0| 66 69 63 65 20 41 75 74 | 6f 6d 61 74 69 6f 6e 20 |fice Aut|omation |
|000042c0| 0a 31 30 30 30 31 39 26 | 53 43 48 45 44 50 52 4f |.100019&|SCHEDPRO|
|000042d0| 47 26 73 63 68 65 64 75 | 6c 69 6e 67 20 73 65 72 |G&schedu|ling ser|
|000042e0| 76 69 63 65 20 20 20 20 | 20 20 0a 31 30 30 30 32 |vice | .10002|
|000042f0| 30 26 4c 4f 43 4b 50 52 | 4f 47 26 6c 6f 63 61 6c |0&LOCKPR|OG&local|
|00004300| 20 6c 6f 63 6b 20 6d 61 | 6e 61 67 65 72 20 20 20 | lock ma|nager |
|00004310| 20 20 20 0a 31 30 30 30 | 32 31 26 4e 45 54 4c 4f | .1000|21&NETLO|
|00004320| 43 4b 50 52 4f 47 26 6e | 65 74 77 6f 72 6b 20 6c |CKPROG&n|etwork l|
|00004330| 6f 63 6b 20 6d 61 6e 61 | 67 65 72 20 20 20 20 0a |ock mana|ger .|
|00004340| 31 30 30 30 32 32 26 58 | 32 35 50 52 4f 47 26 78 |100022&X|25PROG&x|
|00004350| 2e 32 35 20 69 6e 72 20 | 70 72 6f 74 6f 63 6f 6c |.25 inr |protocol|
|00004360| 20 20 20 20 20 20 20 0a | 31 30 30 30 32 33 26 53 | .|100023&S|
|00004370| 54 41 54 4d 4f 4e 31 50 | 52 4f 47 26 73 74 61 74 |TATMON1P|ROG&stat|
|00004380| 75 73 20 6d 6f 6e 69 74 | 6f 72 20 31 20 20 20 20 |us monit|or 1 |
|00004390| 20 20 20 20 0a 31 30 30 | 30 32 34 26 53 54 41 54 | .100|024&STAT|
|000043a0| 4d 4f 4e 32 50 52 4f 47 | 26 73 74 61 74 75 73 20 |MON2PROG|&status |
|000043b0| 6d 6f 6e 69 74 6f 72 20 | 32 20 20 20 20 20 20 20 |monitor |2 |
|000043c0| 20 0a 31 30 30 30 32 35 | 26 53 45 4c 4e 4c 49 42 | .100025|&SELNLIB|
|000043d0| 50 52 4f 47 26 73 65 6c | 65 63 74 69 6f 6e 20 6c |PROG&sel|ection l|
|000043e0| 69 62 72 61 72 79 20 20 | 20 20 20 20 20 0a 31 30 |ibrary | .10|
|000043f0| 30 30 32 36 26 42 4f 4f | 54 50 41 52 41 4d 50 52 |0026&BOO|TPARAMPR|
|00004400| 4f 47 26 62 6f 6f 74 20 | 70 61 72 61 6d 65 74 65 |OG&boot |paramete|
|00004410| 72 73 20 73 65 72 76 69 | 63 65 20 0a 31 30 30 30 |rs servi|ce .1000|
|00004420| 32 37 26 4d 41 5a 45 50 | 52 4f 47 26 6d 61 7a 65 |27&MAZEP|ROG&maze|
|00004430| 77 61 72 73 20 67 61 6d | 65 20 20 20 20 20 20 20 |wars gam|e |
|00004440| 20 20 20 20 0a 31 30 30 | 30 32 38 26 59 50 55 50 | .100|028&YPUP|
|00004450| 44 41 54 45 50 52 4f 47 | 26 79 70 20 75 70 64 61 |DATEPROG|&yp upda|
|00004460| 74 65 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |te | |
|00004470| 20 0a 31 30 30 30 32 39 | 26 4b 45 59 53 45 52 56 | .100029|&KEYSERV|
|00004480| 45 50 52 4f 47 26 6b 65 | 79 20 73 65 72 76 65 72 |EPROG&ke|y server|
|00004490| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 0a 31 | | .1|
|000044a0| 30 30 30 33 30 26 53 45 | 43 55 52 45 43 4d 44 50 |00030&SE|CURECMDP|
|000044b0| 52 4f 47 26 73 65 63 75 | 72 65 20 6c 6f 67 69 6e |ROG&secu|re login|
|000044c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 0a 31 30 30 | | .100|
|000044d0| 30 33 31 26 4e 45 54 46 | 57 44 49 50 52 4f 47 26 |031&NETF|WDIPROG&|
|000044e0| 6e 66 73 20 6e 65 74 20 | 66 6f 72 77 61 72 64 65 |nfs net |forwarde|
|000044f0| 72 20 69 6e 69 74 09 0a | 31 30 30 30 33 32 26 4e |r init..|100032&N|
|00004500| 45 54 46 57 44 54 50 52 | 4f 47 26 6e 66 73 20 6e |ETFWDTPR|OG&nfs n|
|00004510| 65 74 20 66 6f 72 77 61 | 72 64 65 72 20 74 72 61 |et forwa|rder tra|
|00004520| 6e 73 09 0a 31 30 30 30 | 33 33 26 53 55 4e 4c 49 |ns..1000|33&SUNLI|
|00004530| 4e 4b 4d 41 50 5f 50 52 | 4f 47 26 73 75 6e 6c 69 |NKMAP_PR|OG&sunli|
|00004540| 6e 6b 20 4d 41 50 09 09 | 0a 31 30 30 30 33 34 26 |nk MAP..|.100034&|
|00004550| 4e 45 54 4d 4f 4e 50 52 | 4f 47 26 6e 65 74 77 6f |NETMONPR|OG&netwo|
|00004560| 72 6b 20 6d 6f 6e 69 74 | 6f 72 09 09 0a 31 30 30 |rk monit|or...100|
|00004570| 30 33 35 26 44 42 41 53 | 45 50 52 4f 47 26 6c 69 |035&DBAS|EPROG&li|
|00004580| 67 68 74 77 65 69 67 68 | 74 20 64 61 74 61 62 61 |ghtweigh|t databa|
|00004590| 73 65 09 0a 31 30 30 30 | 33 36 26 50 57 44 41 55 |se..1000|36&PWDAU|
|000045a0| 54 48 50 52 4f 47 26 70 | 61 73 73 77 6f 72 64 20 |THPROG&p|assword |
|000045b0| 61 75 74 68 6f 72 69 7a | 61 74 69 6f 6e 09 0a 31 |authoriz|ation..1|
|000045c0| 30 30 30 33 37 26 54 46 | 53 50 52 4f 47 26 74 72 |00037&TF|SPROG&tr|
|000045d0| 61 6e 73 6c 75 63 65 6e | 74 20 66 69 6c 65 20 73 |anslucen|t file s|
|000045e0| 76 63 09 0a 31 30 30 30 | 33 38 26 4e 53 45 50 52 |vc..1000|38&NSEPR|
|000045f0| 4f 47 26 6e 73 65 20 73 | 65 72 76 65 72 09 09 0a |OG&nse s|erver...|
|00004600| 31 30 30 30 33 39 26 4e | 53 45 5f 41 43 54 49 56 |100039&N|SE_ACTIV|
|00004610| 41 54 45 5f 50 52 4f 47 | 26 6e 73 65 20 61 63 74 |ATE_PROG|&nse act|
|00004620| 69 76 61 74 65 20 64 61 | 65 6d 6f 6e 09 0a 58 2e |ivate da|emon..X.|
|00004630| 73 70 20 2e 32 69 0a 31 | 35 30 30 30 31 26 50 43 |sp .2i.1|50001&PC|
|00004640| 4e 46 53 44 50 52 4f 47 | 26 70 63 20 70 61 73 73 |NFSDPROG|&pc pass|
|00004650| 77 64 20 61 75 74 68 6f | 72 69 7a 61 74 69 6f 6e |wd autho|rization|
|00004660| 20 0a 58 2e 73 70 20 2e | 32 69 0a 32 30 30 30 30 | .X.sp .|2i.20000|
|00004670| 30 26 50 59 52 41 4d 49 | 44 4c 4f 43 4b 49 4e 47 |0&PYRAMI|DLOCKING|
|00004680| 50 52 4f 47 26 50 79 72 | 61 6d 69 64 2d 6c 6f 63 |PROG&Pyr|amid-loc|
|00004690| 6b 69 6e 67 20 20 20 20 | 20 20 20 20 20 0a 32 30 |king | .20|
|000046a0| 30 30 30 31 26 50 59 52 | 41 4d 49 44 53 59 53 35 |0001&PYR|AMIDSYS5|
|000046b0| 26 50 79 72 61 6d 69 64 | 2d 73 79 73 35 20 20 20 |&Pyramid|-sys5 |
|000046c0| 20 20 20 20 20 20 20 20 | 20 0a 32 30 30 30 30 32 | | .200002|
|000046d0| 26 43 41 44 44 53 5f 49 | 4d 41 47 45 26 43 56 20 |&CADDS_I|MAGE&CV |
|000046e0| 63 61 64 64 73 5f 69 6d | 61 67 65 09 09 0a 58 2e |cadds_im|age...X.|
|000046f0| 73 70 20 2e 32 69 0a 33 | 30 30 30 30 31 26 41 44 |sp .2i.3|00001&AD|
|00004700| 54 5f 52 46 4c 4f 43 4b | 50 52 4f 47 26 41 44 54 |T_RFLOCK|PROG&ADT|
|00004710| 20 66 69 6c 65 20 6c 6f | 63 6b 69 6e 67 09 0a 58 | file lo|cking..X|
|00004720| 2e 54 45 0a 58 2e 0a 58 | 2e 4e 48 20 32 0a 5c 26 |.TE.X..X|.NH 2.\&|
|00004730| 50 61 73 73 69 6e 67 20 | 41 72 62 69 74 72 61 72 |Passing |Arbitrar|
|00004740| 79 20 44 61 74 61 20 54 | 79 70 65 73 0a 58 2e 49 |y Data T|ypes.X.I|
|00004750| 58 20 22 70 61 73 73 69 | 6e 67 20 61 72 62 69 74 |X "passi|ng arbit|
|00004760| 72 61 72 79 20 64 61 74 | 61 20 74 79 70 65 73 22 |rary dat|a types"|
|00004770| 0a 58 2e 49 58 20 22 61 | 72 62 69 74 72 61 72 79 |.X.IX "a|rbitrary|
|00004780| 20 64 61 74 61 20 74 79 | 70 65 73 22 0a 58 2e 4c | data ty|pes".X.L|
|00004790| 50 0a 49 6e 20 74 68 65 | 20 70 72 65 76 69 6f 75 |P.In the| previou|
|000047a0| 73 20 65 78 61 6d 70 6c | 65 2c 20 74 68 65 20 52 |s exampl|e, the R|
|000047b0| 50 43 20 63 61 6c 6c 20 | 70 61 73 73 65 73 20 61 |PC call |passes a|
|000047c0| 20 73 69 6e 67 6c 65 0a | 58 2e 49 20 22 75 6e 73 | single.|X.I "uns|
|000047d0| 69 67 6e 65 64 20 6c 6f | 6e 67 22 0a 52 50 43 20 |igned lo|ng".RPC |
|000047e0| 63 61 6e 20 68 61 6e 64 | 6c 65 20 61 72 62 69 74 |can hand|le arbit|
|000047f0| 72 61 72 79 20 64 61 74 | 61 20 73 74 72 75 63 74 |rary dat|a struct|
|00004800| 75 72 65 73 2c 20 72 65 | 67 61 72 64 6c 65 73 73 |ures, re|gardless|
|00004810| 20 6f 66 0a 64 69 66 66 | 65 72 65 6e 74 20 6d 61 | of.diff|erent ma|
|00004820| 63 68 69 6e 65 73 27 20 | 62 79 74 65 20 6f 72 64 |chines' |byte ord|
|00004830| 65 72 73 20 6f 72 20 73 | 74 72 75 63 74 75 72 65 |ers or s|tructure|
|00004840| 20 6c 61 79 6f 75 74 20 | 63 6f 6e 76 65 6e 74 69 | layout |conventi|
|00004850| 6f 6e 73 2c 0a 62 79 20 | 61 6c 77 61 79 73 20 63 |ons,.by |always c|
|00004860| 6f 6e 76 65 72 74 69 6e | 67 20 74 68 65 6d 20 74 |onvertin|g them t|
|00004870| 6f 20 61 20 6e 65 74 77 | 6f 72 6b 20 73 74 61 6e |o a netw|ork stan|
|00004880| 64 61 72 64 20 63 61 6c | 6c 65 64 0a 58 2e 49 20 |dard cal|led.X.I |
|00004890| 22 65 58 74 65 72 6e 61 | 6c 20 44 61 74 61 20 52 |"eXterna|l Data R|
|000048a0| 65 70 72 65 73 65 6e 74 | 61 74 69 6f 6e 22 0a 28 |epresent|ation".(|
|000048b0| 58 44 52 29 20 62 65 66 | 6f 72 65 0a 73 65 6e 64 |XDR) bef|ore.send|
|000048c0| 69 6e 67 20 74 68 65 6d | 20 6f 76 65 72 20 74 68 |ing them| over th|
|000048d0| 65 20 77 69 72 65 2e 0a | 54 68 65 20 70 72 6f 63 |e wire..|The proc|
|000048e0| 65 73 73 20 6f 66 20 63 | 6f 6e 76 65 72 74 69 6e |ess of c|onvertin|
|000048f0| 67 20 66 72 6f 6d 20 61 | 20 70 61 72 74 69 63 75 |g from a| particu|
|00004900| 6c 61 72 20 6d 61 63 68 | 69 6e 65 20 72 65 70 72 |lar mach|ine repr|
|00004910| 65 73 65 6e 74 61 74 69 | 6f 6e 0a 74 6f 20 58 44 |esentati|on.to XD|
|00004920| 52 20 66 6f 72 6d 61 74 | 20 69 73 20 63 61 6c 6c |R format| is call|
|00004930| 65 64 0a 58 2e 49 20 73 | 65 72 69 61 6c 69 7a 69 |ed.X.I s|erializi|
|00004940| 6e 67 20 2c 0a 61 6e 64 | 20 74 68 65 20 72 65 76 |ng ,.and| the rev|
|00004950| 65 72 73 65 20 70 72 6f | 63 65 73 73 20 69 73 20 |erse pro|cess is |
|00004960| 63 61 6c 6c 65 64 0a 58 | 2e 49 20 64 65 73 65 72 |called.X|.I deser|
|00004970| 69 61 6c 69 7a 69 6e 67 | 20 2e 0a 54 68 65 20 74 |ializing| ..The t|
|00004980| 79 70 65 20 66 69 65 6c | 64 20 70 61 72 61 6d 65 |ype fiel|d parame|
|00004990| 74 65 72 73 20 6f 66 0a | 58 2e 49 20 63 61 6c 6c |ters of.|X.I call|
|000049a0| 72 70 63 20 0a 61 6e 64 | 0a 58 2e 49 20 72 65 67 |rpc .and|.X.I reg|
|000049b0| 69 73 74 65 72 72 70 63 | 20 0a 63 61 6e 20 62 65 |isterrpc| .can be|
|000049c0| 20 61 20 62 75 69 6c 74 | 2d 69 6e 20 70 72 6f 63 | a built|-in proc|
|000049d0| 65 64 75 72 65 20 6c 69 | 6b 65 0a 58 2e 49 20 78 |edure li|ke.X.I x|
|000049e0| 64 72 5f 75 5f 6c 6f 6e | 67 20 0a 69 6e 20 74 68 |dr_u_lon|g .in th|
|000049f0| 65 20 70 72 65 76 69 6f | 75 73 20 65 78 61 6d 70 |e previo|us examp|
|00004a00| 6c 65 2c 20 6f 72 20 61 | 20 75 73 65 72 20 73 75 |le, or a| user su|
|00004a10| 70 70 6c 69 65 64 20 6f | 6e 65 2e 0a 58 44 52 20 |pplied o|ne..XDR |
|00004a20| 68 61 73 20 74 68 65 73 | 65 20 62 75 69 6c 74 2d |has thes|e built-|
|00004a30| 69 6e 20 74 79 70 65 20 | 72 6f 75 74 69 6e 65 73 |in type |routines|
|00004a40| 3a 0a 58 2e 49 58 20 52 | 50 43 20 22 62 75 69 6c |:.X.IX R|PC "buil|
|00004a50| 74 2d 69 6e 20 72 6f 75 | 74 69 6e 65 73 22 0a 58 |t-in rou|tines".X|
|00004a60| 2e 44 53 0a 58 2e 66 74 | 20 43 57 0a 78 64 72 5f |.DS.X.ft| CW.xdr_|
|00004a70| 69 6e 74 28 29 20 20 20 | 20 20 20 78 64 72 5f 75 |int() | xdr_u|
|00004a80| 5f 69 6e 74 28 29 20 20 | 20 20 20 20 78 64 72 5f |_int() | xdr_|
|00004a90| 65 6e 75 6d 28 29 0a 78 | 64 72 5f 6c 6f 6e 67 28 |enum().x|dr_long(|
|00004aa0| 29 20 20 20 20 20 78 64 | 72 5f 75 5f 6c 6f 6e 67 |) xd|r_u_long|
|00004ab0| 28 29 20 20 20 20 20 78 | 64 72 5f 62 6f 6f 6c 28 |() x|dr_bool(|
|00004ac0| 29 0a 78 64 72 5f 73 68 | 6f 72 74 28 29 20 20 20 |).xdr_sh|ort() |
|00004ad0| 20 78 64 72 5f 75 5f 73 | 68 6f 72 74 28 29 20 20 | xdr_u_s|hort() |
|00004ae0| 20 20 78 64 72 5f 77 72 | 61 70 73 74 72 69 6e 67 | xdr_wr|apstring|
|00004af0| 28 29 0a 78 64 72 5f 63 | 68 61 72 28 29 20 20 20 |().xdr_c|har() |
|00004b00| 20 20 78 64 72 5f 75 5f | 63 68 61 72 28 29 0a 58 | xdr_u_|char().X|
|00004b10| 2e 44 45 0a 4e 6f 74 65 | 20 74 68 61 74 20 74 68 |.DE.Note| that th|
|00004b20| 65 20 72 6f 75 74 69 6e | 65 0a 58 2e 49 20 78 64 |e routin|e.X.I xd|
|00004b30| 72 5f 73 74 72 69 6e 67 | 0a 65 78 69 73 74 73 2c |r_string|.exists,|
|00004b40| 20 62 75 74 20 63 61 6e | 6e 6f 74 20 62 65 20 75 | but can|not be u|
|00004b50| 73 65 64 20 77 69 74 68 | 20 0a 58 2e 49 20 63 61 |sed with| .X.I ca|
|00004b60| 6c 6c 72 70 63 20 0a 61 | 6e 64 0a 58 2e 49 20 72 |llrpc .a|nd.X.I r|
|00004b70| 65 67 69 73 74 65 72 72 | 70 63 20 2c 0a 77 68 69 |egisterr|pc ,.whi|
|00004b80| 63 68 20 6f 6e 6c 79 20 | 70 61 73 73 20 74 77 6f |ch only |pass two|
|00004b90| 20 70 61 72 61 6d 65 74 | 65 72 73 20 74 6f 20 74 | paramet|ers to t|
|00004ba0| 68 65 69 72 20 58 44 52 | 20 72 6f 75 74 69 6e 65 |heir XDR| routine|
|00004bb0| 73 2e 0a 58 2e 49 20 78 | 64 72 5f 77 72 61 70 73 |s..X.I x|dr_wraps|
|00004bc0| 74 72 69 6e 67 20 0a 68 | 61 73 20 6f 6e 6c 79 20 |tring .h|as only |
|00004bd0| 74 77 6f 20 70 61 72 61 | 6d 65 74 65 72 73 2c 20 |two para|meters, |
|00004be0| 61 6e 64 20 69 73 20 74 | 68 75 73 20 4f 4b 2e 20 |and is t|hus OK. |
|00004bf0| 20 49 74 20 63 61 6c 6c | 73 20 0a 58 2e 49 20 78 | It call|s .X.I x|
|00004c00| 64 72 5f 73 74 72 69 6e | 67 20 2e 0a 58 2e 4c 50 |dr_strin|g ..X.LP|
|00004c10| 0a 41 73 20 61 6e 20 65 | 78 61 6d 70 6c 65 20 6f |.As an e|xample o|
|00004c20| 66 20 61 20 75 73 65 72 | 2d 64 65 66 69 6e 65 64 |f a user|-defined|
|00004c30| 20 74 79 70 65 20 72 6f | 75 74 69 6e 65 2c 0a 69 | type ro|utine,.i|
|00004c40| 66 20 79 6f 75 20 77 61 | 6e 74 65 64 20 74 6f 20 |f you wa|nted to |
|00004c50| 73 65 6e 64 20 74 68 65 | 20 73 74 72 75 63 74 75 |send the| structu|
|00004c60| 72 65 0a 58 2e 44 53 0a | 58 2e 66 74 20 43 57 0a |re.X.DS.|X.ft CW.|
|00004c70| 73 74 72 75 63 74 20 73 | 69 6d 70 6c 65 20 7b 0a |struct s|imple {.|
|00004c80| 09 69 6e 74 20 61 3b 0a | 09 73 68 6f 72 74 20 62 |.int a;.|.short b|
|00004c90| 3b 0a 7d 20 73 69 6d 70 | 6c 65 3b 0a 58 2e 44 45 |;.} simp|le;.X.DE|
|00004ca0| 0a 74 68 65 6e 20 79 6f | 75 20 77 6f 75 6c 64 20 |.then yo|u would |
|00004cb0| 63 61 6c 6c 0a 58 2e 49 | 20 63 61 6c 6c 72 70 63 |call.X.I| callrpc|
|00004cc0| 0a 61 73 0a 58 2e 44 53 | 0a 58 2e 66 74 20 43 57 |.as.X.DS|.X.ft CW|
|00004cd0| 0a 63 61 6c 6c 72 70 63 | 28 68 6f 73 74 6e 61 6d |.callrpc|(hostnam|
|00004ce0| 65 2c 20 50 52 4f 47 4e | 55 4d 2c 20 56 45 52 53 |e, PROGN|UM, VERS|
|00004cf0| 4e 55 4d 2c 20 50 52 4f | 43 4e 55 4d 2c 0a 20 20 |NUM, PRO|CNUM,. |
|00004d00| 20 20 20 20 20 20 78 64 | 72 5f 73 69 6d 70 6c 65 | xd|r_simple|
|00004d10| 2c 20 26 73 69 6d 70 6c | 65 20 2e 2e 2e 29 3b 0a |, &simpl|e ...);.|
|00004d20| 58 2e 44 45 0a 77 68 65 | 72 65 0a 58 2e 49 20 78 |X.DE.whe|re.X.I x|
|00004d30| 64 72 5f 73 69 6d 70 6c | 65 0a 69 73 20 77 72 69 |dr_simpl|e.is wri|
|00004d40| 74 74 65 6e 20 61 73 3a | 0a 58 2e 69 65 20 74 20 |tten as:|.X.ie t |
|00004d50| 2e 44 53 0a 58 2e 65 6c | 20 2e 44 53 20 4c 0a 58 |.DS.X.el| .DS L.X|
|00004d60| 2e 66 74 20 43 57 0a 23 | 69 6e 63 6c 75 64 65 20 |.ft CW.#|include |
|00004d70| 3c 72 70 63 2f 72 70 63 | 2e 68 3e 0a 0a 78 64 72 |<rpc/rpc|.h>..xdr|
|00004d80| 5f 73 69 6d 70 6c 65 28 | 78 64 72 73 70 2c 20 73 |_simple(|xdrsp, s|
|00004d90| 69 6d 70 6c 65 70 29 0a | 09 58 44 52 20 2a 78 64 |implep).|.XDR *xd|
|00004da0| 72 73 70 3b 0a 09 73 74 | 72 75 63 74 20 73 69 6d |rsp;..st|ruct sim|
|00004db0| 70 6c 65 20 2a 73 69 6d | 70 6c 65 70 3b 0a 7b 0a |ple *sim|plep;.{.|
|00004dc0| 09 69 66 20 28 21 78 64 | 72 5f 69 6e 74 28 78 64 |.if (!xd|r_int(xd|
|00004dd0| 72 73 70 2c 20 26 73 69 | 6d 70 6c 65 70 2d 3e 61 |rsp, &si|mplep->a|
|00004de0| 29 29 0a 09 09 72 65 74 | 75 72 6e 20 28 30 29 3b |))...ret|urn (0);|
|00004df0| 0a 09 69 66 20 28 21 78 | 64 72 5f 73 68 6f 72 74 |..if (!x|dr_short|
|00004e00| 28 78 64 72 73 70 2c 20 | 26 73 69 6d 70 6c 65 70 |(xdrsp, |&simplep|
|00004e10| 2d 3e 62 29 29 0a 09 09 | 72 65 74 75 72 6e 20 28 |->b))...|return (|
|00004e20| 30 29 3b 0a 09 72 65 74 | 75 72 6e 20 28 31 29 3b |0);..ret|urn (1);|
|00004e30| 0a 7d 0a 58 2e 44 45 0a | 58 2e 4c 50 0a 41 6e 20 |.}.X.DE.|X.LP.An |
|00004e40| 58 44 52 20 72 6f 75 74 | 69 6e 65 20 72 65 74 75 |XDR rout|ine retu|
|00004e50| 72 6e 73 20 6e 6f 6e 7a | 65 72 6f 20 28 74 72 75 |rns nonz|ero (tru|
|00004e60| 65 20 69 6e 20 74 68 65 | 20 73 65 6e 73 65 20 6f |e in the| sense o|
|00004e70| 66 20 43 29 20 69 66 20 | 69 74 20 0a 63 6f 6d 70 |f C) if |it .comp|
|00004e80| 6c 65 74 65 73 20 73 75 | 63 63 65 73 73 66 75 6c |letes su|ccessful|
|00004e90| 6c 79 2c 20 61 6e 64 20 | 7a 65 72 6f 20 6f 74 68 |ly, and |zero oth|
|00004ea0| 65 72 77 69 73 65 2e 0a | 41 20 63 6f 6d 70 6c 65 |erwise..|A comple|
|00004eb0| 74 65 20 64 65 73 63 72 | 69 70 74 69 6f 6e 20 6f |te descr|iption o|
|00004ec0| 66 20 58 44 52 20 69 73 | 20 69 6e 20 74 68 65 0a |f XDR is| in the.|
|00004ed0| 58 2e 49 20 22 58 44 52 | 20 50 72 6f 74 6f 63 6f |X.I "XDR| Protoco|
|00004ee0| 6c 20 53 70 65 63 69 66 | 69 63 61 74 69 6f 6e 22 |l Specif|ication"|
|00004ef0| 20 0a 73 65 63 74 69 6f | 6e 20 6f 66 20 74 68 69 | .sectio|n of thi|
|00004f00| 73 20 6d 61 6e 75 61 6c | 2c 20 6f 6e 6c 79 20 66 |s manual|, only f|
|00004f10| 65 77 20 69 6d 70 6c 65 | 6d 65 6e 74 61 74 69 6f |ew imple|mentatio|
|00004f20| 6e 20 65 78 61 6d 70 6c | 65 73 20 61 72 65 20 0a |n exampl|es are .|
|00004f30| 67 69 76 65 6e 20 68 65 | 72 65 2e 0a 58 2e 4c 50 |given he|re..X.LP|
|00004f40| 0a 49 6e 20 61 64 64 69 | 74 69 6f 6e 20 74 6f 20 |.In addi|tion to |
|00004f50| 74 68 65 20 62 75 69 6c | 74 2d 69 6e 20 70 72 69 |the buil|t-in pri|
|00004f60| 6d 69 74 69 76 65 73 2c | 0a 74 68 65 72 65 20 61 |mitives,|.there a|
|00004f70| 72 65 20 61 6c 73 6f 20 | 74 68 65 20 70 72 65 66 |re also |the pref|
|00004f80| 61 62 72 69 63 61 74 65 | 64 20 62 75 69 6c 64 69 |abricate|d buildi|
|00004f90| 6e 67 20 62 6c 6f 63 6b | 73 3a 0a 58 2e 44 53 0a |ng block|s:.X.DS.|
|00004fa0| 58 2e 66 74 20 43 57 0a | 78 64 72 5f 61 72 72 61 |X.ft CW.|xdr_arra|
|00004fb0| 79 28 29 20 20 20 20 20 | 20 20 78 64 72 5f 62 79 |y() | xdr_by|
|00004fc0| 74 65 73 28 29 20 20 20 | 20 20 78 64 72 5f 72 65 |tes() | xdr_re|
|00004fd0| 66 65 72 65 6e 63 65 28 | 29 0a 78 64 72 5f 76 65 |ference(|).xdr_ve|
|00004fe0| 63 74 6f 72 28 29 20 20 | 20 20 20 20 78 64 72 5f |ctor() | xdr_|
|00004ff0| 75 6e 69 6f 6e 28 29 20 | 20 20 20 20 78 64 72 5f |union() | xdr_|
|00005000| 70 6f 69 6e 74 65 72 28 | 29 0a 78 64 72 5f 73 74 |pointer(|).xdr_st|
|00005010| 72 69 6e 67 28 29 20 20 | 20 20 20 20 78 64 72 5f |ring() | xdr_|
|00005020| 6f 70 61 71 75 65 28 29 | 0a 58 2e 44 45 0a 54 6f |opaque()|.X.DE.To|
|00005030| 20 73 65 6e 64 20 61 20 | 76 61 72 69 61 62 6c 65 | send a |variable|
|00005040| 20 61 72 72 61 79 20 6f | 66 20 69 6e 74 65 67 65 | array o|f intege|
|00005050| 72 73 2c 0a 79 6f 75 20 | 6d 69 67 68 74 20 70 61 |rs,.you |might pa|
|00005060| 63 6b 61 67 65 20 74 68 | 65 6d 20 75 70 20 61 73 |ckage th|em up as|
|00005070| 20 61 20 73 74 72 75 63 | 74 75 72 65 20 6c 69 6b | a struc|ture lik|
|00005080| 65 20 74 68 69 73 0a 58 | 2e 44 53 0a 58 2e 66 74 |e this.X|.DS.X.ft|
|00005090| 20 43 57 0a 73 74 72 75 | 63 74 20 76 61 72 69 6e | CW.stru|ct varin|
|000050a0| 74 61 72 72 20 7b 0a 09 | 69 6e 74 20 2a 64 61 74 |tarr {..|int *dat|
|000050b0| 61 3b 0a 09 69 6e 74 20 | 61 72 72 6c 6e 74 68 3b |a;..int |arrlnth;|
|000050c0| 0a 7d 20 61 72 72 3b 0a | 58 2e 44 45 0a 61 6e 64 |.} arr;.|X.DE.and|
|000050d0| 20 6d 61 6b 65 20 61 6e | 20 52 50 43 20 63 61 6c | make an| RPC cal|
|000050e0| 6c 20 73 75 63 68 20 61 | 73 0a 58 2e 44 53 0a 58 |l such a|s.X.DS.X|
|000050f0| 2e 66 74 20 43 57 0a 63 | 61 6c 6c 72 70 63 28 68 |.ft CW.c|allrpc(h|
|00005100| 6f 73 74 6e 61 6d 65 2c | 20 50 52 4f 47 4e 55 4d |ostname,| PROGNUM|
|00005110| 2c 20 56 45 52 53 4e 55 | 4d 2c 20 50 52 4f 43 4e |, VERSNU|M, PROCN|
|00005120| 55 4d 2c 0a 20 20 20 20 | 20 20 20 20 78 64 72 5f |UM,. | xdr_|
|00005130| 76 61 72 69 6e 74 61 72 | 72 2c 20 26 61 72 72 2e |varintar|r, &arr.|
|00005140| 2e 2e 29 3b 0a 58 2e 44 | 45 0a 77 69 74 68 0a 58 |..);.X.D|E.with.X|
|00005150| 2e 49 20 78 64 72 5f 76 | 61 72 69 6e 74 61 72 72 |.I xdr_v|arintarr|
|00005160| 20 0a 64 65 66 69 6e 65 | 64 20 61 73 3a 0a 58 2e | .define|d as:.X.|
|00005170| 69 65 20 74 20 2e 44 53 | 0a 58 2e 65 6c 20 2e 44 |ie t .DS|.X.el .D|
|00005180| 53 20 4c 0a 58 2e 66 74 | 20 43 57 0a 78 64 72 5f |S L.X.ft| CW.xdr_|
|00005190| 76 61 72 69 6e 74 61 72 | 72 28 78 64 72 73 70 2c |varintar|r(xdrsp,|
|000051a0| 20 61 72 72 70 29 0a 09 | 58 44 52 20 2a 78 64 72 | arrp)..|XDR *xdr|
|000051b0| 73 70 3b 0a 09 73 74 72 | 75 63 74 20 76 61 72 69 |sp;..str|uct vari|
|000051c0| 6e 74 61 72 72 20 2a 61 | 72 72 70 3b 0a 7b 0a 09 |ntarr *a|rrp;.{..|
|000051d0| 72 65 74 75 72 6e 20 28 | 78 64 72 5f 61 72 72 61 |return (|xdr_arra|
|000051e0| 79 28 78 64 72 73 70 2c | 20 26 61 72 72 70 2d 3e |y(xdrsp,| &arrp->|
|000051f0| 64 61 74 61 2c 20 26 61 | 72 72 70 2d 3e 61 72 72 |data, &a|rrp->arr|
|00005200| 6c 6e 74 68 2c 20 0a 09 | 09 4d 41 58 4c 45 4e 2c |lnth, ..|.MAXLEN,|
|00005210| 20 73 69 7a 65 6f 66 28 | 69 6e 74 29 2c 20 78 64 | sizeof(|int), xd|
|00005220| 72 5f 69 6e 74 29 29 3b | 0a 7d 0a 58 2e 44 45 0a |r_int));|.}.X.DE.|
|00005230| 54 68 69 73 20 72 6f 75 | 74 69 6e 65 20 74 61 6b |This rou|tine tak|
|00005240| 65 73 20 61 73 20 70 61 | 72 61 6d 65 74 65 72 73 |es as pa|rameters|
|00005250| 20 74 68 65 20 58 44 52 | 20 68 61 6e 64 6c 65 2c | the XDR| handle,|
|00005260| 0a 61 20 70 6f 69 6e 74 | 65 72 20 74 6f 20 74 68 |.a point|er to th|
|00005270| 65 20 61 72 72 61 79 2c | 20 61 20 70 6f 69 6e 74 |e array,| a point|
|00005280| 65 72 20 74 6f 20 74 68 | 65 20 73 69 7a 65 20 6f |er to th|e size o|
|00005290| 66 20 74 68 65 20 61 72 | 72 61 79 2c 0a 74 68 65 |f the ar|ray,.the|
|000052a0| 20 6d 61 78 69 6d 75 6d | 20 61 6c 6c 6f 77 61 62 | maximum| allowab|
|000052b0| 6c 65 20 61 72 72 61 79 | 20 73 69 7a 65 2c 0a 74 |le array| size,.t|
|000052c0| 68 65 20 73 69 7a 65 20 | 6f 66 20 65 61 63 68 20 |he size |of each |
|000052d0| 61 72 72 61 79 20 65 6c | 65 6d 65 6e 74 2c 0a 61 |array el|ement,.a|
|000052e0| 6e 64 20 61 6e 20 58 44 | 52 20 72 6f 75 74 69 6e |nd an XD|R routin|
|000052f0| 65 20 66 6f 72 20 68 61 | 6e 64 6c 69 6e 67 20 65 |e for ha|ndling e|
|00005300| 61 63 68 20 61 72 72 61 | 79 20 65 6c 65 6d 65 6e |ach arra|y elemen|
|00005310| 74 2e 0a 58 2e 4b 53 0a | 58 2e 4c 50 0a 49 66 20 |t..X.KS.|X.LP.If |
|00005320| 74 68 65 20 73 69 7a 65 | 20 6f 66 20 74 68 65 20 |the size| of the |
|00005330| 61 72 72 61 79 20 69 73 | 20 6b 6e 6f 77 6e 20 69 |array is| known i|
|00005340| 6e 20 61 64 76 61 6e 63 | 65 2c 20 6f 6e 65 20 63 |n advanc|e, one c|
|00005350| 61 6e 20 75 73 65 0a 58 | 2e 49 20 78 64 72 5f 76 |an use.X|.I xdr_v|
|00005360| 65 63 74 6f 72 20 2c 0a | 77 68 69 63 68 20 73 65 |ector ,.|which se|
|00005370| 72 69 61 6c 69 7a 65 73 | 20 66 69 78 65 64 2d 6c |rializes| fixed-l|
|00005380| 65 6e 67 74 68 20 61 72 | 72 61 79 73 2e 0a 58 2e |ength ar|rays..X.|
|00005390| 69 65 20 74 20 2e 44 53 | 0a 58 2e 65 6c 20 2e 44 |ie t .DS|.X.el .D|
|000053a0| 53 20 4c 0a 58 2e 66 74 | 20 43 57 0a 69 6e 74 20 |S L.X.ft| CW.int |
|000053b0| 69 6e 74 61 72 72 5b 53 | 49 5a 45 5d 3b 0a 0a 78 |intarr[S|IZE];..x|
|000053c0| 64 72 5f 69 6e 74 61 72 | 72 28 78 64 72 73 70 2c |dr_intar|r(xdrsp,|
|000053d0| 20 69 6e 74 61 72 72 29 | 0a 09 58 44 52 20 2a 78 | intarr)|..XDR *x|
|000053e0| 64 72 73 70 3b 0a 09 69 | 6e 74 20 69 6e 74 61 72 |drsp;..i|nt intar|
|000053f0| 72 5b 5d 3b 0a 7b 0a 09 | 69 6e 74 20 69 3b 0a 0a |r[];.{..|int i;..|
|00005400| 09 72 65 74 75 72 6e 20 | 28 78 64 72 5f 76 65 63 |.return |(xdr_vec|
|00005410| 74 6f 72 28 78 64 72 73 | 70 2c 20 69 6e 74 61 72 |tor(xdrs|p, intar|
|00005420| 72 2c 20 53 49 5a 45 2c | 20 73 69 7a 65 6f 66 28 |r, SIZE,| sizeof(|
|00005430| 69 6e 74 29 2c 0a 09 09 | 78 64 72 5f 69 6e 74 29 |int),...|xdr_int)|
|00005440| 29 3b 0a 7d 0a 58 2e 44 | 45 0a 58 2e 4b 45 0a 58 |);.}.X.D|E.X.KE.X|
|00005450| 2e 4c 50 0a 58 44 52 20 | 61 6c 77 61 79 73 20 63 |.LP.XDR |always c|
|00005460| 6f 6e 76 65 72 74 73 20 | 71 75 61 6e 74 69 74 69 |onverts |quantiti|
|00005470| 65 73 20 74 6f 20 34 2d | 62 79 74 65 20 6d 75 6c |es to 4-|byte mul|
|00005480| 74 69 70 6c 65 73 20 77 | 68 65 6e 20 64 65 73 65 |tiples w|hen dese|
|00005490| 72 69 61 6c 69 7a 69 6e | 67 2e 0a 54 68 75 73 2c |rializin|g..Thus,|
|000054a0| 20 69 66 20 65 69 74 68 | 65 72 20 6f 66 20 74 68 | if eith|er of th|
|000054b0| 65 20 65 78 61 6d 70 6c | 65 73 20 61 62 6f 76 65 |e exampl|es above|
|000054c0| 20 69 6e 76 6f 6c 76 65 | 64 20 63 68 61 72 61 63 | involve|d charac|
|000054d0| 74 65 72 73 0a 69 6e 73 | 74 65 61 64 20 6f 66 20 |ters.ins|tead of |
|000054e0| 69 6e 74 65 67 65 72 73 | 2c 20 65 61 63 68 20 63 |integers|, each c|
|000054f0| 68 61 72 61 63 74 65 72 | 20 77 6f 75 6c 64 20 6f |haracter| would o|
|00005500| 63 63 75 70 79 20 33 32 | 20 62 69 74 73 2e 0a 54 |ccupy 32| bits..T|
|00005510| 68 61 74 20 69 73 20 74 | 68 65 20 72 65 61 73 6f |hat is t|he reaso|
|00005520| 6e 20 66 6f 72 20 74 68 | 65 20 58 44 52 20 72 6f |n for th|e XDR ro|
|00005530| 75 74 69 6e 65 0a 58 2e | 49 20 78 64 72 5f 62 79 |utine.X.|I xdr_by|
|00005540| 74 65 73 0a 77 68 69 63 | 68 20 69 73 20 6c 69 6b |tes.whic|h is lik|
|00005550| 65 0a 58 2e 49 20 78 64 | 72 5f 61 72 72 61 79 0a |e.X.I xd|r_array.|
|00005560| 65 78 63 65 70 74 20 74 | 68 61 74 20 69 74 20 70 |except t|hat it p|
|00005570| 61 63 6b 73 20 63 68 61 | 72 61 63 74 65 72 73 3b |acks cha|racters;|
|00005580| 0a 58 2e 49 20 78 64 72 | 5f 62 79 74 65 73 20 0a |.X.I xdr|_bytes .|
|00005590| 68 61 73 20 66 6f 75 72 | 20 70 61 72 61 6d 65 74 |has four| paramet|
|000055a0| 65 72 73 2c 20 73 69 6d | 69 6c 61 72 20 74 6f 20 |ers, sim|ilar to |
|000055b0| 74 68 65 20 66 69 72 73 | 74 20 66 6f 75 72 20 70 |the firs|t four p|
|000055c0| 61 72 61 6d 65 74 65 72 | 73 20 6f 66 0a 58 2e 49 |arameter|s of.X.I|
|000055d0| 20 78 64 72 5f 61 72 72 | 61 79 20 2e 0a 46 6f 72 | xdr_arr|ay ..For|
|000055e0| 20 6e 75 6c 6c 2d 74 65 | 72 6d 69 6e 61 74 65 64 | null-te|rminated|
|000055f0| 20 73 74 72 69 6e 67 73 | 2c 20 74 68 65 72 65 20 | strings|, there |
|00005600| 69 73 20 61 6c 73 6f 20 | 74 68 65 0a 58 2e 49 20 |is also |the.X.I |
|00005610| 78 64 72 5f 73 74 72 69 | 6e 67 0a 72 6f 75 74 69 |xdr_stri|ng.routi|
|00005620| 6e 65 2c 20 77 68 69 63 | 68 20 69 73 20 74 68 65 |ne, whic|h is the|
|00005630| 20 73 61 6d 65 20 61 73 | 0a 58 2e 49 20 78 64 72 | same as|.X.I xdr|
|00005640| 5f 62 79 74 65 73 20 0a | 77 69 74 68 6f 75 74 20 |_bytes .|without |
|00005650| 74 68 65 20 6c 65 6e 67 | 74 68 20 70 61 72 61 6d |the leng|th param|
|00005660| 65 74 65 72 2e 0a 4f 6e | 20 73 65 72 69 61 6c 69 |eter..On| seriali|
|00005670| 7a 69 6e 67 20 69 74 20 | 67 65 74 73 20 74 68 65 |zing it |gets the|
|00005680| 20 73 74 72 69 6e 67 20 | 6c 65 6e 67 74 68 20 66 | string |length f|
|00005690| 72 6f 6d 0a 58 2e 49 20 | 73 74 72 6c 65 6e 20 2c |rom.X.I |strlen ,|
|000056a0| 0a 61 6e 64 20 6f 6e 20 | 64 65 73 65 72 69 61 6c |.and on |deserial|
|000056b0| 69 7a 69 6e 67 20 69 74 | 20 63 72 65 61 74 65 73 |izing it| creates|
|000056c0| 20 61 20 6e 75 6c 6c 2d | 74 65 72 6d 69 6e 61 74 | a null-|terminat|
|000056d0| 65 64 20 73 74 72 69 6e | 67 2e 0a 58 2e 4c 50 0a |ed strin|g..X.LP.|
|000056e0| 48 65 72 65 20 69 73 20 | 61 20 66 69 6e 61 6c 20 |Here is |a final |
|000056f0| 65 78 61 6d 70 6c 65 20 | 74 68 61 74 20 63 61 6c |example |that cal|
|00005700| 6c 73 20 74 68 65 20 70 | 72 65 76 69 6f 75 73 6c |ls the p|reviousl|
|00005710| 79 20 77 72 69 74 74 65 | 6e 0a 58 2e 49 20 78 64 |y writte|n.X.I xd|
|00005720| 72 5f 73 69 6d 70 6c 65 | 20 0a 61 73 20 77 65 6c |r_simple| .as wel|
|00005730| 6c 20 61 73 20 74 68 65 | 20 62 75 69 6c 74 2d 69 |l as the| built-i|
|00005740| 6e 20 66 75 6e 63 74 69 | 6f 6e 73 0a 58 2e 49 20 |n functi|ons.X.I |
|00005750| 78 64 72 5f 73 74 72 69 | 6e 67 20 0a 61 6e 64 0a |xdr_stri|ng .and.|
|00005760| 58 2e 49 20 78 64 72 5f | 72 65 66 65 72 65 6e 63 |X.I xdr_|referenc|
|00005770| 65 20 2c 0a 77 68 69 63 | 68 20 63 68 61 73 65 73 |e ,.whic|h chases|
|00005780| 20 70 6f 69 6e 74 65 72 | 73 3a 0a 58 2e 69 65 20 | pointer|s:.X.ie |
|00005790| 74 20 2e 44 53 0a 58 2e | 65 6c 20 2e 44 53 20 4c |t .DS.X.|el .DS L|
|000057a0| 0a 58 2e 66 74 20 43 57 | 0a 73 74 72 75 63 74 20 |.X.ft CW|.struct |
|000057b0| 66 69 6e 61 6c 65 78 61 | 6d 70 6c 65 20 7b 0a 09 |finalexa|mple {..|
|000057c0| 63 68 61 72 20 2a 73 74 | 72 69 6e 67 3b 0a 09 73 |char *st|ring;..s|
|000057d0| 74 72 75 63 74 20 73 69 | 6d 70 6c 65 20 2a 73 69 |truct si|mple *si|
|000057e0| 6d 70 6c 65 70 3b 0a 7d | 20 66 69 6e 61 6c 65 78 |mplep;.}| finalex|
|000057f0| 61 6d 70 6c 65 3b 0a 0a | 78 64 72 5f 66 69 6e 61 |ample;..|xdr_fina|
|00005800| 6c 65 78 61 6d 70 6c 65 | 28 78 64 72 73 70 2c 20 |lexample|(xdrsp, |
|00005810| 66 69 6e 61 6c 70 29 0a | 09 58 44 52 20 2a 78 64 |finalp).|.XDR *xd|
|00005820| 72 73 70 3b 0a 09 73 74 | 72 75 63 74 20 66 69 6e |rsp;..st|ruct fin|
|00005830| 61 6c 65 78 61 6d 70 6c | 65 20 2a 66 69 6e 61 6c |alexampl|e *final|
|00005840| 70 3b 0a 7b 0a 0a 09 69 | 66 20 28 21 78 64 72 5f |p;.{...i|f (!xdr_|
|00005850| 73 74 72 69 6e 67 28 78 | 64 72 73 70 2c 20 26 66 |string(x|drsp, &f|
|00005860| 69 6e 61 6c 70 2d 3e 73 | 74 72 69 6e 67 2c 20 4d |inalp->s|tring, M|
|00005870| 41 58 53 54 52 4c 45 4e | 29 29 0a 09 09 72 65 74 |AXSTRLEN|))...ret|
|00005880| 75 72 6e 20 28 30 29 3b | 0a 09 69 66 20 28 21 78 |urn (0);|..if (!x|
|00005890| 64 72 5f 72 65 66 65 72 | 65 6e 63 65 28 78 64 72 |dr_refer|ence(xdr|
|000058a0| 73 70 2c 20 26 66 69 6e | 61 6c 70 2d 3e 73 69 6d |sp, &fin|alp->sim|
|000058b0| 70 6c 65 70 2c 0a 09 20 | 20 73 69 7a 65 6f 66 28 |plep,.. | sizeof(|
|000058c0| 73 74 72 75 63 74 20 73 | 69 6d 70 6c 65 29 2c 20 |struct s|imple), |
|000058d0| 78 64 72 5f 73 69 6d 70 | 6c 65 29 3b 0a 09 09 72 |xdr_simp|le);...r|
|000058e0| 65 74 75 72 6e 20 28 30 | 29 3b 0a 09 72 65 74 75 |eturn (0|);..retu|
|000058f0| 72 6e 20 28 31 29 3b 0a | 7d 0a 58 2e 44 45 0a 58 |rn (1);.|}.X.DE.X|
|00005900| 2e 0a 58 2e 4e 48 20 31 | 0a 5c 26 4c 6f 77 65 73 |..X.NH 1|.\&Lowes|
|00005910| 74 20 4c 61 79 65 72 20 | 6f 66 20 52 50 43 0a 58 |t Layer |of RPC.X|
|00005920| 2e 49 58 20 22 6c 6f 77 | 65 73 74 20 6c 61 79 65 |.IX "low|est laye|
|00005930| 72 20 6f 66 20 52 50 43 | 22 0a 58 2e 49 58 20 22 |r of RPC|".X.IX "|
|00005940| 52 50 43 22 20 22 6c 6f | 77 65 73 74 20 6c 61 79 |RPC" "lo|west lay|
|00005950| 65 72 22 0a 58 2e 4c 50 | 0a 49 6e 20 74 68 65 20 |er".X.LP|.In the |
|00005960| 65 78 61 6d 70 6c 65 73 | 20 67 69 76 65 6e 20 73 |examples| given s|
|00005970| 6f 20 66 61 72 2c 0a 52 | 50 43 20 74 61 6b 65 73 |o far,.R|PC takes|
|00005980| 20 63 61 72 65 20 6f 66 | 20 6d 61 6e 79 20 64 65 | care of| many de|
|00005990| 74 61 69 6c 73 20 61 75 | 74 6f 6d 61 74 69 63 61 |tails au|tomatica|
|000059a0| 6c 6c 79 20 66 6f 72 20 | 79 6f 75 2e 0a 49 6e 20 |lly for |you..In |
|000059b0| 74 68 69 73 20 73 65 63 | 74 69 6f 6e 2c 20 77 65 |this sec|tion, we|
|000059c0| 27 6c 6c 20 73 68 6f 77 | 20 79 6f 75 20 68 6f 77 |'ll show| you how|
|000059d0| 20 79 6f 75 20 63 61 6e | 20 63 68 61 6e 67 65 20 | you can| change |
|000059e0| 74 68 65 20 64 65 66 61 | 75 6c 74 73 0a 62 79 20 |the defa|ults.by |
|000059f0| 75 73 69 6e 67 20 6c 6f | 77 65 72 20 6c 61 79 65 |using lo|wer laye|
|00005a00| 72 73 20 6f 66 20 74 68 | 65 20 52 50 43 20 6c 69 |rs of th|e RPC li|
|00005a10| 62 72 61 72 79 2e 0a 49 | 74 20 69 73 20 61 73 73 |brary..I|t is ass|
|00005a20| 75 6d 65 64 20 74 68 61 | 74 20 79 6f 75 20 61 72 |umed tha|t you ar|
|00005a30| 65 20 66 61 6d 69 6c 69 | 61 72 20 77 69 74 68 20 |e famili|ar with |
|00005a40| 73 6f 63 6b 65 74 73 0a | 61 6e 64 20 74 68 65 20 |sockets.|and the |
|00005a50| 73 79 73 74 65 6d 20 63 | 61 6c 6c 73 20 66 6f 72 |system c|alls for|
|00005a60| 20 64 65 61 6c 69 6e 67 | 20 77 69 74 68 20 74 68 | dealing| with th|
|00005a70| 65 6d 2e 0a 49 66 20 6e | 6f 74 2c 20 63 6f 6e 73 |em..If n|ot, cons|
|00005a80| 75 6c 74 20 74 68 65 0a | 58 2e 49 20 22 49 50 43 |ult the.|X.I "IPC|
|00005a90| 20 50 72 69 6d 65 72 22 | 20 0a 73 65 63 74 69 6f | Primer"| .sectio|
|00005aa0| 6e 20 6f 66 20 74 68 69 | 73 20 6d 61 6e 75 61 6c |n of thi|s manual|
|00005ab0| 2e 0a 58 2e 4c 50 0a 54 | 68 65 72 65 20 61 72 65 |..X.LP.T|here are|
|00005ac0| 20 73 65 76 65 72 61 6c | 20 6f 63 63 61 73 69 6f | several| occasio|
|00005ad0| 6e 73 20 77 68 65 6e 20 | 79 6f 75 20 6d 61 79 20 |ns when |you may |
|00005ae0| 6e 65 65 64 20 74 6f 20 | 75 73 65 20 6c 6f 77 65 |need to |use lowe|
|00005af0| 72 20 6c 61 79 65 72 73 | 20 6f 66 20 0a 52 50 43 |r layers| of .RPC|
|00005b00| 2e 20 20 46 69 72 73 74 | 2c 20 79 6f 75 20 6d 61 |. First|, you ma|
|00005b10| 79 20 6e 65 65 64 20 74 | 6f 20 75 73 65 20 54 43 |y need t|o use TC|
|00005b20| 50 2c 20 73 69 6e 63 65 | 20 74 68 65 20 68 69 67 |P, since| the hig|
|00005b30| 68 65 72 20 6c 61 79 65 | 72 20 75 73 65 73 20 55 |her laye|r uses U|
|00005b40| 44 50 2c 20 0a 77 68 69 | 63 68 20 72 65 73 74 72 |DP, .whi|ch restr|
|00005b50| 69 63 74 73 20 52 50 43 | 20 63 61 6c 6c 73 20 74 |icts RPC| calls t|
|00005b60| 6f 20 38 4b 20 62 79 74 | 65 73 20 6f 66 20 64 61 |o 8K byt|es of da|
|00005b70| 74 61 2e 20 20 55 73 69 | 6e 67 20 54 43 50 20 70 |ta. Usi|ng TCP p|
|00005b80| 65 72 6d 69 74 73 20 63 | 61 6c 6c 73 20 0a 74 6f |ermits c|alls .to|
|00005b90| 20 73 65 6e 64 20 6c 6f | 6e 67 20 73 74 72 65 61 | send lo|ng strea|
|00005ba0| 6d 73 20 6f 66 20 64 61 | 74 61 2e 20 20 46 6f 72 |ms of da|ta. For|
|00005bb0| 20 61 6e 20 65 78 61 6d | 70 6c 65 2c 20 73 65 65 | an exam|ple, see|
|00005bc0| 20 74 68 65 20 0a 5c 66 | 49 54 43 50 5c 66 50 20 | the .\f|ITCP\fP |
|00005bd0| 0a 73 65 63 74 69 6f 6e | 20 62 65 6c 6f 77 2e 20 |.section| below. |
|00005be0| 20 53 65 63 6f 6e 64 2c | 20 79 6f 75 20 6d 61 79 | Second,| you may|
|00005bf0| 20 77 61 6e 74 20 74 6f | 20 61 6c 6c 6f 63 61 74 | want to| allocat|
|00005c00| 65 20 61 6e 64 20 66 72 | 65 65 20 6d 65 6d 6f 72 |e and fr|ee memor|
|00005c10| 79 0a 77 68 69 6c 65 20 | 73 65 72 69 61 6c 69 7a |y.while |serializ|
|00005c20| 69 6e 67 20 6f 72 20 64 | 65 73 65 72 69 61 6c 69 |ing or d|eseriali|
|00005c30| 7a 69 6e 67 20 77 69 74 | 68 20 58 44 52 20 72 6f |zing wit|h XDR ro|
|00005c40| 75 74 69 6e 65 73 2e 20 | 20 54 68 65 72 65 20 69 |utines. | There i|
|00005c50| 73 20 6e 6f 20 0a 63 61 | 6c 6c 20 61 74 20 74 68 |s no .ca|ll at th|
|00005c60| 65 20 68 69 67 68 65 72 | 20 6c 65 76 65 6c 20 74 |e higher| level t|
|00005c70| 6f 20 6c 65 74 20 79 6f | 75 20 66 72 65 65 20 6d |o let yo|u free m|
|00005c80| 65 6d 6f 72 79 20 65 78 | 70 6c 69 63 69 74 6c 79 |emory ex|plicitly|
|00005c90| 2e 20 20 46 6f 72 20 6d | 6f 72 65 20 0a 65 78 70 |. For m|ore .exp|
|00005ca0| 6c 61 6e 61 74 69 6f 6e | 2c 20 73 65 65 20 74 68 |lanation|, see th|
|00005cb0| 65 20 0a 5c 66 49 4d 65 | 6d 6f 72 79 20 41 6c 6c |e .\fIMe|mory All|
|00005cc0| 6f 63 61 74 69 6f 6e 20 | 77 69 74 68 20 58 44 52 |ocation |with XDR|
|00005cd0| 5c 66 50 20 0a 73 65 63 | 74 69 6f 6e 20 62 65 6c |\fP .sec|tion bel|
|00005ce0| 6f 77 2e 20 20 54 68 69 | 72 64 2c 20 79 6f 75 20 |ow. Thi|rd, you |
|00005cf0| 6d 61 79 20 6e 65 65 64 | 20 74 6f 20 70 65 72 66 |may need| to perf|
|00005d00| 6f 72 6d 20 61 75 74 68 | 65 6e 74 69 63 61 74 69 |orm auth|enticati|
|00005d10| 6f 6e 20 6f 6e 20 65 69 | 74 68 65 72 20 0a 74 68 |on on ei|ther .th|
|00005d20| 65 20 63 6c 69 65 6e 74 | 20 6f 72 20 73 65 72 76 |e client| or serv|
|00005d30| 65 72 20 73 69 64 65 2c | 20 62 79 20 73 75 70 70 |er side,| by supp|
|00005d40| 6c 79 69 6e 67 20 63 72 | 65 64 65 6e 74 69 61 6c |lying cr|edential|
|00005d50| 73 20 6f 72 20 76 65 72 | 69 66 79 69 6e 67 20 74 |s or ver|ifying t|
|00005d60| 68 65 6d 2e 20 20 0a 53 | 65 65 20 74 68 65 20 65 |hem. .S|ee the e|
|00005d70| 78 70 6c 61 6e 61 74 69 | 6f 6e 20 69 6e 20 74 68 |xplanati|on in th|
|00005d80| 65 20 0a 5c 66 49 41 75 | 74 68 65 6e 74 69 63 61 |e .\fIAu|thentica|
|00005d90| 74 69 6f 6e 5c 66 50 20 | 0a 73 65 63 74 69 6f 6e |tion\fP |.section|
|00005da0| 20 62 65 6c 6f 77 2e 0a | 58 2e 0a 58 2e 4e 48 20 | below..|X..X.NH |
|00005db0| 32 0a 5c 26 4d 6f 72 65 | 20 6f 6e 20 74 68 65 20 |2.\&More| on the |
|00005dc0| 53 65 72 76 65 72 20 53 | 69 64 65 0a 58 2e 49 58 |Server S|ide.X.IX|
|00005dd0| 20 52 50 43 20 22 73 65 | 72 76 65 72 20 73 69 64 | RPC "se|rver sid|
|00005de0| 65 22 0a 58 2e 4c 50 0a | 54 68 65 20 73 65 72 76 |e".X.LP.|The serv|
|00005df0| 65 72 20 66 6f 72 20 74 | 68 65 0a 58 2e 49 20 6e |er for t|he.X.I n|
|00005e00| 75 73 65 72 73 20 0a 70 | 72 6f 67 72 61 6d 20 73 |users .p|rogram s|
|00005e10| 68 6f 77 6e 20 62 65 6c | 6f 77 20 64 6f 65 73 20 |hown bel|ow does |
|00005e20| 74 68 65 20 73 61 6d 65 | 20 74 68 69 6e 67 20 61 |the same| thing a|
|00005e30| 73 20 74 68 65 20 6f 6e | 65 20 75 73 69 6e 67 0a |s the on|e using.|
|00005e40| 58 2e 49 20 72 65 67 69 | 73 74 65 72 72 70 63 20 |X.I regi|sterrpc |
|00005e50| 0a 61 62 6f 76 65 2c 20 | 62 75 74 20 69 73 20 77 |.above, |but is w|
|00005e60| 72 69 74 74 65 6e 20 75 | 73 69 6e 67 20 61 20 6c |ritten u|sing a l|
|00005e70| 6f 77 65 72 20 6c 61 79 | 65 72 20 6f 66 20 74 68 |ower lay|er of th|
|00005e80| 65 20 52 50 43 20 70 61 | 63 6b 61 67 65 3a 0a 58 |e RPC pa|ckage:.X|
|00005e90| 2e 69 65 20 74 20 2e 44 | 53 0a 58 2e 65 6c 20 2e |.ie t .D|S.X.el .|
|00005ea0| 44 53 20 4c 0a 58 2e 66 | 74 20 43 57 0a 23 69 6e |DS L.X.f|t CW.#in|
|00005eb0| 63 6c 75 64 65 20 3c 73 | 74 64 69 6f 2e 68 3e 0a |clude <s|tdio.h>.|
|00005ec0| 23 69 6e 63 6c 75 64 65 | 20 3c 72 70 63 2f 72 70 |#include| <rpc/rp|
|00005ed0| 63 2e 68 3e 0a 23 69 6e | 63 6c 75 64 65 20 3c 75 |c.h>.#in|clude <u|
|00005ee0| 74 6d 70 2e 68 3e 0a 23 | 69 6e 63 6c 75 64 65 20 |tmp.h>.#|include |
|00005ef0| 3c 72 70 63 73 76 63 2f | 72 75 73 65 72 73 2e 68 |<rpcsvc/|rusers.h|
|00005f00| 3e 0a 0a 6d 61 69 6e 28 | 29 0a 7b 0a 09 53 56 43 |>..main(|).{..SVC|
|00005f10| 58 50 52 54 20 2a 74 72 | 61 6e 73 70 3b 0a 09 69 |XPRT *tr|ansp;..i|
|00005f20| 6e 74 20 6e 75 73 65 72 | 28 29 3b 0a 0a 09 74 72 |nt nuser|();...tr|
|00005f30| 61 6e 73 70 20 3d 20 73 | 76 63 75 64 70 5f 63 72 |ansp = s|vcudp_cr|
|00005f40| 65 61 74 65 28 52 50 43 | 5f 41 4e 59 53 4f 43 4b |eate(RPC|_ANYSOCK|
|00005f50| 29 3b 0a 09 69 66 20 28 | 74 72 61 6e 73 70 20 3d |);..if (|transp =|
|00005f60| 3d 20 4e 55 4c 4c 29 7b | 0a 09 09 66 70 72 69 6e |= NULL){|...fprin|
|00005f70| 74 66 28 73 74 64 65 72 | 72 2c 20 22 63 61 6e 27 |tf(stder|r, "can'|
|00005f80| 74 20 63 72 65 61 74 65 | 20 61 6e 20 52 50 43 20 |t create| an RPC |
|00005f90| 73 65 72 76 65 72 5c 65 | 6e 22 29 3b 0a 09 09 65 |server\e|n");...e|
|00005fa0| 78 69 74 28 31 29 3b 0a | 09 7d 0a 09 70 6d 61 70 |xit(1);.|.}..pmap|
|00005fb0| 5f 75 6e 73 65 74 28 52 | 55 53 45 52 53 50 52 4f |_unset(R|USERSPRO|
|00005fc0| 47 2c 20 52 55 53 45 52 | 53 56 45 52 53 29 3b 0a |G, RUSER|SVERS);.|
|00005fd0| 09 69 66 20 28 21 73 76 | 63 5f 72 65 67 69 73 74 |.if (!sv|c_regist|
|00005fe0| 65 72 28 74 72 61 6e 73 | 70 2c 20 52 55 53 45 52 |er(trans|p, RUSER|
|00005ff0| 53 50 52 4f 47 2c 20 52 | 55 53 45 52 53 56 45 52 |SPROG, R|USERSVER|
|00006000| 53 2c 0a 09 09 09 20 20 | 6e 75 73 65 72 2c 20 49 |S,.... |nuser, I|
|00006010| 50 50 52 4f 54 4f 5f 55 | 44 50 29 29 20 7b 0a 09 |PPROTO_U|DP)) {..|
|00006020| 09 66 70 72 69 6e 74 66 | 28 73 74 64 65 72 72 2c |.fprintf|(stderr,|
|00006030| 20 22 63 61 6e 27 74 20 | 72 65 67 69 73 74 65 72 | "can't |register|
|00006040| 20 52 55 53 45 52 20 73 | 65 72 76 69 63 65 5c 65 | RUSER s|ervice\e|
|00006050| 6e 22 29 3b 0a 09 09 65 | 78 69 74 28 31 29 3b 0a |n");...e|xit(1);.|
|00006060| 09 7d 0a 09 73 76 63 5f | 72 75 6e 28 29 3b 20 20 |.}..svc_|run(); |
|00006070| 2f 2a 20 5c 66 49 4e 65 | 76 65 72 20 72 65 74 75 |/* \fINe|ver retu|
|00006080| 72 6e 73 5c 66 50 20 2a | 2f 0a 09 66 70 72 69 6e |rns\fP *|/..fprin|
|00006090| 74 66 28 73 74 64 65 72 | 72 2c 20 22 73 68 6f 75 |tf(stder|r, "shou|
|000060a0| 6c 64 20 6e 65 76 65 72 | 20 72 65 61 63 68 20 74 |ld never| reach t|
|000060b0| 68 69 73 20 70 6f 69 6e | 74 5c 65 6e 22 29 3b 0a |his poin|t\en");.|
|000060c0| 7d 0a 0a 6e 75 73 65 72 | 28 72 71 73 74 70 2c 20 |}..nuser|(rqstp, |
|000060d0| 74 72 61 6e 73 70 29 0a | 09 73 74 72 75 63 74 20 |transp).|.struct |
|000060e0| 73 76 63 5f 72 65 71 20 | 2a 72 71 73 74 70 3b 0a |svc_req |*rqstp;.|
|000060f0| 09 53 56 43 58 50 52 54 | 20 2a 74 72 61 6e 73 70 |.SVCXPRT| *transp|
|00006100| 3b 0a 7b 0a 09 75 6e 73 | 69 67 6e 65 64 20 6c 6f |;.{..uns|igned lo|
|00006110| 6e 67 20 6e 75 73 65 72 | 73 3b 0a 0a 09 73 77 69 |ng nuser|s;...swi|
|00006120| 74 63 68 20 28 72 71 73 | 74 70 2d 3e 72 71 5f 70 |tch (rqs|tp->rq_p|
|00006130| 72 6f 63 29 20 7b 0a 09 | 63 61 73 65 20 4e 55 4c |roc) {..|case NUL|
|00006140| 4c 50 52 4f 43 3a 0a 09 | 09 69 66 20 28 21 73 76 |LPROC:..|.if (!sv|
|00006150| 63 5f 73 65 6e 64 72 65 | 70 6c 79 28 74 72 61 6e |c_sendre|ply(tran|
|00006160| 73 70 2c 20 78 64 72 5f | 76 6f 69 64 2c 20 30 29 |sp, xdr_|void, 0)|
|00006170| 29 0a 09 09 09 66 70 72 | 69 6e 74 66 28 73 74 64 |)....fpr|intf(std|
|00006180| 65 72 72 2c 20 22 63 61 | 6e 27 74 20 72 65 70 6c |err, "ca|n't repl|
|00006190| 79 20 74 6f 20 52 50 43 | 20 63 61 6c 6c 5c 65 6e |y to RPC| call\en|
|000061a0| 22 29 3b 0a 09 09 72 65 | 74 75 72 6e 3b 0a 09 63 |");...re|turn;..c|
|000061b0| 61 73 65 20 52 55 53 45 | 52 53 50 52 4f 43 5f 4e |ase RUSE|RSPROC_N|
|000061c0| 55 4d 3a 0a 58 2e 66 74 | 20 49 0a 09 09 2f 2a 0a |UM:.X.ft| I.../*.|
|000061d0| 09 09 20 2a 20 43 6f 64 | 65 20 68 65 72 65 20 74 |.. * Cod|e here t|
|000061e0| 6f 20 63 6f 6d 70 75 74 | 65 20 74 68 65 20 6e 75 |o comput|e the nu|
|000061f0| 6d 62 65 72 20 6f 66 20 | 75 73 65 72 73 0a 09 09 |mber of |users...|
|00006200| 20 2a 20 61 6e 64 20 70 | 75 74 20 69 6e 20 76 61 | * and p|ut in va|
|00006210| 72 69 61 62 6c 65 20 5c | 66 49 6e 75 73 65 72 73 |riable \|fInusers|
|00006220| 5c 66 50 0a 09 09 20 2a | 2f 0a 58 2e 66 74 20 43 |\fP... *|/.X.ft C|
|00006230| 57 0a 09 09 69 66 20 28 | 21 73 76 63 5f 73 65 6e |W...if (|!svc_sen|
|00006240| 64 72 65 70 6c 79 28 74 | 72 61 6e 73 70 2c 20 78 |dreply(t|ransp, x|
|00006250| 64 72 5f 75 5f 6c 6f 6e | 67 2c 20 26 6e 75 73 65 |dr_u_lon|g, &nuse|
|00006260| 72 73 29 29 20 0a 09 09 | 09 66 70 72 69 6e 74 66 |rs)) ...|.fprintf|
|00006270| 28 73 74 64 65 72 72 2c | 20 22 63 61 6e 27 74 20 |(stderr,| "can't |
|00006280| 72 65 70 6c 79 20 74 6f | 20 52 50 43 20 63 61 6c |reply to| RPC cal|
|00006290| 6c 5c 65 6e 22 29 3b 0a | 09 09 72 65 74 75 72 6e |l\en");.|..return|
|000062a0| 3b 0a 09 64 65 66 61 75 | 6c 74 3a 0a 09 09 73 76 |;..defau|lt:...sv|
|000062b0| 63 65 72 72 5f 6e 6f 70 | 72 6f 63 28 74 72 61 6e |cerr_nop|roc(tran|
|000062c0| 73 70 29 3b 0a 09 09 72 | 65 74 75 72 6e 3b 0a 09 |sp);...r|eturn;..|
|000062d0| 7d 0a 7d 0a 58 2e 44 45 | 0a 58 2e 4c 50 0a 46 69 |}.}.X.DE|.X.LP.Fi|
|000062e0| 72 73 74 2c 20 74 68 65 | 20 73 65 72 76 65 72 20 |rst, the| server |
|000062f0| 67 65 74 73 20 61 20 74 | 72 61 6e 73 70 6f 72 74 |gets a t|ransport|
|00006300| 20 68 61 6e 64 6c 65 2c | 20 77 68 69 63 68 20 69 | handle,| which i|
|00006310| 73 20 75 73 65 64 0a 66 | 6f 72 20 72 65 63 65 69 |s used.f|or recei|
|00006320| 76 69 6e 67 20 61 6e 64 | 20 72 65 70 6c 79 69 6e |ving and| replyin|
|00006330| 67 20 74 6f 20 52 50 43 | 20 6d 65 73 73 61 67 65 |g to RPC| message|
|00006340| 73 2e 0a 58 2e 49 20 72 | 65 67 69 73 74 65 72 72 |s..X.I r|egisterr|
|00006350| 70 63 20 0a 75 73 65 73 | 0a 58 2e 49 20 73 76 63 |pc .uses|.X.I svc|
|00006360| 75 64 70 5f 63 72 65 61 | 74 65 0a 74 6f 20 67 65 |udp_crea|te.to ge|
|00006370| 74 20 61 20 55 44 50 20 | 68 61 6e 64 6c 65 2e 0a |t a UDP |handle..|
|00006380| 49 66 20 79 6f 75 20 72 | 65 71 75 69 72 65 20 61 |If you r|equire a|
|00006390| 20 6d 6f 72 65 20 72 65 | 6c 69 61 62 6c 65 20 70 | more re|liable p|
|000063a0| 72 6f 74 6f 63 6f 6c 2c | 20 63 61 6c 6c 0a 58 2e |rotocol,| call.X.|
|000063b0| 49 20 73 76 63 74 63 70 | 5f 63 72 65 61 74 65 0a |I svctcp|_create.|
|000063c0| 69 6e 73 74 65 61 64 2e | 0a 49 66 20 74 68 65 20 |instead.|.If the |
|000063d0| 61 72 67 75 6d 65 6e 74 | 20 74 6f 0a 58 2e 49 20 |argument| to.X.I |
|000063e0| 73 76 63 75 64 70 5f 63 | 72 65 61 74 65 20 0a 69 |svcudp_c|reate .i|
|000063f0| 73 0a 58 2e 49 20 52 50 | 43 5f 41 4e 59 53 4f 43 |s.X.I RP|C_ANYSOC|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.