Barrelfish
Functions
codegen.c File Reference

Code synthesizer for bfdmux filters. More...

Functions

void compile_filter (char *expression, uint8_t **filter_code, int32_t *filter_len)
 Compiles a filter expression in Bfdmux Filter Language into Bfdmux Intermediate Code. More...
 

Detailed Description

Code synthesizer for bfdmux filters.

This file provides functions to create byte code in Bfdmux Intermediate Language from filter strings. This byte code can be executed using the functions in vm.c to filter network packets.

Function Documentation

void compile_filter ( char *  expression,
uint8_t **  filter_code,
int32_t *  filter_len 
)

Compiles a filter expression in Bfdmux Filter Language into Bfdmux Intermediate Code.

Parameters
expressionthe expression to compile
[out]filter_codePoints to the memory buffer that contains the compiled filter, or NULL, if an error occurred
[out]filter_lenIndicates the length of the compiled code, or contains the error position in the filter string on failure