00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef ns_adc_h
00023 #define ns_adc_h
00024
00025 #include "estimator.h"
00026
00027 #define CLASS 10
00028 class ADC : public NsObject {
00029 public:
00030 ADC();
00031 int command(int,const char*const*);
00032 virtual int admit_flow(int cl,double r, int b)=0;
00033 virtual void rej_action(int,double,int){};
00034 virtual void teardown_action(int,double,int){};
00035 inline void recv(Packet*, Handler *){}
00036 inline void setest(int cl,Estimator *est) {est_[cl]=est;
00037 est_[cl]->setactype(type_);}
00038 double peak_rate(int cl,double r,int b) {return r+b/est_[cl]->period();}
00039 char *type() {return type_;}
00040 protected:
00041 Estimator *est_[CLASS];
00042 double bandwidth_;
00043 char *type_;
00044 Tcl_Channel tchan_;
00045 int src_;
00046 int dst_;
00047 int backoff_;
00048 int dobump_;
00049 };
00050
00051 #endif
00052
00053
00054
00055
00056