Files
adsb-tools/backend.h
2016-02-15 21:12:26 +00:00

21 lines
399 B
C

#pragma once
#include "common.h"
#define PARSER_STATE_LEN 256
struct backend;
typedef bool (*parser)(struct backend *, struct packet *);
struct backend {
enum peer_type type;
int fd;
struct buf buf;
char parser_state[PARSER_STATE_LEN];
parser parser;
};
void backend_init(struct backend *);
bool backend_connect(char *, char *, struct backend *, int);
bool backend_read(struct backend *);