1/**
2 * \file
3 * \brief Code synthesizer for bfdmux filters
4 *
5 * This file provides the interface for the filter code generator.
6 */
7/*
8 * Copyright (c) 2009, 2010, ETH Zurich.
9 * All rights reserved.
10 *
11 * This file is distributed under the terms in the attached LICENSE file.
12 * If you do not find this file, copies can be found by writing to:
13 * ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group.
14 */
15
16#ifndef __CODEGEN_H__
17#define __CODEGEN_H__
18
19#include <bfdmuxtools/filter.h>
20
21#include <inttypes.h>
22
23/**
24 * \brief Maximum number of bytes for a compiled filter
25 *
26 * This is used to limit bfdmux's workload in some way.
27 * \todo Implement a better restriction for the filter processing time per application
28 */
29#define MAX_FILTER_CODE_SIZE 256
30
31#define INITIAL_ALLOC_SIZE 64 /**< Size of initially allocated filter code block */
32#define INCREMENTAL_ALLOC_SIZE 64 /**< Size of realloc'ed blocks if filter code doesn't fit */
33
34void compile_filter(char *expression, uint8_t ** filter_code, int32_t *filter_len);
35
36#endif
37