Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

netconfig(5) [freebsd man page]

NETCONFIG(5)						      BSD File Formats Manual						      NETCONFIG(5)

NAME
netconfig -- network configuration data base SYNOPSIS
/etc/netconfig DESCRIPTION
The netconfig file defines a list of ``transport names'', describing their semantics and protocol. In FreeBSD, this file is only used by the RPC library code. Entries have the following format: network_id semantics flags family protoname device libraries Entries consist of the following fields: network_id The name of the transport described. semantics Describes the semantics of the transport. This can be one of: tpi_clts Connectionless transport. tpi_cots Connection-oriented transport tpi_cots_ord Connection-oriented, ordered transport. tpi_raw A raw connection. flags This field is either blank (specified by ``-''), or contains one or more of the following characters: b The network represented by this entry is broadcast capable. This flag is meaningless in FreeBSD. v The entry may be returned by the getnetpath(3) function. family The protocol family of the transport. This is currently one of: inet6 The IPv6 (PF_INET6) family of protocols. inet The IPv4 (PF_INET) family of protocols. loopback The PF_LOCAL protocol family. protoname The name of the protocol used for this transport. Can currently be either udp, tcp or empty. device This field is always empty in FreeBSD. libraries This field is always empty in FreeBSD. The order of entries in this file will determine which transport will be preferred by the RPC library code, given a match on a specified net- work type. For example, if a sample network config file would look like this: udp6 tpi_clts v inet6 udp - - tcp6 tpi_cots_ord v inet6 tcp - - udp tpi_clts v inet udp - - tcp tpi_cots_ord v inet tcp - - rawip tpi_raw - inet - - - local tpi_cots_ord - loopback - - - then using the network type udp in calls to the RPC library function (see rpc(3)) will make the code first try udp6, and then udp. getnetconfig(3) and associated functions will parse this file and return structures of the following format: struct netconfig { char *nc_netid; /* Network ID */ unsigned long nc_semantics; /* Semantics */ unsigned long nc_flag; /* Flags */ char *nc_protofmly; /* Protocol family */ char *nc_proto; /* Protocol name */ char *nc_device; /* Network device pathname (unused) */ unsigned long nc_nlookups; /* Number of lookup libs (unused) */ char **nc_lookups; /* Names of the libraries (unused) */ unsigned long nc_unused[9]; /* reserved */ }; FILES
/etc/netconfig SEE ALSO
getnetconfig(3), getnetpath(3) BSD
November 17, 2000 BSD

Check Out this Related Man Page

GETNETCONFIG(3) 					   BSD Library Functions Manual 					   GETNETCONFIG(3)

NAME
getnetconfig, setnetconfig, endnetconfig, getnetconfigent, freenetconfigent, nc_perror, nc_sperror -- get network configuration database entry LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <netconfig.h> struct netconfig * getnetconfig(void *handlep); void * setnetconfig(void); int endnetconfig(void *handlep); struct netconfig * getnetconfigent(const char *netid); void freenetconfigent(struct netconfig *netconfigp); void nc_perror(const char *msg); char * nc_sperror(void); DESCRIPTION
The library routines described on this page provide the application access to the system network configuration database, /etc/netconfig. struct netconfig { char *nc_netid; /* Network ID */ unsigned long nc_semantics; /* Semantics */ unsigned long nc_flag; /* Flags */ char *nc_protofmly; /* Protocol family */ char *nc_proto; /* Protocol name */ char *nc_device; /* Network device pathname */ unsigned long nc_nlookups; /* Number of directory lookup libs */ char **nc_lookups; /* Names of the libraries */ }; getnetconfig() returns a pointer to the current entry in the netconfig database, formatted as a struct netconfig. Successive calls will return successive netconfig entries in the netconfig database. getnetconfig() can be used to search the entire netconfig file. getnetconfig() returns NULL at the end of the file. handlep is the handle obtained through setnetconfig(). A call to setnetconfig() has the effect of ``binding'' to or ``rewinding'' the netconfig database. setnetconfig() must be called before the first call to getnetconfig() and may be called at any other time. setnetconfig() need not be called before a call to getnetconfigent(). setnetconfig() returns a unique handle to be used by getnetconfig(). endnetconfig() should be called when processing is complete to release resources for reuse. handlep is the handle obtained through setnetconfig(). Programmers should be aware, however, that the last call to endnetconfig() frees all memory allocated by getnetconfig() for the struct netconfig data structure. endnetconfig() may not be called before setnetconfig(). getnetconfigent() returns a pointer to the netconfig structure corresponding to netid. It returns NULL if netid is invalid (that is, does not name an entry in the netconfig database). freenetconfigent() frees the netconfig structure pointed to by netconfigp (previously returned by getnetconfigent()). nc_perror() prints a message to the standard error indicating why any of the above routines failed. The message is prepended with the string msg and a colon. A newline character is appended at the end of the message. nc_sperror() is similar to nc_perror() but instead of sending the message to the standard error, will return a pointer to a string that con- tains the error message. nc_perror() and nc_sperror() can also be used with the NETPATH access routines defined in getnetpath(3). RETURN VALUES
setnetconfig() returns a unique handle to be used by getnetconfig(). In the case of an error, setnetconfig() returns NULL and nc_perror() or nc_sperror() can be used to print the reason for failure. getnetconfig() returns a pointer to the current entry in the netconfig database, formatted as a struct netconfig. getnetconfig() returns NULL at the end of the file, or upon failure. endnetconfig() returns 0 on success and -1 on failure (for example, if setnetconfig() was not called previously). On success, getnetconfigent() returns a pointer to the struct netconfig structure corresponding to netid; otherwise it returns NULL. nc_sperror() returns a pointer to a buffer which contains the error message string. This buffer is overwritten on each call. In multi- threaded applications, this buffer is implemented as thread-specific data. FILES
/etc/netconfig SEE ALSO
getnetpath(3), netconfig(5) BSD
April 22, 2000 BSD
Man Page