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
ipcs-classifier-record.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2007,2008, 2009 INRIA, UDcast
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
* Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
19
*
20
*/
21
22
#ifndef IPCS_CLASSIFIER_RECORD_H
23
#define IPCS_CLASSIFIER_RECORD_H
24
25
#include <stdint.h>
26
#include "ns3/ipv4-address.h"
27
#include "
wimax-tlv.h
"
28
29
namespace
ns3 {
30
34
class
IpcsClassifierRecord
35
{
36
public
:
37
IpcsClassifierRecord
();
38
~IpcsClassifierRecord
();
53
IpcsClassifierRecord
(
Ipv4Address
srcAddress,
Ipv4Mask
srcMask,
54
Ipv4Address
dstAddress,
Ipv4Mask
dstMask,
55
uint16_t srcPortLow, uint16_t srcPortHigh,
56
uint16_t dstPortLow, uint16_t dstPortHigh,
57
uint8_t protocol,
58
uint8_t priority);
63
IpcsClassifierRecord
(
Tlv
tlv);
68
Tlv
ToTlv
(
void
)
const
;
74
void
AddSrcAddr
(
Ipv4Address
srcAddress,
Ipv4Mask
srcMask);
80
void
AddDstAddr
(
Ipv4Address
dstAddress,
Ipv4Mask
dstMask);
86
void
AddSrcPortRange
( uint16_t srcPortLow, uint16_t srcPortHigh);
92
void
AddDstPortRange
( uint16_t dstPortLow, uint16_t dstPortHigh);
97
void
AddProtocol
(uint8_t proto);
102
void
SetPriority
(uint8_t prio);
107
void
SetIndex
(uint16_t index);
116
bool
CheckMatch
(
Ipv4Address
srcAddress,
Ipv4Address
dstAddress,
117
uint16_t srcPort, uint16_t dstPort,
118
uint8_t proto)
const
;
122
uint16_t
GetCid
(
void
)
const
;
126
uint8_t
GetPriority
(
void
)
const
;
130
uint16_t
GetIndex
(
void
)
const
;
135
void
SetCid
(uint16_t cid);
136
137
138
private
:
139
bool
CheckMatchSrcAddr
(
Ipv4Address
srcAddress)
const
;
140
bool
CheckMatchDstAddr
(
Ipv4Address
dstAddress)
const
;
141
bool
CheckMatchSrcPort
(uint16_t srcPort)
const
;
142
bool
CheckMatchDstPort
(uint16_t dstPort)
const
;
143
bool
CheckMatchProtocol
(uint8_t proto)
const
;
144
struct
PortRange
145
{
146
uint16_t
PortLow
;
147
uint16_t
PortHigh
;
148
};
149
struct
ipv4Addr
150
{
151
Ipv4Address
Address
;
152
Ipv4Mask
Mask
;
153
};
154
155
uint8_t
m_priority
;
156
uint16_t
m_index
;
157
uint8_t
m_tosLow
;
158
uint8_t
m_tosHigh
;
159
uint8_t
m_tosMask
;
160
std::vector<uint8_t>
m_protocol
;
161
std::vector<struct ipv4Addr>
m_srcAddr
;
162
std::vector<struct ipv4Addr>
m_dstAddr
;
163
std::vector<struct PortRange>
m_srcPortRange
;
164
std::vector<struct PortRange>
m_dstPortRange
;
165
166
uint16_t
m_cid
;
167
};
168
}
// namespace ns3
169
170
#endif
/* IPCS_CLASSIFIER_RECORD_H */
src
wimax
model
ipcs-classifier-record.h
Generated on Tue Nov 13 2012 10:32:26 for ns-3 by
1.8.1.2