| 1 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | |
| 3 | #ifndef NETDATA_CONNECT_TO_H |
| 4 | #define NETDATA_CONNECT_TO_H |
| 5 | |
| 6 | void foreach_entry_in_connection_string(const char *destination, bool (*callback)(char *entry, void *data), void *data); |
| 7 | int connect_to_this_ip46( |
| 8 | int protocol, |
| 9 | int socktype, |
| 10 | const char *host, |
| 11 | uint32_t scope_id, |
| 12 | const char *service, |
| 13 | struct timeval *timeout, |
| 14 | bool *fallback_ipv4); |
| 15 | // Fills `service` with the effective service from `definition`, or `default_port` when none is specified. |
| 16 | // Returns false only when arguments are invalid or a non-empty definition is malformed (no host). |
| 17 | // For NULL/empty definition, it keeps `service` set to `default_port` and returns true. |
| 18 | bool connect_to_definition_get_service(const char *definition, int default_port, char *service, size_t service_size); |
| 19 | int connect_to_this(const char *definition, int default_port, struct timeval *timeout); |
| 20 | int connect_to_one_of(const char *destination, int default_port, struct timeval *timeout, size_t *reconnects_counter, char *connected_to, size_t connected_to_size); |
| 21 | int connect_to_one_of_urls(const char *destination, int default_port, struct timeval *timeout, size_t *reconnects_counter, char *connected_to, size_t connected_to_size); |
| 22 | |
| 23 | #endif //NETDATA_CONNECT_TO_H |