Move wordlist specific functions into their own source file

This commit is contained in:
jsteube
2016-09-08 16:32:24 +02:00
parent 367473c657
commit e304eed8c5
7 changed files with 339 additions and 272 deletions
+2
View File
@@ -93,4 +93,6 @@ int _old_apply_rule (char *rule, int rule_len, char in[BLOCK_SIZE], int in_len,
int cpu_rule_to_kernel_rule (char *rule_buf, uint rule_len, kernel_rule_t *rule);
int kernel_rule_to_cpu_rule (char *rule_buf, kernel_rule_t *rule);
int run_rule_engine (const int rule_len, const char *rule_buf);
#endif // _RP_CPU_H
-8
View File
@@ -331,15 +331,7 @@ typedef struct
} outfile_data_t;
typedef struct
{
char *buf;
u32 incr;
u32 avail;
u32 cnt;
u32 pos;
} wl_data_t;
#define CPT_BUF 0x20000
+31
View File
@@ -0,0 +1,31 @@
/**
* Author......: Jens Steube <jens.steube@gmail.com>
* License.....: MIT
*/
#ifndef _WORDLIST_H
#define _WORDLIST_H
typedef struct
{
char *buf;
u32 incr;
u32 avail;
u32 cnt;
u32 pos;
} wl_data_t;
uint convert_from_hex (char *line_buf, const uint line_len);
void load_segment (wl_data_t *wl_data, FILE *fd);
void get_next_word_lm (char *buf, u32 sz, u32 *len, u32 *off);
void get_next_word_uc (char *buf, u32 sz, u32 *len, u32 *off);
void get_next_word_std (char *buf, u32 sz, u32 *len, u32 *off);
void get_next_word (wl_data_t *wl_data, FILE *fd, char **out_buf, uint *out_len);
void pw_add (hc_device_param_t *device_param, const u8 *pw_buf, const int pw_len);
#endif // _WORDLIST_H