00001
00002 #include "dostraffic.h"
00003
00004 void CBRTrafficGen(int NetworkDia, double H, int NoAttackers, int Master, double rate, struct DDOS_Traffic *traffic){
00005 struct flow_list *listroot = NULL;
00006
00007 int no_hops;
00008 double flow,delay,total_bw;
00009 int i,cntr;
00010
00011 for(i=0;i<NoAttackers;i++){
00012 no_hops = Power_law_no_hops(NetworkDia,H);
00013 if(Master==1)
00014 no_hops+=Power_law_no_hops(NetworkDia,H);
00015 delay = (double) no_hops;
00016 flow = rate;
00017 flow_list_insert(delay,flow,&listroot);
00018 cntr++;
00019 }
00020
00021 traffic->Events = get_all_events(listroot);
00022 traffic->NoEvents = get_no_events(listroot);
00023 }
00024
00025
00026 void CBRTrafficInet(int NetworkDia, int NoAttackers, int Master, double rate, struct DDOS_Traffic *traffic){
00027 struct flow_list *listroot = NULL;
00028
00029 int no_hops;
00030 double flow,delay,total_bw;
00031 int i,cntr;
00032
00033 for(i=0;i<NoAttackers;i++){
00034 no_hops = Inet_default_no_hops(NetworkDia);
00035 if(Master==1)
00036 no_hops+=Inet_default_no_hops(NetworkDia);
00037 delay = (double) no_hops;
00038 flow = rate;
00039 flow_list_insert(delay,flow,&listroot);
00040 cntr++;
00041 }
00042
00043 traffic->Events = get_all_events(listroot);
00044 traffic->NoEvents = get_no_events(listroot);
00045
00046 }