Changeset 93 for trunk/src

Show
Ignore:
Timestamp:
12/08/08 11:53:10 (14 years ago)
Author:
andreu
Message:

ticket #32 CdS

Location:
trunk/src
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/dataFlowSet.c

    r86 r93  
    765765                  res->pktsNbOUT += agCache.pkts*myPtrs->currentRouterPtr->sampled/res->sampling; 
    766766                  /* (res->flowNbOUT)++; FIXME : FIND SOMETHING*/ 
     767                  if (agCache.dscp>>2 == FIRST_CoS) { 
     768                    res->firstCoSOUT += agCache.bytes*myPtrs->currentRouterPtr->sampled/res->sampling; 
     769                  } else if (agCache.dscp>>2 == SECOND_CoS) { 
     770                    res->secondCoSOUT += agCache.bytes*myPtrs->currentRouterPtr->sampled/res->sampling; 
     771                  } else if (agCache.dscp>>2 == THIRD_CoS) { 
     772                    res->thirdCoSOUT += agCache.bytes*myPtrs->currentRouterPtr->sampled/res->sampling; 
     773                  } else { 
     774                    res->fourthCoSOUT += agCache.bytes*myPtrs->currentRouterPtr->sampled/res->sampling; 
     775                  } 
    767776                }else{ 
    768777                  res->bytesNbOUT += agCache.bytes; 
    769778                  res->pktsNbOUT += agCache.pkts; 
    770                   (res->flowNbOUT)++;              
     779                  (res->flowNbOUT)++; 
     780                  if (agCache.dscp>>2 == FIRST_CoS) { 
     781                    res->firstCoSOUT += agCache.bytes; 
     782                  } else if (agCache.dscp>>2 == SECOND_CoS) { 
     783                    res->secondCoSOUT += agCache.bytes; 
     784                  } else if (agCache.dscp>>2 == THIRD_CoS) { 
     785                    res->thirdCoSOUT += agCache.bytes; 
     786                  } else { 
     787                    res->fourthCoSOUT += agCache.bytes; 
     788                  } 
    771789                } 
    772790#else 
     
    775793                  res->pktsNbOUT += agCache.pkts; 
    776794                  (res->flowNbOUT)++; 
     795                  if (agCache.dscp>>2 == FIRST_CoS) { 
     796                    res->firstCoSOUT += agCache.bytes; 
     797                  } else if (agCache.dscp>>2 == SECOND_CoS) { 
     798                    res->secondCoSOUT += agCache.bytes; 
     799                  } else if (agCache.dscp>>2 == THIRD_CoS) { 
     800                    res->thirdCoSOUT += agCache.bytes; 
     801                  } else { 
     802                    res->fourthCoSOUT += agCache.bytes; 
     803                  } 
    777804                } 
    778805                if (res->sampling == 0  
     
    817844                    res3->pktsNbIN += agCache.pkts*myPtrs->currentRouterPtr->sampled/res3->sampling; 
    818845                    /* (res3->flowNbIN)++;  FIXME : FIND SOMETHING */ 
     846                    if (agCache.dscp>>2 == FIRST_CoS) { 
     847                      res3->firstCoSIN += agCache.bytes*myPtrs->currentRouterPtr->sampled/res3->sampling; 
     848                    } else if (agCache.dscp>>2 == SECOND_CoS) { 
     849                      res3->secondCoSIN += agCache.bytes*myPtrs->currentRouterPtr->sampled/res3->sampling; 
     850                    } else if (agCache.dscp>>2 == THIRD_CoS) { 
     851                      res3->thirdCoSIN += agCache.bytes*myPtrs->currentRouterPtr->sampled/res3->sampling; 
     852                    } else { 
     853                      res3->fourthCoSIN += agCache.bytes*myPtrs->currentRouterPtr->sampled/res3->sampling; 
     854                    } 
    819855                  }else{ 
    820856                    res3->bytesNbIN += agCache.bytes; 
    821857                    res3->pktsNbIN += agCache.pkts; 
    822858                    (res3->flowNbIN)++; 
     859                    if (agCache.dscp>>2 == FIRST_CoS) { 
     860                      res3->firstCoSIN += agCache.bytes; 
     861                    } else if (agCache.dscp>>2 == SECOND_CoS) { 
     862                      res3->secondCoSIN += agCache.bytes; 
     863                    } else if (agCache.dscp>>2 == THIRD_CoS) { 
     864                      res3->thirdCoSIN += agCache.bytes; 
     865                    } else { 
     866                      res3->fourthCoSIN += agCache.bytes; 
     867                    } 
    823868                  } 
    824869#else 
     
    828873                    res3->pktsNbIN += agCache.pkts; 
    829874                    (res3->flowNbIN)++; 
     875                    if (agCache.dscp>>2 == FIRST_CoS) { 
     876                      res3->firstCoSIN += agCache.bytes; 
     877                    } else if (agCache.dscp>>2 == SECOND_CoS) { 
     878                      res3->secondCoSIN += agCache.bytes; 
     879                    } else if (agCache.dscp>>2 == THIRD_CoS) { 
     880                      res3->thirdCoSIN += agCache.bytes; 
     881                    } else { 
     882                      res3->fourthCoSIN += agCache.bytes; 
     883                    } 
    830884                  } 
    831885                  if (res3->sampling == 0  
     
    915969                  res->bytesNbIN += agCache.bytes*myPtrs->currentRouterPtr->sampled/res->sampling; 
    916970                  res->pktsNbIN += agCache.pkts*myPtrs->currentRouterPtr->sampled/res->sampling; 
     971                  if (agCache.dscp>>2 == FIRST_CoS) { 
     972                    res->firstCoSIN += agCache.bytes*myPtrs->currentRouterPtr->sampled/res->sampling; 
     973                  } else if (agCache.dscp>>2 == SECOND_CoS) { 
     974                    res->secondCoSIN += agCache.bytes*myPtrs->currentRouterPtr->sampled/res->sampling; 
     975                  } else if (agCache.dscp>>2 == THIRD_CoS) { 
     976                    res->thirdCoSIN += agCache.bytes*myPtrs->currentRouterPtr->sampled/res->sampling; 
     977                  } else { 
     978                    res->fourthCoSIN += agCache.bytes*myPtrs->currentRouterPtr->sampled/res->sampling; 
     979                  } 
    917980                }else{ 
    918981                  res->bytesNbIN += agCache.bytes; 
    919982                  res->pktsNbIN += agCache.pkts; 
    920983                  (res->flowNbIN)++; 
     984                  if (agCache.dscp>>2 == FIRST_CoS) { 
     985                    res->firstCoSIN += agCache.bytes; 
     986                  } else if (agCache.dscp>>2 == SECOND_CoS) { 
     987                    res->secondCoSIN += agCache.bytes; 
     988                  } else if (agCache.dscp>>2 == THIRD_CoS) { 
     989                    res->thirdCoSIN += agCache.bytes; 
     990                  } else { 
     991                    res->fourthCoSIN += agCache.bytes; 
     992                  } 
    921993                } 
    922994#else 
     
    926998                  res->pktsNbIN += agCache.pkts; 
    927999                  (res->flowNbIN)++; 
     1000                  if (agCache.dscp>>2 == FIRST_CoS) { 
     1001                    res->firstCoSIN += agCache.bytes; 
     1002                  } else if (agCache.dscp>>2 == SECOND_CoS) { 
     1003                    res->secondCoSIN += agCache.bytes; 
     1004                  } else if (agCache.dscp>>2 == THIRD_CoS) { 
     1005                    res->thirdCoSIN += agCache.bytes; 
     1006                  } else { 
     1007                    res->fourthCoSIN += agCache.bytes; 
     1008                  } 
    9281009                } 
    9291010#endif 
     
    9371018                  res->pktsNbIN += agCache.pkts; 
    9381019                  (res->flowNbIN)++; 
     1020                  if (agCache.dscp>>2 == FIRST_CoS) { 
     1021                    res->firstCoSIN += agCache.bytes; 
     1022                  } else if (agCache.dscp>>2 == SECOND_CoS) { 
     1023                    res->secondCoSIN += agCache.bytes; 
     1024                  } else if (agCache.dscp>>2 == THIRD_CoS) { 
     1025                    res->thirdCoSIN += agCache.bytes; 
     1026                  } else { 
     1027                    res->fourthCoSIN += agCache.bytes; 
     1028                  } 
    9391029                } 
    9401030              } 
  • trunk/src/renetcolParam.h

    r80 r93  
    3838#define RECEPTION_PORT 1111 
    3939/*  
    40  * routers index max + 1  
     40 * routers index max + 1 (index of the beginning of the lines, and not number of routers) 
    4141 */ 
    4242#define ROUTER_INDEX_MAX 55 
     
    4444 * FILE with your routers IP address  
    4545*/  
    46 #define ROUTERS_LIST "<path to renetcol>/renetcol-0.0.12beta/conf/routers.txt" 
     46#define ROUTERS_LIST "<path to renetcol>/renetcol-0.0.14beta/conf/routers.txt" 
    4747/*  
    4848 * FILE with your prefix/subnet  
    4949 */ 
    50 #define SUBNETS_LIST "<path to renetcol>/renetcol-0.0.12beta/conf/IPv4_Subnet_Aggregation_based_on_SNMP_index.txt" 
     50#define SUBNETS_LIST "<path to renetcol>/renetcol-0.0.14beta/conf/IPv4_Subnet_Aggregation_based_on_SNMP_index.txt" 
    5151/*  
    5252 * FILE with the list of AS with accounting 
    5353 */ 
    54 #define AS_LIST "<path to renetcol>/renetcol-0.0.12beta/conf/AS.txt" 
     54#define AS_LIST "<path to renetcol>/renetcol-0.0.14beta/conf/AS.txt" 
    5555/*  
    5656 * constants, here a subnet is include in a prefix  
     
    6262 * FILE for the rules  
    6363 */ 
    64 #define RULES_FILE "<path to renetcol>/renetcol-0.0.12beta/conf/rules.txt" 
     64#define RULES_FILE "<path to renetcol>/renetcol-0.0.14beta/conf/rules.txt" 
    6565/*  
    6666 * FILE with SNMP index of the interfaces 
    6767 * tagged "C"ustomers or "B"ackbone  
    6868 */ 
    69 #define INTERFACES_TYPE_LIST "<path to renetcol>/renetcol-0.0.12beta/conf/SNMP_INDEX.txt" 
     69#define INTERFACES_TYPE_LIST "<path to renetcol>/renetcol-0.0.14beta/conf/SNMP_INDEX.txt" 
    7070/*  
    7171 * maximum SNMP index  
     
    7979#define AS_RRD_LOCATION "/mnt/data/RRD/RENATER/AS/" 
    8080 
     81/* 
     82 * Your CoS - DSCP field in decimal notation, EF PHB 101110 (46) == ToS 10111000 (184) 
     83 */ 
     84#define FIRST_CoS 46  /* EF, Premium - dec 46, bin 101110 - ToS 10111000 */ 
     85#define SECOND_CoS 34 /* AF41, Best than BE - dec 34, bin 100010 - ToS 10001000*/ 
     86#define THIRD_CoS 8   /* CS1, Less than BE - dec 8, bin 001000 - 00100000 */ 
     87#define FOURTH_CoS 0  /* Best Effort or All flows if not in the 3 others class */ 
     88 
    8189/**************************************************************** 
    8290 * the following parameters CAN be changed but it's NOT REQUIRED 
    8391 ***************************************************************/ 
    8492#define STEP 5 
    85 #define FIELD_TYPE_NUMBER 89 
     93#define FIELD_TYPE_NUMBER 216 
    8694#define MAX_RULES_PER_FIELD 10 
    8795#define SHMSIZE 33554432