Encapsulate flow descriptions inside a struct.

This commit is contained in:
Ian Gulliver
2016-02-29 17:12:06 -08:00
parent 3539f9d640
commit 3fb3c02cf5
12 changed files with 83 additions and 68 deletions

View File

@@ -12,6 +12,7 @@
#include "airspy_adsb.h"
#include "beast.h"
#include "buf.h"
#include "flow.h"
#include "json.h"
#include "list.h"
#include "packet.h"
@@ -32,6 +33,14 @@ struct send {
struct list_head send_list;
};
static struct flow _send_flow = {
.name = "send",
.new = send_new_wrapper,
.get_hello = send_hello,
.ref_count = &peer_count_out,
};
struct flow *send_flow = &_send_flow;
typedef void (*serialize)(struct packet *, struct buf *);
typedef void (*hello)(struct buf **);
static struct serializer {