Changeset 53 for trunk

Show
Ignore:
Timestamp:
09/10/07 14:15:30 (15 years ago)
Author:
andreu
Message:

new function addLValue in rules_mgmt.c

Location:
trunk/src
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/rules_mgmt.c

    r28 r53  
    467467      tmp->fieldType = ft; 
    468468      tmp->value = NULL; 
    469       if ((ft==1) || (ft==25)){ 
     469      if ((ft==25)){ 
    470470          tmp->value = addValue(tmp->value, operatorToNumber, value); 
     471      } else if ((ft==1)){ 
     472          tmp->value = addLValue(tmp->value, operatorToNumber, value); 
    471473      } else if ( (ft==0) || (ft==8) || (ft==12) || (ft==15) || (ft==18) ){ 
    472474          tmp->value = addAddress(tmp->value, operatorToNumber, value); 
     
    634636 
    635637ValuesPtr 
     638addLValue(ValuesPtr vPtr, unsigned short op, char *val) 
     639{ 
     640  ValuesPtr tmp; 
     641  char value[11]; 
     642 
     643  tmp = (ValuesPtr) malloc(sizeof(struct Values)); 
     644  if (tmp==NULL) { 
     645    syslog(LOG_ERR, "ERROR in malloc in addValue function"); 
     646    exit(1); 
     647  } else { 
     648    if (sscanf(val, "%s", value) == 0) { 
     649      syslog(LOG_ERR, "Errors in Tests definition : wrong long value"); 
     650      exit(1); 
     651    }    
     652    tmp->valueLength = 4; 
     653    tmp->stor.lvalue = (unsigned short) atoi(value); 
     654    tmp->next = vPtr; 
     655  } 
     656  return tmp; 
     657} 
     658 
     659ValuesPtr 
    636660addCValue(ValuesPtr vPtr, unsigned short op, char *val) 
    637661{ 
  • trunk/src/rules_mgmt.h

    r28 r53  
    9797FieldPtr addFields(FieldPtr, char *); 
    9898ValuesPtr addValue(ValuesPtr, unsigned short, char *); 
     99ValuesPtr addLValue(ValuesPtr, unsigned short, char *); 
    99100ValuesPtr addAddress(ValuesPtr, unsigned short, char *); 
    100101ValuesPtr addV6Address(ValuesPtr, unsigned short, char *);