1024 | | if (res2!=NULL){ |
| 1025 | if (res2!=NULL){ |
| 1026 | #if defined(MULTISAMPLING) |
| 1027 | if (myPtrs->currentRouterPtr->sampled != res2->sampling ){ |
| 1028 | ((struct POP *)((myPtrs->matrixPOP) |
| 1029 | +((res->routerNb)*ROUTER_INDEX_MAX) |
| 1030 | +((res2->routerNb))))->pktsNb += agCache.pkts*myPtrs->currentRouterPtr->sampled/res2->sampling; |
| 1031 | ((struct POP *)((myPtrs->matrixPOP) |
| 1032 | +((res->routerNb)*ROUTER_INDEX_MAX) |
| 1033 | +((res2->routerNb))))->bytesNb += agCache.bytes*myPtrs->currentRouterPtr->sampled/res2->sampling; |
| 1034 | ((struct POP *)((myPtrs->matrixPOP) |
| 1035 | +((res->routerNb)*ROUTER_INDEX_MAX) |
| 1036 | +((res2->routerNb))))->flowNb++; |
| 1037 | } else { |
| 1038 | ((struct POP *)((myPtrs->matrixPOP) |
| 1039 | +((res->routerNb)*ROUTER_INDEX_MAX) |
| 1040 | +((res2->routerNb))))->pktsNb += agCache.pkts; |
| 1041 | ((struct POP *)((myPtrs->matrixPOP) |
| 1042 | +((res->routerNb)*ROUTER_INDEX_MAX) |
| 1043 | +((res2->routerNb))))->bytesNb += agCache.bytes; |
| 1044 | ((struct POP *)((myPtrs->matrixPOP) |
| 1045 | +((res->routerNb)*ROUTER_INDEX_MAX) |
| 1046 | +((res2->routerNb))))->flowNb++; |
| 1047 | } |
| 1048 | #else |
1034 | | } else { |
| 1058 | #endif |
| 1059 | } else { |
| 1060 | /* here we'll make the choice that in multisampling mode, |
| 1061 | * the virtual POP that represent the reste of world is |
| 1062 | * in 1:10 packets mode */ |
| 1063 | #if defined(MULTISAMPLING) |
| 1064 | ( |
| 1065 | ((struct POP *)(myPtrs->matrixPOP) |
| 1066 | +((res->routerNb)*ROUTER_INDEX_MAX) |
| 1067 | +((ROUTER_INDEX_MAX-1))))->pktsNb += agCache.pkts*myPtrs->currentRouterPtr->sampled/10; |
| 1068 | ( |
| 1069 | ((struct POP *)(myPtrs->matrixPOP) |
| 1070 | +((res->routerNb)*ROUTER_INDEX_MAX) |
| 1071 | +((ROUTER_INDEX_MAX-1))))->bytesNb += agCache.bytes*myPtrs->currentRouterPtr->sampled/10; |
| 1072 | ( |
| 1073 | ((struct POP *)(myPtrs->matrixPOP) |
| 1074 | +((res->routerNb)*ROUTER_INDEX_MAX) |
| 1075 | +((ROUTER_INDEX_MAX-1))))->flowNb++; |
| 1076 | #else |
| 1185 | #if defined(MULTISAMPLING) |
| 1186 | if (myPtrs->currentRouterPtr->sampled != res->sampling ){ |
| 1187 | res->bytesNbIN += agCache.bytes*myPtrs->currentRouterPtr->sampled/res->sampling; |
| 1188 | res->pktsNbIN += agCache.pkts*myPtrs->currentRouterPtr->sampled/res->sampling; |
| 1189 | if (agCache.dscp>>2 == FIRST_CoS) { |
| 1190 | res->firstCoSIN += agCache.bytes*myPtrs->currentRouterPtr->sampled/res->sampling; |
| 1191 | } else if (agCache.dscp>>2 == SECOND_CoS) { |
| 1192 | res->secondCoSIN += agCache.bytes*myPtrs->currentRouterPtr->sampled/res->sampling; |
| 1193 | } else if (agCache.dscp>>2 == THIRD_CoS) { |
| 1194 | res->thirdCoSIN += agCache.bytes*myPtrs->currentRouterPtr->sampled/res->sampling; |
| 1195 | } else { |
| 1196 | res->fourthCoSIN += agCache.bytes*myPtrs->currentRouterPtr->sampled/res->sampling; |
| 1197 | } |
| 1198 | }else{ |
| 1199 | res->bytesNbIN += agCache.bytes; |
| 1200 | res->pktsNbIN += agCache.pkts; |
| 1201 | (res->flowNbIN)++; |
| 1202 | if (agCache.dscp>>2 == FIRST_CoS) { |
| 1203 | res->firstCoSIN += agCache.bytes; |
| 1204 | } else if (agCache.dscp>>2 == SECOND_CoS) { |
| 1205 | res->secondCoSIN += agCache.bytes; |
| 1206 | } else if (agCache.dscp>>2 == THIRD_CoS) { |
| 1207 | res->thirdCoSIN += agCache.bytes; |
| 1208 | } else { |
| 1209 | res->fourthCoSIN += agCache.bytes; |
| 1210 | } |
| 1211 | } |
| 1212 | #else |