| |
| Code Example 2-1 Sample /etc/netconfig File | 15 |
| Code Example 3-1 Single Process Version of printmesg.c | 23 |
| Code Example 3-2 RPC Version of printmsg.c | 25 |
| Code Example 3-3 Client Program to Call printmsg.c | 27 |
| Code Example 3-4 RPC Protocol Description File: dir.x | 30 |
| Code Example 3-5 Server dir_proc.c Example | 32 |
| Code Example 3-6 Client-side Implementation of rls.c | 33 |
| Code Example 3-7 Time Protocol rpcgen Source | 36 |
| Code Example 3-8 C-style Mode Version of add.x | 39 |
| Code Example 3-9 Default Mode Version of add.x | 39 |
| Code Example 3-10 C-style Mode Client Stub for add.x | 40 |
| Code Example 3-11 Default Mode Client | 41 |
| Code Example 3-12 C-style Mode Server | 41 |
| Code Example 3-13 Default Mode Server Stub | 41 |
| Code Example 3-14 MT-Safe Program: msg.x | 42 |
| Code Example 3-15 MT-Safe Client Stub | 42 |
| |
| Code Example 3-16 Client Stub (Not MT Safe) | 43 |
| Code Example 3-17 MT-Safe Server Stub | 44 |
| Code Example 3-18 MT-Safe Program: add.x | 45 |
| Code Example 3-19 MT-Safe Client: add.x | 45 |
| Code Example 3-20 MT-Safe Server: add.x | 47 |
| Code Example 3-21 MT Auto Mode: time.x | 48 |
| Code Example 3-22 rpcgen ANSI C Server Template | 49 |
| Code Example 3-23 NFS Server Response to Broadcast Calls | 52 |
| Code Example 3-24 clnt_control Routine | 53 |
| Code Example 3-25 AUTH_SYS Authentication Program | 54 |
| Code Example 3-26 printmsg_1 for Superuser | 54 |
| Code Example 4-1 rusers Program, Example One | 63 |
| Code Example 4-2 rusers Program, Example Two | 64 |
| Code Example 4-3 rusers Remote Server Procedure | 66 |
| Code Example 4-4 "Hand-Coding" Registration Server | 67 |
| Code Example 4-5 xdr_simple Routine | 68 |
| Code Example 4-6 xdr_varintarr Syntax Use | 69 |
| Code Example 4-7 xdr_vector Syntax Use | 69 |
| Code Example 4-8 xdr_reference Syntax Use | 70 |
| Code Example 4-9 time_prot.h Header File | 71 |
| Code Example 4-10 Client for Trivial Date Service | 72 |
| Code Example 4-11 Server for Trivial Date Service | 73 |
| Code Example 4-12 Client for Time Service, Intermediate Level | 75 |
| Code Example 4-13 Server for Time Service, Intermediate Level | 77 |
| Code Example 4-14 Client for RPC Lower Level | 78 |
| |
| Code Example 4-15 Server for RPC Lower Level | 81 |
| Code Example 4-16 Client for Bottom Level | 83 |
| Code Example 4-17 Server for Bottom Level | 84 |
| Code Example 4-18 RPC Client Handle Structure | 85 |
| Code Example 4-19 Client Authentication Handle | 85 |
| Code Example 4-20 Server Transport Handle | 86 |
| Code Example 4-21 Simple Program Using Raw RPC | 88 |
| Code Example 4-22 svc_run() and poll() | 91 |
| Code Example 4-23 RPC Broadcast | 93 |
| Code Example 4-24 Collect Broadcast Replies | 94 |
| Code Example 4-25 Unbatched Client | 95 |
| Code Example 4-26 Batched Client | 96 |
| Code Example 4-27 Batched Server | 97 |
| Code Example 4-28 AUTH_SYS Credential Structure | 100 |
| Code Example 4-29 Authentication Server | 100 |
| Code Example 4-30 AUTH_DES Server | 103 |
| Code Example 4-31 Server Handle for Two Versions of Single Routine | 109 |
| Code Example 4-32 Procedure for Two Versions of Single Routine | 110 |
| Code Example 4-33 RPC Versions on Client Side | 111 |
| Code Example 4-34 Client for MT rstat | 115 |
| Code Example 4-35 Server for MT Auto Mode | 122 |
| Code Example 4-36 MT Auto Mode:time_prot.h | 124 |
| Code Example 4-37 MT User Mode: rpc_test.h | 126 |
| Code Example 4-38 Client for MT User Mode | 126 |
| Code Example 4-39 Server for MT User Mode | 129 |
| |
| Code Example 4-40 Remote Copy (Two-Way XDR Routine) | 133 |
| Code Example 4-41 Remote Copy Client Routines | 134 |
| Code Example 4-42 Remote Copy Server Routines | 135 |
| Code Example 4-43 Client Creation in TS-RPC | 144 |
| Code Example 4-44 Client Creation in TI-RPC | 144 |
| Code Example 4-45 Broadcast in TS-RPC | 145 |
| Code Example 4-46 Broadcast in TI-RPC | 146 |
| Code Example 5-1 Sample netconfig File | 154 |
| Code Example 5-2 The netconfig Structure | 155 |
| Code Example 5-3 setnetpath(), getnetpath(), and endnetpath()157 |
| Code Example 5-4 setnetconfig(), getnetconfig(), and endnetconfig() | 158 |
| Code Example 5-5 getnetconfigent() and freenetconfigent() 159 |
| Code Example 5-6 Looping Through Visible Transports | 159 |
| Code Example 5-7 Network Selection and Name-to-Address Mapping. 164 |
| Code Example 6-1 Client Implementation of Open and Bind | 176 |
| Code Example 6-2 Server Implementation of Open and Bind | 178 |
| Code Example 6-3 Client-to-Server Connection | 181 |
| Code Example 6-4 accept_call Function | 184 |
| Code Example 6-5 Spawning Child Process to Loopback and Listen | 188 |
| Code Example 6-6 Transaction Server | 193 |
| Code Example 6-7 Data Transfer Routine | 195 |
| Code Example 6-8 Read/Write Interface | 198 |
| Code Example 6-9 Endpoint Establishment (Convertible to Multiple Connections) | 202 |
| Code Example 6-10 Processing Connection Requests | 204 |
| |
| Code Example 6-11 Event Processing Routine | 205 |
| Code Example 6-12 Process All Connect Requests | 207 |
| Code Example 7-1 Bind Name to Socket | 222 |
| Code Example 7-2 Internet Domain Stream Connection (Client) | 226 |
| Code Example 7-3 Accepting an Internet Stream Connection (Server) | 228 |
| Code Example 7-4 Reading Internet Domain Datagrams | 231 |
| Code Example 7-5 Sending an Internet Domain Datagram | 232 |
| Code Example 7-6 Check for Pending Connections With select() | 234 |
| Code Example 7-7 Remote Login Server | 240 |
| Code Example 7-8 Remote Login Server: Step 1 | 241 |
| Code Example 7-9 Dissociating from the Controlling Terminal | 241 |
| Code Example 7-10 Remote Login Server: Main Body | 242 |
| Code Example 7-11 Output of ruptime Program | 243 |
| Code Example 7-12 rwho Server | 244 |
| Code Example 7-13 Flushing Terminal I/O on Receipt of Out-of-Band Data 247 |
| Code Example 7-14 Set Nonblocking Socket | 248 |
| Code Example 7-15 Making a Socket Asynchronous | 249 |
| Code Example 7-16 Asynchronous Notification of I/O Requests | 250 |
| Code Example 7-17 SIGCHLD Signal | 251 |
| Code Example 7-18 Bind Port Number to Socket | 253 |
| Code Example 7-19 net/if.h Header File | 255 |
| Code Example 7-20 Obtaining Interface Flags | 256 |
| Code Example 7-21 Broadcast Address of an Interface | 256 |
| Code Example 8-1 NIS+ Program Main example.c | 275 |
| Code Example 8-2 NIS+ Routine to Create Directory Objects | 278 |
| |
| Code Example 8-3 NIS+ Routine to Create Group Objects | 279 |
| Code Example 8-4 NIS+ Routine to Create Table Objects | 279 |
| Code Example 8-5 NIS+ Routine to Add Objects to Table | 280 |
| Code Example 8-6 NIS+ Routine for nis_list Call | 282 |
| Code Example 8-7 NIS+ Routine to List Objects | 283 |
| Code Example 8-8 NIS+ Routine to Remove Directory Objects | 284 |
| Code Example 8-9 NIS+ Routine to Remove All Objects | 285 |
| Code Example A-1 XDR Specification | 310 |
| Code Example A-2 XDR File Data Structure | 312 |
| Code Example B-1 Writer Example (initial) | 324 |
| Code Example B-2 Reader Example (initial) | 324 |
| Code Example B-3 Writer Example (XDR modified) | 325 |
| Code Example B-4 Reader Example (XDR modified) | 326 |
| Code Example B-5 xdr_sizeof Example #1 | 331 |
| Code Example B-6 xdr_sizeof Example #2 | 332 |
| Code Example B-7 Array Example #1 | 338 |
| Code Example B-8 Array Example #2 | 339 |
| Code Example B-9 Array Example #3 | 339 |
| Code Example B-10 xdr_netobj Routine | 341 |
| Code Example B-11 xdr_vector Routine | 341 |
| Code Example B-12 XDR Discriminated Union | 343 |
| Code Example B-13 XDR Stream Interface Example | 349 |
| Code Example B-14 Linked List | 351 |
| Code Example B-15 xdr_pointer | 352 |
| Code Example B-16 Nonrecursive Stack in XDR | 353 |
| |
| Code Example C-1 RPC Message Protocol | 362 |
| Code Example C-2 AUTH_DES Authentication Protocol | 371 |
| Code Example C-3 AUTH_KERB Authentication Protocol | 376 |
| Code Example C-4 ping Service Using RPC Language | 378 |
| Code Example C-5 rpcbind Protocol Specification (in RPC Language). 388 |
| Code Example D-1 Sample Port Monitor | 419 |
| Code Example D-2 sac.h Header File | 423 |
| Code Example E-1 portmap Protocol Specification (in RPC Language). 431 |
| Code Example F-1 rpcgen Program: dir.x | 435 |
| Code Example F-2 Remote dir_proc.c | 436 |
| Code Example F-3 rls.c Client | 438 |
| Code Example F-4 rpcgen Program: time.x | 439 |
| Code Example F-5 rpcgen program: Add Two Numbers | 440 |
| Code Example F-6 rpcgen program: spray.x | 440 |
| Code Example F-7 printmesg.c | 441 |
| Code Example F-8 Remote Version of printmesg.c | 442 |
| Code Example F-9 rpcgen Program: msg.x | 444 |
| Code Example F-10 mesg_proc.c | 444 |
| Code Example F-11 Batched Client Program | 445 |
| Code Example F-12 Batched Server Program | 446 |
| Code Example F-13 Unbatched Version of Batched Client | 447 |