From 12e33be6b7de64e06c5b51330db34f2545f7087e Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sun, 28 Dec 2008 14:10:15 +0000 Subject: options parser almost done --- src/options.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/options.h') diff --git a/src/options.h b/src/options.h index bc0f296..91ae768 100644 --- a/src/options.h +++ b/src/options.h @@ -35,6 +35,12 @@ #ifndef _OPTIONS_H_ #define _OPTIONS_H_ +struct buffer_struct { + u_int32_t length_; + u_int8_t* buf_; +}; +typedef struct buffer_struct buffer_t; + struct options_struct { char* progname_; int daemonize_; @@ -57,19 +63,18 @@ struct options_struct { char* kd_prf_; char* auth_algo_; mux_t mux_; - u_int8_t* key_; - u_int32_t key_length_; - u_int8_t* salt_; - u_int32_t salt_length_; + buffer_t key_; + buffer_t salt_; }; typedef struct options_struct options_t; +buffer_t options_parse_hex_string(const char* hex); + int options_parse(options_t** opt, int argc, char* argv[]); void options_default(options_t* opt); void options_clear(options_t** opt); void options_print_usage(); void options_print(options_t* opt); - #endif -- cgit v1.2.3