From 77b9decbcd277613d359b75ceb2520787ffdc038 Mon Sep 17 00:00:00 2001 From: Ian Gulliver Date: Wed, 2 Mar 2016 22:30:45 -0800 Subject: [PATCH] Make send_get_hello public, so we can use it in send_receive --- adsbus/send.c | 15 +++++++-------- adsbus/send.h | 5 ++--- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/adsbus/send.c b/adsbus/send.c index d7bc01e..2dc6ce4 100644 --- a/adsbus/send.c +++ b/adsbus/send.c @@ -34,7 +34,6 @@ struct send { }; static void send_new(int, void *, struct peer *); -static void send_get_hello(struct buf **, void *); static struct flow _send_flow = { .name = "send", @@ -121,13 +120,6 @@ static void send_new(int fd, void *passthrough, struct peer *on_close) { fprintf(stderr, "S %s (%s): New send connection\n", send->id, serializer->name); } -static void send_get_hello(struct buf **buf_pp, void *passthrough) { - struct serializer *serializer = (struct serializer *) passthrough; - if (serializer->hello) { - serializer->hello(buf_pp); - } -} - void send_init() { assert(signal(SIGPIPE, SIG_IGN) != SIG_ERR); for (size_t i = 0; i < NUM_SERIALIZERS; i++) { @@ -153,6 +145,13 @@ void *send_get_serializer(char *name) { return NULL; } +void send_get_hello(struct buf **buf_pp, void *passthrough) { + struct serializer *serializer = (struct serializer *) passthrough; + if (serializer->hello) { + serializer->hello(buf_pp); + } +} + void send_write(struct packet *packet) { packet_sanity_check(packet); for (size_t i = 0; i < NUM_SERIALIZERS; i++) { diff --git a/adsbus/send.h b/adsbus/send.h index eab1c4e..a3c380f 100644 --- a/adsbus/send.h +++ b/adsbus/send.h @@ -1,14 +1,13 @@ #pragma once -#include - +struct buf; struct flow; struct packet; -struct peer; void send_init(void); void send_cleanup(void); void *send_get_serializer(char *); +void send_get_hello(struct buf **, void *); void send_write(struct packet *); void send_print_usage(void); extern struct flow *send_flow;