L4Re Operating System Framework
Interface and Usage Documentation
Loading...
Searching...
No Matches
filter.h
1/*
2 * Copyright (C) 2016-2017, 2023-2024 Kernkonzept GmbH.
3 * Author(s): Jean Wolter <jean.wolter@kernkonzept.com>
4 *
5 * License: see LICENSE.spdx (in this directory or the directories above)
6 */
7#pragma once
8
9#include "request.h"
10#include <l4/bid_config.h>
11
24#ifdef CONFIG_VNS_PORT_FILTER
25bool filter(const uint8_t *buf, size_t size);
26#else
27inline bool filter(const uint8_t *, size_t)
28{
29 // default implementation filtering out no packets, see filter.cc for
30 // other examples
31 return false;
32}
33#endif
34
43inline bool filter_request(Virtio_net_request const &req)
44{
45 size_t size;
46 const uint8_t *buf = req.buffer(&size);
47 return filter(buf, size);
48}
Abstraction for a network request.
Definition request.h:36
const uint8_t * buffer(size_t *size) const
Get the location and size of the current buffer.
Definition request.h:90