A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
ipv4-flow-classifier.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
//
3
// Copyright (c) 2009 INESC Porto
4
//
5
// This program is free software; you can redistribute it and/or modify
6
// it under the terms of the GNU General Public License version 2 as
7
// published by the Free Software Foundation;
8
//
9
// This program is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
// GNU General Public License for more details.
13
//
14
// You should have received a copy of the GNU General Public License
15
// along with this program; if not, write to the Free Software
16
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
//
18
// Author: Gustavo J. A. M. Carneiro <gjc@inescporto.pt> <gjcarneiro@gmail.com>
19
//
20
21
#ifndef IPV4_FLOW_CLASSIFIER_H
22
#define IPV4_FLOW_CLASSIFIER_H
23
24
#include <stdint.h>
25
#include <map>
26
27
#include "ns3/ipv4-header.h"
28
#include "ns3/flow-classifier.h"
29
30
namespace
ns3 {
31
32
class
Packet;
33
38
class
Ipv4FlowClassifier
:
public
FlowClassifier
39
{
40
public
:
41
43
struct
FiveTuple
44
{
45
Ipv4Address
sourceAddress
;
46
Ipv4Address
destinationAddress
;
47
uint8_t
protocol
;
48
uint16_t
sourcePort
;
49
uint16_t
destinationPort
;
50
};
51
52
Ipv4FlowClassifier
();
53
61
bool
Classify
(
const
Ipv4Header
&ipHeader,
Ptr<const Packet>
ipPayload,
62
uint32_t *out_flowId, uint32_t *out_packetId);
63
67
FiveTuple
FindFlow
(
FlowId
flowId)
const
;
68
69
virtual
void
SerializeToXmlStream
(std::ostream &os,
int
indent
)
const
;
70
71
private
:
72
74
std::map<FiveTuple, FlowId>
m_flowMap
;
75
76
};
77
85
bool
operator <
(
const
Ipv4FlowClassifier::FiveTuple
&t1,
const
Ipv4FlowClassifier::FiveTuple
&t2);
86
94
bool
operator ==
(
const
Ipv4FlowClassifier::FiveTuple
&t1,
const
Ipv4FlowClassifier::FiveTuple
&t2);
95
96
97
}
// namespace ns3
98
99
#endif
/* IPV4_FLOW_CLASSIFIER_H */
ns3::Ptr< const Packet >
ns3::Ipv4FlowClassifier::FiveTuple::destinationAddress
Ipv4Address destinationAddress
Destination address.
Definition:
ipv4-flow-classifier.h:46
ns3::Ipv4FlowClassifier
Classifies packets by looking at their IP and TCP/UDP headers.
Definition:
ipv4-flow-classifier.h:38
ns3::Ipv4FlowClassifier::FiveTuple::destinationPort
uint16_t destinationPort
Destination port.
Definition:
ipv4-flow-classifier.h:49
ns3::Ipv4FlowClassifier::FiveTuple::protocol
uint8_t protocol
Protocol.
Definition:
ipv4-flow-classifier.h:47
ns3::operator<
bool operator<(const Room &a, const Room &b)
Definition:
building-position-allocator-test.cc:57
ns3::Ipv4Header
Packet header for IPv4.
Definition:
ipv4-header.h:31
check-style.indent
def indent
Definition:
check-style.py:286
ns3::Ipv4FlowClassifier::SerializeToXmlStream
virtual void SerializeToXmlStream(std::ostream &os, int indent) const
Serializes the results to an std::ostream in XML format.
Definition:
ipv4-flow-classifier.cc:189
ns3::Ipv4FlowClassifier::FindFlow
FiveTuple FindFlow(FlowId flowId) const
Searches for the FiveTuple corresponding to the given flowId.
Definition:
ipv4-flow-classifier.cc:173
ns3::Ipv4FlowClassifier::FiveTuple::sourcePort
uint16_t sourcePort
Source port.
Definition:
ipv4-flow-classifier.h:48
ns3::Ipv4FlowClassifier::FiveTuple
Structure to classify a packet.
Definition:
ipv4-flow-classifier.h:43
ns3::Ipv4Address
Ipv4 addresses are stored in host order in this class.
Definition:
ipv4-address.h:38
ns3::operator==
bool operator==(const EventId &a, const EventId &b)
Definition:
event-id.cc:89
ns3::Ipv4FlowClassifier::Classify
bool Classify(const Ipv4Header &ipHeader, Ptr< const Packet > ipPayload, uint32_t *out_flowId, uint32_t *out_packetId)
try to classify the packet into flow-id and packet-id
Definition:
ipv4-flow-classifier.cc:103
ns3::Ipv4FlowClassifier::Ipv4FlowClassifier
Ipv4FlowClassifier()
Definition:
ipv4-flow-classifier.cc:98
ns3::Ipv4FlowClassifier::m_flowMap
std::map< FiveTuple, FlowId > m_flowMap
Map to Flows Identifiers to FlowIds.
Definition:
ipv4-flow-classifier.h:74
ns3::Ipv4FlowClassifier::FiveTuple::sourceAddress
Ipv4Address sourceAddress
Source address.
Definition:
ipv4-flow-classifier.h:45
ns3::FlowId
uint32_t FlowId
Abstract identifier of a packet flow.
Definition:
flow-classifier.h:33
ns3::FlowClassifier
Provides a method to translate raw packet data into abstract flow identifier'' andpacket identifier''...
Definition:
flow-classifier.h:53
src
flow-monitor
model
ipv4-flow-classifier.h
Generated on Sat Apr 19 2014 14:06:55 for ns-3 by
1.8.6