2023-03-06 14:42:04 +01:00
|
|
|
// SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
// Copyright CM4all GmbH
|
|
|
|
// author: Max Kellermann <mk@cm4all.com>
|
2011-09-20 07:56:59 +02:00
|
|
|
|
2024-02-26 13:01:12 +01:00
|
|
|
#pragma once
|
2012-08-02 18:15:49 +02:00
|
|
|
|
2018-08-21 08:26:12 +02:00
|
|
|
class AddressInfoList;
|
2011-09-20 07:56:59 +02:00
|
|
|
|
2021-01-12 14:47:33 +01:00
|
|
|
/**
|
|
|
|
* Thin wrapper for getaddrinfo() which throws on error and returns a
|
|
|
|
* RAII object.
|
|
|
|
*/
|
|
|
|
AddressInfoList
|
|
|
|
Resolve(const char *node, const char *service,
|
|
|
|
const struct addrinfo *hints);
|
|
|
|
|
2011-09-20 20:51:46 +02:00
|
|
|
/**
|
2018-08-21 08:26:12 +02:00
|
|
|
* Resolve the given host name (which may include a port), and fall
|
|
|
|
* back to the given default port.
|
2011-09-20 20:51:46 +02:00
|
|
|
*
|
2018-08-21 08:26:12 +02:00
|
|
|
* This is a wrapper for getaddrinfo() and it does not support local
|
|
|
|
* sockets.
|
2016-10-28 10:36:05 +02:00
|
|
|
*
|
2018-08-21 08:26:12 +02:00
|
|
|
* Throws on error.
|
2011-09-20 20:51:46 +02:00
|
|
|
*/
|
2018-08-21 08:26:12 +02:00
|
|
|
AddressInfoList
|
|
|
|
Resolve(const char *host_and_port, int default_port,
|
|
|
|
const struct addrinfo *hints);
|
|
|
|
|
|
|
|
AddressInfoList
|
|
|
|
Resolve(const char *host_port, unsigned default_port, int flags, int socktype);
|