FreeCalypso > hg > osmo-playpen
diff ctrl-client/client.h @ 21:80849380395d
osmo-ctrl-client compiles
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 17 Dec 2023 08:53:02 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ctrl-client/client.h Sun Dec 17 08:53:02 2023 +0000 @@ -0,0 +1,30 @@ +#pragma once + +#include <stdint.h> +#include <stdbool.h> + +enum match_kind { + MATCH_NAME, + MATCH_HOST, + MATCH_BOTH, + MATCH_EITHER, +}; + +/* a client config */ +struct host_cfg { + /* name of this client */ + const char *name; + /* remote host/IP */ + char *remote_host; + /* remote port */ + uint16_t remote_port; +}; + +struct host_cfg *host_cfg_alloc(void *ctx, const char *name, const char *host, uint16_t port); +bool match_config(const struct host_cfg *cfg, const char *match, enum match_kind k); +char *make_authority(void *ctx, const struct host_cfg *cfg); + +struct osmo_stream_cli *make_tcp_client(struct host_cfg *cfg); + +void update_name(struct host_cfg *cfg, const char *new_name); +void update_host(struct host_cfg *cfg, const char *new_host);