28 |
{ false = 0, true } |
{ false = 0, true } |
29 |
bool_t; |
bool_t; |
30 |
|
|
31 |
|
/* command line getopt values */ |
32 |
|
typedef enum |
33 |
|
{ |
34 |
|
/* use this if no command line option is associated */ |
35 |
|
opt_none = 256, |
36 |
|
/* letter correspond to short option alias */ |
37 |
|
opt_help = 'h', |
38 |
|
opt_version = 'V', |
39 |
|
opt_interface_type = 't', |
40 |
|
opt_interface_name = 'i', |
41 |
|
opt_user = 'u', |
42 |
|
opt_pass = 'p', |
43 |
|
opt_auto_reconnect = 'r', |
44 |
|
opt_daemon = 'd', |
45 |
|
opt_debug_level = 'D', |
46 |
|
opt_modem = 'm', |
47 |
|
opt_phone = 'n', |
48 |
|
opt_speed = 's', |
49 |
|
opt_server_login = 'l', |
50 |
|
opt_server_pass = 'w', |
51 |
|
/* numeric opt_id, not associated with any short option */ |
52 |
|
opt_pid_file = 300, |
53 |
|
opt_ip_up = 301, |
54 |
|
opt_ip_down = 302, |
55 |
|
opt_rtscts = 303, |
56 |
|
opt_init_str = 304, |
57 |
|
opt_dial_str = 305 |
58 |
|
} option_e; |
59 |
|
|
60 |
typedef struct |
typedef struct |
61 |
{ |
{ |
62 |
char *shortopt; |
option_e opt_id; |
|
char *longopt; |
|
63 |
char *name; |
char *name; |
64 |
enum |
enum |
65 |
{ boolean, integer, string } |
{ boolean, integer, string } |
86 |
#define PARAM_AOL_USER param[4].value.string |
#define PARAM_AOL_USER param[4].value.string |
87 |
#define PARAM_AOL_PASS param[5].value.string |
#define PARAM_AOL_PASS param[5].value.string |
88 |
#define PARAM_AUTO_RECONNECT param[6].value.boolean |
#define PARAM_AUTO_RECONNECT param[6].value.boolean |
89 |
#define PARAM_RECONNECT_DELAY param[7].value.boolean |
#define PARAM_RECONNECT_DELAY param[7].value.integer |
90 |
#define PARAM_DAEMON param[8].value.boolean |
#define PARAM_DAEMON param[8].value.boolean |
91 |
#define PARAM_DEBUG_LEVEL param[9].value.integer |
#define PARAM_DEBUG_LEVEL param[9].value.integer |
92 |
#define PARAM_SET_DNS param[10].value.boolean |
#define PARAM_SET_DNS param[10].value.boolean |
135 |
|
|
136 |
extern param_t param[PARAM_MAX]; |
extern param_t param[PARAM_MAX]; |
137 |
|
|
138 |
|
int parse_command_line (int argc, char **argv); |
139 |
int parse_config( void ); |
int parse_config( void ); |
140 |
int parse_config_file (char *filename); |
int parse_config_file (char *filename); |
141 |
void try_param (param_t * param, char *filename, int lineno, char *name, |
void try_param (param_t * param, char *filename, int lineno, char *name, |