2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /*%% (c) Copyright 1993, 1994 Hewlett-Packard Company */
24 /*%% (c) Copyright 1993, 1994 International Business Machines Corp. */
25 /*%% (c) Copyright 1993, 1994 Sun Microsystems, Inc. */
26 /*%% (c) Copyright 1993, 1994 Novell, Inc. */
27 /*%% $XConsortium: tt_host.h /main/3 1995/10/23 10:39:40 rswiston $ */
32 * Copyright (c) 1990, 1994 by Sun Microsystems, Inc.
34 * This file implements the _Tt_host object which is a utility object
35 * that handles locating a host address by name or locating a host name
43 #include <sys/types.h>
44 #include <netinet/in.h>
45 #include "util/tt_object.h"
46 #include "util/tt_string.h"
48 class _Tt_host : public _Tt_object {
52 int init_byaddr(_Tt_string addr);
53 int init_byname(_Tt_string name);
54 int init_bystringaddr(_Tt_string addr);
55 const _Tt_string & name() const {return _name;};
56 const _Tt_string & netname() const {return _netname;};
57 const _Tt_string & addr() const {return _addr;};
58 int addr_length() const;
59 const _Tt_string & stringaddr() const {return _string_address;};
60 bool_t xdr(XDR *xdrs);
63 int init_from_hostent(hostent *h);
64 // Internet '.' notation
65 _Tt_string _string_address;
68 // IP_QUALIFIER:<ip_address>
69 // TLI_QUALIFIER:<fully_qualified_hostname>
75 _Tt_string _tt_host_addr(_Tt_object_ptr &o);
76 _Tt_string _tt_host_name(_Tt_object_ptr &o);
77 #endif /* _TT_HOST_H */