Statistics
| Branch: | Revision:

napa-baselibs / monl / plugins / packet_measure.h @ d2cfc5c9

History | View | Annotate | Download (2.18 KB)

1 956892f0 ArpadBakay
/***************************************************************************
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 40a7aea7 RobertBirke
#ifndef _PACKET_MEASURE_H_
21
#define _PACKET_MEASURE_H_
22 956892f0 ArpadBakay
23
#include <string>
24
#include "measure_plugin.h"
25
#include "mon_measure.h"
26
27 40a7aea7 RobertBirke
class PacketMeasure : public MonMeasure {
28 956892f0 ArpadBakay
29
public:
30 40a7aea7 RobertBirke
        PacketMeasure(class MeasurePlugin *m, MeasurementCapabilities mc, class MeasureDispatcher *md);
31
        virtual ~PacketMeasure();
32 956892f0 ArpadBakay
        virtual result RxPkt(result *r,ExecutionList *el);
33
        virtual result RxData(result *r,ExecutionList *el);
34
        virtual result TxPkt(result *r,ExecutionList *el);
35
        virtual result TxData(result *r,ExecutionList *el);
36
};
37
38 40a7aea7 RobertBirke
class RxPacketMeasurePlugin : public MeasurePlugin {
39
        virtual ~RxPacketMeasurePlugin() {};
40 956892f0 ArpadBakay
41
        virtual MeasurementCapabilities getCaps() {
42 40a7aea7 RobertBirke
                return IN_BAND | PACKET | DATA | RXONLY;
43 956892f0 ArpadBakay
        };
44
45
        virtual MonMeasure* createMeasure (MeasurementCapabilities mc, class MeasureDispatcher *md) {
46 40a7aea7 RobertBirke
                return new PacketMeasure(this, mc, md);
47 956892f0 ArpadBakay
        };
48
public:
49 40a7aea7 RobertBirke
        RxPacketMeasurePlugin();
50 956892f0 ArpadBakay
};
51
52 40a7aea7 RobertBirke
class TxPacketMeasurePlugin : public MeasurePlugin {
53
        virtual ~TxPacketMeasurePlugin() {};
54
55
        virtual MeasurementCapabilities getCaps() {
56
                return IN_BAND | PACKET | DATA | TXONLY;
57
        };
58
59
        virtual MonMeasure* createMeasure (MeasurementCapabilities mc, class MeasureDispatcher *md) {
60
                return new PacketMeasure(this, mc, md);
61
        };
62
public:
63
        TxPacketMeasurePlugin();
64
};
65
#endif /* _PACKET_MEASURE_H_ */