diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-03-24 22:32:24 +0100 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-03-24 22:32:24 +0100 |
commit | 359e9b6c2b0cc4817b55338f0b89638945d98c50 (patch) | |
tree | 731b1b59a96f9ff84a6a5b531964418bee634815 /src/fastd.c | |
parent | 4ffc28ecd6d914f9c1e5aaf5d5921ee4827bb289 (diff) | |
download | fastd-359e9b6c2b0cc4817b55338f0b89638945d98c50.tar fastd-359e9b6c2b0cc4817b55338f0b89638945d98c50.zip |
Rename methods to protocols; fix some command line parse bugs; implement most of the config file parser
Diffstat (limited to 'src/fastd.c')
-rw-r--r-- | src/fastd.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/fastd.c b/src/fastd.c index 3b27e98..479ac95 100644 --- a/src/fastd.c +++ b/src/fastd.c @@ -219,7 +219,7 @@ static void handle_tun(fastd_context *ctx) { } if (peer->state == STATE_ESTABLISHED) { - ctx->conf->method->send(ctx, peer, buffer); + ctx->conf->protocol->send(ctx, peer, buffer); } else { fastd_buffer_free(buffer); @@ -231,7 +231,7 @@ static void handle_tun(fastd_context *ctx) { if (peer->state == STATE_ESTABLISHED) { fastd_buffer send_buffer = fastd_buffer_alloc(len, 0, 0); memcpy(send_buffer.data, buffer.data, len); - ctx->conf->method->send(ctx, peer, send_buffer); + ctx->conf->protocol->send(ctx, peer, send_buffer); } } @@ -240,7 +240,7 @@ static void handle_tun(fastd_context *ctx) { } static void handle_socket(fastd_context *ctx, int sockfd) { - size_t max_len = ctx->conf->method->max_packet_size(ctx); + size_t max_len = ctx->conf->protocol->max_packet_size(ctx); fastd_buffer buffer = fastd_buffer_alloc(max_len, 0, 0); uint8_t packet_type; @@ -295,7 +295,7 @@ static void handle_socket(fastd_context *ctx, int sockfd) { switch (packet_type) { case PACKET_DATA: peer->seen = ctx->now; - ctx->conf->method->handle_recv(ctx, peer, buffer); + ctx->conf->protocol->handle_recv(ctx, peer, buffer); break; case PACKET_HANDSHAKE: |