/[pengfork]/pengfork/src/checkopt.c
ViewVC logotype

Diff of /pengfork/src/checkopt.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by chupa, Mon Sep 16 14:25:53 2002 UTC revision 1.3 by chupa, Sat Nov 30 10:28:52 2002 UTC
# Line 30  Line 30 
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"
# Line 108  check_iface_type(option, type) Line 109  check_iface_type(option, type)
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
# Line 163  check_line_speed(option, speed) Line 167  check_line_speed(option, speed)
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;
# Line 187  check_ip(option, ip) Line 191  check_ip(option, ip)
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 */

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26