2016-02-29 17:12:06 -08:00
|
|
|
#pragma once
|
|
|
|
|
|
2016-02-29 20:49:36 -08:00
|
|
|
#include <stdbool.h>
|
2016-02-29 17:12:06 -08:00
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
|
|
struct buf;
|
|
|
|
|
struct peer;
|
|
|
|
|
|
|
|
|
|
typedef void (*flow_bound_socket_init)(int);
|
|
|
|
|
typedef void (*flow_new)(int, void *, struct peer *);
|
|
|
|
|
typedef void (*flow_get_hello)(struct buf **, void *);
|
|
|
|
|
struct flow {
|
|
|
|
|
const char *name;
|
|
|
|
|
flow_bound_socket_init bound_socket_init;
|
|
|
|
|
flow_new new;
|
|
|
|
|
flow_get_hello get_hello;
|
|
|
|
|
uint32_t *ref_count;
|
|
|
|
|
};
|
2016-02-29 20:49:36 -08:00
|
|
|
|
|
|
|
|
bool flow_hello(int, struct flow *, void *);
|