Statistics
| Branch: | Revision:

napa-baselibs / monl / plugins / rtt_measure.h @ d1e0f2ca

History | View | Annotate | Download (2.03 KB)

1
/***************************************************************************
2
 *   Copyright (C) 2009 by Robert Birke
3
 *   robert.birke@polito.it
4
 *
5
 * This library is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU Lesser General Public
7
 * License as published by the Free Software Foundation; either
8
 * version 2.1 of the License, or (at your option) any later version.
9

10
 * This library is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
 * Lesser General Public License for more details.
14

15
 * You should have received a copy of the GNU Lesser General Public
16
 * License along with this library; if not, write to the Free Software
17
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
18
 ***********************************************************************/
19

    
20
#ifndef _RTT_MEASURE_H_
21
#define _RTT_MEASURE_H_
22

    
23
#include <string>
24
#include "measure_plugin.h"
25
#include "mon_measure.h"
26

    
27

    
28
//TODO:
29
//- add window size as parameter
30

    
31
class RttMeasure : public MonMeasure {
32
        result last_time_rx;
33
        result last_time_rem_tx;
34

    
35
public:
36
        RttMeasure(class MeasurePlugin *m, MeasurementCapabilities mc, class MeasureDispatcher *md);
37
        virtual void init();
38
        virtual void stop();
39
        virtual ~RttMeasure();
40

    
41
        virtual result RxPkt(result *r,ExecutionList *el);
42

    
43
        virtual result RxData(result *r,ExecutionList *el);
44

    
45
        virtual result TxPkt(result *r,ExecutionList *el);
46

    
47
        virtual result TxData(result *r,ExecutionList *el);
48

    
49
        virtual void Run();
50
        virtual void receiveOobData(char *buf, int buf_len, result *r);
51

    
52
};
53

    
54
class RttMeasurePlugin : public MeasurePlugin {
55
        virtual ~RttMeasurePlugin() {};
56

    
57

    
58
        virtual MeasurementCapabilities getCaps() {
59
                return IN_BAND | OUT_OF_BAND | PACKET | DATA | TXRXBI;
60
        };
61

    
62
        virtual MonMeasure* createMeasure (MeasurementCapabilities mc, class MeasureDispatcher *md) {
63
                return new RttMeasure(this, mc, md);
64
        };
65

    
66
public:
67
        RttMeasurePlugin();
68
};
69

    
70

    
71

    
72
#endif /* _RTT_MEASURE_H_ */
73