getnetconfigent()--Return a Pointer to a Netconfig Structure


  Syntax
 #include <netconfig.h>

 struct netconfig *getnetconfigent(char *);

  Service Program Name: QZNFTRPC

  Default Public Authority: *USE

  Threadsafe: No

The getnetconfigent() function returns the pointer to the netconfig structure that corresponds to the input netid.


Parameters

netid  (Input) 
A character pointer to a netid such as "tcp" or "udp".

Authorities

The caller of getnetconfigent() function must have execute (*X) authority to the /etc directory and must have read (*R) authority to the netconfig file.


Return Value



Error Conditions

If getnetconfigent() is not successful, errno usually indicates one of the following errors. Under some conditions, errno could indicate an error other than those listed here.


Error Messages



Usage Notes

getnetconfigent() returns a pointer to a netconfig structure in the netconfig file for the corresponding netid. The netid is expected in the job CCSID. It returns NULL if it is unsuccessful.

The callers of the getnetconfigent() function do not need to call the setnetconfig() function prior to calling the getnetconfigent() function but must call the freenetconfigent() function to free the storage allocated by the getnetconfigent() function.

The getnetconfigent() function will return [ENOENT] if the /etc/netconfig file does not exist. The getnetconfigent() function will fail with [ECONVERT] if the data conversion required to convert the data stored in the /etc/netconfig file cannot be converted to the job CCSID.


Example

For more information, see the example for freenetconfigent()--Free the Netconfig Structure.



API introduced: V4R2

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