diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-03-26 03:06:03 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-03-26 03:06:03 +0200 |
commit | a02fb0711ba496877c111b118b78d404151a8b8d (patch) | |
tree | 7537bd38a88e0f46751f93871bb44f66829d23af /src/fastd.h | |
parent | 44742f8aadb7a8a969f11d9b1d50c8be2573a576 (diff) | |
download | fastd-a02fb0711ba496877c111b118b78d404151a8b8d.tar fastd-a02fb0711ba496877c111b118b78d404151a8b8d.zip |
Initial implementation of the FHMQV-C handshake
Diffstat (limited to 'src/fastd.h')
-rw-r--r-- | src/fastd.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/fastd.h b/src/fastd.h index 8aed925..8bd04ec 100644 --- a/src/fastd.h +++ b/src/fastd.h @@ -59,9 +59,6 @@ struct _fastd_eth_addr { struct _fastd_protocol { const char *name; - bool (*handle_config)(fastd_context *ctx, const fastd_config *conf, const char *option); - bool (*check_config)(fastd_context *ctx, const fastd_config *conf); - void (*init)(fastd_context *ctx); size_t (*max_packet_size)(fastd_context *ctx); @@ -73,7 +70,7 @@ struct _fastd_protocol { void (*handle_recv)(fastd_context *ctx, fastd_peer *peer, fastd_buffer buffer); void (*send)(fastd_context *ctx, fastd_peer *peer, fastd_buffer buffer); - void (*free_peer_private)(fastd_context *ctx, fastd_peer *peer); + void (*free_peer_state)(fastd_context *ctx, fastd_peer *peer); }; struct _fastd_config { @@ -117,7 +114,7 @@ struct _fastd_context { size_t n_eth_addr; fastd_peer_eth_addr *eth_addr; - void *protocol_context; + fastd_protocol_context *protocol_context; }; @@ -126,6 +123,8 @@ void fastd_printf(const fastd_context *ctx, const char *format, ...); void fastd_read_config(fastd_context *ctx, fastd_config *conf, const char *filename, int depth); void fastd_configure(fastd_context *ctx, fastd_config *conf, int argc, char *const argv[]); +void fastd_random_bytes(fastd_context *ctx, void *buffer, size_t len, bool secure); + #define pr_log(ctx, level, prefix, args...) if ((ctx)->conf == NULL || (level) <= (ctx)->conf->loglevel) \ do { fputs(prefix, stderr); fastd_printf(ctx, args); fputs("\n", stderr); } while(0) |