summaryrefslogtreecommitdiffstats
path: root/src/method_null.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2012-03-08 20:55:58 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2012-03-08 20:55:58 +0100
commitc111e07c4ac6e276c9399b56ca8fe342d78c96cc (patch)
treea9747eae9545e7c57191c3c201ebcb90b2dfd674 /src/method_null.c
parente9ff4485fbe4a445968ed762f688c36516834826 (diff)
downloadfastd-c111e07c4ac6e276c9399b56ca8fe342d78c96cc.tar
fastd-c111e07c4ac6e276c9399b56ca8fe342d78c96cc.zip
Moved some code
Diffstat (limited to 'src/method_null.c')
-rw-r--r--src/method_null.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/method_null.c b/src/method_null.c
index 62be501..eb9ff64 100644
--- a/src/method_null.c
+++ b/src/method_null.c
@@ -24,6 +24,7 @@
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+
#define _GNU_SOURCE
#include "fastd.h"
@@ -34,7 +35,7 @@
-static bool null_check_config(fastd_context *ctx, const fastd_config *conf) {
+static bool method_check_config(fastd_context *ctx, const fastd_config *conf) {
if (conf->n_floating > 1) {
pr_error(ctx, "with method `null' use can't define more than one floating peer");
return false;
@@ -43,11 +44,11 @@ static bool null_check_config(fastd_context *ctx, const fastd_config *conf) {
return true;
}
-static size_t null_max_packet_size(fastd_context *ctx) {
+static size_t method_max_packet_size(fastd_context *ctx) {
return fastd_max_packet_size(ctx);
}
-static char* null_peer_str(const fastd_context *ctx, const fastd_peer *peer) {
+static char* method_peer_str(const fastd_context *ctx, const fastd_peer *peer) {
char addr_buf[INET6_ADDRSTRLEN] = "";
char *ret;
@@ -80,11 +81,11 @@ static char* null_peer_str(const fastd_context *ctx, const fastd_peer *peer) {
return NULL;
}
-static void null_init(fastd_context *ctx, fastd_peer *peer) {
+static void method_init(fastd_context *ctx, fastd_peer *peer) {
fastd_task_put_send(ctx, peer, fastd_buffer_alloc(0, 0, 0));
}
-static void null_handle_recv(fastd_context *ctx, fastd_peer *peer, fastd_buffer buffer) {
+static void method_handle_recv(fastd_context *ctx, fastd_peer *peer, fastd_buffer buffer) {
if (!fastd_peer_is_established(peer)) {
fastd_peer_set_established(ctx, peer);
}
@@ -110,7 +111,7 @@ static void null_handle_recv(fastd_context *ctx, fastd_peer *peer, fastd_buffer
fastd_buffer_free(buffer);
}
-static void null_send(fastd_context *ctx, fastd_peer *peer, fastd_buffer buffer) {
+static void method_send(fastd_context *ctx, fastd_peer *peer, fastd_buffer buffer) {
fastd_task_put_send(ctx, peer, buffer);
}
@@ -118,13 +119,13 @@ static void null_send(fastd_context *ctx, fastd_peer *peer, fastd_buffer buffer)
const fastd_method fastd_method_null = {
.name = "null",
- .check_config = null_check_config,
+ .check_config = method_check_config,
- .max_packet_size = null_max_packet_size,
+ .max_packet_size = method_max_packet_size,
- .peer_str = null_peer_str,
+ .peer_str = method_peer_str,
- .init = null_init,
- .handle_recv = null_handle_recv,
- .send = null_send,
+ .init = method_init,
+ .handle_recv = method_handle_recv,
+ .send = method_send,
};