[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1 AmiTCP/IP RPC Notes

This chapter describes the AmiTCP/IP version of the Sun RPC 4.0.

Note: Read this chapter carefully and then do the “Hello World!” test with the provided demonstration protocols in ‘demo’ directory. Once you get these compiled and running you know that your setup is complete.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.1 About the Port to AmiTCP/IP and Amiga


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.1.1 Nonsupported Features

Following features are not supported/modified in this version:

Secure RPC

This is not yet supported. I might decide to support it, if it is requested. This means that none of the DES authentication functions are included in the library.

Broadcast RPC

The current support for Broadcast RPC is limited in sense that the blocks while serving the broadcasted RPC. This means that the portmap services are not available during that time, which may prevent some RPC servers from functioning correctly.

getrpcent()

Didn’t include this, since AmiTCP/IP doesn’t provide the *ent() functions in general. I might re-enable this if there is any demand for it.

svcfd_create()

This is not included, since the library uses AmiTCP/IP socket descriptors. This might be added if there ever becomes a good, portable solution to the file vs. socket descriptor problem.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.1.2 About the Floating Point Format

The library supports only IEEE format floating point values (xdr_float() and xdr_double()). The FFP format must not be used. Consult your compiler documentation about choosing the floating point format (SAS/C uses IEEE by default).


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.1.3 What Was Done to the Original SUNRPC 4.0 While Porting

  1. Added ANSI C prototypes to all function and function pointer prototypes
  2. ANSIfied the includes if possible (‘sys/errno.h’ -> ‘errno.h’, for example).
  3. Removed dependency on select() retaining the value of the timeout timeval.
  4. Changed read() and write() calls to recv() and send(), respectively. This prevents the usage of the real file descriptors (see the svcfd_create() in Nonsupported Features).
  5. Added ‘sys/param.h’ as the first include file for every ‘.c’ file for concistency.
  6. Added XDRFUN definition to ‘rpc/types.h’. It is used in definition of every xdr-function.
  7. Changed close()s and ioctl()s on sockets to CloseSocket() and IoctlSocket() if AMITCP is defined.
  8. Changed getpid()s to FindTask(NULL) if AMIGA is defined.
  9. Changed socket calls no to be retried after the EINTR error return.

[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.2 rpcgen Notes

The rpcgen included in this distibution is ported from the TIRPC(1) rpcgen from Linux by Carsten Heyl <ch@irb.informatik.uni-dortmund.de>. This version of rpcgen can produce K&R/ANSI-C/C++ compatible output. It also can generate inetd compatible daemons, but this feature is not yet supported. Refer to the manual page of the rpcgen for its usage.

The rpcgen needs a C preprocessor to handle the macros and comments. One suitable C preprocessor (cpp) is included in the distribution. It is based on an old DECUS cpp port by Fred Fish. Carsten added a ‘-P’ option to suppress #line directives, which the cpp left on the output.

@xref{rpcgen Manual Page}.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.3 portmap and rpcinfo

portmap is the RPC program to internet port mapper, see @ref{Port Mapper Program Protocol}. The portmap must be started before any RPC services, and it is best to include line “run portmap” to your ‘AmiTCP:bin/startnet’ script. @xref{portmap Manual Page}.

The rpcinfo can be used to view portmap bindings on any host. See the manual page for the usage. @xref{rpcinfo Manual Page}.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.4 Using the Library


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.4.1 Supported Compilers

The distribution contains precompiled library for the SAS/C 6.x, since it’s the compiler I use. The library is highly portable though, and you should have no problems compiling it with DICE, GCC etc.

The only compiler dependent part I made there is the definition XDRFUN (in ‘rpc/types.h’), which is defined as __regargs for SAS/C and as nothing for others.

The makefiles are written for the SAS smake, but since it doesn’t have any fancy features, they should be quite portable as well.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.4.2 Compiling the library

The library code assumes that the bsdsocket.library is opened by the caller, and the library base is in global variable named SocketBase. Also the global errno variable must be set with the AmiTCP/IP SocketBaseTagList() function (2).

The ‘Smakefile’ of the library can compile eight different versions of the library, but only the rpcr.lib version is compiled by default, see section Choosing the Library to Use. This library is installed to the ‘AmiTCP:netlib’ directory by default.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.4.3 Choosing the Library to Use

Eight different versions of the library are provided. The library is compiled either with or without the debugging information, with near or far data, and with register or stack arguments. Use the following table to select the right library:

|   Arguments   |     Data      | Debugging |              
| Stack | Reg.  | Near  |  Far  | No  | Yes | Library name 
+-------+-------+-------+-------+-----+-----+--------------
|   x   |       |   x   |       |  x  |     | rpc.lib
|       |   x   |   x   |       |  x  |     | rpcr.lib
|   x   |       |       |   x   |  x  |     | rpcnb.lib
|       |   x   |       |   x   |  x  |     | rpcnbr.lib
|   x   |       |   x   |       |     |  x  | grpc.lib
|       |   x   |   x   |       |     |  x  | grpcr.lib
|   x   |       |       |   x   |     |  x  | grpcnb.lib
|       |   x   |       |   x   |     |  x  | grpcnbr.lib

The use of registerized arguments and near data is highly recommended, since these options provide smaller and faster executables.

To compile the desired version of the library, issue smake <Library name> or smake all to compile all the versions. The makefile can only install the default version to the ‘netlib:’, you must move the other libraries yourself.

The reason why the library is not compiled with SAS/C ARGS=BOTH is that there are some problems SAS/C not enforcing the function pointers prototyped as taking stack arguments actually being assigned with the proper (stack) entry point of a function, if there are both stack and register versions of the function available (as is the case with the ARGS=BOTH libraries).

Second reason is that if you want to use stack arguments, an ARGS=STACK library is faster than the BOTH equivalent.

The dedugging info is compiled with SAS/C FullFlush option.


[Top] [Contents] [Index] [ ? ]

Footnotes

(1)

Transport Independent RPC

(2)

These are standard AmiTCP/IP practices and are provided by the net.lib autoinitialization routine, so normally these are no concern.


[Top] [Contents] [Index] [ ? ]

About This Document

This document was generated on October 27, 2024 using texi2html 5.0.

The buttons in the navigation panels have the following meaning:

Button Name Go to From 1.2.3 go to
[ << ] FastBack Beginning of this chapter or previous chapter 1
[ < ] Back Previous section in reading order 1.2.2
[ Up ] Up Up section 1.2
[ > ] Forward Next section in reading order 1.2.4
[ >> ] FastForward Next chapter 2
[Top] Top Cover (top) of document  
[Contents] Contents Table of contents  
[Index] Index Index  
[ ? ] About About (help)  

where the Example assumes that the current position is at Subsubsection One-Two-Three of a document of the following structure:


This document was generated on October 27, 2024 using texi2html 5.0.