Switch to unified view

a/src/Common/Flow.cc b/src/Common/Flow.cc
...
...
25
    srcApni(APNamingInfo()), dstApni(APNamingInfo()),
25
    srcApni(APNamingInfo()), dstApni(APNamingInfo()),
26
    srcPortId(VAL_UNDEFINED), dstPortId(VAL_UNDEFINED),
26
    srcPortId(VAL_UNDEFINED), dstPortId(VAL_UNDEFINED),
27
    srcAddr(Address()), dstAddr(Address()),
27
    srcAddr(Address()), dstAddr(Address()),
28
    srcNeighbor(Address()), dstNeighbor(Address()),
28
    srcNeighbor(Address()), dstNeighbor(Address()),
29
    conId(ConnectionId()),
29
    conId(ConnectionId()),
30
    createFlowRetries(0), maxCreateFlowRetries(VAL_MAXCREATERETRIES), hopCount(VAL_MAXHOPCOUNT) {
30
    createFlowRetries(0), maxCreateFlowRetries(VAL_MAXCREATERETRIES), hopCount(VAL_MAXHOPCOUNT),
31
    allocInvokeId(0), deallocInvokeId(0)
32
{
31
}
33
}
32
34
33
Flow::Flow(APNamingInfo src, APNamingInfo dst) :
35
Flow::Flow(APNamingInfo src, APNamingInfo dst) :
34
        srcApni(src), dstApni(dst),
36
        srcApni(src), dstApni(dst),
35
        srcPortId(VAL_UNDEFINED), dstPortId(VAL_UNDEFINED),
37
        srcPortId(VAL_UNDEFINED), dstPortId(VAL_UNDEFINED),
36
        srcAddr(Address()), dstAddr(Address()),
38
        srcAddr(Address()), dstAddr(Address()),
37
        srcNeighbor(Address()), dstNeighbor(Address()),
39
        srcNeighbor(Address()), dstNeighbor(Address()),
38
        conId(ConnectionId()),
40
        conId(ConnectionId()),
39
        createFlowRetries(0), maxCreateFlowRetries(VAL_MAXCREATERETRIES), hopCount(VAL_MAXHOPCOUNT)
41
        createFlowRetries(0), maxCreateFlowRetries(VAL_MAXCREATERETRIES), hopCount(VAL_MAXHOPCOUNT),
42
        allocInvokeId(0), deallocInvokeId(0)
40
{
43
{
41
}
44
}
42
45
43
Flow::~Flow() {
46
Flow::~Flow() {
44
    this->srcApni = APNamingInfo();
47
    this->srcApni = APNamingInfo();
...
...
50
    this->createFlowRetries = VAL_UNDEFINED;
53
    this->createFlowRetries = VAL_UNDEFINED;
51
    this->maxCreateFlowRetries = VAL_UNDEFINED;
54
    this->maxCreateFlowRetries = VAL_UNDEFINED;
52
    this->hopCount = VAL_UNDEFINED;
55
    this->hopCount = VAL_UNDEFINED;
53
    srcNeighbor = Address();
56
    srcNeighbor = Address();
54
    dstNeighbor = Address();
57
    dstNeighbor = Address();
58
    allocInvokeId = 0;
59
    deallocInvokeId = 0;
55
}
60
}
56
61
57
bool Flow::operator ==(const Flow& other) const {
62
bool Flow::operator ==(const Flow& other) const {
58
    return (srcApni == other.srcApni && dstApni == other.dstApni
63
    return (srcApni == other.srcApni && dstApni == other.dstApni
59
            && srcPortId == other.srcPortId && dstPortId == other.dstPortId
64
            && srcPortId == other.srcPortId && dstPortId == other.dstPortId
60
            && srcAddr == other.srcAddr && dstAddr == other.dstAddr
65
            && srcAddr == other.srcAddr && dstAddr == other.dstAddr
61
            && conId == other.conId
66
            && conId == other.conId
62
            && createFlowRetries == other.createFlowRetries && maxCreateFlowRetries == other.maxCreateFlowRetries
67
            && createFlowRetries == other.createFlowRetries && maxCreateFlowRetries == other.maxCreateFlowRetries
63
            && hopCount == other.hopCount
68
            && hopCount == other.hopCount
64
            && srcNeighbor == other.srcNeighbor && dstNeighbor == other.dstNeighbor
69
            && srcNeighbor == other.srcNeighbor && dstNeighbor == other.dstNeighbor
70
            //&& allocInvokeId == other.allocInvokeId && deallocInvokeId == other.deallocInvokeId
65
            );
71
            );
66
}
72
}
67
73
68
const ConnectionId& Flow::getConId() const {
74
const ConnectionId& Flow::getConId() const {
69
    return conId;
75
    return conId;
...
...
162
    flow->setHopCount(this->getHopCount());
168
    flow->setHopCount(this->getHopCount());
163
    flow->setCreateFlowRetries(this->getCreateFlowRetries());
169
    flow->setCreateFlowRetries(this->getCreateFlowRetries());
164
    flow->setQosParameters(this->getQosParameters());
170
    flow->setQosParameters(this->getQosParameters());
165
    flow->setSrcNeighbor(this->getSrcNeighbor());
171
    flow->setSrcNeighbor(this->getSrcNeighbor());
166
    flow->setDstNeighbor(this->getDstNeighbor());
172
    flow->setDstNeighbor(this->getDstNeighbor());
173
    flow->setAllocInvokeId(this->getAllocInvokeId());
174
    flow->setDeallocInvokeId(this->getDeallocInvokeId());
167
    return flow;
175
    return flow;
168
}
176
}
169
177
170
std::string Flow::getFlowName() const {
178
std::string Flow::getFlowName() const {
171
    std::stringstream os;
179
    std::stringstream os;
...
...
233
            && srcAddr == other.srcAddr && dstAddr == other.dstAddr
241
            && srcAddr == other.srcAddr && dstAddr == other.dstAddr
234
            && conId == other.conId
242
            && conId == other.conId
235
            );
243
            );
236
}
244
}
237
245
246
/*
247
const long Flow::getPortCepId() const {
248
    int ports = getSrcPortId() xor getDstPortId();
249
    int ceps = conId.getSrcCepId() xor conId.getDstCepId();
250
    return (long) ((ports << sizeof(int)) xor ceps);
251
}
252
*/
253
254
long Flow::getAllocInvokeId() const{
255
    return allocInvokeId;
256
}
257
258
void Flow::setAllocInvokeId(long allocInvokeId) {
259
    this->allocInvokeId = allocInvokeId;
260
}
261
262
long Flow::getDeallocInvokeId() const {
263
    return deallocInvokeId;
264
}
265
266
void Flow::setDeallocInvokeId(long deallocInvokeId) {
267
    this->deallocInvokeId = deallocInvokeId;
268
}
269
238
void Flow::swapApni() {
270
void Flow::swapApni() {
239
    APNamingInfo tmpapni = srcApni;
271
    APNamingInfo tmpapni = srcApni;
240
    srcApni = dstApni;
272
    srcApni = dstApni;
241
    dstApni = tmpapni;
273
    dstApni = tmpapni;
242
}
274
}