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
|
GETNAMEINFO(3) FreeBSD Library Functions Manual GETNAMEINFO(3)
NNAAMMEE
ggeettnnaammeeiinnffoo -- address-to-name translation in protocol-independent manner
SSYYNNOOPPSSIISS
##iinncclluuddee <<ssyyss//ssoocckkeett..hh>>
##iinncclluuddee <<nneettddbb..hh>>
_i_n_t
ggeettnnaammeeiinnffoo(_c_o_n_s_t _s_t_r_u_c_t _s_o_c_k_a_d_d_r _*_s_a, _s_o_c_k_l_e_n___t _s_a_l_e_n, _c_h_a_r _*_h_o_s_t,
_s_i_z_e___t _h_o_s_t_l_e_n, _c_h_a_r _*_s_e_r_v, _s_i_z_e___t _s_e_r_v_l_e_n, _i_n_t _f_l_a_g_s);
DDEESSCCRRIIPPTTIIOONN
The ggeettnnaammeeiinnffoo() function is defined for protocol-independent address-
to-nodename translation. It performs functionality of gethostbyaddr(3)
and getservbyport(3) in more sophisticated manner.
The _s_a arguement is a pointer to a generic socket address structure of
size _s_a_l_e_n. The arguements _h_o_s_t and _s_e_r_v are pointers to buffers to hold
the return values. Their sizes are specified by _h_o_s_t_l_e_n and _s_e_r_v_l_e_n
repectively. Either _h_o_s_t or _s_e_r_v may be NULL if the hostname or service
name is not required.
The _f_l_a_g_s arguement modifies the behaviour of ggeettnnaammeeiinnffoo() as follows:
If NI_NOFQDN is set only the unqualified hostname is returned for local
fully qualified names.
If NI_NUMERICHOST is set then the numeric form of the hostname is
returned.
If NI_NAMEREQD is set, then a error is returned if the hostname cannot be
looked up.
If NI_NUMERICSERV is set then the service is returned in numeric form.
If NI_DGRAM is set then the service is UDP based rather than TCP based.
SSEEEE AALLSSOO
getaddrinfo(3), gethostbyaddr(3), getservbyport(3), hosts(5),
services(5), hostname(7),
R. Gilligan, S. Thomson, J. Bound, and W. Stevens, ``Basic Socket Inter-
face Extensions for IPv6,'' RFC2133, April 1997.
SSTTAANNDDAARRDDSS
The ggeettaaddddrriinnffoo() function is defined IEEE POSIX 1003.1g draft specifica-
tion, and documented in ``Basic Socket Interface Extensions for IPv6''
(RFC2133).
January 11, 1999
|