~ubuntu-branches/ubuntu/lucid/nfs-utils/lucid

« back to all changes in this revision

Viewing changes to support/export/hostname.c

  • Committer: Bazaar Package Importer
  • Author(s): Anibal Monsalve Salazar
  • Date: 2006-07-03 10:36:59 UTC
  • mto: (12.1.1 feisty)
  • mto: This revision was merged to the branch mainline in revision 6.
  • Revision ID: james.westby@ubuntu.com-20060703103659-71qzs6f21zzmjmhx
Tags: upstream-1.0.8
ImportĀ upstreamĀ versionĀ 1.0.8

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 *
6
6
 */
7
7
 
8
 
#include "config.h"
 
8
#ifdef HAVE_CONFIG_H
 
9
#include <config.h>
 
10
#endif
9
11
 
10
12
/*
11
13
#define TEST
118
120
      len_addr_list += align (hp->h_length, ALIGNMENT)
119
121
                       + sizeof (char *);
120
122
    }
121
 
  
 
123
 
122
124
  cp = (struct hostent *) xmalloc (len_ent + len_name + len_aliases
123
125
                                   + len_addr_list);
124
126
 
219
221
 
220
222
 
221
223
/* Map IP to hostname, and then map back to addr to make sure it is a
222
 
 * reliable hostname 
 
224
 * reliable hostname
223
225
 */
224
226
struct hostent *
225
227
get_reliable_hostbyaddr(const char *addr, int len, int type)
275
277
 
276
278
  if (hp)
277
279
    {
278
 
      printf ("official hostname: %s\n", hp->h_name); 
 
280
      printf ("official hostname: %s\n", hp->h_name);
279
281
      printf ("aliases:\n");
280
282
      for (sp = hp->h_aliases; *sp; sp++)
281
283
        printf ("  %s\n", *sp);