/usr/share/doc/libbobcat3-dev/man/hostent.3.html is in libbobcat-dev 3.19.01-1ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 | <html><head>
<title>FBB::Hostent</title>
<link rev="made" href="mailto:Frank B. Brokken: f.b.brokken@rug.nl">
</head>
<body text="#27408B" bgcolor="#FFFAF0">
<hr>
<h1>FBB::Hostent</h1>
<h2>libbobcat-dev_3.19.01-x.tar.gz</h2>
<h2>2005-2013</h2>
<html><head>
<link rev="made" href="mailto:Frank B. Brokken: f.b.brokken@rug.nl">
</head>
<body text="#27408B" bgcolor="#FFFAF0">
<hr>
<h1></h1>
<html><head>
<title>FBB::Hostent(3bobcat)</title>
<link rev="made" href="mailto:Frank B. Brokken: f.b.brokken@rug.nl">
</head>
<body text="#27408B" bgcolor="#FFFAF0">
<hr>
<h1>FBB::Hostent(3bobcat)</h1>
<h2>libbobcat-dev_3.19.01-x.tar.gz struct hostent wrapper</h2>
<h2>2005-2013</h2>
<p>
<h2>NAME</h2>FBB::Hostent - Wrapper around a <strong>struct hostent</strong>
<p>
<h2>SYNOPSIS</h2>
<strong>#include <bobcat/hostent></strong><br>
Linking option: <em>-lbobcat</em>
<p>
<h2>DESCRIPTION</h2>
<strong>@CLASS</strong> objects are wrappers around <strong>hostent</strong> structs which may be
used by other objects. A <strong>struct hostent</strong> is defined as follows:
<pre>
struct hostent
{
char *h_name; // official name of host
char **h_aliases; // alias list
int h_addrtype; // host address type (always AF_INET)
int h_length; // length of address
char **h_addr_list; // list of addresses
}
</pre>
<p>
The <em>address</em> fields are binary values of the addresses, each address
requiring <em>h_length</em> bytes, the last address being equal to 0. The
<strong>@CLASS</strong> objects offer a <strong>C++</strong>-like interface to this struct.
<p>
<h2>NAMESPACE</h2>
<strong>FBB</strong><br>
All constructors, members, operators and manipulators, mentioned in this
man-page, are defined in the namespace <strong>FBB</strong>.
<p>
<h2>INHERITS FROM</h2>
-
<p>
<h2>CONSTRUCTORS</h2>
<ul>
<li> <strong>Hostent(hostent const *hostentPtr)</strong>:<br>
This constructor initializes an <strong>@CLASS</strong> object from an existing
<strong>hostent</strong> struct. Functions like <strong>gethostbyname</strong>(3) and
<strong>gethostbyaddress</strong>(3) return pointers to <strong>hostent</strong> structs.
</ul>
<p>
The default, copy and move constructors are available.
<p>
<h2>MEMBER FUNCTIONS</h2>
<p>
<ul>
<li> <strong>size_t addressLength() const</strong>:<br>
This member returns the length of the binary addresses in bytes.
<li> <strong>size_t addressType() const</strong>:<br>
This member returns the type of the address. Currently this is always
<strong>AF_INET</strong>.
<li> <strong>char const *alias(size_t index) const</strong>:<br>
This member returns alias `<em>index</em>' of the host. The first alias has
<em>index 0</em>. If alias `<em>index</em>' does not exist, 0 is returned.
<li> <strong>char const * const *beginAlias() const</strong>:<br>
This member returns an iterator to the first alias. The hostname
itself is not included in the list of aliases.
<li> <strong>char const *binaryAddress(size_t index) const</strong>:<br>
This member returns the binary address `<em>index</em>' of the host. The
first address has <em>index 0</em>. If address `<em>index</em>' does not exist, 0 is
returned. The pointer to the binary address points to a series of
<strong>addressLength()</strong> bytes. Note that the returned address is in <em>network
byte order</em>. It can be converted to host byte order by the functions described
in <strong>byteorder</strong>(3).
<li> <strong>std::string dottedDecimalAddress(size_t index) const</strong>:<br>
This member returns address `<em>index</em>' as a dotted decimal address in
a string. The first address has <em>index 0</em>. If address `<em>index</em>' does not
exist, an empty string is returned.
<li> <strong>char const * const *endAlias() const</strong>:<br>
This member returns an iterator pointing beyond the last alias.
<li> <strong>char const *hostname() const</strong>:<br>
This member returns the standard (first) name of the host.
<li> <strong>size_t nAddresses() const</strong>:<br>
This member returns the number of addresses that are available. When
requesting a particular address, the requested index should be less than
the value returned by this member.
<li> <strong>size_t nAliases() const</strong>:<br>
This member returns the number of aliases that are available. When
requesting a particular alias, the requested index should be less than the
value returned by this member.
<li> <strong>void swap(Hostent &other)</strong>:<br>
The current <em>Hostent</em> object's contents are swapped with the other
object's contents.
</ul>
<p>
The overloaded assignment operator and the move-aware overloaded
assignment operators are available.
<p>
<h2>EXAMPLE</h2>
<pre>
#include <iostream>
#include <algorithm>
#include <iterator>
#include <bobcat/hostent>
using namespace std;
using namespace FBB;
int main(int argc, char **argv)
{
Hostent he(gethostbyname("localhost"));
cout << "The local hostname = " << he.hostname() << endl;
cout << "All aliases: " << endl;
copy(he.beginAlias(), he.endAlias(),
ostream_iterator<char const *>(cout, "\n"));
cout << "Addresses:\n";
for (size_t idx = 0; idx < he.nAddresses(); idx++)
cout << he.dottedDecimalAddress(idx) << endl;
return 0;
}
</pre>
<p>
<h2>FILES</h2>
<em>bobcat/hostent</em> - defines the class interface
<p>
<h2>SEE ALSO</h2>
<strong>bobcat</strong>(7)
<p>
<h2>BUGS</h2>
None Reported.
<p>
<h2>DISTRIBUTION FILES</h2>
<ul>
<li> <em>bobcat_3.19.01-x.dsc</em>: detached signature;
<li> <em>bobcat_3.19.01-x.tar.gz</em>: source archive;
<li> <em>bobcat_3.19.01-x_i386.changes</em>: change log;
<li> <em>libbobcat1_3.19.01-x_*.deb</em>: debian package holding the
libraries;
<li> <em>libbobcat1-dev_3.19.01-x_*.deb</em>: debian package holding the
libraries, headers and manual pages;
<li> <em>http://sourceforge.net/projects/bobcat</em>: public archive location;
</ul>
<p>
<h2>BOBCAT</h2>
Bobcat is an acronym of `Brokken's Own Base Classes And Templates'.
<p>
<h2>COPYRIGHT</h2>
This is free software, distributed under the terms of the
GNU General Public License (GPL).
<p>
<h2>AUTHOR</h2>
Frank B. Brokken (<strong>f.b.brokken@rug.nl</strong>).
<p>
|