BSD 4_2 development
authorCSRG <csrg@ucbvax.Berkeley.EDU>
Sun, 3 Apr 1983 21:25:34 +0000 (13:25 -0800)
committerCSRG <csrg@ucbvax.Berkeley.EDU>
Sun, 3 Apr 1983 21:25:34 +0000 (13:25 -0800)
Work on file usr/man/man3/gethostent.3n
Work on file usr/man/man3/getnetent.3n
Work on file usr/man/man3/getprotoent.3n

Synthesized-from: CSRG/cd1/4.2

usr/man/man3/gethostent.3n [new file with mode: 0644]
usr/man/man3/getnetent.3n [new file with mode: 0644]
usr/man/man3/getprotoent.3n [new file with mode: 0644]

diff --git a/usr/man/man3/gethostent.3n b/usr/man/man3/gethostent.3n
new file mode 100644 (file)
index 0000000..c713fdc
--- /dev/null
@@ -0,0 +1,103 @@
+.TH GETHOSTENT 3N "9 February 1983"
+.UC 4
+.SH NAME
+gethostent, gethostbyaddr, gethostbyname, sethostent, endhostent \- get network host entry
+.SH SYNOPSIS
+.B "#include <netdb.h>
+.PP
+.B "struct hostent *gethostent()
+.PP
+.B "struct hostent *gethostbyname(name)
+.br
+.B "char *name;
+.PP
+.B "struct hostent *gethostbyaddr(addr, len, type)
+.br
+.B "char *addr; int len, type;
+.PP
+.B "sethostent(stayopen)
+.br
+.B "int stayopen
+.PP
+.B "endhostent()
+.SH DESCRIPTION
+.IR Gethostent ,
+.IR gethostbyname ,
+and
+.I gethostbyaddr
+each return a pointer to an object with the
+following structure
+containing the broken-out
+fields of a line in the network host data base,
+.IR /etc/hosts .
+.RS
+.PP
+.nf
+struct hostent {
+       char    *h_name;        /* official name of host */
+       char    **h_aliases;    /* alias list */
+       int     h_addrtype;     /* address type */
+       int     h_length;       /* length of address */
+       char    *h_addr;        /* address */
+};
+.ft R
+.ad
+.fi
+.RE
+.PP
+The members of this structure are:
+.TP \w'h_addrtype'u+2n
+h_name
+Official name of the host.
+.TP \w'h_addrtype'u+2n
+h_aliases
+A zero terminated array of alternate names for the host.
+.TP \w'h_addrtype'u+2n
+h_addrtype
+The type of address being returned; currently always AF_INET.
+.TP \w'h_addrtype'u+2n
+h_length
+The length, in bytes, of the address.
+.TP \w'h_addrtype'u+2n
+h_addr
+A pointer to the network address for the host.
+Host addresses are returned
+in network byte order.
+.PP
+.I Gethostent
+reads the next line of the file, opening the file if necessary.
+.PP
+.I Sethostent
+opens and rewinds the file.  If the
+.I stayopen
+flag is non-zero,
+the host data base will not be closed after each call to 
+.I gethostent
+(either directly, or indirectly through one of the other
+\*(lqgethost\*(rq calls).
+.PP
+.I Endhostent
+closes the file.
+.PP
+.I Gethostbyname
+and
+.I gethostbyaddr
+sequentially search from the beginning
+of the file until a matching
+host name or
+host address is found,
+or until EOF is encountered.
+Host addresses are supplied in network order.
+.SH FILES
+/etc/hosts
+.SH "SEE ALSO"
+hosts(5)
+.SH DIAGNOSTICS
+Null pointer
+(0) returned on EOF or error.
+.SH BUGS
+All information
+is contained in a static area
+so it must be copied if it is
+to be saved.  Only the Internet
+address format is currently understood.
diff --git a/usr/man/man3/getnetent.3n b/usr/man/man3/getnetent.3n
new file mode 100644 (file)
index 0000000..82c0862
--- /dev/null
@@ -0,0 +1,106 @@
+.TH GETNETENT 3N "9 February 1983"
+.UC 4
+.SH NAME
+getnetent, getnetbyaddr, getnetbyname, setnetent, endnetent \- get network entry
+.SH SYNOPSIS
+.nf
+.ft B
+#include <netdb.h>
+.PP
+.ft B
+struct netent *getnetent()
+.PP
+.ft B
+struct netent *getnetbyname(name)
+char *name;
+.PP
+.ft B
+struct netent *getnetbyaddr(net)
+long net;
+.PP
+.ft B
+setnetent(stayopen)
+int stayopen
+.PP
+.ft B
+endnetent()
+.fi
+.SH DESCRIPTION
+.IR Getnetent ,
+.IR getnetbyname ,
+and
+.I getnetbyaddr
+each return a pointer to an object with the
+following structure
+containing the broken-out
+fields of a line in the network data base,
+.IR /etc/networks .
+.RS
+.PP
+.nf
+struct netent {
+       char    *n_name;        /* official name of net */
+       char    **n_aliases;    /* alias list */
+       int     n_addrtype;     /* net number type */
+       long    n_net;          /* net number */
+};
+.ft R
+.ad
+.fi
+.RE
+.PP
+The members of this structure are:
+.TP \w'n_addrtype'u+2n
+n_name
+The official name of the network.
+.TP \w'n_addrtype'u+2n
+n_aliases
+A zero terminated list of alternate names for the network.
+.TP \w'n_addrtype'u+2n
+n_addrtype
+The type of the network number returned; currently only AF_INET.
+.TP \w'n_addrtype'u+2n
+n_net
+The network number.  Network numbers are returned in machine byte
+order.
+.PP
+.I Getnetent
+reads the next line of the file, opening the file if necessary.
+.PP
+.I Setnetent
+opens and rewinds the file.  If the
+.I stayopen
+flag is non-zero,
+the net data base will not be closed after each call to 
+.I getnetent
+(either directly, or indirectly through one of
+the other \*(lqgetnet\*(rq calls).
+.PP
+.I Endnetent
+closes the file.
+.PP
+.I Getnetbyname
+and
+.I getnetbyaddr
+sequentially search from the beginning
+of the file until a matching
+net name or
+net address is found,
+or until EOF is encountered.
+Network numbers are supplied in host order.
+.SH FILES
+/etc/networks
+.SH "SEE ALSO"
+networks(5)
+.SH DIAGNOSTICS
+Null pointer
+(0) returned on EOF or error.
+.SH BUGS
+All information
+is contained in a static area
+so it must be copied if it is
+to be saved.  Only Internet network
+numbers are currently understood.
+Expecting network numbers to fit
+in no more than 32 bits is probably
+naive.
diff --git a/usr/man/man3/getprotoent.3n b/usr/man/man3/getprotoent.3n
new file mode 100644 (file)
index 0000000..9cd81c7
--- /dev/null
@@ -0,0 +1,97 @@
+.TH GETPROTOENT 3N "9 February 1983"
+.UC 4
+.SH NAME
+getprotoent, getprotobynumber, getprotobyname, setprotoent, endprotoent \- get protocol entry
+.SH SYNOPSIS
+.nf
+.ft B
+.B #include <netdb.h>
+.PP
+.ft B
+struct protoent *getprotoent()
+.PP
+.ft B
+struct protoent *getprotobyname(name)
+char *name;
+.PP
+.ft B
+struct protoent *getprotobynumber(proto)
+int proto;
+.PP
+.ft B
+setprotoent(stayopen)
+int stayopen
+.PP
+.ft B
+endprotoent()
+.fi
+.SH DESCRIPTION
+.IR Getprotoent ,
+.IR getprotobyname ,
+and
+.I getprotobynumber
+each return a pointer to an object with the
+following structure
+containing the broken-out
+fields of a line in the network protocol data base,
+.IR /etc/protocols .
+.RS
+.PP
+.nf
+struct protoent {
+       char    *p_name;        /* official name of protocol */
+       char    **p_aliases;    /* alias list */
+       long    p_proto;        /* protocol number */
+};
+.ft R
+.ad
+.fi
+.RE
+.PP
+The members of this structure are:
+.TP \w'p_aliases'u+2n
+p_name
+The official name of the protocol.
+.TP \w'p_aliases'u+2n
+p_aliases
+A zero terminated list of alternate names for the protocol.
+.TP \w'p_aliases'u+2n
+p_proto
+The protocol number.
+.PP
+.I Getprotoent
+reads the next line of the file, opening the file if necessary.
+.PP
+.I Setprotoent
+opens and rewinds the file.  If the
+.I stayopen
+flag is non-zero,
+the net data base will not be closed after each call to 
+.I getprotoent
+(either directly, or indirectly through one of
+the other \*(lqgetproto\*(rq calls).
+.PP
+.I Endprotoent
+closes the file.
+.PP
+.I Getprotobyname
+and
+.I getprotobynumber
+sequentially search from the beginning
+of the file until a matching
+protocol name or
+protocol number is found,
+or until EOF is encountered.
+.SH FILES
+/etc/protocols
+.SH "SEE ALSO"
+protocols(5)
+.SH DIAGNOSTICS
+Null pointer
+(0) returned on EOF or error.
+.SH BUGS
+All information
+is contained in a static area
+so it must be copied if it is
+to be saved.  Only the Internet
+protocols are currently understood.