Haka
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 {
25 
26 struct packet_module_state;
33 struct packet_module {
34  struct module module;
40 
45 
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 */
bool(* is_realtime)()
Definition: packet_module.h:49
Definition: packet_module.h:23
Definition: module.h:34
size_t(* get_mtu)(struct packet *pkt)
Definition: packet_module.h:114
filter_result
Definition: packet_module.h:21
unsigned HAKA_64BIT_TYPE uint64
Definition: types.h:30
int(* receive)(struct packet_module_state *state, struct packet **pkt)
Definition: packet_module.h:68
Definition: packet_module.h:33
uint64(* get_id)(struct packet *pkt)
Definition: packet_module.h:83
bool(* send_packet)(struct packet *pkt)
Definition: packet_module.h:109
Definition: packet.h:24
void(* verdict)(struct packet *pkt, filter_result result)
Definition: packet_module.h:78
Definition: packet_module.h:22
unsigned char bool
Definition: types.h:17
bool(* multi_threaded)()
Definition: packet_module.h:39
void(* cleanup_state)(struct packet_module_state *state)
Definition: packet_module.h:60
Definition: time.h:21
packet_status
Definition: packet.h:39
void(* release_packet)(struct packet *pkt)
Definition: packet_module.h:93
enum packet_status(* packet_getstate)(struct packet *pkt)
Definition: packet_module.h:98
bool(* pass_through)()
Definition: packet_module.h:44