~ubuntu-branches/ubuntu/vivid/cctools/vivid

« back to all changes in this revision

Viewing changes to dttools/src/domain_name_cache.h

  • Committer: Bazaar Package Importer
  • Author(s): Michael Hanke
  • Date: 2011-05-07 09:05:00 UTC
  • Revision ID: james.westby@ubuntu.com-20110507090500-lqpmdtwndor6e7os
Tags: upstream-3.3.2
ImportĀ upstreamĀ versionĀ 3.3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
Copyright (C) 2003-2004 Douglas Thain and the University of Wisconsin
 
3
Copyright (C) 2005- The University of Notre Dame
 
4
This software is distributed under the GNU General Public License.
 
5
See the file COPYING for details.
 
6
*/
 
7
 
 
8
#ifndef DOMAIN_NAME_CACHE_H
 
9
#define DOMAIN_NAME_CACHE_H
 
10
 
 
11
#include "domain_name.h"
 
12
 
 
13
/** @file domain_name_cache.h
 
14
Look up domain names and addresses quickly.
 
15
These routines resolve domain names using an internal cache,
 
16
allowing for much faster response time than the plain @ref domain_name.h routines.
 
17
*/
 
18
 
 
19
/** Determine the caller's primary domain name.
 
20
This function uses a variety of sources, including uname, the local hosts file,
 
21
and the domain name system, to determine the caller's primary domain name.
 
22
If this function returns an unexpected name, try running with the @ref debug flags
 
23
set to @ref D_DNS to observe exactly who th ename was determined.
 
24
@param name Pointer to buffer where name will be stored.
 
25
@returns One on success, zero on failure.
 
26
*/
 
27
 
 
28
int domain_name_cache_guess( char *name );
 
29
 
 
30
/** Determine the caller's local machine name.
 
31
This function uses the built in facility to determine the
 
32
local host name of the machine, without involving DNS.
 
33
If the local name has been configured to look like a domain name,
 
34
only the first segment of the name will be returned.
 
35
@param name Pointer to buffer where name will be stored.
 
36
@returns One on success, zero on failure.
 
37
*/
 
38
 
 
39
int domain_name_cache_guess_short( char *name );
 
40
 
 
41
/** Resolve a domain name to an IP address with caching.
 
42
@param name A string containing a domain name like "www.google.com".
 
43
@param addr A string where the IP address will be written.
 
44
@return One on success, zero on failure.
 
45
*/
 
46
 
 
47
int domain_name_cache_lookup( const char *name, char *addr );
 
48
 
 
49
/** Resolve an IP address to a domain name with caching.
 
50
@param addr A string containing an IP address like "202.5.129.1"
 
51
@param name A string where the domain name will be written.
 
52
@return One on success, zero on failure.
 
53
*/
 
54
 
 
55
int domain_name_cache_lookup_reverse( const char *addr, char *name );
 
56
 
 
57
/** Find the canonical name of a host.
 
58
@param name_or_addr A string containing a domain name or ip address.
 
59
@param cname A string where the canonical domain name will be written.
 
60
@return One on success, zero on failure.
 
61
*/
 
62
 
 
63
int domain_name_cache_canonical( const char *name_or_addr, char *cname );
 
64
 
 
65
#endif