svcerr_progvers Subroutine

Important: The subroutine is exported from both the libc and the libnsl libraries.

svcerr_progvers Subroutine Exported from the libc Library

Purpose

Indicates that the service dispatch routine cannot complete the remote procedure call because the requested program version is not registered.

Library

C Library (libc.a)

Syntax

#include <rpc/rpc.h>

void svcerr_progvers ( xprt)
SVCXPRT *xprt; u_long

Description

The svcerr_progvers subroutine is called by a service dispatch routine when the requested version of a program is not registered with the Remote Procedure Call (RPC) package. This subroutine sets the status of the RPC reply message to the PROG_MISMATCH condition, which indicates that the remote server cannot support the client's version number.

Note: Service implementors do not usually need this subroutine.

Parameters

Item Description
xprt Points to the RPC service transport handle.

svcerr_progvers Subroutine Exported from the libnsl Library

Purpose

Indicates that the service dispatch routine cannot complete the remote procedure call because the requested program version is not registered.

Library

Network Services Library (libnsl.a)

Syntax

#include <rpc/rpc.h>
void svcerr_progvers( xprt, low, high)
const SVCXPRT *xprt;
const rpcvers_t low;
const rpcvers_t high; 

Description

The svcerr_progvers subroutine is called by a service dispatch routine when the requested version of a program is not registered with the Remote Procedure Call (RPC) package. This subroutine sets the status of the RPC reply message to the RPC_PROGVERSMISMATCH condition, which indicates that the remote server cannot support the client's version number.

Note: Service implementors do not usually need this subroutine.

Parameters

Item Description
xprt Points to the RPC service transport handle.
low Indicates the lowest version number.
high Indicates the highest version number.

Examples

#include <rpc/rpc.h>
#include <stdlib.h>

#define PROG 0x3fffffffL
#define VERS 0x1L

static void sample_dispatch();
main()
{
  char *nettype = "tcp";
  int no_of_handles;
 
  /* Create RPC service handle and register with RPCBIND service */
  if((no_of_handles = svc_create(sample_dispatch, PROG, VERS,nettype)) == 0)
  {
    fprintf(stdout,"Error in svc_create!");
    exit(EXIT_FAILURE);
  }
  svc_run();
  return 0;
} 

/* following is the sample dispatch routine*/
static void sample_dispatch(struct svc_req *request, SVCXPRT *xprt)
{
  int args,high,low;
    
  /* Dispatch routine code */
  /* If requested version of a program is not registered. */
  svcerr_progvers(xprt,low,high);     
}