ONC+ Developer's Guide
  Buscar sólo este libro
Descargar este libro en PDF

............................Contents


Part 1 --Introduction

1. Introduction to ONC+ Technologies
3
...Brief Description of ONC+Technologies 4
......TI-RPC 4
......XDR 4
......NFS 4
......NIS+ 5

Part 2 --Remote Procedure Call

2. Introduction to TI-RPC
9
...What Is TI-RPC 9
...TI-RPC Issues 11
......Parameter Passing 11
......Binding 11
......Transport Protocol 11
......Call Semantics 12
......Data Representation 12
... Program, Version, and Procedure Numbers 12
...Overview of Interface Routines 13
......Simplified Interface Routines 13
......Standard Interface Routines 13
...Network Selection 16
...Transport Selection 17
......Name-to-Address Translation 17
... Address Lookup Services 18
......Registering Addresses 19
......Reporting RPC Information 20

3. rpcgen Programming Guide
21
...What is rpcgen 21
...SunOS 5.x Features 22
...An rpcgen Tutorial 23
......Converting Local Procedures to Remote Procedures 23
......Passing Complex Data Structures 30
......Preprocessing Directives 35
......cpp Directive 37
...Compile-Time Flags 37
......Client and Server Templates 38
......C-style Mode 39
......MT-Safe Code 42
......MT Auto Mode 48
......TI-RPC or TS-RPC Library Selection 49
...... ANSI C-compliant Code 49
......xdr_inline Count 50
...rpcgen Programming Techniques 50
......Network Types/Transport Selection 51
......Command Line Define Statements 51
......Server Response to Broadcast Calls 52
......Port Monitor Support 52
......Time-out Changes 53
......Client Authentication 54
......Dispatch Tables 55
......Debugging Applications 56

4. The Programmer's Interface to RPC
59
...RPC Is Multithread Safe 59
... Simplified Interface 60
......Client 61
...... Server 63
......Hand-Coded Registration Routine 64
......Passing Arbitrary Data Types 64
...Standard Interfaces 68
......Top Level Interface 68
......Intermediate Level Interface 73
......Expert Level Interface 75
......Bottom Level Interface 80
......Server Caching 82
......Low-Level Data Structures 82
...Testing Programs Using Low-level Raw RPC 85
...Advanced RPC Programming Techniques 88
......poll() on the Server Side 88
......Broadcast RPC 90
......Batching 92
......Authentication 95
......Using Port Monitors 104
......Multiple Server Versions 106
......Multiple Client Versions 108
......Using Transient RPC Program Numbers 109
...Multithreaded RPC Programming 111
......MT Client Overview 111
......MT Server Overview 116
......MT Auto Mode 119
......MT User Mode 123
...Connection-Oriented Transports 131
...Memory Allocation With XDR 134
...Porting From TS-RPC to TI-RPC 136
......Porting an Application 136
......Benefits of Porting 136
......Porting Issues 137
......Differences Between TI-RPC and TS-RPC 138
......Function Compatibility Lists 139
......Comparison Examples 142

Part 3 --NIS+

5. NIS+ Programming Guide
149
...NIS+ Overview 149
......Domains 149
......Servers 150
......Tables 150
......NIS+ Security 151
......Name Service Switch 152
......NIS+ Administration Commands 152
...NIS+ API 153
...NIS+ Sample Program 157

A. XDR Technical Note
175
...What is XDR 175
... A Canonical Standard 179
...The XDR Library 180
...XDR Library Primitives 182
......Memory Requirements for XDR Routines 183
......Number Filters 185
......Floating Point Filters 186
......Enumeration Filters 186
......No-Data Routine 187
......Constructed Data Type Filters 187
......Strings 187
......Byte Arrays 189
......Arrays 189
......Opaque Data 192
......Fixed-Length Arrays 193
......Discriminated Unions 194
......Pointers 196
......Nonfilter Primitives 198
...... Operation Directions 198
......Stream Access 198
......Standard I/O Streams 199
......Memory Streams 199
......Record (TCP/IP) Streams 199
...XDR Stream Implementation 201
......The XDR Object 201
...Advanced Topics 203
......Linked Lists 203

B. RPC Protocol and Language Specification
207
...Protocol Overview 207
......The RPC Model 208
......Transports and Semantics 209
......Binding and Rendezvous Independence 210
...Program and Procedure Numbers 210
......Program Number Assignment 212
......Program Number Registration 213
......Other Uses of the RPC Protocol 213
......The RPC Message Protocol 214
......Record-Marking Standard 217
...Authentication Protocols 218
......AUTH_NONE 218
......AUTH_SYS 218
......AUTH_DES Authentication 220
......AUTH_DES Authentication Verifiers 221
......Nicknames and Clock Synchronization 222
......DES Authentication Protocol (in XDR language) 223
......AUTH_KERB Authentication 226
...The RPC Language Specification 230
......An Example Service Described in the RPC Language 230
......RPCL Syntax 231
......Enumerations 232
......Constants 233
......Type Definitions 233
......Declarations 234
......Simple Declarations 234
......Fixed-Length Array Declarations 234
......Variable-Length Array Declarations 235
......Pointer Declarations 235
......Structures 236
......Unions 236
......Programs 237
......Special Cases 238
......rpcbind Protocol 240
......rpcbind Operation 245
......Version 4 rpcbind 247
...Bibliography 249

C. XDR Protocol Specification
251
...XDR Protocol Introduction 251
......Graphic Box Notation 252
......Basic Block Size 252
...XDR Data Type Declarations 253
......Signed Integer 253
......Unsigned Integer 254
......Enumerations 254
...... Booleans 255
......Hyper Integer and Unsigned Hyper Integer 255
......Floating Point 256
......Quadruple-Precision Floating Point 257
......Fixed-Length Opaque Data 258
......Variable-Length Opaque Data 259
......Counted Byte Strings 260
......Fixed-Length Array 261
......Variable-Length Array 262
......Structure 263
......Discriminated Union 263
......Void 264
......Constant 265
......Typedef 265
......Optional-Data 266
...The XDR Language Specification 267
......Notational Conventions 267
......Lexical Notes 267
......Syntax Notes 269
......XDR Data Description 270
...RPC Language Reference 272
......Enumerations 272
......Constants 273
......Type Definitions 273
......Declarations 273
......Simple Declarations 274
......Fixed-Length Array Declarations 274
......Variable-Length Array Declarations 275
......Pointer Declarations 275
......Structures 276
......Unions 276
......Programs 277
......Special Cases 278

D. Live RPC Code Examples
281
......Directory Listing Program and Support Routines (rpcgen) 281
......Time Server Program (rpcgen) 285
......Add Two Numbers Program (rpcgen) 286
......Spray Packets Program (rpcgen) 286
......Print Message Program With Remote Version 287
......Batched Code Example 291
......Non-Batched Example 293

E. The portmap Utility
295
...System Registration Overview 295
...portmap Protocol 296
...portmap Operation 299
...Bibliography 300
F. Writing a Port Monitor With the Service Access Facility (SAF) 301
...What Is the SAF 301
...What Is the SAC 302
......Basic Port Monitor Functions 303
......Port Management 303
......Activity Monitoring 304
......Other Port Monitor Functions 304
...Terminating a Port Monitor 305
...SAF Files 306
......The Port Monitor Administrative File 306
......Per-Service Configuration Files 306
......Private Port Monitor Files 306
...The SAC/Port Monitor Interface 306
......Message Formats 307
......Message Classes 309
...The Port Monitor Administrative Interface 309
......The SAC Administrative File _sactab 310
......The Port Monitor Administrative File _pmtab 311
......The SAC Administrative Command sacadm 312
......The Port Monitor Administrative Command pmadm 313
......Monitor-Specific Administrative Command 313
......The Port Monitor/Service Interface 314
......Port Monitor Requirements 314
......Important Files 315
......Port Monitor Responsibilities 315
...Configuration Files and Scripts 316
......Interpreting Configuration Scripts With doconfig() 316
......The Per-System Configuration File 317
......Per-Port Monitor Configuration Files 317
......Per-Service Configuration Files 317
......The Configuration Language 318
......Printing, Installing, and Replacing Configuration Scripts . 319
...Sample Port Monitor Code 321
...Logic Diagram and Directory Structure 327

Glossary
331

Index
335