BIO_parse_hostserv

Split a host:service string into separately allocated host and service names.

Synopsis

Declared in <openssl/bio.h>

int
BIO_parse_hostserv(
    char const* hostserv,
    char** host,
    char** service,
    BIO_hostserv_priorities hostserv_prio);

Return Value

1 on success, or 0 on error.

Parameters

NameDescription
hostservCombined host and/or service string (IPv6 hosts must be bracketed).
hostReceives a malloc'd hostname string, or is left unchanged / set to NULL per the parse rules; free with OPENSSL_free().
serviceReceives a malloc'd service/port string, or is left unchanged / set to NULL per the parse rules; free with OPENSSL_free().
hostserv_prioBIO_PARSE_PRIO_HOST or BIO_PARSE_PRIO_SERV when hostserv has no colon.