endnetconfig()--Release the Pointer in the Netconfig File


  Syntax

 #include <netconfig.h>

 int endnetconfig (void *);

  Service Program Name: QZNFTRPC

  Default Public Authority: *USE


  Threadsafe: No


The endnetconfig() function releases the pointer to the records stored in the netconfig file.


Parameters

void pointer (Input) 
A void pointer that is set by a call to the setnetconfig() function.

Authorities

No authorization is required.


Return Value



Error Conditions

When an exception occurs, endnetconfig() is trying to free the handle to the /etc/netconfig file. If endnetconfig() is not successful, errno indicates the following error.



Error Messages



Usage Notes

endnetconfig() API must be used to release the pointer to the netconfig structure obtained by a call to the setnetconfig() API.


Example

The following example shows how endnetconfig() is used.

Note: By using the code examples, you agree to the terms of the Code license and disclaimer information.

#include <netconfig.h>

main()
{
 void *handlep;
 struct netconfig *nconf;

 /* Initialize the network selection mechanism */
 if ((handlep = setnetconfig()) == (void *)NULL)
 {
   exit(1);
 }

 /* Loop through the transport providers */
 while ((nconf = getnetconfig(handlep)) != (struct netconfig *) NULL)
 {
    /* Print out the information associated with the */
    /* transport providers described in the          */
    /* "netconfig" structure.                        */
    printf("Transport provider name: %s\n", nconf->nc_netid);
    switch(nconf->nc_semantics)
    {
       case NC_TPI_CLTS:
          printf("Transport type name: TPI_CLTS\n");
          break;
       case NC_TPI_COTS:
          printf("Transport type name: TPI_COTS\n");
          break;
       case NC_TPI_COTS_ORD:
          printf("Transport type name: TPI_COTS_ORD\n");
          break;
       default:
          break;
    }
    switch(nconf->nc_flag)
    {
       case 0:
          printf("Transport flag name: N\n");
          break;
       case 1:
          printf("Transport flag name: V\n");
          break;
       default:
          break;
    }
    printf("Transport family name: %s\n", nconf->nc_protofmly);
    printf("Transport protocol name: %s\n", nconf->nc_proto);
 }

 /*Release the netconfig handle allocated by setnetconfig() */
 endnetconfig(handlep);
}



API introduced: V4R2

[ Back to top | Remote Procedure Call (RPC) APIs | APIs by category ]