diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-11-05 18:26:55 +0100 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-11-05 18:26:55 +0100 |
commit | f631c10660c7c0bcdbf793bb1588670fb9ea82e6 (patch) | |
tree | 280d32d74c48bfde96cc3510df51e50a5609fa31 /src/fastd.h | |
parent | 0c2f5da1650a295c29001e50384ec2f605055aed (diff) | |
download | fastd-f631c10660c7c0bcdbf793bb1588670fb9ea82e6.tar fastd-f631c10660c7c0bcdbf793bb1588670fb9ea82e6.zip |
Implement peer groups
Diffstat (limited to 'src/fastd.h')
-rw-r--r-- | src/fastd.h | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/fastd.h b/src/fastd.h index 9779de8..38af9cc 100644 --- a/src/fastd.h +++ b/src/fastd.h @@ -144,6 +144,28 @@ struct _fastd_socket { fastd_peer *peer; }; +struct _fastd_peer_group_config { + fastd_peer_group_config *next; + fastd_peer_group_config *parent; + fastd_peer_group_config *children; + + char *name; + fastd_string_stack *peer_dirs; + + /* contraints */ + unsigned max_connections; +}; + +struct _fastd_peer_group { + fastd_peer_group *next; + fastd_peer_group *parent; + fastd_peer_group *children; + + const fastd_peer_group_config *conf; + + unsigned n_connections; +}; + struct _fastd_config { int log_stderr_level; int log_syslog_level; @@ -187,7 +209,7 @@ struct _fastd_config { const fastd_crypto_ghash *crypto_ghash; #endif - fastd_string_stack *peer_dirs; + fastd_peer_group_config *peer_group; fastd_peer_config *peers; unsigned n_floating; @@ -229,6 +251,7 @@ struct _fastd_context { struct timespec now; unsigned n_peers; + fastd_peer_group *peer_group; fastd_peer *peers; fastd_queue task_queue; @@ -284,6 +307,8 @@ bool fastd_config_method(fastd_context *ctx, fastd_config *conf, const char *nam bool fastd_config_crypto(fastd_context *ctx, fastd_config *conf, const char *alg, const char *impl); bool fastd_config_add_log_file(fastd_context *ctx, fastd_config *conf, const char *name, int level); void fastd_config_bind_address(fastd_context *ctx, fastd_config *conf, const fastd_peer_address *address, const char *bindtodev, bool default_v4, bool default_v6); +void fastd_config_peer_group_push(fastd_context *ctx, fastd_config *conf, const char *name); +void fastd_config_peer_group_pop(fastd_context *ctx, fastd_config *conf); void fastd_configure(fastd_context *ctx, fastd_config *conf, int argc, char *const argv[]); void fastd_reconfigure(fastd_context *ctx, fastd_config *conf); void fastd_config_release(fastd_context *ctx, fastd_config *conf); |