-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathparams.h
74 lines (60 loc) · 1.6 KB
/
params.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/* SPDX-License-Identifier: BSD-3-Clause
* Copyright (c) 2021 ETH Zurich
*/
#ifndef LF_PARAMS_H
#define LF_PARAMS_H
#include <inttypes.h>
#include <limits.h>
#include <rte_config.h>
#include "lf.h"
/**
* Parameters are expected in the usual DPDK format:
* (<EAL Parameters> -- <Application Parameters>)
*
* This module parses the application parameters and returns a parameter struct.
* Parameters that are not provided are set to a default in the struct.
*/
/**
* Application parameters are divided according to the modules they are used
* for.
*/
struct lf_params {
/*
* Config Manager
*/
char config_file[PATH_MAX];
/*
* Setup
*/
uint32_t portmask; /* enabled ports */
uint32_t rx_portmask; /* enabled rx ports */
uint32_t tx_portmask; /* enabled tx ports */
uint32_t promiscuous; /* promiscuous ports */
uint16_t dst_port[RTE_MAX_ETHPORTS]; /* rx, tx port pair */
enum lf_forwarding_direction
forwarding_direction[RTE_MAX_ETHPORTS]; /* rx packet direction */
unsigned int mtu; /* tx MTU */
bool disable_mirrors; /* disable mirrors for all ports */
/*
* Timestamp Filter
*/
unsigned int tf_threshold; /* threshold in milliseconds */
/*
* Duplicate Filter
*/
unsigned int bf_nb;
unsigned int bf_period; /* rotation period in milliseconds */
unsigned int bf_hashes;
unsigned int bf_bytes;
/*
* Rate Limiter
*/
unsigned int rl_size;
/*
* Keymanager
*/
unsigned int km_size;
};
int
lf_params_parse(int argc, char **argv, struct lf_params *params);
#endif /* LF_PARAMETERS_H */