blob: a14019e1ffab607dd6385136f84f685abe7846d5 [file] [log] [blame]
Max5d42b8e2019-02-07 17:28:01 +01001#pragma once
2
3#include <stdint.h>
4#include <stdbool.h>
5
6enum match_kind {
7 MATCH_NAME,
8 MATCH_HOST,
9 MATCH_BOTH,
10 MATCH_EITHER,
11};
12
13/* a client config */
14struct host_cfg {
15 /* name of this client */
16 const char *name;
17 /* remote host/IP */
Max6cbdcaf2019-02-21 10:06:19 +010018 char *remote_host;
Max5d42b8e2019-02-07 17:28:01 +010019 /* remote port */
20 uint16_t remote_port;
21};
22
23struct host_cfg *host_cfg_alloc(void *ctx, const char *name, const char *host, uint16_t port);
24bool match_config(const struct host_cfg *cfg, const char *match, enum match_kind k);
25char *make_authority(void *ctx, const struct host_cfg *cfg);
Max9a852f22019-01-31 15:58:57 +010026
27struct osmo_stream_cli *make_tcp_client(struct host_cfg *cfg);
28
29void update_name(struct host_cfg *cfg, const char *new_name);
30void update_host(struct host_cfg *cfg, const char *new_host);