Helium
src
he
plugin_stats.h
Go to the documentation of this file.
1
/* *
2
* Lightway Core
3
* Copyright (C) 2021 Express VPN International Ltd.
4
*
5
* This program is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU General Public License
7
* as published by the Free Software Foundation; either version 2
8
* of the License, or (at your option) any later version.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18
*/
19
26
#ifndef PLUGIN_STATS
27
#define PLUGIN_STATS
28
29
#include <stddef.h>
30
#include <
he_plugin.h
>
31
32
// This is the only "public" API
33
he_plugin_return_code_t
stats_plugin_create(
plugin_struct_t
*
plugin_struct
);
34
void
stats_plugin_destroy(
plugin_struct_t
*
plugin_struct
);
35
36
// Everything else here is for testing
37
38
#define PACKET_SAMPLE_N 100000
39
40
typedef
struct
stats
{
41
double
sum;
42
double
sumsq;
43
unsigned
long
n;
44
double
min;
45
double
max;
46
}
stats_t
;
47
48
typedef
struct
packet_stats
{
49
stats_t
incoming;
50
stats_t
outgoing;
51
}
packet_stats_t
;
52
53
he_plugin_return_code_t
stats_plugin_do_ingress(uint8_t *packet,
size_t
*length,
size_t
capacity,
54
packet_stats_t
*data);
55
he_plugin_return_code_t
stats_plugin_do_egress(uint8_t *packet,
size_t
*length,
size_t
capacity,
56
packet_stats_t
*data);
57
58
#endif // PLUGIN_STATS
he_plugin.h
The internal plugin API definitions.
he_plugin_return_code_t
enum he_plugin_return_code he_plugin_return_code_t
plugin_struct
Data structure of a helium plugin.
Definition:
he_plugin.h:76
stats
Definition:
plugin_stats.h:40
packet_stats
Definition:
plugin_stats.h:48
Generated by
1.8.17