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;
|
|
|
|
|
|
|
|
|
|
struct flow {
|
|
|
|
|
const char *name;
|
2016-03-02 19:28:02 -08:00
|
|
|
void (*socket_ready)(int);
|
2016-03-02 21:51:30 -08:00
|
|
|
void (*socket_connected)(int);
|
2016-02-29 22:17:37 -08:00
|
|
|
void (*new)(int, void *, struct peer *);
|
|
|
|
|
void (*get_hello)(struct buf **, void *);
|
2016-02-29 17:12:06 -08:00
|
|
|
uint32_t *ref_count;
|
|
|
|
|
};
|
2016-02-29 20:49:36 -08:00
|
|
|
|
2016-03-02 19:28:02 -08:00
|
|
|
void flow_socket_ready(int, struct flow *);
|
2016-03-02 21:51:30 -08:00
|
|
|
void flow_socket_connected(int, struct flow *);
|
2016-03-02 22:25:56 -08:00
|
|
|
void flow_new(int, struct flow *, void *, struct peer *);
|
|
|
|
|
bool flow_new_send_hello(int, struct flow *, void *, struct peer *);
|
|
|
|
|
void flow_get_hello(struct flow *, struct buf **, void *);
|
2016-03-02 19:20:25 -08:00
|
|
|
void flow_ref_inc(struct flow *);
|
|
|
|
|
void flow_ref_dec(struct flow *);
|