Helium
he_plugin.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 
32 #ifndef HE_PLUGIN
33 #define HE_PLUGIN
34 
35 #include <stddef.h>
36 #include <stdint.h>
37 
38 typedef enum he_plugin_return_code {
39  HE_PLUGIN_SUCCESS = 0,
40  HE_PLUGIN_FAIL = -1,
41  HE_PLUGIN_DROP = -2,
42 } he_plugin_return_code_t;
43 
44 typedef he_plugin_return_code_t (*plugin_do_ingress)(uint8_t *packet, size_t *length,
45  size_t capacity, void *data);
46 typedef he_plugin_return_code_t (*plugin_do_egress)(uint8_t *packet, size_t *length,
47  size_t capacity, void *data);
48 
49 typedef struct plugin_struct {
50  plugin_do_ingress do_ingress;
51  plugin_do_egress do_egress;
52  void *data;
54 
55 #endif
Definition: he_plugin.h:49