A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
service-flow-manager.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2007,2008, 2009 INRIA, UDcast
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Jahanzeb Farooq <jahanzeb.farooq@sophia.inria.fr>
18 * Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
19 */
20
21#ifndef SERVICE_FLOW_MANAGER_H
22#define SERVICE_FLOW_MANAGER_H
23
24#include "mac-messages.h"
25
26#include "ns3/buffer.h"
27#include "ns3/event-id.h"
28
29#include <stdint.h>
30
31namespace ns3
32{
33
34class Packet;
35class ServiceFlow;
36class WimaxNetDevice;
37class SSRecord;
38class WimaxConnection;
39
40/**
41 * \ingroup wimax
42 * The same service flow manager class serves both for BS and SS though some functions are exclusive
43 * to only one of them.
44 */
46{
47 public:
48 /// confirmation code enumeration as per Table 384 (not all codes implemented)
50 {
53 };
54
55 /**
56 * \brief Get the type ID.
57 * \return the object TypeId
58 */
59 static TypeId GetTypeId();
60
62 ~ServiceFlowManager() override;
63 void DoDispose() override;
64
65 /**
66 * Add service flow function
67 * \param serviceFlow the service flow
68 */
69 void AddServiceFlow(ServiceFlow* serviceFlow);
70 /**
71 * Get service flow by flow id
72 * \param sfid the service flow id
73 * \returns pointer to the service flow object corresponding to the flow id
74 */
76 /**
77 * Get service flow by CID
78 * \param cid the CID
79 * \returns pointer to the service flow object corresponding to the CID
80 */
81 ServiceFlow* GetServiceFlow(Cid cid) const;
82 /**
83 * Get service flows function
84 * \param schedulingType the scheduling type
85 * \returns vector of pointers to service flows corresponding to the scheduling type
86 */
87 std::vector<ServiceFlow*> GetServiceFlows(ServiceFlow::SchedulingType schedulingType) const;
88
89 /**
90 * \return true if all service flows are allocated, false otherwise
91 */
93 /**
94 * \param serviceFlows vector of pointers to service flows to be checked
95 * \return true if all service flows are allocated, false otherwise
96 */
97 bool AreServiceFlowsAllocated(std::vector<ServiceFlow*>* serviceFlows);
98 /**
99 * \param serviceFlows vector of pointers to service flows to be checked
100 * \return true if all service flows are allocated, false otherwise
101 */
102 bool AreServiceFlowsAllocated(std::vector<ServiceFlow*> serviceFlows);
103 /**
104 * \return pointer to the next service flow to be allocated
105 */
107
108 /**
109 * \return the number of all service flows
110 */
112
113 /**
114 *\param SrcAddress the source ip address
115 *\param DstAddress the destination ip address
116 *\param SrcPort the source port
117 *\param DstPort the destination port
118 *\param Proto the protocol
119 *\param dir the direction of the service flow
120 *\return the service flow to which this ip flow is associated
121 */
123 Ipv4Address DstAddress,
124 uint16_t SrcPort,
125 uint16_t DstPort,
126 uint8_t Proto,
128
129 private:
130 std::vector<ServiceFlow*>* m_serviceFlows; ///< the service flows
131};
132
133} // namespace ns3
134
135#endif /* SERVICE_FLOW_MANAGER_H */
Cid class.
Definition: cid.h:37
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:42
A base class which provides memory management and object aggregation.
Definition: object.h:89
This class implements service flows as described by the IEEE-802.16 standard.
Definition: service-flow.h:43
SchedulingType
section 11.13.11 Service flow scheduling type, page 701
Definition: service-flow.h:62
Direction
Direction enumeration.
Definition: service-flow.h:47
The same service flow manager class serves both for BS and SS though some functions are exclusive to ...
ServiceFlow * GetNextServiceFlowToAllocate()
ServiceFlow * DoClassify(Ipv4Address SrcAddress, Ipv4Address DstAddress, uint16_t SrcPort, uint16_t DstPort, uint8_t Proto, ServiceFlow::Direction dir) const
void AddServiceFlow(ServiceFlow *serviceFlow)
Add service flow function.
ConfirmationCode
confirmation code enumeration as per Table 384 (not all codes implemented)
ServiceFlow * GetServiceFlow(uint32_t sfid) const
Get service flow by flow id.
std::vector< ServiceFlow * > GetServiceFlows(ServiceFlow::SchedulingType schedulingType) const
Get service flows function.
uint32_t GetNrServiceFlows() const
static TypeId GetTypeId()
Get the type ID.
void DoDispose() override
Destructor implementation.
std::vector< ServiceFlow * > * m_serviceFlows
the service flows
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::string dir