A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
flow-classifier.h
Go to the documentation of this file.
1
//
2
// Copyright (c) 2009 INESC Porto
3
//
4
// SPDX-License-Identifier: GPL-2.0-only
5
//
6
// Author: Gustavo J. A. M. Carneiro <gjc@inescporto.pt> <gjcarneiro@gmail.com>
7
//
8
9
#ifndef FLOW_CLASSIFIER_H
10
#define FLOW_CLASSIFIER_H
11
12
#include "ns3/simple-ref-count.h"
13
14
#include <ostream>
15
16
namespace
ns3
17
{
18
19
/**
20
* \ingroup flow-monitor
21
* \brief Abstract identifier of a packet flow
22
*/
23
typedef
uint32_t
FlowId
;
24
25
/**
26
* \ingroup flow-monitor
27
* \brief Abstract identifier of a packet within a flow
28
*/
29
typedef
uint32_t
FlowPacketId
;
30
31
/// \ingroup flow-monitor
32
/// Provides a method to translate raw packet data into abstract
33
/// `flow identifier` and `packet identifier` parameters. These
34
/// identifiers are unsigned 32-bit integers that uniquely identify a
35
/// flow and a packet within that flow, respectively, for the whole
36
/// simulation, regardless of the point in which the packet was
37
/// captured. These abstract identifiers are used in the
38
/// communication between FlowProbe and FlowMonitor, and all collected
39
/// statistics reference only those abstract identifiers in order to
40
/// keep the core architecture generic and not tied down to any
41
/// particular flow capture method or classification system.
42
class
FlowClassifier
:
public
SimpleRefCount
<FlowClassifier>
43
{
44
private
:
45
FlowId
m_lastNewFlowId
;
//!< Last known Flow ID
46
47
public
:
48
FlowClassifier
();
49
virtual
~FlowClassifier
();
50
51
// Delete copy constructor and assignment operator to avoid misuse
52
FlowClassifier
(
const
FlowClassifier
&) =
delete
;
53
FlowClassifier
&
operator=
(
const
FlowClassifier
&) =
delete
;
54
55
/// Serializes the results to an std::ostream in XML format
56
/// \param os the output stream
57
/// \param indent number of spaces to use as base indentation level
58
virtual
void
SerializeToXmlStream
(std::ostream& os, uint16_t indent)
const
= 0;
59
60
protected
:
61
/// Returns a new, unique Flow Identifier
62
/// \returns a new FlowId
63
FlowId
GetNewFlowId
();
64
65
///
66
/// \brief Add a number of spaces for indentation purposes.
67
/// \param os The stream to write to.
68
/// \param level The number of spaces to add.
69
void
Indent
(std::ostream& os, uint16_t level)
const
;
70
};
71
72
inline
void
73
FlowClassifier::Indent
(std::ostream& os, uint16_t level)
const
74
{
75
for
(uint16_t __xpto = 0; __xpto < level; __xpto++)
76
{
77
os <<
' '
;
78
}
79
}
80
81
}
// namespace ns3
82
83
#endif
/* FLOW_CLASSIFIER_H */
ns3::FlowClassifier
Provides a method to translate raw packet data into abstract flow identifier and packet identifier pa...
Definition
flow-classifier.h:43
ns3::FlowClassifier::Indent
void Indent(std::ostream &os, uint16_t level) const
Add a number of spaces for indentation purposes.
Definition
flow-classifier.h:73
ns3::FlowClassifier::~FlowClassifier
virtual ~FlowClassifier()
Definition
flow-classifier.cc:19
ns3::FlowClassifier::FlowClassifier
FlowClassifier()
Definition
flow-classifier.cc:14
ns3::FlowClassifier::operator=
FlowClassifier & operator=(const FlowClassifier &)=delete
ns3::FlowClassifier::GetNewFlowId
FlowId GetNewFlowId()
Returns a new, unique Flow Identifier.
Definition
flow-classifier.cc:24
ns3::FlowClassifier::FlowClassifier
FlowClassifier(const FlowClassifier &)=delete
ns3::FlowClassifier::m_lastNewFlowId
FlowId m_lastNewFlowId
Last known Flow ID.
Definition
flow-classifier.h:45
ns3::FlowClassifier::SerializeToXmlStream
virtual void SerializeToXmlStream(std::ostream &os, uint16_t indent) const =0
Serializes the results to an std::ostream in XML format.
ns3::SimpleRefCount
A template-based reference counting class.
Definition
simple-ref-count.h:70
uint32_t
ns3::FlowId
uint32_t FlowId
Abstract identifier of a packet flow.
Definition
flow-classifier.h:23
ns3::FlowPacketId
uint32_t FlowPacketId
Abstract identifier of a packet within a flow.
Definition
flow-classifier.h:29
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
flow-monitor
model
flow-classifier.h
Generated on Fri Nov 8 2024 13:59:00 for ns-3 by
1.11.0