Show
Ignore:
Timestamp:
04/22/04 19:35:32 (9 years ago)
Author:
aprilp
Message:

Added debugging, changed way firewall tags traffic, cleanups

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/wifidog/src/conf.c

    r90 r95  
    6363        oFWScriptsPath, 
    6464        oFWType, 
    65         oUserClass, 
    6665    oSyslogFacility, 
    6766} OpCodes; 
     
    8887        { "fwscriptspath",      oFWScriptsPath }, 
    8988        { "fwtype",             oFWType }, 
    90         { "userclass",                  oUserClass }, 
    9189        { "syslogfacility",     oSyslogFacility }, 
    9290        { NULL,                 oBadOption }, 
     
    114112        config.fwscripts_path = DEFAULT_FWSCRIPTS_PATH; 
    115113        config.fwtype = DEFAULT_FWTYPE; 
    116         config.userclasses = (char **)malloc(sizeof(char *) * 256); 
    117         memset(config.userclasses, 0, sizeof(char *) * 256); 
    118114        config.syslog_facility = DEFAULT_SYSLOG_FACILITY; 
    119115    config.daemon = -1; 
     
    197193 
    198194                                switch(opcode) { 
    199                                 case oUserClass: 
    200                                         add_userclass((int)strtol(p1, NULL, 10), 
    201                                                         ++p2); 
    202                                         break; 
    203195                                case oDaemon: 
    204196                                        if (config.daemon == -1 && ((value = parse_value(p1)) != -1)) { 
     
    288280        buf = strdup(ptr); 
    289281        return buf; 
    290 } 
    291  
    292 char * 
    293 add_userclass(int profile, char *ptr) 
    294 { 
    295         char *tmp_str; 
    296  
    297         if (profile > 255 || profile < 0) 
    298                 return NULL; 
    299  
    300         if (*(config.userclasses + profile) != NULL) 
    301                 free(*(config.userclasses + profile)); 
    302  
    303         tmp_str = strdup(ptr); 
    304  
    305         *(config.userclasses + profile) = tmp_str; 
    306  
    307         return tmp_str; 
    308282} 
    309283