--- a/src/Common/Flow.h
+++ b/src/Common/Flow.h
@@ -1,17 +1,24 @@
+// The MIT License (MIT)
//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Lesser General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public License
-// along with this program. If not, see http://www.gnu.org/licenses/.
-//
+// Copyright (c) 2014-2016 Brno University of Technology, PRISTINE project
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
#ifndef FLOW_H_
#define FLOW_H_
@@ -23,8 +30,10 @@
#include "APNamingInfo.h"
#include "ConnectionId.h"
#include "Address.h"
-
-extern const int VAL_UNDEFINED;
+#include "QoSReq.h"
+
+extern const int VAL_UNDEF_PORTID;
+extern const int VAL_MGMT_PORTID;
extern const int VAL_MAXHOPCOUNT;
extern const int VAL_MAXCREATERETRIES;
@@ -71,6 +80,8 @@
*/
virtual Flow* dup() const;
+ Flow* dupToMgmt() const;
+
//Various string output functions
/**
* @brief Prints Flow information as string
@@ -139,17 +150,24 @@
*/
void setConId(const ConnectionId& conId);
+
+ void setQosCube(const QoSCube& qosCube);
+
+ const QoSCube& getQosCube() const;
+
/**
* @brief Gets QoS parameters wanted by flow initiator
- * @return Read-only QoSCube instance
- */
- const QoSCube& getQosParameters() const;
+ * @return Read-only QoSReq instance
+ */
+ const QoSReq& getQosRequirements() const;
+
+ QoSReq& getQosReqs();
/**
* @brief Sets QoS parameters wanted by flow initiator
- * @param qosParameters A new QoSCube instance that is accompanied with Flow
- */
- void setQosParameters(const QoSCube& qosParameters);
+ * @param qosParameters A new QoSReq instance that is accompanied with Flow
+ */
+ void setQosRequirements(const QoSReq& qosReqs);
/**
* @brief Gets read-only source APNamingInfo
@@ -291,8 +309,6 @@
*/
void setDstNeighbor(const Address& dstNeighbor);
- //const long getPortCepId() const;
-
/**
* @brief Gets allocation InvokeId
* Used inside M_CREATE(_R)(flow) messages
@@ -331,6 +347,10 @@
*/
void setDdtFlag(bool ddtFlag);
+ bool isManagementFlow() const;
+
+ bool isManagementFlowLocalToIPCP() const;
+
protected:
//Properties are based on RINA-Demo-2012-001.pdf page 6
@@ -394,10 +414,16 @@
*/
uint32_t hopCount;
- /**
- * @brief Attribute holding wanted QoS parameters in form of QoSCube
- */
- QoSCube qosParameters;
+
+ /**
+ * @brief Attribute holding the assigned QoSCube
+ */
+ QoSCube qosCube;
+
+ /**
+ * @brief Attribute holding wanted QoS parameters in form of QoSReq
+ */
+ QoSReq qosReqs;
/**
* @brief Attribute holding persistant InvokeId used for allocation