building fieldset and probe modules

This commit is contained in:
Zakir Durumeric
2013-08-19 04:42:25 -04:00
parent a0288adec8
commit 952f6cefa1
7 changed files with 159 additions and 106 deletions

View File

@ -1,4 +1,5 @@
#include "../state.h"
#include "../fieldset.h"
#ifndef HEADER_PROBE_MODULES_H
#define HEADER_PROBE_MODULES_H
@ -14,9 +15,10 @@ typedef int (*probe_make_packet_cb)(void* packetbuf, ipaddr_n_t src_ip, ipaddr_n
uint32_t *validation, int probe_num);
typedef void (*probe_print_packet_cb)(FILE *, void* packetbuf);
typedef int (*probe_close_cb)(struct state_conf*, struct state_send*, struct state_recv*);
typedef response_type_t* (*probe_classify_packet_cb)(const u_char* packetbuf, uint32_t len);
typedef int (*probe_validate_packet_cb)(const struct iphdr *ip_hdr, uint32_t len, uint32_t *src_ip, uint32_t *validation);
typedef void (*probe_classify_packet_cb)(const u_char* packetbuf, uint32_t len, fieldset_t*);
typedef struct probe_module {
const char *name;
size_t packet_length;
@ -27,19 +29,20 @@ typedef struct probe_module {
// source and target port numbers?
uint8_t port_args;
response_type_t *responses;
probe_global_init_cb global_initialize;
probe_thread_init_cb thread_initialize;
probe_make_packet_cb make_packet;
probe_print_packet_cb print_packet;
probe_validate_packet_cb validate_packet;
probe_classify_packet_cb classify_packet;
probe_classify_packet_cb process_packet;
probe_close_cb close;
fielddef_t *fields;
} probe_module_t;
probe_module_t* get_probe_module_by_name(const char*);
void print_probe_modules(void);
#endif // HEADER_PROBE_MODULES_H