42a26e19fd6d58a5b290150d1ee725f47b5c21be
[openssl.git] / doc / crypto / BIO_ADDRINFO.pod
1 =pod
2
3 =head1 NAME
4
5 BIO_ADDRINFO, BIO_ADDRINFO_lookup, BIO_ADDRINFO_next, BIO_ADDRINFO_free,
6 BIO_ADDRINFO_family, BIO_ADDRINFO_socktype, BIO_ADDRINFO_protocol,
7 BIO_ADDRINFO_sockaddr, BIO_ADDRINFO_sockaddr_size, BIO_ADDRINFO_address
8 - BIO_ADDRINFO type and routines
9
10 =head1 SYNOPSIS
11
12  #include <sys/types.h>
13  #include <openssl/bio.h>
14
15  typedef union bio_addrinfo_st BIO_ADDRINFO;
16
17  enum BIO_lookup_type {
18      BIO_LOOKUP_CLIENT, BIO_LOOKUP_SERVER
19  };
20  int BIO_lookup(const char *node, const char *service,
21                 enum BIO_lookup_type lookup_type,
22                 int family, int socktype, BIO_ADDRINFO **res);
23
24  const BIO_ADDRINFO *BIO_ADDRINFO_next(const BIO_ADDRINFO *bai);
25  int BIO_ADDRINFO_family(const BIO_ADDRINFO *bai);
26  int BIO_ADDRINFO_socktype(const BIO_ADDRINFO *bai);
27  int BIO_ADDRINFO_protocol(const BIO_ADDRINFO *bai);
28  const BIO_ADDR *BIO_ADDRINFO_address(const BIO_ADDRINFO *bai);
29  void BIO_ADDRINFO_free(BIO_ADDRINFO *bai);
30
31 =head1 DESCRIPTION
32
33 The B<BIO_ADDRINFO> type is a wrapper for address information
34 types provided on your platform.
35
36 B<BIO_ADDRINFO> normally forms a chain of several that can be
37 picked at one by one.
38
39 BIO_lookup() looks up a specified B<host> and B<service>, and
40 uses B<lookup_type> to determine what the default address should
41 be if B<host> is B<NULL>.  B<family>, B<socktype> are used to
42 determine what protocol family and protocol should be used for
43 the lookup.  B<family> can be any of AF_INET, AF_INET6, AF_UNIX and
44 AF_UNSPEC, and B<socktype> can be SOCK_STREAM or SOCK_DGRAM.
45 B<res> points at a pointer to hold the start of a B<BIO_ADDRINFO>
46 chain.
47 For the family B<AF_UNIX>, BIO_lookup() will ignore the B<service>
48 parameter and expects the B<node> parameter to hold the path to the
49 socket file.
50
51 BIO_ADDRINFO_family() returns the family of the given
52 B<BIO_ADDRINFO>.  The result will be one of the constants
53 AF_INET, AF_INET6 and AF_UNIX.
54
55 BIO_ADDRINFO_socktype() returns the socket type of the given
56 B<BIO_ADDRINFO>.  The result will be one of the constants
57 SOCK_STREAM and SOCK_DGRAM.
58
59 BIO_ADDRINFO_protocol() returns the protocol id of the given
60 B<BIO_ADDRINFO>.  The result will be one of the constants
61 IPPROTO_TCP and IPPROTO_UDP.
62
63 BIO_ADDRINFO_address() returns the underlying B<BIO_ADDR>
64 of the given B<BIO_ADDRINFO>.
65
66 BIO_ADDRINFO_next() returns the next B<BIO_ADDRINFO> in the chain
67 from the given one.
68
69 BIO_ADDRINFO_free() frees the chain of B<BIO_ADDRINFO> starting
70 with the given one.
71
72 =head1 RETURN VALUES
73
74 BIO_lookup() returns 1 on success and 0 when an error occurred, and
75 will leave an error indicaton on the OpenSSL error stack in that case.
76
77 All other functions described here return 0 or B<NULL> when the
78 information they should return isn't available.
79
80 =head1 SEE ALSO
81
82 L<BIO_lookup(3)>