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 
28 #ifndef HE_PLUGIN_H
29 #define HE_PLUGIN_H
30 
31 #include <stddef.h>
32 #include <stdint.h>
33 
37 typedef enum he_plugin_return_code {
38  HE_PLUGIN_SUCCESS = 0,
39  HE_PLUGIN_FAIL = -1,
40  HE_PLUGIN_DROP = -2,
42 
55 typedef he_plugin_return_code_t (*plugin_do_ingress)(uint8_t *packet, size_t *length,
56  size_t capacity, void *data);
57 
70 typedef he_plugin_return_code_t (*plugin_do_egress)(uint8_t *packet, size_t *length,
71  size_t capacity, void *data);
72 
76 typedef struct plugin_struct {
77  plugin_do_ingress do_ingress;
78  plugin_do_egress do_egress;
79  void *data;
81 
82 #endif // HE_PLUGIN_H
he_plugin_return_code_t
enum he_plugin_return_code he_plugin_return_code_t
plugin_do_ingress
he_plugin_return_code_t(* plugin_do_ingress)(uint8_t *packet, size_t *length, size_t capacity, void *data)
The prototype for the ingress function of a helium plugin.
Definition: he_plugin.h:55
plugin_struct
Data structure of a helium plugin.
Definition: he_plugin.h:76
he_plugin_return_code
he_plugin_return_code
Definition: he_plugin.h:37
plugin_do_egress
he_plugin_return_code_t(* plugin_do_egress)(uint8_t *packet, size_t *length, size_t capacity, void *data)
The prototype for the egress function of a helium plugin.
Definition: he_plugin.h:70
plugin_struct_t
struct plugin_struct plugin_struct_t
Data structure of a helium plugin.