]> asedeno.scripts.mit.edu Git - 1ts-debian.git/blob - hesiod/hesiod_getservbyname.3
We're planning to upload this to unstable
[1ts-debian.git] / hesiod / hesiod_getservbyname.3
1 .\" $Id: hesiod_getservbyname.3,v 1.1 1996/12/08 21:38:45 ghudson Exp $
2 .\"
3 .\" Copyright 1996 by the Massachusetts Institute of Technology.
4 .\"
5 .\" Permission to use, copy, modify, and distribute this
6 .\" software and its documentation for any purpose and without
7 .\" fee is hereby granted, provided that the above copyright
8 .\" notice appear in all copies and that both that copyright
9 .\" notice and this permission notice appear in supporting
10 .\" documentation, and that the name of M.I.T. not be used in
11 .\" advertising or publicity pertaining to distribution of the
12 .\" software without specific, written prior permission.
13 .\" M.I.T. makes no representations about the suitability of
14 .\" this software for any purpose.  It is provided "as is"
15 .\" without express or implied warranty.
16 .\"
17 .TH HESIOD 3 "30 November 1996"
18 .SH NAME
19 hesiod_getservbyname, hesiod_free_servent \- Hesiod functions for retrieving service information
20 .SH SYNOPSIS
21 .nf
22 .B #include <hesiod.h>
23 .PP
24 .B struct servent *hesiod_getservbyname(void *\fIcontext\fP,
25 .B      const char *\fIname\fP, const char *\fIproto\fP)
26 .B void hesiod_free_servent(void *\fIcontext\fP, struct servent *\fIserv\fP)
27 .PP
28 .B cc file.c \-lhesiod
29 .fi
30 .SH DESCRIPTION
31 This family of functions allows you to retrieve service to port
32 mappings using Hesiod.  To perform lookups, you need an initialized
33 Hesiod context; see hesiod(3) for details.  Information is returned in
34 the same format as by
35 .IR getservbyname .
36 It is the caller's responsibility to call
37 .I hesiod_free_servent
38 with the returned service entry to free the resources used by the
39 service entry.
40 .PP
41 Hesiod queries for service information are made using the ``service''
42 Hesiod type, using the service name as the Hesiod name.  The
43 corresponding records should be space-separated lists of strings
44 giving the service name, protocol, port number (in decimal), and zero
45 or more aliases for the service.  There may be multiple records per
46 service name;
47 .I hesiod_getservbyname
48 will pick the first one whose protocol matches
49 .IR proto .
50 .SH RETURN VALUES
51 On failure,
52 .I hesiod_getservbyname
53 returns NULL and sets the global variable
54 .I errno
55 to indicate the error.
56 .SH ERRORS
57 .I hesiod_getservbyname
58 may fail for any of the reasons the routine
59 .I hesiod_resolve
60 may fail.
61 .SH SEE ALSO
62 hesiod(3)