blob: 605ddd7e034e1b6e76eb6b2aec1a8c72069e9b1d [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 */
18 const char *remote_host;
19 /* 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);