summaryrefslogtreecommitdiff
path: root/gsm-receiver/src/lib/decoder/gsmstack.h
blob: 62427d211d6d6f5244738a1f8937378a1c1d60da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//TODO: this file shouldn't be part of the GSM Receiver
#ifndef __GSMSTACK_H__
#define __GSMSTACK_H__ 1

#ifdef __cplusplus
extern "C" {
#endif

#include <linux/if_ether.h>
#include "interleave.h"

struct gs_ts_ctx {
	/* FIXME: later do this per each ts per each arfcn */
	unsigned char burst[4 * 58 * 2];
	int burst_count;
};

typedef struct
{
	int flags;
	int fn;
	int bsic;
	char msg[23];	/* last decoded message */

	INTERLEAVE_CTX interleave_ctx;
	INTERLEAVE_CTX interleave_facch_f1_ctx;
	INTERLEAVE_CTX interleave_facch_f2_ctx;

	struct gs_ts_ctx ts_ctx[8];

	int tun_fd;
	unsigned char ether_addr[ETH_ALEN];

	int gsmtap_fd;
} GS_CTX;

int GS_new(GS_CTX *ctx);
int GS_process(GS_CTX *ctx, int ts, int type, const unsigned char *src, int fn);

#ifdef __cplusplus
}
#endif

#endif
personal git repositories of Harald Welte. Your mileage may vary