BIO_ADDRINFO.pod 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. =pod
  2. =head1 NAME
  3. BIO_lookup_type,
  4. BIO_ADDRINFO, BIO_ADDRINFO_next, BIO_ADDRINFO_free,
  5. BIO_ADDRINFO_family, BIO_ADDRINFO_socktype, BIO_ADDRINFO_protocol,
  6. BIO_ADDRINFO_address,
  7. BIO_lookup
  8. - BIO_ADDRINFO type and routines
  9. =head1 SYNOPSIS
  10. #include <sys/types.h>
  11. #include <openssl/bio.h>
  12. typedef union bio_addrinfo_st BIO_ADDRINFO;
  13. enum BIO_lookup_type {
  14. BIO_LOOKUP_CLIENT, BIO_LOOKUP_SERVER
  15. };
  16. int BIO_lookup(const char *node, const char *service,
  17. enum BIO_lookup_type lookup_type,
  18. int family, int socktype, BIO_ADDRINFO **res);
  19. const BIO_ADDRINFO *BIO_ADDRINFO_next(const BIO_ADDRINFO *bai);
  20. int BIO_ADDRINFO_family(const BIO_ADDRINFO *bai);
  21. int BIO_ADDRINFO_socktype(const BIO_ADDRINFO *bai);
  22. int BIO_ADDRINFO_protocol(const BIO_ADDRINFO *bai);
  23. const BIO_ADDR *BIO_ADDRINFO_address(const BIO_ADDRINFO *bai);
  24. void BIO_ADDRINFO_free(BIO_ADDRINFO *bai);
  25. =head1 DESCRIPTION
  26. The B<BIO_ADDRINFO> type is a wrapper for address information
  27. types provided on your platform.
  28. B<BIO_ADDRINFO> normally forms a chain of several that can be
  29. picked at one by one.
  30. BIO_lookup() looks up a specified B<host> and B<service>, and
  31. uses B<lookup_type> to determine what the default address should
  32. be if B<host> is B<NULL>. B<family>, B<socktype> are used to
  33. determine what protocol family and protocol should be used for
  34. the lookup. B<family> can be any of AF_INET, AF_INET6, AF_UNIX and
  35. AF_UNSPEC, and B<socktype> can be SOCK_STREAM or SOCK_DGRAM.
  36. B<res> points at a pointer to hold the start of a B<BIO_ADDRINFO>
  37. chain.
  38. For the family B<AF_UNIX>, BIO_lookup() will ignore the B<service>
  39. parameter and expects the B<node> parameter to hold the path to the
  40. socket file.
  41. BIO_ADDRINFO_family() returns the family of the given
  42. B<BIO_ADDRINFO>. The result will be one of the constants
  43. AF_INET, AF_INET6 and AF_UNIX.
  44. BIO_ADDRINFO_socktype() returns the socket type of the given
  45. B<BIO_ADDRINFO>. The result will be one of the constants
  46. SOCK_STREAM and SOCK_DGRAM.
  47. BIO_ADDRINFO_protocol() returns the protocol id of the given
  48. B<BIO_ADDRINFO>. The result will be one of the constants
  49. IPPROTO_TCP and IPPROTO_UDP.
  50. BIO_ADDRINFO_address() returns the underlying B<BIO_ADDR>
  51. of the given B<BIO_ADDRINFO>.
  52. BIO_ADDRINFO_next() returns the next B<BIO_ADDRINFO> in the chain
  53. from the given one.
  54. BIO_ADDRINFO_free() frees the chain of B<BIO_ADDRINFO> starting
  55. with the given one.
  56. =head1 RETURN VALUES
  57. BIO_lookup() returns 1 on success and 0 when an error occurred, and
  58. will leave an error indication on the OpenSSL error stack in that case.
  59. All other functions described here return 0 or B<NULL> when the
  60. information they should return isn't available.
  61. =head1 COPYRIGHT
  62. Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
  63. Licensed under the OpenSSL license (the "License"). You may not use
  64. this file except in compliance with the License. You can obtain a copy
  65. in the file LICENSE in the source distribution or at
  66. L<https://www.openssl.org/source/license.html>.
  67. =cut