xref: /freebsd/secure/lib/libcrypto/man/man3/BIO_ADDR.3 (revision d4eeb02986980bf33dd56c41ceb9fc5f180c0d47)
Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40)

Standard preamble:
========================================================================
..
..
.. Set up some character translations and predefined strings. \*(-- will
give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
double quote, and \*(R" will give a right double quote. \*(C+ will
give a nicer C++. Capital omega is used to do unbreakable dashes and
therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
nothing in troff, for use with C<>.
.tr \(*W- . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\}
Escape single quotes in literal strings from groff's Unicode transform.

If the F register is >0, we'll generate index entries on stderr for
titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
entries marked with X<> in POD. Of course, you'll have to process the
output yourself in some meaningful fashion.

Avoid warning from groff about undefined register 'F'.
.. .nr rF 0 . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF
Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] .\} . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents . \" corrections for vroff . \" for low resolution devices (crt and lpr) \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} ========================================================================

Title "BIO_ADDR 3"
BIO_ADDR 3 "2022-07-05" "1.1.1q" "OpenSSL"
For nroff, turn off justification. Always turn off hyphenation; it makes
way too many mistakes in technical documents.
"NAME"
BIO_ADDR, BIO_ADDR_new, BIO_ADDR_clear, BIO_ADDR_free, BIO_ADDR_rawmake, BIO_ADDR_family, BIO_ADDR_rawaddress, BIO_ADDR_rawport, BIO_ADDR_hostname_string, BIO_ADDR_service_string, BIO_ADDR_path_string - BIO_ADDR routines
"SYNOPSIS"
Header "SYNOPSIS" .Vb 2 #include <sys/types.h> #include <openssl/bio.h> \& typedef union bio_addr_st BIO_ADDR; \& BIO_ADDR *BIO_ADDR_new(void); void BIO_ADDR_free(BIO_ADDR *); void BIO_ADDR_clear(BIO_ADDR *ap); int BIO_ADDR_rawmake(BIO_ADDR *ap, int family, const void *where, size_t wherelen, unsigned short port); int BIO_ADDR_family(const BIO_ADDR *ap); int BIO_ADDR_rawaddress(const BIO_ADDR *ap, void *p, size_t *l); unsigned short BIO_ADDR_rawport(const BIO_ADDR *ap); char *BIO_ADDR_hostname_string(const BIO_ADDR *ap, int numeric); char *BIO_ADDR_service_string(const BIO_ADDR *ap, int numeric); char *BIO_ADDR_path_string(const BIO_ADDR *ap); .Ve
"DESCRIPTION"
Header "DESCRIPTION" The \s-1BIO_ADDR\s0 type is a wrapper around all types of socket addresses that OpenSSL deals with, currently transparently supporting \s-1AF_INET, AF_INET6\s0 and \s-1AF_UNIX\s0 according to what's available on the platform at hand.

\fBBIO_ADDR_new() creates a new unfilled \s-1BIO_ADDR\s0, to be used with routines that will fill it with information, such as \fBBIO_accept_ex().

\fBBIO_ADDR_free() frees a \s-1BIO_ADDR\s0 created with BIO_ADDR_new().

\fBBIO_ADDR_clear() clears any data held within the provided \s-1BIO_ADDR\s0 and sets it back to an uninitialised state.

\fBBIO_ADDR_rawmake() takes a protocol family, a byte array of size wherelen with an address in network byte order pointed at by where and a port number in network byte order in port (except for the \s-1AF_UNIX\s0 protocol family, where port is meaningless and therefore ignored) and populates the given \s-1BIO_ADDR\s0 with them. In case this creates a \s-1AF_UNIX\s0 \s-1BIO_ADDR\s0, wherelen is expected to be the length of the path string (not including the terminating \s-1NUL,\s0 such as the result of a call to strlen()). \fIRead on about the addresses in \*(L"\s-1RAW ADDRESSES\*(R"\s0 below.

\fBBIO_ADDR_family() returns the protocol family of the given \fB\s-1BIO_ADDR\s0. The possible non-error results are one of the constants \s-1AF_INET, AF_INET6\s0 and \s-1AF_UNIX.\s0 It will also return \s-1AF_UNSPEC\s0 if the \s-1BIO_ADDR\s0 has not been initialised.

\fBBIO_ADDR_rawaddress() will write the raw address of the given \fB\s-1BIO_ADDR\s0 in the area pointed at by p if p is non-NULL, and will set *l to be the amount of bytes the raw address takes up if l is non-NULL. A technique to only find out the size of the address is a call with p set to \s-1NULL\s0. The raw address will be in network byte order, most significant byte first. In case this is a \s-1AF_UNIX\s0 \s-1BIO_ADDR\s0, l gets the length of the path string (not including the terminating \s-1NUL,\s0 such as the result of a call to strlen()). \fIRead on about the addresses in \*(L"\s-1RAW ADDRESSES\*(R"\s0 below.

\fBBIO_ADDR_rawport() returns the raw port of the given \s-1BIO_ADDR\s0. The raw port will be in network byte order.

\fBBIO_ADDR_hostname_string() returns a character string with the hostname of the given \s-1BIO_ADDR\s0. If numeric is 1, the string will contain the numerical form of the address. This only works for \fB\s-1BIO_ADDR\s0 of the protocol families \s-1AF_INET\s0 and \s-1AF_INET6.\s0 The returned string has been allocated on the heap and must be freed with OPENSSL_free().

\fBBIO_ADDR_service_string() returns a character string with the service name of the port of the given \s-1BIO_ADDR\s0. If numeric is 1, the string will contain the port number. This only works for \s-1BIO_ADDR\s0 of the protocol families \s-1AF_INET\s0 and \s-1AF_INET6.\s0 The returned string has been allocated on the heap and must be freed with OPENSSL_free().

\fBBIO_ADDR_path_string() returns a character string with the path of the given \s-1BIO_ADDR\s0. This only works for \s-1BIO_ADDR\s0 of the protocol family \s-1AF_UNIX.\s0 The returned string has been allocated on the heap and must be freed with OPENSSL_free().

"RAW ADDRESSES"
Header "RAW ADDRESSES" Both BIO_ADDR_rawmake() and BIO_ADDR_rawaddress() take a pointer to a network byte order address of a specific site. Internally, those are treated as a pointer to struct in_addr (for \s-1AF_INET\s0), struct in6_addr (for \s-1AF_INET6\s0) or char * (for \s-1AF_UNIX\s0), all depending on the protocol family the address is for.
"RETURN VALUES"
Header "RETURN VALUES" The string producing functions BIO_ADDR_hostname_string(), \fBBIO_ADDR_service_string() and BIO_ADDR_path_string() will return \s-1NULL\s0 on error and leave an error indication on the OpenSSL error stack.

All other functions described here return 0 or \s-1NULL\s0 when the information they should return isn't available.

"SEE ALSO"
Header "SEE ALSO" \fBBIO_connect\|(3), BIO_s_connect\|(3)
"COPYRIGHT"
Header "COPYRIGHT" Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the OpenSSL license (the \*(L"License\*(R"). You may not use this file except in compliance with the License. You can obtain a copy in the file \s-1LICENSE\s0 in the source distribution or at <https://www.openssl.org/source/license.html>.