30 |
|
|
31 |
#include "utils.h" |
#include "utils.h" |
32 |
#include "options.h" |
#include "options.h" |
33 |
|
#include "getpass.h" |
34 |
#include "log.h" |
#include "log.h" |
35 |
#include "modem/modem.h" |
#include "modem/modem.h" |
36 |
#include "checkopt.h" |
#include "checkopt.h" |
109 |
} |
} |
110 |
|
|
111 |
int |
int |
112 |
check_use_sn(option, sn) |
check_screen_name(option, sn) |
113 |
char *option; |
char *option; |
114 |
int sn; |
char *sn; |
115 |
{ |
{ |
116 |
if(sn>=1 && sn<=7) |
char *pass; |
117 |
|
|
118 |
|
if(!sn) |
119 |
{ |
{ |
120 |
if(PARAM_SCREEN_NAME(sn)!=NULL && PARAM_PASSWORD(sn)!=NULL) |
log(LOG_ERR, "Screen name not defined, please edit your configuration file (%s).\n", |
121 |
return 1; |
PARAM_CONFIG_FILE); |
122 |
else |
return 0; |
|
{ |
|
|
log(LOG_ERR, "%s is set to %d, but corresponding screen name " |
|
|
"or password isn't defined.\n", option, sn); |
|
|
return 0; |
|
|
} |
|
123 |
} |
} |
124 |
|
if(get_password(sn,&pass)) |
125 |
log(LOG_ERR, "%s must be between 1 and 7.\n", option); |
{ |
126 |
return 0; |
free(pass); |
127 |
|
return 1; |
128 |
|
} |
129 |
|
else { |
130 |
|
log(LOG_ERR, "Screen name '%s' not found in %s.\n", sn, PARAM_SECRET_FILE); |
131 |
|
return 0; |
132 |
|
} |
133 |
} |
} |
134 |
|
|
135 |
int |
int |
167 |
} |
} |
168 |
#endif /* WITH_MODEM */ |
#endif /* WITH_MODEM */ |
169 |
|
|
170 |
#ifdef WITH_CABLE |
#ifdef WITH_TCPIP |
171 |
int |
int |
172 |
check_port(option, port) |
check_port(option, port) |
173 |
char *option; |
char *option; |
191 |
log(LOG_ERR, "%s must be a valid IP address.\n", option); |
log(LOG_ERR, "%s must be a valid IP address.\n", option); |
192 |
return 0; |
return 0; |
193 |
} |
} |
194 |
#endif /* WITH_CABLE */ |
#endif /* WITH_TCPIP */ |