auth_destroy()--Destroy Authentication Information


  Syntax

 #include <rpc/rpc.h>

 void auth_destroy(AUTH *auth);

  Default Public Authority: *USE

  Service Program Name: QZNFTRPC

  Threadsafe: No

The auth_destroy() function destroys the authentication information structure that is pointed to by the auth parameter.


Parameters

auth
 (Input) 
A pointer to the authentication information structure to be destroyed. By destroying the auth structure, you deallocate private data structures.

Authorities

No authorization is required.


Return Value

None.


Error Conditions

None.


Error Messages

Message ID Error Message Text
CPE3418 E Possible APAR condition or hardware failure.
CPF3CF2 E Error(s) occurred during running of &1 API.
CPF9872 E Program or service program &1 in library &2 ended. Reason code &3.


Related Information


Example

See Code disclaimer information for information pertaining to code examples.

The following example shows how auth_destroy() is used:

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

/* Define remote program number and version */
#define RMTPROGNUM (u_long)0x3fffffffL
#define RMTPROGVER (u_long)0x1

main()
{
  CLIENT *clnt; /* The client handle */

  /*
    Create the client handle, and initialize the authentication in
    the clnt->cl_auth struct
  */
  clnt = clnt_create("RPCSERVER_HOST", RMTPROGNUM, RMTPROGVER,
                       "tcp");
  if (clnt == (CLIENT *)NULL) {
    printf("Could not create client\n");
    exit(1);
  }

  ...

  /*
    Destroy the authentication information associated with
    clnt->cl_auth
  */
  auth_destroy(clnt->cl_auth);

  ...

}


API introduced: V4R2
Top | Remote Procedure Call (RPC) APIs | APIs by category