HP-UX Reference (11i v2 07/12) - 3 Library Functions N-Z (vol 7)

n
nis_tables(3N) nis_tables(3N)
invalid or non-existent object then it is silently ignored.
HARD_LOOKUP
This flag specifies that the operation should continue trying to contact a server of the
named table until a definitive result is returned (such as
NIS_NOTFOUND ).
ALL_RESULTS
This flag can only be used in conjunction with
FOLLOW_PATH and a callback function.
When specified, it forces all of the tables in the path to be searched. If name does not
specify a search criteria (implying that all entries are to be returned), then this flag will
cause all of the entries in all of the tables in the path to be returned.
NO_CACHE This flag specifies that the client library should bypass any client object caches and get its
information directly from either the master server or a replica server for the named table.
MASTER_ONLY
This flag is even stronger than NO_CACHE
in that it specifies that the client library should
only get its information from the master server for a particular table. This guarantees that
the information will be up to date. However, there may be severe performance penalties
associated with contacting the master server directly on large networks. When used in con-
junction with the
HARD_LOOKUP flag, this will block the list operation until the master
server is up and available.
EXPAND_NAME
When specified, the client library will attempt to expand a partially qualified name by cal-
ling nis_getnames() (see nis_local_names(3N)) which uses the environment variable
NIS_PATH.
RETURN_RESULT
This flag is used to specify that a copy of the returning object be returned in the
nis_result structure if the operation was successful.
The third parameter to nis_list() , callback, is an optional pointer to a function that will process the
ENTRY type objects that are returned from the search. If this pointer is NULL, then all entries that match
the search criteria are returned in the nis_result structure, otherwise this function will be called once for
each entry returned. When called, this function should return 0 when additional objects are desired and 1
when it no longer wishes to see any more objects. The fourth parameter, userdata, is simply passed to call-
back function along with the returned entry object. The client can use this pointer to pass state information
or other relevant data that the callback function might need to process the entries.
nis_add_entry() will add the NIS+ object to the NIS+ table_name. The flags parameter is used to
specify the failure semantics for the add operation. The default (flags equal 0) is to fail if the entry being
added already exists in the table. The
ADD_OVERWRITE
flag may be used to specify that the existing
object is to be overwritten if it exists, (a modify operation) or added if it does not exist. With the
ADD_OVERWRITE flag, this function will fail with the error
NIS_PERMISSION if the existing object does
not allow modify privileges to the client.
If the flag
RETURN_RESULT
has been specified, the server will return a copy of the resulting object if the
operation was successful.
nis_remove_entry() removes the identified entry from the table or a set of entries identified by
table_name. If the parameter object is non-null, it is presumed to point to a cached copy of the entry. When
the removal is attempted, and the object that would be removed is not the same as the cached object
pointed to by object then the operation will fail with an NIS_NOTSAMEOBJ error. If an object is passed
with this function, the search criteria in name is optional as it can be constructed from the values within
the entry. However, if no object is present, the search criteria must be included in the name parameter. If
the flags variable is null, and the search criteria does not uniquely identify an entry, the
NIS_NOTUNIQUE error is returned and the operation is aborted. If the flag parameter REM_MULTIPLE
is passed, and if remove permission is allowed for each of these objects, then all objects that match the
search criteria will be removed. Note that a null search criteria and the REM_MULTIPLE flag will remove
all entries in a table.
nis_modify_entry() modifies an object identified by name. The parameter object should point to an
entry with the
EN_MODIFIED flag set in each column that contains new information. These columns will
replace their counterparts in the entry that is stored in the table. The entry passed must have the same
number of columns, same type, and valid data in the modified columns for this operation to succeed.
102 Hewlett-Packard Company 2 HP-UX 11i Version 2: December 2007 Update