Loading...
Searching...
No Matches
filter.h
/*
* Copyright (C) 2016-2017, 2023-2024 Kernkonzept GmbH.
* Author(s): Jean Wolter <jean.wolter@kernkonzept.com>
*
* License: see LICENSE.spdx (in this directory or the directories above)
*/
#pragma once
#include "request.h"
#include <l4/bid_config.h>
#ifdef CONFIG_VNS_PORT_FILTER
bool filter(const uint8_t *buf, size_t size);
#else
inline bool filter(const uint8_t *, size_t)
{
// default implementation filtering out no packets, see filter.cc for
// other examples
return false;
}
#endif
inline bool filter_request(Net_request const &req)
{
size_t size;
const uint8_t *buf = req.buffer(&size);
return filter(buf, size);
}