From 359e9b6c2b0cc4817b55338f0b89638945d98c50 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 24 Mar 2012 22:32:24 +0100 Subject: Rename methods to protocols; fix some command line parse bugs; implement most of the config file parser --- src/fastd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/fastd.c') 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: -- cgit v1.2.3