[#BIO_lookup]
= BIO&lowbar;lookup
:mrdocs:

Resolve `host` &sol; `service` into a BIO&lowbar;ADDRINFO list&period;

== Synopsis

Declared in `&lt;openssl&sol;bio&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
BIO&lowbar;lookup(
    char const* host,
    char const* service,
    xref:BIO_lookup_type.adoc[BIO&lowbar;lookup&lowbar;type] lookup&lowbar;type,
    int family,
    int socktype,
    xref:BIO_ADDRINFO.adoc[BIO&lowbar;ADDRINFO]** res);
----

== Description

Prefer BIO&lowbar;lookup&lowbar;ex() when a specific protocol number is required&period;

== Return Value

1 on success, or 0 on failure&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *host*
| Hostname or address string to look up, or NULL for wildcard&period;
| *service*
| Service name or port string, or NULL&period;
| *lookup&lowbar;type*
| BIO&lowbar;LOOKUP&lowbar;CLIENT or BIO&lowbar;LOOKUP&lowbar;SERVER&period;
| *family*
| Address family (for example AF&lowbar;INET, AF&lowbar;INET6, or AF&lowbar;UNSPEC)&period;
| *socktype*
| Socket type (for example SOCK&lowbar;STREAM or SOCK&lowbar;DGRAM)&period;
| *res*
| Receives the head of the allocated BIO&lowbar;ADDRINFO list&semi; free with BIO&lowbar;ADDRINFO&lowbar;free()&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
