Haka: include/haka/packet_module.h Source File

Haka

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

packet_module.h
Go to the documentation of this file.
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
10 #ifndef HAKA_PACKET_MODULE_H
11 #define HAKA_PACKET_MODULE_H
12
13 #include <haka/module.h>
14 #include <haka/packet.h>
15 #include <haka/types.h>
16
17
21 typedef enum {
22 FILTER_ACCEPT,
23 FILTER_DROP
24 } filter_result;
25
26 struct packet_module_state;
33 struct packet_module {
34 struct module module;
39 bool (*multi_threaded)();
40
44 bool (*pass_through)();
45
49 bool (*is_realtime)();
50
55 struct packet_module_state *(*init_state)(int thread_id);
56
60 void (*cleanup_state)(struct packet_module_state *state);
61
68 int (*receive)(struct packet_module_state *state, struct packet **pkt);
69
78 void (*verdict)(struct packet *pkt, filter_result result);
79
83 uint64 (*get_id)(struct packet *pkt);
84
88 const char *(*get_dissector)(struct packet *pkt);
89
93 void (*release_packet)(struct packet *pkt);
94
98 enum packet_status (*packet_getstate)(struct packet *pkt);
99
103 struct packet *(*new_packet)(struct packet_module_state *state, size_t size);
104
109 bool (*send_packet)(struct packet *pkt);
110
114 size_t (*get_mtu)(struct packet *pkt);
115
119 const struct time *(*get_timestamp)(struct packet *pkt);
120 };
121
122 #endif /* HAKA_PACKET_MODULE_H */
types.h
packet_module::is_realtime
bool(* is_realtime)()
Definition: packet_module.h:49
FILTER_DROP
Definition: packet_module.h:23
module
Definition: module.h:34
packet_module::get_mtu
size_t(* get_mtu)(struct packet *pkt)
Definition: packet_module.h:114
filter_result
filter_result
Definition: packet_module.h:21
uint64
unsigned HAKA_64BIT_TYPE uint64
Definition: types.h:30
packet_module::receive
int(* receive)(struct packet_module_state *state, struct packet **pkt)
Definition: packet_module.h:68
packet_module
Definition: packet_module.h:33
packet_module::get_id
uint64(* get_id)(struct packet *pkt)
Definition: packet_module.h:83
packet_module::send_packet
bool(* send_packet)(struct packet *pkt)
Definition: packet_module.h:109
packet
Definition: packet.h:24
packet_module::verdict
void(* verdict)(struct packet *pkt, filter_result result)
Definition: packet_module.h:78
FILTER_ACCEPT
Definition: packet_module.h:22
bool
unsigned char bool
Definition: types.h:17
packet_module::multi_threaded
bool(* multi_threaded)()
Definition: packet_module.h:39
packet.h
packet_module::cleanup_state
void(* cleanup_state)(struct packet_module_state *state)
Definition: packet_module.h:60
time
Definition: time.h:21
module.h
packet_status
packet_status
Definition: packet.h:39
packet_module::release_packet
void(* release_packet)(struct packet *pkt)
Definition: packet_module.h:93
packet_module::packet_getstate
enum packet_status(* packet_getstate)(struct packet *pkt)
Definition: packet_module.h:98
packet_module::pass_through
bool(* pass_through)()
Definition: packet_module.h:44