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

Name

Description

hostserv

Combined host and/or service string (IPv6 hosts must be bracketed).

host

Receives a malloc'd hostname string, or is left unchanged / set to NULL per the parse rules; free with OPENSSL_free().

service

Receives a malloc'd service/port string, or is left unchanged / set to NULL per the parse rules; free with OPENSSL_free().

hostserv_prio

BIO_PARSE_PRIO_HOST or BIO_PARSE_PRIO_SERV when hostserv has no colon.

Created with MrDocs