SEARCH
NEW RPMS
DIRECTORIES
ABOUT
FAQ
VARIOUS
BLOG
DONATE


YUM REPOSITORY

 
 

MAN page from PCLinuxOS lib64tirpc-devel-1.0.1-1pclos2017.x86_64.rpm

GETNETCONFIG

Section: C Library Functions (3)
Index
BSD mandoc
 

NAME

getnetconfig setnetconfig endnetconfig getnetconfigent freenetconfigent nc_perror nc_sperror - get network configuration database entry 

SYNOPSIS

In netconfig.hFt struct netconfig *Fn getnetconfig void *handlepFt void *Fn setnetconfig voidFt intFn endnetconfig void *handlepFt struct netconfig *Fn getnetconfigent const char *netidFt voidFn freenetconfigent struct netconfig *netconfigpFt voidFn nc_perror const char *msgFt char *Fn nc_sperror void 

DESCRIPTION

The library routines described on this pageprovide the application access tothe system network configuration database,/etc/netconfig TheFn getnetconfigfunctionreturns a pointer to thecurrent entry in thenetconfigdatabase, formatted as aFt struct netconfig .Successive calls will return successive netconfigentries in the netconfig database.TheFn getnetconfigfunctioncan be used to search the entire netconfigfile.TheFn getnetconfigfunctionreturnsNULLat the end of the file.TheFa handlepargumentis the handle obtained throughFn setnetconfig .

A call toFn setnetconfighas the effect of``binding''to or``rewinding''the netconfig database.TheFn setnetconfigfunctionmust be called before the first call toFn getnetconfigand may be called at any other time.TheFn setnetconfigfunctionneed not be called before a call toFn getnetconfigent .TheFn setnetconfigfunctionreturns a unique handle to be used byFn getnetconfig .

TheFn endnetconfigfunctionshould be called when processing is complete to release resources for reuse.TheFa handlepargumentis the handle obtained throughFn setnetconfig .Programmers should be aware, however, that the last call toFn endnetconfigfrees all memory allocated byFn getnetconfigfor theFt struct netconfigdata structure.TheFn endnetconfigfunctionmay not be called beforeFn setnetconfig .

TheFn getnetconfigentfunctionreturns a pointerto the netconfig structure correspondingtoFa netid .It returnsNULLifFa netidis invalid(that is, does not name an entry in the netconfig database).

TheFn freenetconfigentfunctionfrees the netconfig structure pointed to byFa netconfigp(previously returned byFn getnetconfigent ) .

TheFn nc_perrorfunctionprints a message to the standard error indicating why any of theabove routines failed.The message is prepended with the stringFa msgand a colon.A newline character is appended at the end of the message.

TheFn nc_sperrorfunctionis similar toFn nc_perrorbut instead of sending the messageto the standard error, will return a pointer to a string thatcontains the error message.

TheFn nc_perrorandFn nc_sperrorfunctionscan also be used with theNETPATHaccess routines defined ingetnetpath(3). 

RETURN VALUES

TheFn setnetconfigfunctionreturns a unique handle to be used byFn getnetconfig .In the case of an error,Fn setnetconfigreturnsNULLandFn nc_perrororFn nc_sperrorcan be used to print the reason for failure.

TheFn getnetconfigfunctionreturns a pointer to the current entry in the netconfigdatabase, formatted as aFt struct netconfig .TheFn getnetconfigfunctionreturnsNULLat the end of the file, or upon failure.

TheFn endnetconfigfunctionreturns 0 on success and -1 on failure(for example, ifFn setnetconfigwas not called previously).

On success,Fn getnetconfigentreturns a pointer to theFt struct netconfigstructure corresponding toFa netid ;otherwise it returnsNULL

TheFn nc_sperrorfunctionreturns a pointer to a buffer which contains the error message string.This buffer is overwritten on each call.In multithreaded applications, this buffer isimplemented as thread-specific data. 

FILES

/etc/netconfig

 

AVAILABILITY

These functions are part of libtirpc. 

SEE ALSO

getnetpath(3),netconfig(5)


 

Index

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUES
FILES
AVAILABILITY
SEE ALSO

This document was created byman2html,using the manual pages.