.H 2  "Getrpcent/getrpcbynumber/getrpcbyname (Cristina Mahon)"

.PP
Getrpcent reads the next line of the file /etc/rpc opening the
file if necessary.
Getrpcbyname and getrpcbynumber sequentially search from the 
beginning of the file until the matching rpc program name or 
program number is found, or until EOF is encountered.
.PP
The formats of the routines are as follows:
.sp
.nf
getrpcent()
getrpcbyname(name)
getrpcbynumber(number)
.fi
.sp 2
The fields in /etc/rpc are the following:
.sp 
.nf
name of server for the rpc program
program number
aliases
.fi
.sp
Make sure to use both spaces and tabs between the fields in the file.
.sp
.nf
RESPONSIBLE ENGINEER: Jason Zions
DEPENDENCIES:
ISSUES:
IMPLEMENT TIME:  1.0  md 
PERFORM TIME:    1.5  md
.fi
.sp 2
.H 3 "Domainname not set"
.sp 1
.PP
Getrpc* first finds out in what YP domain the machine is and then
proceeds to find the required information from a YP map.
.sp
.nf
TYPE OF TEST: 
       functional (error conditions testing)
EXPECTED OUTPUT: 
       setrpcent: getdomainname system call missing
.fi
.sp 2
.H 3  "Call getrpcbynumber with unknown program number"
.sp 1
.PP
We will have the same result whether Yellow Pages is up
or not.
.sp
.nf
TYPE OF TEST: 
       functional (error conditions testing)
EXPECTED OUTPUT: 
       Returns NULL.
.fi
.sp 2
.H 3  "Getrpcbynumber: correct program number and YP"
.sp 1
.PP
Call getrpcbynumber with a correct program number and make sure the Yellow
Pages are up and that /etc/rpc has been made into a Yellow Pages database.
The only Yellow Pages database that needs to be made for /etc/rpc is
rpc.bynumber.(dir/pag).
.sp
.nf
TYPE OF TEST: 
       functional 
EXPECTED OUTPUT: 
       Getrpcbynumber  will  return  a  structure   containing  all  the
       information  related to that  program  number.  That is,  program
       name, program number and aliases.
.fi
.sp 2
.H 3  "Getrpcbynumber: correct program number and no YP"
.sp 1
.PP
Call getrpcbynumber with a correct program number. Make sure the Yellow
Pages are not running.  Getrpcbynumber will read the local /etc/rpc file.
.sp
.nf
TYPE OF TEST: 
       functional 
EXPECTED OUTPUT: 
       Getrpcbynumber  will  return  a  structure   containing  all  the
       information  related to that  program  number.  That is,  program
       name, program number and aliases.
.fi
.sp 2
.H 3  "Getrpcbynumber: correct program number, YP, no map"
.sp 1
.PP
Call getrpcbynumber with a correct program number. Make sure the Yellow
Pages are running, but that the Yellow Pages database for rpc was not
created. 
.sp
.nf
TYPE OF TEST: 
       functional (error conditions testing)
EXPECTED OUTPUT: 
       Getrpcbynumber will return a NULL.
.fi
.sp 2
.H 3  "Call getrpcbyname with unknown program name"
.sp 1
.PP
We will have the same result whether Yellow Pages is up or not.
.sp
.nf
TYPE OF TEST: 
       functional (error conditions testing)
EXPECTED OUTPUT: 
       Returns NULL.
.fi
.sp 2
.H 3  "Getrpcbyname: correct program name and YP"
.sp 1
.PP
Call getrpcbyname with a correct program name and make sure the Yellow
Pages are up and that /etc/rpc has been made into a Yellow Pages database.
The only Yellow Pages database that needs to be made for /etc/rpc is
rpc.bynumber.(dir/pag).
.sp
.nf
TYPE OF TEST: 
       functional 
EXPECTED OUTPUT: 
       Getrpcbyname   will  return  a  structure   containing   all  the
       information related to that program name.  That is, program name,
       program number and aliases.
.fi
.sp 2
.H 3  "Getrpcbyname: correct program name and no YP"
.sp 1
.PP
Call getrpcbynumber with a correct program number. Make sure the Yellow
Pages are not running.  Getrpcbynumber will read the local /etc/rpc file.
.sp
.nf
TYPE OF TEST: 
       functional 
EXPECTED OUTPUT: 
       Getrpcbynumber  will  return  a  structure   containing  all  the
       information  related to that  program  number.  That is,  program
       name, program number and aliases.
.fi
.sp 2
.H 3  "Getrpcbyname: correct program name, YP, no map"
.sp 1
.PP
Call getrpcbyname with a correct program name. Make sure the Yellow
Pages are running, but that the Yellow Pages database for rpc was not
created.  
.sp
.nf
TYPE OF TEST: 
       functional (error conditions testing)
EXPECTED OUTPUT: 
       Getrpcbyname will return a NULL.
.fi
.sp 2
.H 3  "Comment line in /etc/rpc"
.sp 1
.PP
Have an entry in /etc/rpc that has a comment as follows:
.sp
#bogus	100016	bogusalias
.sp
Then call getrpcbyname with bogus.
.nf
.sp
TYPE OF TEST: 
       functional
EXPECTED OUTPUT: 
       Getrpcbyname should return a NULL pointer.
.fi
.sp 2
.H 3  "Comment at end of line in /etc/rpc"
.sp 1
.PP
Have an entry in /etc/rpc that has a comment as follows:
.sp
nfs 100003 nfsprog #bogus
.sp
Then call getrpcbyname with bogus.
.nf
.sp
TYPE OF TEST: 
       functional
EXPECTED OUTPUT: 
       Getrpcbyname should return a NULL pointer.
.fi
.sp 2
.H 3  "Call getrpcbyname with an alias"
.sp 1
.PP
Have an entry in /etc/rpc as follows:
.sp
nfs 100003 nfsprog
.sp
Then call getrpcbyname with nfsprog.
.nf
.sp
TYPE OF TEST: 
       functional
EXPECTED OUTPUT: 
       Getrpcbyname  should return the structure  containing nfs, 100003
       and nfsprog.
.fi
.sp 2
.H 2  "Get/set/endnetgrent (Cristina Mahon)"

.PP
Getnetgrent uses /etc/netgroup to return the next member of a network 
group.  Setnetgrent establishes the network group from which getnetgrent 
will obtain members and also restarts calls to getnetgrent from the beginning
of the list.  Endnetgrent frees the space allocated during the getnetgrent
calls.
.PP
The formats of the routines are as follows:
.sp
.nf
getnetgrent(machine, user, domain)
setnetgrent(netgroup)
endnetgrent()
.fi
.sp 2
.nf
RESPONSIBLE ENGINEER: Jason Zions
DEPENDENCIES:
ISSUES:
IMPLEMENT TIME:  1.0  md 
PERFORM TIME:    1.5  md
.fi
.sp 2
.H 3 "Call setnetgrent with unknown netgroup"
.sp 1
.PP
The file /etc/netgroup should have been put on a Yellow Pages
database.  The netgroup we call setnetgrent with should not be 
in /etc/netgroup.
.sp
.nf
TYPE OF TEST: 
       functional (error conditions testing)
EXPECTED OUTPUT: 
       Returns.
.fi
.sp 2
.H 3 "Call setnetgrent with domainname not set"
.sp 1
.PP
Domainname should not be set on that machine.
.sp
.nf
TYPE OF TEST: 
       functional (error conditions testing)
EXPECTED OUTPUT: 
       "getnetgrent: getdomainname system call missing"
       I will change this message so that it actually says
       what it means, domainname not set.
.fi
.sp 2
.H 3 "Call setnetgrent with a cycle in /etc/netgroup"
.sp 1
.PP
A cycle is when a network group defines itself based on itself.
That is, if a member of the group uses the group itself as one
of its fields.
.sp
.nf
TYPE OF TEST: 
       functional (error conditions testing)
EXPECTED OUTPUT: 
       "Cycle detected in /etc/netgroup: <groupname>."
.fi
.sp 2
.H 3 "Call setnetgrent with only hostname field"
.sp 1
.PP
Have an entry in /etc/netgroup as follows:
.sp
group	(hostname)
.sp
.nf
TYPE OF TEST: 
       functional (error conditions testing)
EXPECTED OUTPUT: 
       "syntax error in /etc/netgroup"
       "--- <group>"
.fi
.sp 2
.H 3 "Call setnetgrent with only hostname, username field"
.sp 1
.PP
Have an entry in /etc/netgroup as follows:
.sp
group	(hostname, username)
.sp
.nf
TYPE OF TEST: 
       functional (error conditions testing)
EXPECTED OUTPUT: 
       "syntax error in /etc/netgroup"
       "--- <group>"
.fi
.sp 2
.H 3 "Call setnetgrent with no separating commas"
.sp 1
.PP
Have an entry in /etc/netgroup as follows:
.sp
group	(hostname username domainname)
.sp
.nf
TYPE OF TEST: 
       functional (error conditions testing)
EXPECTED OUTPUT: 
       "syntax error in /etc/netgroup"
       "--- <group>"
.fi
.sp 2
.H 3 "Have a comment on /etc/netgroup"
.sp 1
.PP
Have a comment line on /etc/netgroup.  A comment line starts
with a '#'.  For example, if the comment symbol is followed by the
definition of a group, make sure that that group is never actually
defined.
.sp
#commentgroup	(hostname, username, domainname)
.sp
.nf
TYPE OF TEST: 
       functional
EXPECTED OUTPUT: 
       If getnetgrent ask for commentgroup, such information should not
       exist.
.fi
.sp 2
.H 3 "Have a comment on end of line"
.sp 1
.PP
Have a comment line on /etc/netgroup at the end of a group
description.  A comment line starts with a '#'.  
The definition of the group should not be affected.
.sp
group  (hostname, username, domainname) # (bogus, , nodomain)
.sp
.nf
TYPE OF TEST: 
       functional
EXPECTED OUTPUT: 
       In this example the list of members on the group should not 
       include the triplet after the comment.
.fi
.sp 2
.H 3 "Call setnetgrent with empty field"
.sp 1
.PP
Have an entry in /etc/netgroup with one of its fields empty,
like for example:
.sp
group	(hostname, ,domainname)
.sp
In this example all user should be members of that group.
.sp 
.nf
TYPE OF TEST: 
       functional
EXPECTED OUTPUT: 
       A null pointer should be returned for the username during
       a getnetgrent call.
.fi
.sp 2
.H 3 "Call setnetgrent twice in a row"
.sp 1
.nf
TYPE OF TEST: 
       functional 
EXPECTED OUTPUT: 
       Start form beginning of netgroup list again.  A getnetgrent
       call should return the first member of the group again.
.fi
.sp 2
.H 3 "Have a group with several triplets"
.sp 1
.nf
TYPE OF TEST: 
       functional 
EXPECTED OUTPUT: 
       Several getnetgrent calls for the same group should return all the
       members of the triplet.  That should be checked against the values 
       stored in the Yellow Pages database.
.fi
.sp 2
.H 3 "Have group that points to another group in /etc/netgroup"
.sp 1
.PP
Have entries in /etc/netgroup as follows:
.sp
group	group1
group1  (hostname, username, domainname)
.sp
Have blanks after group1.  This was a defect that we found.
.sp
.nf
TYPE OF TEST: 
       functional
EXPECTED OUTPUT: 
       Gtnetgrent should show hostname, username and domainname as
       part of group.
.fi
.sp 2
.H 3 "Have cycle in /etc/netgroup"
.sp 1
.PP
Have entries in /etc/netgroup as follows:
.sp
group	group1
group1  group
.sp
.nf
TYPE OF TEST: 
       functional
EXPECTED OUTPUT: 
       This should give an error message.       
.fi
.sp 2
.H 3 "Have a group missing a close parentheses in /etc/netgroup"
.sp 1
.PP
Have an entry in /etc/netgroup as follows:
.sp
group	(hostname, username, domainname
.sp
.nf
TYPE OF TEST: 
       functional
EXPECTED OUTPUT: 
       This should give an error message.       
.fi
.H 2  "Getrpcport (Cristina Mahon)"

.PP
Getrpcport returns the port number kept by portmap for a given
hostname, program number, version number and protocol.
.PP
The format of getrpcport is as follows:
.sp
getrpcport(host, prognum, versnum, protocol)
.sp 2
.nf
RESPONSIBLE ENGINEER: Jason Zions
DEPENDENCIES:
ISSUES:
IMPLEMENT TIME:  1.0  md 
PERFORM TIME:    1.5  md
.fi
.sp 2
.H 3 "Call getrpcport with unknown host"
.sp 1
.PP
If getrpcport is called with an unknown host (meaning a host not listed
in /etc/hosts, either kept by the Yellow Pages or locally) it will not
be able to contact the host that contains the information requested.
.sp
.nf
TYPE OF TEST: 
       functional (error conditions testing)
EXPECTED OUTPUT: 
       Zero returned. 
.fi
.sp 2
.H 3  "Call getrpcport with unknown prognum"
.sp 1
.PP
Getrpcport will call portmap (PMAPPROC_GETPORT) which will return a
zero since the program number is not registered with portmap. 
.sp
.nf
TYPE OF TEST: 
       functional (error conditions testing)
EXPECTED OUTPUT: 
       Zero returned.
.fi
.sp 2
.H 3  "Call getrpcport with unknown versnum, known prognum"
.sp 1
.PP
This is what I think it should do:
.sp
Getrpcport will call portmap (PMAPPROC_GETPORT) which will return a
zero since that version number is not registered with portmap.
.sp
What it does though is return the port number of the program even if
the version does not match.
.sp
.nf
TYPE OF TEST: 
       functional (error conditions testing)
EXPECTED OUTPUT: 
.fi
.sp 2
.H 3  "Call getrpcport with unknown protocol"
.sp 1
.PP
Getrpcport will call portmap (PMAPPROC_GETPORT) which will return a
zero since the protocol number is unknown to it (even though the program
is registered under a different protocol).
.sp
.nf
TYPE OF TEST: 
       functional (error conditions testing)
EXPECTED OUTPUT: 
       Zero returned.
.fi
.sp 2
.H 3  "Call getrpcport with all parameters known"
.sp 1
.PP
Getrpcport will call portmap (PMAPPROC_GETPORT) which will return the
port number since all the parameters match a program registered with 
portmap.
.sp
.nf
TYPE OF TEST: 
       functional (error conditions testing)
EXPECTED OUTPUT: 
       Returns port that was originally registered with portmap for this
       program number, version number and protocol.
.fi
