Files
adsb-tools/backend.h

25 lines
458 B
C
Raw Normal View History

2016-02-15 20:01:48 +00:00
#pragma once
#include <stdbool.h>
2016-02-15 20:01:48 +00:00
#include "common.h"
#define PARSER_STATE_LEN 256
struct backend;
2016-02-17 08:05:18 +00:00
struct addrinfo;
2016-02-15 20:01:48 +00:00
typedef bool (*parser)(struct backend *, struct packet *);
struct backend {
2016-02-17 08:05:18 +00:00
struct peer peer;
2016-02-15 21:22:23 +00:00
char id[UUID_LEN];
2016-02-17 08:05:18 +00:00
char *node;
char *service;
struct addrinfo *addrs;
struct addrinfo *addr;
2016-02-15 20:01:48 +00:00
struct buf buf;
char parser_state[PARSER_STATE_LEN];
parser parser;
};
2016-02-17 08:05:18 +00:00
struct backend *backend_new(char *node, char *service, int epoll_fd);