Changeset 16 for trunk/src/dataFlowSet.c
- Timestamp:
- 03/17/06 17:15:12 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/dataFlowSet.c
r15 r16 34 34 unsigned short *offV9, unsigned char *buf, short *cFNPtr, 35 35 short *cFId, DatagramPtr pcktPtr, RuleDefPtr *rulesCache, 36 RulesPtr rlPtr, int myQueue) 36 RulesPtr rlPtr, int myQueue, struct PrefixV4 *V4PTab, 37 size_t nbPV4) 37 38 { 38 39 TplFlowSetPtr tmp; … … 50 51 int overflow = 0; 51 52 int noEnd = 1; 52 int i =0;53 int j =0;53 int i = 0; 54 int j = 0; 54 55 int pos = 0; 55 56 unsigned char buffer1; … … 60 61 char *msgTextIndex; 61 62 unsigned short tplMsgType = 11; 63 struct PrefixV4 prefixKey, *res; /* for bsearch */ 64 struct AggCache agCache; 62 65 63 66 buffer2[1] = *(buf+(*offV9));(*offV9)++; … … 118 121 == *((unsigned char*)&buffer1)) { 119 122 ((RuleDefPtr)(*(rulesCache+pos)))->check = 1; 120 } 123 } 124 /* aggregation */ 125 126 /* end aggregation */ 121 127 break; 122 128 case 2: … … 126 132 == *((unsigned short*)&buffer2)) 127 133 ((RuleDefPtr)(*(rulesCache+pos)))->check = 1; 134 /* aggregation */ 135 136 /* end aggregation */ 128 137 break; 129 138 case 4: … … 133 142 buffer4[0]= *(buf+(*offV9)); (*offV9)++; 134 143 /* FIXME : here , add a check on the field type */ 135 if ((((RuleDefPtr)(*(rulesCache+pos)))->value->stor.lvalue) 136 == (*((unsigned long*)&buffer4))>>(32-((RuleDefPtr)(*(rulesCache+pos)))->value->mask)<<(32-((RuleDefPtr)(*(rulesCache+pos)))->value->mask) ) 137 { 138 ((RuleDefPtr)(*(rulesCache+pos)))->check = 1; 139 } 144 if ((pftmp->fieldType==8)||(pftmp->fieldType==12)){ 145 if ((((RuleDefPtr)(*(rulesCache+pos)))->value->stor.lvalue) 146 == (*((unsigned long*)&buffer4))>>(32-((RuleDefPtr)(*(rulesCache+pos)))->value->mask)<<(32-((RuleDefPtr)(*(rulesCache+pos)))->value->mask) ) 147 { 148 ((RuleDefPtr)(*(rulesCache+pos)))->check = 1; 149 } 150 prefixKey.beginning = *((unsigned long*)&buffer4); 151 res = bsearch(&prefixKey, V4PTab, nbPV4, 152 sizeof(struct PrefixV4), prefCmp); 153 if (res == NULL) 154 fprintf(stderr,"!"); 155 else 156 fprintf(stderr,"."); 157 } 158 /* aggregation */ 159 160 /* end aggregation */ 140 161 break; 141 162 case 16: … … 262 283 } 263 284 moreIsNecessary = 1; 285 /* aggregation */ 286 287 /* end aggregation */ 264 288 break; 265 289 default: … … 286 310 case 1: 287 311 buffer1 = *(buf+(*offV9)); (*offV9)++; 312 /* aggregation */ 313 314 /* end aggregation */ 288 315 break; 289 316 case 2: 290 317 buffer2[1]= *(buf+(*offV9)); (*offV9)++; 291 318 buffer2[0]= *(buf+(*offV9)); (*offV9)++; 319 /* aggregation */ 320 321 /* end aggregation */ 292 322 break; 293 323 case 4: … … 296 326 buffer4[1]= *(buf+(*offV9)); (*offV9)++; 297 327 buffer4[0]= *(buf+(*offV9)); (*offV9)++; 328 /* aggregation */ 329 330 /* end aggregation */ 298 331 break; 299 332 case 16: … … 304 337 buffer2[0]= *(buf+(*offV9)); (*offV9)++; 305 338 } 339 /* aggregation */ 340 341 /* end aggregation */ 306 342 break; 307 343 default: … … 316 352 * end of one flow (not the flowset) 317 353 */ 354 /* put aggregation cache information to tables */ 355 356 /* end put */ 318 357 /* 319 358 * Redirection if needed