#include <netconfig.h> void freenetconfigent(struct netconfig *);
The freenetconfigent() function frees the netconfig structure that is returned from the call to the getnetconfigent() function.
No authorization is required.
None.
If an exception occurs, freenetconfigent() fails to free the netconfig structure. If freenetconfigent() is not successful, errno indicates the following error.
[EUNKNOWN] | Unknown system state.
The operation failed because of an unknown system state. See any messages in the job log and correct any errors that are indicated. Then retry the operation. |
Message ID | Error Message Text |
---|---|
CPF3CF2 E | Error(s) occurred during running of &1 API. |
CPF9872 E | Program or service program &1 in library &2 ended. Reason code &3. |
The following example shows how freenetconfigent() is used.
Note: By using the code examples, you agree to the terms of the Code license and disclaimer information.
#include <netconfig.h> main() { struct netconfig *nconf; /* Assuming UDP is a netid on the system, get the netconfig structure * if ((nconf = getnetconfigent("UDP")) == (struct netconfig *)NULL) { printf("There is no information about UDP\n"); exit(1); } /* Print out the information associated with the transport */ /* identified with the netid of UDP */ 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); /* Free the netconfig structure returned by getnetconfigent() */ freenetconfigent(nconf); }
[ Back to top | Remote Procedure Call (RPC) APIs | APIs by category ]