libcortex
Event loop library following a "batteries included" approach
Loading...
Searching...
No Matches
nf_queue.h
1#ifndef _CRTX_NF_QUEUE_H
2#define _CRTX_NF_QUEUE_H
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8/*
9 * Mario Kicherer (dev@kicherer.org) 2016
10 *
11 */
12
13// #define NFQ_PACKET_MSG_ETYPE "nf_queue/packet_msg"
14
15#define PFW_NEWPACKET_SIGNATURE "ussssD"
16enum {PFW_NEWP_PROTOCOL=0, PFW_NEWP_SRC_IP, PFW_NEWP_SRC_HOST, PFW_NEWP_DST_IP, PFW_NEWP_DST_HOST, PFW_NEWP_PAYLOAD};
17
18#define PFW_NEWPACKET_TCP_SIGNATURE "uu"
19enum {PFW_NEWP_TCP_SPORT=0, PFW_NEWP_TCP_DPORT};
20
21#define PFW_NEWPACKET_UDP_SIGNATURE "uu"
22enum {PFW_NEWP_UDP_SPORT=0, PFW_NEWP_UDP_DPORT};
23
24
26 struct crtx_listener_base base;
27
28 pthread_t thread;
29
30 u_int16_t queue_num;
31 u_int32_t default_mark;
32};
33
35 int id;
36 u_int16_t hw_protocol;
37
38 char *hw_addr;
39
40 u_int32_t mark_in;
41 u_int32_t indev;
42 u_int32_t outdev;
43 u_int32_t physindev;
44 u_int32_t physoutdev;
45
46 unsigned char *payload;
47 size_t payload_size;
48
49 u_int32_t mark_out;
50};
51
52char crtx_nfq_print_packet(struct crtx_dict *ds);
53char *crtx_nfq_proto2str(u_int16_t protocol);
54
55char nfq_packet_msg_okay(struct crtx_event *event);
56struct crtx_listener_base *crtx_setup_nf_queue_listener(void *options);
57CRTX_DECLARE_ALLOC_FUNCTION(nf_queue)
58
59void crtx_nf_queue_init();
60void crtx_nf_queue_finish();
61
62#ifdef __cplusplus
63}
64#endif
65
66#endif
Definition dict.h:61
an event that is emitted by a listener crtx_listener_base
Definition core.h:59
base structure of a listener
Definition core.h:186
Definition nf_queue.h:25
Definition nf_queue.h:34