L4Re Operating System Framework
Interface and Usage Documentation
Loading...
Searching...
No Matches
options.h
1/*
2 * Copyright (C) 2016-2017, 2022, 2024 Kernkonzept GmbH.
3 * Author(s): Jean Wolter <jean.wolter@kernkonzept.com>
4 * Manuel von Oltersdorff-Kalettka <manuel.kalettka@kernkonzept.com>
5 *
6 * License: see LICENSE.spdx (in this directory or the directories above)
7 */
8#pragma once
9
10#include <memory>
11#include <vector>
12#include <cerrno>
13#include <climits>
14
15#include <l4/re/dataspace>
16
17bool
18parse_int_optstring(char const *optstring, int *out);
19
20class Options
21{
22 using Ds_vector = std::vector<L4::Cap<L4Re::Dataspace>>;
23public:
24 int get_max_ports() const
25 { return _max_ports; }
26
27 int get_virtq_max_num() const
28 { return _virtq_max_num; }
29
30 int get_portq_max_num() const
31 { return _portq_max_num; }
32
33 int get_request_timeout() const
34 { return _request_timeout; }
35
36 int assign_mac() const
37 { return _assign_mac; }
38
39 static Options const *
40 parse_options(int argc, char **argv,
41 std::shared_ptr<Ds_vector> trusted_dataspaces);
42 static Options const *get_options();
43
44private:
45 int _max_ports = 5;
46 int _virtq_max_num = 0x100; // default value for data queues
47 int _portq_max_num = 50; // default value for port queues
48 int _request_timeout = 1 * 1000 * 1000; // default packet timeout 1 second
49 bool _assign_mac = false;
50
51 int parse_cmd_line(int argc, char **argv,
52 std::shared_ptr<Ds_vector> trusted_dataspaces);
53};
Dataspace interface.