summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2013-10-29 20:47:17 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2013-10-29 20:47:17 +0100
commit020bb327dd9445fd82dbf8d2e59a3d5bda408bb3 (patch)
tree53c658aeb80cbaabf6b1cb41b7aaf9e432744c5e
parent8df7ea375df1ca8868763e30e90120e13af2b808 (diff)
downloadfastd-020bb327dd9445fd82dbf8d2e59a3d5bda408bb3.tar
fastd-020bb327dd9445fd82dbf8d2e59a3d5bda408bb3.zip
Rename fastd_parse_method_name to fastd_method_get_by_name
-rw-r--r--src/config.c6
-rw-r--r--src/fastd.h2
-rw-r--r--src/methods/methods.c.in2
-rw-r--r--src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c2
4 files changed, 5 insertions, 7 deletions
diff --git a/src/config.c b/src/config.c
index 1d9df10..407ef97 100644
--- a/src/config.c
+++ b/src/config.c
@@ -124,9 +124,7 @@ bool fastd_config_protocol(fastd_context_t *ctx UNUSED, fastd_config_t *conf, co
}
bool fastd_config_method(fastd_context_t *ctx, fastd_config_t *conf, const char *name) {
- const fastd_method_t *parsed_method = fastd_parse_method_name(name);
-
- if (!parsed_method)
+ if (!fastd_method_get_by_name(name))
return false;
fastd_string_stack_t **method;
@@ -564,7 +562,7 @@ static void configure_method_parameters(fastd_context_t *ctx, fastd_config_t *co
fastd_string_stack_t *method_name;
for (method_name = conf->methods; method_name; method_name = method_name->next) {
- const fastd_method_t *method = fastd_parse_method_name(method_name->str);
+ const fastd_method_t *method = fastd_method_get_by_name(method_name->str);
conf->max_packet_size = max_size_t(conf->max_packet_size, method->max_packet_size(ctx));
conf->min_encrypt_head_space = max_size_t(conf->min_encrypt_head_space, method->min_encrypt_head_space(ctx));
diff --git a/src/fastd.h b/src/fastd.h
index fd55a0b..f3d67ca 100644
--- a/src/fastd.h
+++ b/src/fastd.h
@@ -348,7 +348,7 @@ void fastd_logf(const fastd_context_t *ctx, fastd_loglevel_t level, const char *
void fastd_add_peer_dir(fastd_context_t *ctx, fastd_config_t *conf, const char *dir);
bool fastd_read_config(fastd_context_t *ctx, fastd_config_t *conf, const char *filename, bool peer_config, int depth);
-const fastd_method_t* fastd_parse_method_name(const char *name);
+const fastd_method_t* fastd_method_get_by_name(const char *name);
bool fastd_config_protocol(fastd_context_t *ctx, fastd_config_t *conf, const char *name);
bool fastd_config_method(fastd_context_t *ctx, fastd_config_t *conf, const char *name);
diff --git a/src/methods/methods.c.in b/src/methods/methods.c.in
index f402b51..61d1251 100644
--- a/src/methods/methods.c.in
+++ b/src/methods/methods.c.in
@@ -33,7 +33,7 @@ static const fastd_method_t *const methods[] = { @METHOD_LIST@
};
-const fastd_method_t* fastd_parse_method_name(const char *name) {
+const fastd_method_t* fastd_method_get_by_name(const char *name) {
int i;
for (i = 0; methods[i]; i++) {
if (!strcmp(methods[i]->name, name))
diff --git a/src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c b/src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c
index ab66f93..15e85d6 100644
--- a/src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c
+++ b/src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c
@@ -408,7 +408,7 @@ static bool establish(fastd_context_t *ctx, fastd_peer_t *peer, const char *meth
return false;
}
- const fastd_method_t *method = fastd_parse_method_name(method_name);
+ const fastd_method_t *method = fastd_method_get_by_name(method_name);
if (is_session_valid(ctx, &peer->protocol_state->session) && !is_session_valid(ctx, &peer->protocol_state->old_session)) {
if (peer->protocol_state->old_session.method)