|
gjc@5205
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
|
gjc@5205
|
2 |
//
|
|
gjc@5205
|
3 |
// Copyright (c) 2009 INESC Porto
|
|
gjc@5205
|
4 |
//
|
|
gjc@5205
|
5 |
// This program is free software; you can redistribute it and/or modify
|
|
gjc@5205
|
6 |
// it under the terms of the GNU General Public License version 2 as
|
|
gjc@5205
|
7 |
// published by the Free Software Foundation;
|
|
gjc@5205
|
8 |
//
|
|
gjc@5205
|
9 |
// This program is distributed in the hope that it will be useful,
|
|
gjc@5205
|
10 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
gjc@5205
|
11 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
gjc@5205
|
12 |
// GNU General Public License for more details.
|
|
gjc@5205
|
13 |
//
|
|
gjc@5205
|
14 |
// You should have received a copy of the GNU General Public License
|
|
gjc@5205
|
15 |
// along with this program; if not, write to the Free Software
|
|
gjc@5205
|
16 |
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
gjc@5205
|
17 |
//
|
|
gjc@5205
|
18 |
// Author: Gustavo J. A. M. Carneiro <gjc@inescporto.pt> <gjcarneiro@gmail.com>
|
|
gjc@5205
|
19 |
//
|
|
gjc@5205
|
20 |
|
|
gjc@5205
|
21 |
#ifndef __FLOW_CLASSIFIER_H__
|
|
gjc@5205
|
22 |
#define __FLOW_CLASSIFIER_H__
|
|
gjc@5205
|
23 |
|
|
mathieu@5505
|
24 |
#include "ns3/simple-ref-count.h"
|
|
gjc@5205
|
25 |
#include <ostream>
|
|
gjc@5205
|
26 |
|
|
gjc@5205
|
27 |
namespace ns3 {
|
|
gjc@5205
|
28 |
|
|
gjc@5205
|
29 |
typedef uint32_t FlowId;
|
|
gjc@5205
|
30 |
typedef uint32_t FlowPacketId;
|
|
gjc@5205
|
31 |
|
|
gjc@5210
|
32 |
/// provides a method to translate raw packet data into abstract
|
|
gjc@5210
|
33 |
/// ``flow identifier'' and ``packet identifier'' parameters. These
|
|
gjc@5210
|
34 |
/// identifiers are unsigned 32-bit integers that uniquely identify a
|
|
gjc@5210
|
35 |
/// flow and a packet within that flow, respectively, for the whole
|
|
gjc@5210
|
36 |
/// simulation, regardless of the point in which the packet was
|
|
gjc@5210
|
37 |
/// captured. These abstract identifiers are used in the
|
|
gjc@5210
|
38 |
/// communication between FlowProbe and FlowMonitor, and all collected
|
|
gjc@5210
|
39 |
/// statistics reference only those abstract identifiers in order to
|
|
gjc@5210
|
40 |
/// keep the core architecture generic and not tied down to any
|
|
gjc@5210
|
41 |
/// particular flow capture method or classification system.
|
|
mathieu@5505
|
42 |
class FlowClassifier : public SimpleRefCount<FlowClassifier>
|
|
gjc@5205
|
43 |
{
|
|
gjc@5205
|
44 |
FlowId m_lastNewFlowId;
|
|
gjc@5205
|
45 |
|
|
gjc@5205
|
46 |
public:
|
|
gjc@5205
|
47 |
|
|
gjc@5205
|
48 |
FlowClassifier ();
|
|
mathieu@5505
|
49 |
virtual ~FlowClassifier ();
|
|
gjc@5205
|
50 |
|
|
gjc@5205
|
51 |
virtual void SerializeToXmlStream (std::ostream &os, int indent) const = 0;
|
|
gjc@5205
|
52 |
|
|
gjc@5205
|
53 |
protected:
|
|
gjc@5205
|
54 |
FlowId GetNewFlowId ();
|
|
gjc@5205
|
55 |
|
|
gjc@5205
|
56 |
};
|
|
gjc@5205
|
57 |
|
|
gjc@5205
|
58 |
|
|
gjc@5205
|
59 |
} // namespace ns3
|
|
gjc@5205
|
60 |
|
|
gjc@5205
|
61 |
#endif
|
|
gjc@5205
|
62 |
|